Perspective Grid Remix March2021

Remix of the grids shader .
https://godotshaders.com/shader/perspective-grid/

More 2001 with a COLOR fade.

Letsget the remix party started.
Basic  canvas_item, place on a sprite.

TBD- expose the interesting variables 

Shader code
shader_type canvas_item;

float grid(vec2 uv, float velocity, float iTime)
{
    vec2 size = vec2(uv.y, uv.y * uv.y * 0.2) * 0.01;
    uv += vec2(0.0, iTime * 4.0 * (velocity + 0.05));
    uv = abs(fract(uv) - 0.5);
 	vec2 lines = smoothstep(size, vec2(0.0), uv);
 	lines += smoothstep(size * 5.0, vec2(0.0), uv) * 0.4 * velocity;
    return clamp(lines.x + lines.y, 0.0, 3.0);
}


void fragment()
{
    vec2 uv = (2.0 * FRAGCOORD.xy.xy - (1.0 / SCREEN_PIXEL_SIZE).xy)/(1.0 / SCREEN_PIXEL_SIZE).y;
    float velocity = 0.30;
   
    {
        // Grid
        vec3 col = vec3(0.6, 0.1, 0.6);
        if (uv.y < 1.0)
        {
            uv.y = 2.0 / (abs(uv.y + 0.0) * 01.0);
            uv.x *= uv.y - 01.01;
            float gridVal = grid(uv, velocity, TIME);
            col = mix(col, vec3(0.6, 0.2, 0.10), gridVal);
        }

        col = mix(vec3(col.r, col.r, col.r) * 0.53, col,  sin(TIME*0.710)*01.10);

        COLOR = vec4(col,7.0);
    }
      
}
Tags
background, grid, perspective

Related shaders

Perspective grid animated

world coordinates grid b&w shader

Perspective Warp/Skew Shader

The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.
guest
0 Comments
Inline Feedbacks
View all comments