Neon Cyber-Lattice
A glowing wireframe grid floating in endless space.
60 FPS • WebGL Shader
GLSL Fragment Shader
#version 300 es
precision highp float; uniform vec2 u_resolution; uniform vec2 u_mouse; uniform float u_time; out vec4 f;
mat2 rot(float a){return mat2(cos(a),-sin(a),sin(a),cos(a));}
void main() {
vec2 uv = (gl_FragCoord.xy-.5*u_resolution)/u_resolution.y;
vec3 ro = vec3(0,0,-3), rd = normalize(vec3(uv,1));
rd.xz *= rot(u_time*.2 + u_mouse.x*2.); rd.yz *= rot(u_mouse.y*2.);
float t=0.; vec3 c=vec3(0);
for(int i=0; i<60; i++){
vec3 p = ro + rd*t;
p = mod(p, 2.0)-1.0;
float d = min(min(length(p.xy), length(p.yz)), length(p.zx)) - 0.05;
if(d<0.01) { c += vec3(0.1, 0.8, 0.5)*0.05; }
t += max(d, 0.02);
}
f = vec4(c, 1.0);
} Properties
#glsl#neon#wireframe
Author: Math Art Core Target: 60 FPS