Hello there!
First post
We’ve got many shaders in our mobile game that use the _Time input for surface shaders to utilize many scrolling effects. The shaders render correctly when testing in the editor, but I’ve noticed while testing this on mobile (Galaxy SII) that after 2-3 minutes, the shaders eventually start stepping and become very pixelated.
Here is what it looks like after 3 minutes:
This shader is using 2 textures, a star overlay which doesn’t scroll, and a cloud overlay which uses the _Time variable, here is the shader code for it:
Shader "Rage/Scroll Overlay" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Overlay ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
sampler2D _Overlay;
struct Input {
float2 uv_MainTex;
float2 uv_Overlay;
float4 _Time;
};
void surf (Input IN, inout SurfaceOutput o) {
float2 overlaymove = IN.uv_Overlay.xy;
overlaymove.x = overlaymove.x + _Time;
half4 c = tex2D (_MainTex, IN.uv_MainTex);
half4 ov = tex2D (_Overlay, overlaymove);
o.Albedo = c.rgb + ov.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Thanks for your time!