feat(gsplat): hybrid raster renderer with compute projector#8658
Merged
Conversation
- Add GSPLAT_RENDERER_RASTER_HYBRID (WebGPU): projector pass + radix sort + instanced quads - GSplatManager: hybrid sorting path, pick/prepass support, alphaCull for projector culling - GSplatParams: alphaCull (forward-pass threshold), hybrid wired to projector - Shared WGSL projection helper for projector and compute tile-count passes - Examples: Raster (Hybrid) option; lod-streaming alphaCull slider; benchmark chart/table layout + PNG capture fixes
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an experimental hybrid WebGPU Gaussian splat renderer that uses a compute projection/sort-key pass plus the existing instanced-quad raster path, wiring it into GSplatManager, exposing an alphaCull parameter, and updating examples/benchmark UI to include the new mode.
Changes:
- Introduces a hybrid raster pipeline: compute projector (projection cache + sort keys) → indirect radix sort → raster via new
gsplatHybridVS. - Wires hybrid mode into
GSplatManager(including hybrid pick integration) and addsscene.gsplat.alphaCull. - Updates gsplat examples to expose “Raster (Hybrid)” and adds benchmark/chart layout + capture improvements.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scene/shader-lib/wgsl/collections/gsplat-chunks-wgsl.js | Registers the new hybrid WGSL vertex chunk for inclusion. |
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatHybrid.js | New hybrid vertex shader reading sorted indices + projection cache. |
| src/scene/shader-lib/wgsl/chunks/gsplat/compute-gsplat-projector.js | New compute projector pass producing proj cache + sort keys with workgroup-local compaction. |
| src/scene/shader-lib/wgsl/chunks/gsplat/compute-gsplat-projector-write-indirect-args.js | Writes indirect draw + radix-sort dispatch args from projector’s visible counter. |
| src/scene/shader-lib/wgsl/chunks/gsplat/compute-gsplat-project-common.js | Shared projection/cull helper reused by projector and compute tile-count. |
| src/scene/shader-lib/wgsl/chunks/gsplat/compute-gsplat-local-tile-count.js | Refactors tile-count shader to reuse shared projection gate logic. |
| src/scene/gsplat-unified/gsplat-projector.js | New JS-side owner for projector compute pipelines and cache buffers. |
| src/scene/gsplat-unified/gsplat-projector-constants.js | Defines cache stride/layout shared between JS and WGSL via cdefines. |
| src/scene/gsplat-unified/gsplat-params.js | Adds alphaCull parameter and documents the new hybrid renderer mode. |
| src/scene/gsplat-unified/gsplat-manager.js | Adds hybrid sorting/projector path, hybrid renderer selection, and hybrid pick preparation. |
| src/scene/gsplat-unified/gsplat-hybrid-renderer.js | New renderer that draws from projection cache + sorted indices (forward + pick/prepass). |
| src/scene/gsplat-unified/gsplat-compute-local-renderer.js | Adds shared projection helper include for tile-count compute shaders. |
| src/scene/constants.js | Adds new internal/ignored renderer constant GSPLAT_RENDERER_RASTER_HYBRID = 4. |
| examples/src/examples/gaussian-splatting/xr-views.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/world.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/weather.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/viewer.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/shadows.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/shader-effects.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/reveal.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/procedural-shapes.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/procedural-mesh.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/procedural-instanced.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/picking.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/paint.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/multi-view.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/lod-streaming.example.mjs | Hooks up alphaCull runtime updates in the LOD streaming example. |
| examples/src/examples/gaussian-splatting/lod-streaming.controls.mjs | Adds hybrid renderer option + Alpha Cull slider. |
| examples/src/examples/gaussian-splatting/lod-streaming-sh.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/lod-instances.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/global-sorting.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/flipbook.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/editor.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/crop.controls.mjs | Adds “Raster (Hybrid)” renderer option to UI. |
| examples/src/examples/gaussian-splatting/benchmark.example.mjs | Adds hybrid benchmark column and improves chart sizing + PNG capture reliability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Projector stores clipPos.w in cache slot [3]; hybrid VS reconstructs linear view depth via clipToViewZ = -inv(projectionMatrix)[row 2] - Instance-owned Float32Arrays for forward and pick materials (not global) - Pass picker cameraNode for pick clipToViewZ; document cache layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a WebGPU hybrid Gaussian splat renderer that combines a compute projection / sort-key pass with the existing instanced quad raster path, plus manager wiring, shared WGSL projection logic, and example updates.
Changes:
GSplatProjectorcompute pass writes projection cache and sort keys; indirect radix sort orders splats;GSplatHybridRendererdraws with WGSLgsplatHybridVS reading sorted indices + cache (forward, pick, prepass; shadow casting not included).GSplatManager: hybrid GPU sorting (initHybridSorting,sortGpuHybrid/sortGpuHybridForCamera), indirect args when projector visible count differs from interval compaction, pick integration.compute-gsplat-project-commonused by hybrid projector and compute local tile-count shader.GSplatParams:alphaCullfor forward-pass projector-side threshold (default1/255).Public API:
scene.gsplat.alphaCull— threshold passed through material/GSplat params for forward projector-side culling when hybrid mode is active (GSplatParams).GSPLAT_RENDERER_RASTER_HYBRIDremains@ignorein API reference builds (experimental / internal); examples may still select the numeric mode for testing.Examples:
.controls.mjs: Hybrid option where other renderer modes are listed.lod-streaming.example.mjs/.controls.mjs: Alpha Cull slider.