Hello.
Recently my shader was stopped working for Android build but it does properly on Editor and Windows, previously it worked correctly.
Here is the shader:
Shader "Hidden/Pokémon/UI/PokemonSpritesheet"
{
Properties
{
[HideInInspector] _MainTex("", 2D) = "white" {}
[HideInInspector] _Color("", Color) = (1, 1, 1, 1)
[HideInInspector] _ColorMask("", Float) = 15
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
fixed4 color : COLOR;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float _Fps;
float2 _Scale;
float2 _Frames[512];
float4 _Color;
uint _FrameCount;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
// Calculate the frame index over time
uint index = _FrameCount > 0 ? ((int)(_Time.y / (1 / _Fps)) % _FrameCount) : 0;
// Set the frame
o.uv = v.uv * _Scale + _Frames[index];
o.color = v.color * _Color;
return o;
}
fixed4 frag(v2f i) : SV_Target
{
return tex2D(_MainTex, i.uv) * i.color;
}
ENDCG
}
}
}
What’s wrong with the shader?