Flagship · 262k tris
Crytek Sponza — Path Tracing & SVGF
Authentic Khronos Crytek Sponza glTF with 25 PBR textures, multi-bounce Global Illumination, soft sunlight, temporal accumulation, and demodulated À-Trous denoising.
enable magma_ray_query;
MIT License
Write inline WebGPU ray queries once. Run with zero overhead on native DXR 1.1 in Magma / MegaBrowser, and automatically fall back to a 2-level 8-bin SAH BVH compute shader in Chrome, Edge, Firefox & Safari.
Every demo runs live in your browser using the exact same enable magma_ray_query; WGSL shader on both hardware DXR 1.1 and software BVH.
Flagship · 262k tris
Authentic Khronos Crytek Sponza glTF with 25 PBR textures, multi-bounce Global Illumination, soft sunlight, temporal accumulation, and demodulated À-Trous denoising.
Scene 2 · Soft Shadows
Multi-bounce mirror and glossy reflections, jittered area-light soft shadows, smooth barycentric normals, and live material presets.
Scene 3 · Dynamic TLAS
Up to 20 animated BLAS/TLAS instances rebuilt every frame with instance_custom_data procedural materials, Fresnel reflections, and orbiting light shadows.
Scene 4 · Dielectrics & AO
Smooth normals via barycentrics, Snell refraction & TIR via front_face, object_to_world transforms, stratified hemisphere AO, and debug views.
One SDK call inspects adapter.features.has("ray-query") and selects the optimal backend transparently.
| Environment | Mode | Path |
|---|---|---|
| Magma / MegaBrowser | "hardware" |
Direct native DXR 1.1 pass-through |
| Chrome / Edge / Firefox / Safari | "software-bvh" |
2-level 8-bin SAH BVH + WGSL transpile |
Survey of the newest neural & real-time path tracing denoisers on GitHub — including Neural Ray Reconstruction, online neural cross-regression, neural kernel-predicting transformers, Cooperative Vectors / Slang, and WebGPU compute denoisers.
import { installMagmaRayQueryShim, RAY_QUERY_FEATURE_NAME } from "@vibegameengine/magma-ray-query-shim"; const adapter = await navigator.gpu.requestAdapter(); const hasDXR = adapter.features.has(RAY_QUERY_FEATURE_NAME); const device = await adapter.requestDevice( hasDXR ? { requiredFeatures: [RAY_QUERY_FEATURE_NAME] } : {} ); const { mode } = installMagmaRayQueryShim(device); console.log("RT backend:", mode); // "hardware" | "software-bvh"
enable magma_ray_query; @group(0) @binding(0) var scene: acceleration_structure; fn traceRay(origin: vec3<f32>, dir: vec3<f32>) -> RayIntersection { var rq: ray_query; let desc = RayDesc(1u, 0xFFu, 0.002, 150.0, origin, dir); rayQueryInitialize(&rq, scene, desc); while (rayQueryProceed(&rq)) {} return rayQueryGetCommittedIntersection(&rq); }