Menu

Post image 1
Post image 2
Post image 3
Post image 4
1 / 4
0

Fractals and Non-Euclidean Geometry in the Browser

DEV Community·Ajay D·22 days ago
#xVXx7rdR
#webgl#fractals#react#gpu#corridor#precision
Reading 0:00
15s threshold

I have been watching Corridor Digital's videos for a while now. Their breakdowns of how impossible spaces work in games and film got me thinking about whether I could build something similar that runs entirely in a browser tab. No game engine, no desktop app. Just a Next.js site and a GPU. So I built two things for my portfolio: an infinite-zoom Mandelbrot explorer and a non-Euclidean corridor that loops forever. Both use GLSL fragment shaders and React Three Fiber. This post is about the GPU techniques that make them possible. Why the GPU The Mandelbrot formula is dead simple. For each pixel, run z = z^2 + c until it escapes. The problem is scale. A 1080p canvas has 2 million pixels. Each one needs hundreds of iterations. On the CPU that is a single-threaded loop and you get maybe 3 FPS. Completely unusable. GPUs run the same small program on every pixel at the same time. Write the iteration loop in GLSL instead of JavaScript and suddenly all 2 million pixels compute in parallel, every frame, at 60fps.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More