aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/linearGradient.frag.glsl
diff options
context:
space:
mode:
authorhwc4872012-07-09 16:08:02 -0700
committerhwc4872012-07-09 16:08:02 -0700
commit5085d0f67df89a21715308956004164597a6ba79 (patch)
tree2c896163143a66331205a39b0a3b1b45d51bf12a /assets/shaders/linearGradient.frag.glsl
parent51f1691f792dbda9b740ded8aa0457c9406db156 (diff)
parent84b3327bd92faafab7954b5eb64c7abe24a3fe13 (diff)
downloadninja-5085d0f67df89a21715308956004164597a6ba79.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into GridFixes
Conflicts: js/helper-classes/3D/StageLine.js
Diffstat (limited to 'assets/shaders/linearGradient.frag.glsl')
-rwxr-xr-xassets/shaders/linearGradient.frag.glsl68
1 files changed, 34 insertions, 34 deletions
diff --git a/assets/shaders/linearGradient.frag.glsl b/assets/shaders/linearGradient.frag.glsl
index 111dffbd..03310255 100755
--- a/assets/shaders/linearGradient.frag.glsl
+++ b/assets/shaders/linearGradient.frag.glsl
@@ -33,44 +33,44 @@ precision highp float;
33#endif 33#endif
34 34
35 35
36uniform vec4 u_color1; 36uniform vec4 u_color1;
37uniform vec4 u_color2; 37uniform vec4 u_color2;
38uniform vec4 u_color3; 38uniform vec4 u_color3;
39uniform vec4 u_color4; 39uniform vec4 u_color4;
40uniform float u_colorStop1; 40uniform float u_colorStop1;
41uniform float u_colorStop2; 41uniform float u_colorStop2;
42uniform float u_colorStop3; 42uniform float u_colorStop3;
43uniform float u_colorStop4; 43uniform float u_colorStop4;
44uniform vec2 u_cos_sin_angle; 44uniform vec2 u_cos_sin_angle;
45//uniform int u_colorCount; // currently using 4 45//uniform int u_colorCount; // currently using 4
46 46
47varying vec2 v_uv; 47varying vec2 v_uv;
48 48
49 49
50void main(void) 50void main(void)
51{ 51{
52 float t = dot(v_uv, u_cos_sin_angle); 52 float t = dot(v_uv, u_cos_sin_angle);
53 53
54 vec4 color; 54 vec4 color;
55 if (t < u_colorStop1) 55 if (t < u_colorStop1)
56 color = u_color1; 56 color = u_color1;
57 else if (t < u_colorStop2) 57 else if (t < u_colorStop2)
58 { 58 {
59 float tLocal = (t - u_colorStop1)/(u_colorStop2 - u_colorStop1); 59 float tLocal = (t - u_colorStop1)/(u_colorStop2 - u_colorStop1);
60 color = mix(u_color1,u_color2,tLocal); 60 color = mix(u_color1,u_color2,tLocal);
61 } 61 }
62 else if (t < u_colorStop3) 62 else if (t < u_colorStop3)
63 { 63 {
64 float tLocal = (t - u_colorStop2)/(u_colorStop3 - u_colorStop2); 64 float tLocal = (t - u_colorStop2)/(u_colorStop3 - u_colorStop2);
65 color = mix(u_color2,u_color3,tLocal); 65 color = mix(u_color2,u_color3,tLocal);
66 } 66 }
67 else if (t < u_colorStop4) 67 else if (t < u_colorStop4)
68 { 68 {
69 float tLocal = (t - u_colorStop3)/(u_colorStop4 - u_colorStop3); 69 float tLocal = (t - u_colorStop3)/(u_colorStop4 - u_colorStop3);
70 color = mix(u_color3,u_color4,tLocal); 70 color = mix(u_color3,u_color4,tLocal);
71 } 71 }
72 else 72 else
73 color = u_color4; 73 color = u_color4;
74 74
75 gl_FragColor =color; 75 gl_FragColor =color;
76} 76}