blob: d2d6ca7bff08f6d5cd883abdee20f289272be0a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/*
* swirlytron.frag
*
* Swirly stuff for rendering onto swirly things...
*
* (c) 2007-2008 Thomas White <taw27@cam.ac.uk>
*
* thrust3d - a silly game
*
*/
varying vec2 coords;
varying vec2 incoords;
uniform float time;
uniform bool landed;
void main() {
vec3 colour;
float f;
float r;
r = pow(abs(coords.x), 2.0) + pow(abs(coords.y), 2.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) );
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);
}
|