BLOKS Shader Bulletin Board
space visualizer
Shader Preview Unavailable
This realtime shader may be too intensive for your current device or browser.
Shader Code
float line(float value, float target, float thickness)
{
return 1.0 - smoothstep(0.0, thickness, abs(value - target));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
vec2 uv = fragCoord.xy / iResolution.xy;
vec3 color = vec3(0.02, 0.04, 0.08);
color += vec3(uv.x * 0.25, uv.y * 0.35, 0.45);
float grid = 0.0;
grid += line(fract(uv.x * 10.0), 0.0, 0.015);
grid += line(fract(uv.y * 10.0), 0.0, 0.015);
float centerX = line(uv.x, 0.5, 0.004);
float centerY = line(uv.y, 0.5, 0.004);
color += grid * vec3(0.0, 0.35, 0.75);
color += (centerX + centerY) * vec3(0.2, 0.9, 1.0);
fragColor = vec4(color, 1.0);
}
