Vaporwave Grid

love vaporwave art.

Surfing on Shader Toy I’ve found the shader Cyber Fuji 2020 from Kaiware007. So, I’ve decided to convert part of it to be used into Godot. The glowing grid could give some ’80s vibes to your game!

INSTRUCTIONS
For using it, just place the shader on a node like ColorRect and see the magic happens!

Enjoy!

Shader code
shader_type canvas_item;

uniform float battery : hint_range(0.0,1.0) = 1.0;
uniform float anchor : hint_range(-1.0,1.0) = -0.5;
uniform float speed_scale : hint_range(1.0, 10.0) = 1.0;
uniform float fov : hint_range(0.01, 1.0) = 0.2;
uniform vec4 background_color : hint_color = vec4(0.0, 0.1, 0.2, 1.0);
uniform vec4 grid_color : hint_color = vec4(1.0, 0.5, 1.0, 1.0);

float grid(vec2 uv, float batt) {
    vec2 size = vec2(uv.y, uv.y * uv.y * 0.2) * 0.01;
    uv += vec2(0.0, TIME * speed_scale * (batt + 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 * batt;
    return clamp(lines.x + lines.y, 0.0, 3.0);
}

void fragment() {
	vec2 uv = UV;
	vec4 col = background_color;
    uv.y = 3.0 / (abs(uv.y + fov) + 0.05);
	uv.x += anchor;
    uv.x *= uv.y * 1.0;
    float gridVal = grid(uv, battery);
    col = mix(background_color, grid_color, gridVal);
	COLOR = col;
}
Tags
80s, glow, grid, vaporwave
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.

More from BlueMoon_Coder

Green Screen – Chroma Key

Related shaders

Vaporwave grid tweaks

Dashed Grid (The Best Darn Grid Shader (Yet))

Dotted grid 2d [Improved]

Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Tanders
2 years ago

Thanks for the shader! It inspired me to recreate an old Unity game, in which I used a similar shader. Feel free to check out the final prouduct:

https://glitchfield.com/

lyghtkruz
lyghtkruz
2 years ago

If you want to use this on Godot 4.0, hint_color is now source_color. Everything else works perfectly.