You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
435 B
27 lines
435 B
11 years ago
|
#version 330
|
||
|
|
||
|
uniform float rotation;
|
||
|
|
||
|
in vec2 pos;
|
||
|
in vec2 start;
|
||
|
|
||
|
out vec4 fragColor;
|
||
|
|
||
|
void main(){
|
||
|
|
||
|
vec2 z = start;
|
||
|
|
||
|
int i = 0;
|
||
|
for (i = 0; i < 30; i++) {
|
||
|
vec2 zsq = z*z;
|
||
|
if(zsq.x + zsq.y > 16.0) break;
|
||
|
|
||
|
float t = zsq.x - zsq.y + pos.x;
|
||
|
z.y = 2.0*z.x*z.y + pos.y;
|
||
|
z.x = t;
|
||
|
}
|
||
|
|
||
|
fragColor = vec4(float(i) / 30.0);
|
||
|
fragColor.bg = 0.5 * sin(z) + 0.5;
|
||
|
}
|