8000 fractional part should be calculated AFTER gray value has been added … · jcs-PR/UnityLibrary@6fc5b5c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fc5b5c

Browse files
committed
fractional part should be calculated AFTER gray value has been added for continuous cycling effect
1 parent 2b45566 commit 6fc5b5c

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)
0