I have 2 errors on my Timer.shader file, but don't understand why, I'm new on Unity3D
this is the error:
Shader error in 'Timer': 'dot': no matching 0 parameter intrinsic function; Possible intrinsic functions are: dot(floatM|halfM|doubleM|min10floatM|min16floatM|intM|uintM|min12intM|min16intM|min16uintM, floatM|halfM|doubleM|min10floatM|min16floatM|intM|uintM|min12intM|min16intM|min16uintM) at line 51 (on gles3)
Shader error in 'Timer': syntax error: unexpected token 'h' at line 51 (on gles3)
And the file with the errors: Timer.shader
Shader "Timer"
{
Properties
{
_MainTex ("Texture Image", 2D) = "white" {}
_SecondTex ("Second Image", 2D) = "white" {}
_MaskTime ("Time", Range (0, 1)) = 0
_MPow ("Pow", Range (5, 50)) = 5
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
sampler2D _MainTex;
sampler2D _SecondTex;
fixed _MaskTime;
fixed _MPow;
struct vertexInput
{
float4 vertex : POSITION;
fixed4 texcoord : TEXCOORD0;
};
struct vertexOutput
{
fixed4 pos : SV_POSITION;
fixed2 tex : TEXCOORD0;
};
vertexOutput vert (vertexInput input)
{
vertexOutput output;
output.tex = input.texcoord;
output.pos = UnityObjectToClipPos (input.vertex);
return output;
};
float4 frag (vertexOutput input) : COLOR
{
fixed3 c0 = tex2D (_MainTex, fixed2 (input.tex));
fixed3 c1 = tex2D (_SecondTex, fixed2 (input.tex));
fixed dot1 = dot (normalize (input.tex.xy-fixed2 (0.5h, 0.5h)), fixed2 (0h, 1h));
half ang = acos (dot1);
ang = degrees (ang);
ang = (input.tex.x<0.5h)?360h-ang:ang;
fixed pos = min ((ang/360h), 360h);
pos = pos+0.9h-_MaskTime+(0.2h*(1h-_MaskTime));
pos = saturate (pow (pos, _MPow*_MPow));
fixed3 c = lerp (c1.rgb, c0, pos);
return fixed4 (c, 1h);
//return pos;
}
ENDCG
}
}
}
Please let me know if need more info, because like I say I'm new, and I don't understand much of this error.
Im trying to build to Android, and there's where everything crash, because if I only press play everything runs without warnings.
Of course the error trigger on other platforms, but I pretend to build to Android
hIn your shader? just remove anyhIn your shader for example0.5hto0.5