Back to browse
Organic cell simulation with infinite zoom (100k cells, raw WebGL)

Organic cell simulation with infinite zoom (100k cells, raw WebGL)

by cloogshicer·Jul 26, 2026·2 points·0 comments

AI Analysis

●●●BangerEye CandyWizardryCozy

Infinite zoom into 100k procedural cells with zero dependencies in one HTML file.

Strengths
  • Domain warping in fragment shaders creates organic cell stretching based on velocity
  • Instanced rendering handles 100k cells efficiently on consumer hardware like M1 MBA
  • Single unminified HTML file invites learning and modification without build tools
Weaknesses
  • No gameplay mechanics beyond splitting cells and panning around the simulation
  • Limited practical use beyond visual demonstration and educational exploration
Category
Target Audience

Creative coders, graphics programmers, demoscene enthusiasts

Similar To

ShaderToy · The Book of Shaders · WebGL Fluid Sim

Post Description

Made this little cell simulation with an infinite zoom mechanic in raw WebGL. Renders up to 100k cells on my laptop (M1 MBA).

It's a single HTML file, not minified, without dependencies, so you can just inspect the source code. It's just raw JS and WebGL shaders. No assets, everything is procedurally generated.

For each cell, I draw a single quad using instanced rendering. To create a nice organic wobble, I use SDF (Signed Distance Fields) to draw a circle (or another base shape), which is then distorted by adjusting the radius using multiple overlapping sine waves. I explain this visually here. [1]

To get the cells to stretch dynamically based on their velocity, I use a technique called Domain Warping. Basically in the fragment shader, the fragmentPosition is adjusted inwards/outwards depending on the current velocity, which squashes/stretches the entire coordinate system of the quad in either direction. Gives it a very organic look. I explain this in more detail here. [2]

Physics are also custom, on the CPU using position-based dynamics (PBD). This is currently the weak point of the engine, and with lots of cells, it's CPU constrained. I might move this to the GPU later or switch to a different approach. Not sure yet.

The infinite zoom mechanic works by dynamically rendering only the two currently visible layers. Physics are currently simulated all the time for all layers, although I could potentially also pause layers that are not currently visible.

All of this uses data-oriented design (DOD) techniques to keep most of the data structures in flat typed arrays for fast iteration and to minimize allocations in the main game loop.

I'm planning to build this engine out into a full incremental game with some light automation elements (think a microscopic Factorio, but much shorter). If you're interested in following the dev process, I post highly technical deep-dives on YouTube [3], or you can enter your email here [4] to get source code updates (super low volume).

Let me know what you think! Happy to answer any questions.

[1] https://youtu.be/VChlSt6gVSo?t=380 [2] https://youtu.be/VChlSt6gVSo?t=516 [3] https://youtube.com/@philomatics [4] https://philomatics.com/cell-game

Similar Projects

SocialMid

Own the Void – a trillion-cell infinite canvas

This is an engineering-first take on the million-pixel idea: a 1,000,000×1,000,000 logical grid where only claimed cells hit storage and the client pulls tile-based viewport queries while a DPR-aware Canvas draws without full redraws. The clever parts are the sparse-storage model and edge serving via Cloudflare Workers+D1, but the product hinges on hard questions — D1 query scaling, cheap moderation for free text, and whether a €1-per-cell economy actually funds permanent storage.

Bold BetWizardryRabbit Hole
sneezydwarf
225mo ago
GamingPass

Founder City

Skyline flying demo that's mostly novelty; real product (founder networking) still vapor.

Eye Candy
programad
204mo ago