demo
This commit is contained in:
22
shaders/fractal.frag
Normal file
22
shaders/fractal.frag
Normal file
@@ -0,0 +1,22 @@
|
||||
#version 100
|
||||
precision mediump float;
|
||||
uniform float u_time;
|
||||
uniform vec2 u_resolution;
|
||||
|
||||
void main() {
|
||||
vec2 uv = (gl_FragCoord.xy * 2.0 - u_resolution.xy) / u_resolution.y;
|
||||
vec2 u0 = uv;
|
||||
vec3 finalColor = vec3(0.0);
|
||||
|
||||
for (float i = 0.0; i < 4.0; i++) {
|
||||
uv = fract(uv * 1.5) - 0.5;
|
||||
float d = length(uv) * exp(-length(u0));
|
||||
vec3 col = vec3(0.2, 0.5, 0.82);
|
||||
d = sin(d * 8.0 + u_time) / 8.0;
|
||||
d = abs(d);
|
||||
d = pow(0.01 / d, 1.2);
|
||||
finalColor += col * d;
|
||||
}
|
||||
|
||||
gl_FragColor = vec4(finalColor, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user