diff options
author | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-07-06 23:08:28 +0000 |
---|---|---|
committer | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-07-06 23:08:28 +0000 |
commit | f2457f3e95c3c05eb89310a2a15723705461a414 (patch) | |
tree | 8034fe80deae8bcb94d0e49f98f3dd9aa5af55bd /data/shaders | |
parent | 879952d954259eebc40235346e48a0287f48dc1d (diff) |
Second spirally thing when landed
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@132 84d2e878-0bd5-11dd-ad15-13eda11d74c5
Diffstat (limited to 'data/shaders')
-rw-r--r-- | data/shaders/swirlytron.frag | 17 | ||||
-rw-r--r-- | data/shaders/swirlytron.vert | 6 |
2 files changed, 16 insertions, 7 deletions
diff --git a/data/shaders/swirlytron.frag b/data/shaders/swirlytron.frag index 31a0912..d2d6ca7 100644 --- a/data/shaders/swirlytron.frag +++ b/data/shaders/swirlytron.frag @@ -10,8 +10,9 @@ */ varying vec2 coords; - +varying vec2 incoords; uniform float time; +uniform bool landed; void main() { @@ -20,12 +21,18 @@ void main() { float r; r = pow(abs(coords.x), 2.0) + pow(abs(coords.y), 2.0); - - f = 1.0 ;//+ (0.5*cos(time/1000.0)); - + f = 1.0; colour.r = 0.0; colour.g = 0.0; - colour.b = 1.0 * cos(2*f*3.141*r - (time/250.0) ); + colour.b = 1.0 * cos(2*f*3.141*r - (time/250.0) ); + + if ( landed ) { + r = pow(abs(incoords.x), 2.0) + pow(abs(incoords.y), 2.0); + f = 1.0; + colour.r += 1.0 * cos(2*f*3.141*r + (time/250.0) ); + colour.g += 1.0 * cos(2*f*3.141*r + (time/250.0) ); + colour.b += 0.0; + } gl_FragColor = vec4(colour.r, colour.g, colour.b, 1.0); diff --git a/data/shaders/swirlytron.vert b/data/shaders/swirlytron.vert index a15b8a7..bd69d97 100644 --- a/data/shaders/swirlytron.vert +++ b/data/shaders/swirlytron.vert @@ -10,11 +10,13 @@ */ varying vec2 coords; +varying vec2 incoords; +uniform vec2 lander; void main() { - coords.x = gl_Vertex.x; - coords.y = gl_Vertex.y; + coords = gl_Vertex.xy; + incoords = gl_Vertex.xy + lander; /* Coordinates */ gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; |