JFProjectsProjectsMeMe
CVContact
All projects

Dec 2025

04 / 14

ShaderLab


A browser scene editor where ray-marched primitives are added, selected, moved and coloured live.

Gallery — ShaderLab01 / 01
ShaderLab editor with the live shader preview
01ShaderLab editor with the live shader preview

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.

All projects14