This proof-of-concept demonstrates a Babylon.js scene backed by Rapier 3D physics, showcasing a pachinko/pinball hybrid with WebGPU-first rendering.
- Vite (vanilla TypeScript template)
- Babylon.js (core)
- Rapier 3D WASM (
@dimforge/rapier3d-compat)
npm install
npm run devOpen http://localhost:5173/. Use Left Shift / Right Shift for the flippers, hold Space or Enter to charge and release the plunger, and press R to reset the ball.
The recommended progression path is the alternating A/B campaign system (EXTENDED_MAP <-> STATIONARY_TABLE) driven by AdventureTrackProgression + AdventureProgressionSupervisor. See docs/ADVENTURE_CAMPAIGN.md.
The game runs WebGPU-first with an automatic WebGL fallback, but you can force WebGL2 — handy for visual debugging, Playwright, and CI where WebGPU output isn't easily inspectable.
Ways to select a renderer (checked in this order):
- URL param:
http://localhost:5173/?renderer=webgl2(or?renderer=webgpu) window.DEBUG_RENDERER = 'webgl2'set before the page loads- Settings → Developer → Renderer dropdown (persists via
localStorage, reloads the page) - Default:
auto(WebGPU first, WebGL fallback)
The Developer settings panel (visible in dev builds or with a debug query param) also has two debug overlays, available in either renderer:
- Wireframe Mode — toggles
scene.forceWireframe - Physics Debug Draw — overlays Rapier's collider/joint wireframes via
world.debugRender()
See AGENTS.md for implementation details and WebGL2 ↔ WebGPU porting notes.