Devlog & Updates

Behind-the-scenes notes, new simulation announcements, and WebGL tips from building this project.

📝 Devlogs & tips 🚀 Announcements 📡 RSS Feed
Filter:
⭐ Featured Post Read post →

🔧 Devlog Series

📚 Devlog #8

Three New Tutorials: Solar System, GLSL Shaders & localStorage

The tutorial section grew from 8 to 11 — a Three.js solar system for intermediates, raw GLSL fire-and-water shaders for the brave, and a beginner-friendly localStorage guide. Plus related-sim cross-links on 16 articles.

🧫 Devlog #7

Reaction-Diffusion — Turing Patterns on the GPU

How Alan Turing's 1952 morphogenesis equations became a real-time WebGL texture shader. Ping-pong framebuffers, the Gray–Scott model, and the haunting patterns that emerge from two chemicals.

🐦 Devlog #6

Boids — 3 Rules, Emergent Behaviour & 10,000-Bird Skies

Craig Reynolds' three steering forces — separation, alignment, cohesion — are all it takes to fill the sky with a convincing murmuration. Plus the spatial hash that makes 10,000 agents fast.

🌊 Devlog #5

Ocean Shader — GLSL, Gerstner Waves & Fresnel in 3 Days

Realistic ocean water with animated vertex displacement, foam at crests and a Fresnel reflection effect — all written from scratch in GLSL over a long weekend.

🌌 Devlog #4

Galaxy — Rendering 80,000 Stars Without Slowdown

A spiral galaxy with 80 k stars sounds impossible at 60 FPS — until you discover InstancedMesh and custom instanced shaders. The full story of how I cut GPU draw calls from 80,000 to 1.

🌍 Devlog #3

Tectonic Plates — Spherical Geometry & Real Displacement

Mapping Earth's crustal plates onto a sphere with displacement maps and smooth boundary animations. Three.js, spherical harmonics and a lot of trigonometry.

💧 Devlog #2

SPH Fluid — from Wikipedia to 60 FPS

SPH neighbour lookups, kernel functions, pressure and viscosity forces — translating dense academic notation into running JavaScript code. Plus the spatial-hash optimisation that made it real-time.

🚀 Devlog #1

How This Project Started — One Simulation in a Weekend

It was supposed to be a quick Three.js experiment for a weekend. A year and 40+ simulations later, here we are. The origin story of 3D Simulations.

📣 Announcements

💡 Tips & Tricks

Perf

InstancedMesh Changed Everything — 5 FPS to 60 FPS

Rendering thousands of identical objects is the most common Three.js performance trap. One API call — InstancedMesh — solves it completely. Benchmarks and code included.

🔍 Debug

How I Debug GLSL Shaders (and Keep My Sanity)

No console.log in GLSL. No breakpoints. Just a black screen. Here are my practical tools and workflow for debugging vertex and fragment shaders — including the colour-as-value trick.

🗑️ Memory

Disposing Three.js Objects Correctly (No Memory Leaks)

Geometry, material, texture and renderer — all leak if you don't call dispose() correctly. The complete checklist I use before every simulation cleanup.

⚙️ Comparison

Cannon-es vs Rapier.js — Choosing a Browser Physics Engine

Both run in the browser; both handle rigid bodies. So which do you pick? A practical side-by-side comparison based on building simulations with each.

⚖️ Comparison

Three.js vs Babylon.js — Which WebGL Framework?

Two mature WebGL frameworks, very different philosophies. I built the same simulation in both and here's what I found: bundle size, API ergonomics, shader access and ecosystem differences.

⏱️ Perf

requestAnimationFrame vs setInterval — Always Use rAF

setInterval can't match the display refresh rate, wastes CPU in hidden tabs, and causes jitter. Here's exactly why rAF wins for animations and simulations, plus the fixed-timestep pattern that prevents physics explosions.

📋 Snippets

Useful Three.js Snippets I Use Every Day

8 copy-paste code blocks I reach for in every project: pixel-ratio renderer setup, resize handler, texture loader with callbacks, instanced matrix update, BufferGeometry from typed arrays, and more.

🎨 CSS

CSS Grid for Responsive Simulation Cards

auto-fill vs auto-fit, minmax() columns that work from 320 px to 4 K — no media queries needed. The exact grid setup behind this site's simulation catalogue, with a live editable demo.