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.
23 lines
433 B
23 lines
433 B
11 years ago
|
#version 100
|
||
|
|
||
|
varying highp vec2 pos;
|
||
|
varying highp vec2 start;
|
||
|
|
||
|
void main(){
|
||
|
|
||
|
highp vec2 z = start;
|
||
|
|
||
|
int i = 0;
|
||
|
for (i = 0; i < 7; i++) {
|
||
|
highp vec2 zsq = z*z;
|
||
|
if(zsq.x + zsq.y > 16.0) break;
|
||
|
|
||
|
highp float t = zsq.x - zsq.y + pos.x;
|
||
|
z.y = 2.0*z.x*z.y + pos.y;
|
||
|
z.x = t;
|
||
|
}
|
||
|
|
||
|
gl_FragColor = vec4(float(i) / 7.0);
|
||
|
gl_FragColor.bg = 0.5 * sin(z) + 0.5;
|
||
|
}
|