Support GSPLAT_AA in the hybrid gsplat renderer#8807
Merged
Conversation
The quad gsplat renderer applies an anti-aliasing opacity factor when GSPLAT_AA is enabled, but the hybrid (GPU-sort) renderer ignored it. Since the hybrid path projects in a compute pass and rasterizes from a cache, the AA factor is computed in the projector and baked into the cached alpha, so the hybrid VS and cache layout are unchanged. The AA variant is gated to non-pick mode (picking only gates on a binary opacity threshold), keeping the projector variant count to 12 not 16. Also adds an Anti-alias toggle to the gsplat viewer example's Renderer panel, wired to GSplatParams#antiAlias. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds GSPLAT_AA (anti-aliasing opacity compensation) support to the WebGPU hybrid (GPU-sort) gsplat renderer. The compensation factor — sqrt(detOrig / detBlur) matching the quad renderer's initCornerCov — is computed in the projector compute pass and baked into the cached alpha, so the rasterizer's VS and cache layout are unchanged. A projector variant axis (Aa) is added, gated to non-pick mode to cap variants at 12.
Changes:
- Compute the AA factor in
computeSplatCov(preserving pre-blur covariance diagonal) and store it onSplatCov2Dunder#if GSPLAT_AA; the projector multiplies it into the cachedalphafor the non-pick color branch. - Thread an
antiAliasflag throughGSplatProjector(_projectorKey/_createProjectorCompute/_getProjectorCompute/dispatch), adding theGSPLAT_AAcdefine andAavariant suffix;GSplatManagerpassesgsplat.antiAliasper dispatch. - Add an "Anti-alias" toggle to the gsplat viewer example bound to
app.scene.gsplat.antiAlias.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/scene/shader-lib/wgsl/chunks/gsplat/compute-gsplat-common.js | Compute and expose aaFactor on SplatCov2D from raw vs. blurred covariance determinants. |
| src/scene/shader-lib/wgsl/chunks/gsplat/compute-gsplat-projector.js | Multiply cached alpha by proj.aaFactor under #if GSPLAT_AA in the non-pick branch. |
| src/scene/gsplat-unified/gsplat-projector.js | Add antiAlias to projector variant key/name/cdefines and dispatch; gate AA off in pick mode. |
| src/scene/gsplat-unified/gsplat-manager.js | Pass antiAlias: gsplat.antiAlias into projector.dispatch. |
| examples/src/examples/gaussian-splatting/viewer.example.mjs | Add antialias observer data and wire it to app.scene.gsplat.antiAlias. |
| examples/src/examples/gaussian-splatting/viewer.controls.mjs | Add Anti-alias toggle in the Renderer panel bound to data.antialias. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mvaligursky
added a commit
that referenced
this pull request
May 29, 2026
The quad gsplat renderer applies an anti-aliasing opacity factor when GSPLAT_AA is enabled, but the hybrid (GPU-sort) renderer ignored it. Since the hybrid path projects in a compute pass and rasterizes from a cache, the AA factor is computed in the projector and baked into the cached alpha, so the hybrid VS and cache layout are unchanged. The AA variant is gated to non-pick mode (picking only gates on a binary opacity threshold), keeping the projector variant count to 12 not 16. Also adds an Anti-alias toggle to the gsplat viewer example's Renderer panel, wired to GSplatParams#antiAlias. Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
The quad gsplat renderer applies an anti-aliasing opacity compensation factor when
GSPLAT_AAis enabled (viaGSplatParams#antiAlias), but the hybrid (GPU-sort) renderer ignored it. This wires AA support through the hybrid pipeline.Because the hybrid path projects splats in a compute pass and rasterizes from a pre-projected cache, the AA factor is computed in the projector and baked into the cached alpha — so the hybrid vertex shader and the cache layout need no changes. The formula matches the quad renderer's
initCornerCovexactly:aaFactor = sqrt(detOrig / detBlur), the ratio of the pre-blur to post-blur 2D covariance determinant.Changes:
compute-gsplat-common.js:computeSplatCovkeeps the raw (pre-blur) covariance diagonal and, under#if GSPLAT_AA, computesaaFactorinto a newSplatCov2Dfield.compute-gsplat-projector.js: the non-pick color branch multipliesalpha *= proj.aaFactorunder#if GSPLAT_AA.gsplat-projector.js: threadsantiAliasthrough_projectorKey/_createProjectorCompute/_getProjectorCompute/dispatch, adding theGSPLAT_AAcdefine and anAavariant suffix. The setting is read live each frame, so toggling takes effect on the next frame.gsplat-manager.js: passesantiAlias: gsplat.antiAliasintoprojector.dispatch.AA is gated to non-pick mode (
aaMode = antiAlias && !pickMode) since picking only gates on a binary opacity threshold — this keeps the projector variant count at 12 rather than 16.This is the WebGPU-only path, so only WGSL chunks were touched; the GLSL quad path already had AA.
Examples:
GSplatParams#antiAlias.Notes for reviewers:
opacity <= alphaClipearly-out runs against raw opacity before AA modulation, whereas the quad VS applies AA before its alpha discard. The fragment shader'salpha < alphaClipForwardtest still catches anything AA pushes below threshold, so the visible result matches.