Add 2D Gaussian Splatting (2DGS) Rendering Support#8416
Merged
slimbuck merged 1 commit intoplaycanvas:mainfrom Jan 28, 2026
Merged
Add 2D Gaussian Splatting (2DGS) Rendering Support#8416slimbuck merged 1 commit intoplaycanvas:mainfrom
slimbuck merged 1 commit intoplaycanvas:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for 2D Gaussian Splatting (2DGS) rendering by introducing a new GSPLAT_2DGS shader define. The implementation renders splats as oriented 3D quads in model space using quaternion rotation, contrasting with the existing 3DGS approach which uses covariance-based screen-space projection.
Changes:
- Added
GSPLAT_2DGSconditional compilation path for 2D Gaussian Splatting - Changed
SplatCorner.offsetfromvec2/vec2ftovec3/vec3fto accommodate both clip-space (3DGS) and model-space (2DGS) offsets - Implemented
initCorner2DGSfunction for computing oriented quad corners using direct quaternion-vector rotation
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatStructs.js | Updated SplatCorner.offset type from vec2f to vec3f with updated comment |
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatCorner.js | Added initCorner2DGS function and updated initCornerCov to use vec3f offset |
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplat.js | Added conditional 2DGS rendering path with model-space corner projection |
| src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatStructs.js | Updated SplatCorner.offset type from vec2 to vec3 with updated comment |
| src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatCorner.js | Added initCorner2DGS function and updated initCornerCov to use vec3 offset |
| src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplat.js | Added conditional 2DGS rendering path with model-space corner projection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mvaligursky
approved these changes
Jan 28, 2026
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.
Add 2D Gaussian Splatting (2DGS) Rendering Support
This PR adds support for rendering 2D Gaussian Splats using a new
GSPLAT_2DGSshader define, similar to the existingGSPLAT_AAdefine.Summary
GSPLAT_2DGSconditional rendering path for 2D Gaussian SplattingSplatCorner.offsetfromvec2tovec3to support both 3DGS (clip-space XY) and 2DGS (model-space XYZ)initCorner2DGSfunctionTechnical Details
2DGS Rendering Approach:
Quaternion Rotation:
Uses direct quaternion-vector rotation formula (faster than matrix conversion):
Public API Changes
New Shader Define:
GSPLAT_2DGS- When enabled, uses the 2DGS oriented quad rendering path instead of the 3DGS covariance-based pathStruct Change:
SplatCorner.offset: Changed fromvec2/vec2ftovec3/vec3fFiles Changed
src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatStructs.jssrc/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatCorner.jssrc/scene/shader-lib/glsl/chunks/gsplat/vert/gsplat.jssrc/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatStructs.jssrc/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatCorner.jssrc/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplat.jsTest Plan
GSPLAT_2DGSdefine and verify 2DGS splats render correctly