Skip to content

feat(gsplat): hybrid raster renderer with compute projector#8658

Merged
mvaligursky merged 5 commits into
mainfrom
mv-gsplat-hybrid-renderer
Apr 30, 2026
Merged

feat(gsplat): hybrid raster renderer with compute projector#8658
mvaligursky merged 5 commits into
mainfrom
mv-gsplat-hybrid-renderer

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

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:

  • New hybrid pipeline: GSplatProjector compute pass writes projection cache and sort keys; indirect radix sort orders splats; GSplatHybridRenderer draws with WGSL gsplatHybrid VS 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.
  • Shared WGSL compute-gsplat-project-common used by hybrid projector and compute local tile-count shader.
  • GSplatParams: alphaCull for forward-pass projector-side threshold (default 1/255).
  • Examples: Raster (Hybrid) in gsplat renderer dropdowns where applicable; lod-streaming Alpha Cull slider; benchmark layout (linear x-axis from data, chart aligned to table width, DPR bitmap, scroll column, PNG capture fixes).

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_HYBRID remains @ignore in API reference builds (experimental / internal); examples may still select the numeric mode for testing.

Examples:

  • Gaussian splatting .controls.mjs: Hybrid option where other renderer modes are listed.
  • lod-streaming.example.mjs / .controls.mjs: Alpha Cull slider.

- 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 adds scene.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.

Comment thread src/scene/shader-lib/wgsl/chunks/gsplat/compute-gsplat-projector.js
Comment thread src/scene/gsplat-unified/gsplat-projector-constants.js Outdated
Comment thread src/scene/gsplat-unified/gsplat-manager.js
Comment thread src/scene/gsplat-unified/gsplat-hybrid-renderer.js Outdated
Comment thread src/scene/gsplat-unified/gsplat-hybrid-renderer.js Outdated
Comment thread src/scene/gsplat-unified/gsplat-params.js
- 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
@mvaligursky mvaligursky merged commit 1b73d6d into main Apr 30, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-gsplat-hybrid-renderer branch April 30, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants