Playground
GLSL
GPU 셰이더 프로그래밍
shader.frag
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
// GLSL Fragment Shader // Edit the shader code below precision mediump float; uniform float u_time; uniform vec2 u_resolution; uniform vec2 u_mouse; void main() { vec2 uv = gl_FragCoord.xy / u_resolution.xy; uv = uv * 2.0 - 1.0; uv.x *= u_resolution.x / u_resolution.y; // Animated pattern float d = length(uv); float a = atan(uv.y, uv.x); // Rings float rings = sin(d * 10.0 - u_time * 2.0) * 0.5 + 0.5; // Spiral float spiral = sin(a * 5.0 + d * 8.0 - u_time * 3.0) * 0.5 + 0.5; // Colors vec3 col1 = vec3(0.4, 0.4, 0.95); // Indigo vec3 col2 = vec3(0.95, 0.45, 0.7); // Pink vec3 col3 = vec3(0.2, 0.85, 0.6); // Emerald vec3 color = mix(col1, col2, rings); color = mix(color, col3, spiral * 0.5); // Vignette float vignette = 1.0 - d * 0.6; color *= vignette; gl_FragColor = vec4(color, 1.0); }
Preview
Console
GLSL
shader.frag
UTF-8
Ln 1, Col 1
Spaces: 2