#version 450 // Name: Creation by Silexars // Author: Danguafer // URL: https://www.shadertoy.com/view/XsXXDn layout(location = 0) in vec2 vUV; layout(location = 0) out vec4 FragColor; layout(set = 3, binding = 0) uniform ShadertoyUBO { float iTime; vec2 iResolution; }; #define t iTime #define r iResolution.xy void mainImage(out vec4 fragColor, in vec2 fragCoord) { vec3 c = vec3(0.0); float l; float z = t; for (int i = 0; i < 3; i++) { vec2 uv, p = fragCoord.xy / r; uv = p; p -= 0.5; p.x *= r.x / r.y; z += 0.07; l = length(p); float invl = (l > 0.0) ? (1.0 / l) : 0.0; uv += p * invl * (sin(z) + 1.0) * abs(sin(l * 9.0 - z - z)); vec2 m = mod(uv, 1.0) - 0.5; float denom = length(m); if (denom < 1e-6) denom = 1e-6; c[i] = 0.01 / denom; } float L = (l > 0.0) ? l : 1.0; fragColor = vec4(c / L, t); } void main() { vec2 fragCoordPixels = vUV * iResolution; vec4 outColor; mainImage(outColor, fragCoordPixels); FragColor = outColor; }