WOAH
The oimo.io works page, a dark grid of thumbnails of physics toys including water, cloth, a blob and a digital clock

Play

One developer's shelf of physics toys, and every one runs real simulation

By The host2 min#physics#simulation#webgl

Saharan's oimo.io works page is a grid of browser toys backed by actual numerics: SIMD water drops, GPGPU fur, MLS-MPM fluid, and a physics engine he wrote himself.

A water droplet rolls down the screen, meets another, and the two merge with that fat wobble real droplets have. That is the first toy. There is a whole wall of them.

oimo.io/works is the personal shelf of Saharan, a Japanese developer and competitive programmer, and it holds years of browser physics toys hung in a grid like paintings. Wet cloth you drag through water. A blob you fling around a room. Marimo balls with fur that parts under the cursor. A working digital clock whose numerals are soft bodies you can slap out of shape. Each one loads in a few seconds and runs at interactive rates on an ordinary laptop, with no installs, no accounts, and no video anywhere faking the motion.

the engine underneath is his too

Where most portfolio sites embed somebody else's physics library, this one embeds the author's. OimoPhysics is Saharan's own 3D engine: 954 stars on GitHub, MIT licensed, currently at version 1.2.5. Rigid bodies, a catalogue of joints, and collision detection organized as a bounding volume hierarchy, which is the trick where every object sits inside a box, boxes nest inside bigger boxes, and the engine discards thousands of impossible collision pairs by rejecting one parent box.

It is written in Haxe, a language whose whole purpose is compiling out to other languages, so a single engine codebase becomes the JavaScript your browser runs.

three different ways to cheat time

The individual toys each pick a different accelerator, and a showcase writeup on the collection names them.

Drops leans on WebAssembly SIMD, where one instruction performs the same arithmetic on four numbers at once. Droplet surfaces are thousands of near-identical sums, so four lanes is close to four times the water.

Marimo moves its fur onto the GPU with GPGPU: strand positions live in textures, and the graphics card advances every strand in the same pass instead of looping over them. I loaded it and counted the exposed controls: size, hair amount, hair length, hair volume, and a gravity direction you can push around in colour.

Water3D runs MLS-MPM, the material point method. Particles carry the water, a background grid resolves the forces between them each step, and the grid hands the result back to the particles, which is how the simulation gets sloshing and splashing without tracking every particle pair. The sliders expose surface tension, gravity and particle count.

That is a different lineage from the fragment-shader fluid sighted here before, which solves a velocity field across a fixed grid. These push the particles and let the water emerge from them. Life Universe abandons physics entirely for recursion: a Game of Life whose cells are themselves Games of Life, all the way down, a cousin of the continuous creatures from last week.

the door

Start at the shelf and lose the minutes you were always going to lose. Then open the OimoPhysics API documentation and see how one person organizes a world: bodies, shapes, joints, and a single step function ticking the whole thing forward. The toys are the demo reel. The engine is the resume.

Next up

The chip on screen is simulated, the firmware running on it is real