Skip to content

Commit 26c200c

Browse files
authored
Merge pull request #57 from BahuMan/fix-Colorcycle-shader
ColorCycle.shader: fix cycling
2 parents 2b45566 + 6fc5b5c commit 26c200c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Assets/Shaders/2D/Effects/ColorCycle.shader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ Shader "UnityLibrary/2D/Effects/ColorCycle"
5151
float gray = tex2D(_MainTex, i.uv).r;
5252

5353
// get scrolling
54-
float scroll = frac(_Time.x*_Speed);
54+
float scroll = frac(gray + _Time.x*_Speed);
5555

5656
// get gradient color from texture
57-
fixed4 col = tex2D(_GradientTex,float2(gray+scroll,0.5));
57+
fixed4 col = tex2D(_GradientTex,float2(scroll,0.5));
5858

5959
return col;
6060
}

0 commit comments

Comments
 (0)