demo
This commit is contained in:
23
shaders/tunnel.frag
Normal file
23
shaders/tunnel.frag
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 100
|
||||
precision mediump float;
|
||||
uniform float u_time;
|
||||
uniform vec2 u_resolution;
|
||||
|
||||
void main() {
|
||||
vec2 p = (2.0 * gl_FragCoord.xy - u_resolution.xy) / u_resolution.y;
|
||||
float a = atan(p.y, p.x);
|
||||
float r = length(p);
|
||||
vec2 uv = vec2(0.5 / r + 0.5 * u_time, a / 3.14159);
|
||||
|
||||
// Simple checkerboard pattern
|
||||
float f = sin(uv.x * 20.0) * sin(uv.y * 20.0);
|
||||
vec3 col = vec3(f);
|
||||
|
||||
// Fade to black in center
|
||||
col *= r;
|
||||
|
||||
// Add some color
|
||||
col *= vec3(0.5 + 0.5 * sin(u_time), 0.5, 0.5 + 0.5 * cos(u_time));
|
||||
|
||||
gl_FragColor = vec4(col, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user