Blur Study Box
- group .........
- 3D and WebGL scenes
- source ........
- https://ui.aryank.space/components/blur-study-box
- markdown ......
- /lab/blur-study-box.md
- human .........
- /lab/blur-study-box
── WHAT_IT_IS ────────────────────────────────────────────────────────────────────────────────
Sixty-four Box3D capsule bodies move behind a frosted render pane, with depth controlling each capsule's blur radius, diffusion ramp, opacity, and dithered edge. The original ninety-six depth samples run in one instanced WebGPU draw instead of sixty-four separate meshes. Drag bodies through a spring joint, set the optical and physical model through props, and export verified square PNGs from 2,048 to 24,000 pixels through tiled GPU readback and stripe-streamed compression.
── BEHAVIOUR ────────────────────────────────────────────────────────────────────────────────
* Depth is the blur input
Each proxy integrates ninety-six samples through its analytic capsule. The distance from the render pane drives diffusion radius, density, opacity falloff, and the dithered edge instead of applying a screen-space blur after rendering.
* One instanced draw
Box3D writes the sixty-four transforms into one instance buffer. A single WebGPU draw resolves every capsule, which keeps the source's depth integration without paying for sixty-four mesh submissions.
* The simulation is deterministic
Initial placement, velocity, orientation, and timed impulses use the source seed and Mulberry32 sequence. Physics advances at 1/60 second with four substeps, independent of display refresh rate.
* Render scale is the frame-rate control
Cost is ninety-six samples per fragment times the pixel count, so a 2x display renders four times the work for the same picture. The renderScale prop caps device pixels per CSS pixel and defaults to 1. Raise it to 2 for a pixel-exact match on a high-density screen. Exports render at their own print size either way.
* Large exports never allocate the full image
The export camera renders 1,024 by 256 pixel tiles. Rows are joined into one stripe, filtered, compressed through CompressionStream, and written to origin-private storage before the verified file downloads.