A browser scene editor where ray-marched primitives are added, selected, moved and coloured live.
ShaderLab is an interactive 3D scene editor that runs in the browser, rendered with WebGPU and WGSL ray marching. You build a scene out of primitives — spheres, boxes and the rest — then select them, move them with a three-axis translation gizmo and change their colour from a side panel. The viewport updates immediately: nothing is recompiled and nothing reloads between two edits.
Selection is the part worth explaining. On a ray-marched image there is no mesh to ray cast against, so objects are picked with an ID-based render pass that writes a unique identifier per object and reads the pixel back under the cursor. The project is also my way of learning the WebGPU pipeline properly rather than through a wrapper: buffers, bind groups, render passes, multi-pass rendering and error handling all appear here because the editor needs them. The honest gaps are listed in the repository — the picking pass still flickers, auto-rotate jitters slightly, and CSG needs redoing.
