Skip to content

optimized UV distortion

BLOKS Shader Bulletin Board

optimized UV distortion

By RJ Shelton June 9, 2026

Shader Preview Unavailable

This realtime shader may be too intensive for your current device or browser.

Shader Code
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
    vec2 uv = fragCoord.xy / iResolution.xy;

    vec2 p = uv * 2.0 - 1.0;

    p.x *= iResolution.x / iResolution.y;

    float t = iTime;

    vec2 subtle =
        vec2(
            sin(p.y * 4.0 + t),
            cos(p.x * 4.0 - t)
        ) * 0.05;

    p += subtle;

    float rings =
        sin(length(p) * 20.0 - t * 3.0);

    vec3 color = vec3(0.02, 0.04, 0.08);

    color += vec3(0.1, 0.7, 1.0) * rings;
    color += vec3(1.0, 0.25, 0.8) *
             sin(p.x * 8.0 + t);

    fragColor = vec4(color, 1.0);
}

← Back to Shader Bulletin Board