You are browsing as a guest. Sign up (or log in) to start making projects!

1h 51m 28s logged

reFlow Devlog 4 — pain & suffering++

long one, buckle up. also never posted devlog 3, so some of that’s folded in here.

hour 13 (retroactive): hardware hijacking
wanted the tunnel to interrogate your PC. hooked into the WebGL debug renderer extension for real GPU model strings (had to regex out ANGLE’s prefix junk), navigator.hardwareConcurrency for core count, performance.memory for live JS heap, and the Battery API for charge state. built a perf tracker timing the physics loop per frame — if it blows the 16ms budget, System Stress flips to CRITICAL with specific diagnoses like “Low Core Alert” instead of just “it’s lagging.”

hour 17: the great physics divorce
the entire physics engine was crammed inside Three.js’s render loop in WindTunnel.tsx. worked at 10k particles, died at 30k+ — browser froze, laptop got loud. ripped every physics function into a standalone physics.ts — pure math, zero Three.js imports, just numbers in and out. took two hours of replacing Vector3.set() calls with raw tuples and hand-rolled rotation matrices.

hour 18: web workers enter the chat
moved the whole particle loop off the main thread into a Web Worker via Vite’s one-line worker syntax. main thread sends position/velocity/color arrays, worker crunches 40k particles, sends them back. UI never freezes. used Transferable objects so arrays move by ownership transfer instead of getting copied every frame. added a main-thread fallback if workers fail to load.

hour 19: the wake was lying to me
old turbulence was just Math.sin() — predictable, periodic, fake. replaced with hash-based pseudo-random noise for organic chaos, added von Kármán vortex shedding behind bluff bodies (alternating vortex pairs, like lampposts oscillating in wind), and a no-slip boundary layer so particles slow down near surfaces instead of just bouncing.

hour 20: the car was ugly and the flat plate was a brick
car was a 2D extruded polygon that looked like a cheese wedge. rebuilt with bezier/quadratic curves for a real windshield, roofline, and spoiler lip, plus wheel arch cutouts. flat plate was basically a cutting board (BoxGeometry(0.3, 5.8, 5.8)) — thinned to 0.08 with beveled edges so it actually reads as a plate.

hour 21: torus goes brrr
torus was hardcoded. added live sliders for major radius (1.5–6.0) and minor radius (0.3–2.5) that rebuild the geometry AND feed the physics engine in real time. thin ring = ethereal vortex shedding, chonky donut = half-blocked tunnel. added an R/r ratio readout because it sounds smart.

hour 22: the sidebar was eating my screen
between left controls, right diagnostics, a bottom chart/AI panel, and a header full of badges, the 3D canvas shrank to a postage stamp. added collapsible panels — chevron toggles collapse the sidebars to thin strips and the canvas reclaims ~80% of the screen. sometimes the best feature is removing stuff.

hour 23: the absolute madman feature (GLB loader)
end of devlog 3 I said “maybe a glTF loader, we’ll see.” we saw. you can now upload any .glb/.gltf, and the app auto-scales/centers it, then voxelizes it — shoots rays through a 48×48×48 grid, counts intersections, and marks solid vs. air. physics engine uses that voxel grid for collisions. not physically perfect, but you can drop in a Stanford bunny and watch particles flow around its ears.

file count went from 2 source files to 5. physics.ts alone is 731 lines of math. wrote more linear algebra this week than my whole school career.

up next: markdown rendering for AI reports, and fixing the README’s leftover “YOUR_USERNAME” placeholders before anyone notices.

0
0

Comments 0

No comments yet. Be the first!