diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-10-18 21:46:52 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-10-18 21:46:52 +0530 |
| commit | a2cbcea7144380cfa51d050530251c1dd9bc4d1a (patch) | |
| tree | a1282b2cff0f72c9c1a4a0dde0b9bbd198d2bd58 /src/main/resources/shaders/kaleidos.glsl | |
| parent | d3b2736d64988af02b58e934d63fe1c2f0f38d6a (diff) | |
| download | art-playground-openrndr-a2cbcea7144380cfa51d050530251c1dd9bc4d1a.tar.gz art-playground-openrndr-a2cbcea7144380cfa51d050530251c1dd9bc4d1a.zip | |
Kaliedo rotate
Diffstat (limited to 'src/main/resources/shaders/kaleidos.glsl')
| -rw-r--r-- | src/main/resources/shaders/kaleidos.glsl | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/main/resources/shaders/kaleidos.glsl b/src/main/resources/shaders/kaleidos.glsl index b8c499b..689d806 100644 --- a/src/main/resources/shaders/kaleidos.glsl +++ b/src/main/resources/shaders/kaleidos.glsl @@ -96,17 +96,35 @@ void main() { float aspect_ratio = resolution.y / resolution.x; vec2 uv = (gl_GlobalInvocationID.xy - resolution / 2) * vec2(1.0, aspect_ratio) / resolution; - vec3 color = enable_antialiasing ? antialiased_image(uv) : image(uv); - float t = seconds / 3; + vec2 offset = vec2(mod(t * sin(t * 8), 0.02), 0); + + float tilt = 0, scale = 1.0; + float div1 = mod(t * 10, 17); + int s1 = 7, s2 = 15; + bool gshake = int(div1) == s1 || int(div1) == s2; + tilt = mix(tilt, PI / 3, ease_in_out_quart(smoothstep(s1 + 1, s1 + 2, div1))); + scale = mix(scale, 1.3, ease_in_out_quart(smoothstep(s1 + 1, s1 + 1.5, div1))); + scale = mix(scale, 1, ease_in_out_quart(smoothstep(s1 + 1.5, s1 + 2, div1))); + tilt = mix(tilt, PI / 2, step(div1, s2 + 2) * smoothstep(s1 + 1, 30, div1)); + tilt = mix(tilt, 0, ease_in_out_quart(smoothstep(s2 + 1, s2 + 2, div1))); + scale = mix(scale, 1.3, ease_in_out_quart(smoothstep(s2 + 1, s2 + 1.5, div1))); + scale = mix(scale, 1, ease_in_out_quart(smoothstep(s2 + 1.5, s2 + 2, div1))); + + float saturate = smoothstep(s1 + 2, s2, div1); + + uv *= mat2x2(cos(tilt), -sin(tilt), sin(tilt), cos(tilt)); + uv *= scale; + + vec3 color = enable_antialiasing ? antialiased_image(uv) : image(uv); - vec2 offset = vec2(mod(t, 0.01), mod(t, 0.003)); - if (int(t * 5) % 20 == 10) { + if (int(t * 5) % 20 == 5) { color.r = (color.r + image(uv + offset).r / 2 + image(uv - offset).r / 2) / 2.; - color.b = (color.b + image(uv + offset).b + image(uv - offset).b) / 3.; - } else if (int(t * 10) % 17 == 7) { + color.b = (color.b + image(uv + vec2(offset.y, offset.x)).b + image(uv - offset).b) / 3.; + } else if (gshake) { color.g = (color.g + image(uv + offset).g / 2 + image(uv - offset).g / 2) / 2.; } + color.r *= (0.7 + saturate); imageStore(output_image, ivec2(gl_GlobalInvocationID.xy), vec4(color, 1)); } |
