Drawing with Math - Pixel Shaders
summary
Builds a real-time tunnel effect in GLSL running on WebGL/Three.js with an editable demo at code-shaders.app. Uses signed distance functions: a circle SDF via length (Pythagorean theorem) minus radius, then multiplies coords by grid size (demo uses 10×10) and fract to get a grid, then converts to polar with atan and inverse radius to pinch and animate. Adds a radial mask to hide central distortion; the live shader works as shown.
AI-written summary · about
