Skip to content

feat(gsplat): apply vertex-modify to hybrid cast shadows#8937

Merged
mvaligursky merged 1 commit into
mainfrom
mv-gsplat-shadow-modify
Jun 22, 2026
Merged

feat(gsplat): apply vertex-modify to hybrid cast shadows#8937
mvaligursky merged 1 commit into
mainfrom
mv-gsplat-shadow-modify

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Cast shadows from the hybrid (GPU-sort) gsplat renderer now follow the same per-vertex animation as the forward pass.

Changes:

  • GSplatShadowRenderer applies the scene gsplat material's gsplatModifyVS chunk to every per-light shadow material (recompiling only when the chunk changes), and forwards the scene material's parameters (e.g. uTime) to them each frame. Previously the per-light shadow materials ignored the user vertex modifier, so animated splat positions/colors were not reflected in their cast shadows.

Examples:

  • Gaussian Splatting > Shadows: added an Animate toggle that enables a custom gsplatModifyVS vertex shader (animated splat position + color), demonstrating the cast shadow tracking the animation.

The hybrid (GPU-sort) gsplat shadow renderer draws per-light shadow casters
with their own ShaderMaterials, which did not pick up a user `gsplatModifyVS`
chunk set on the scene gsplat material. As a result, cast shadows did not
follow forward-pass per-vertex animation (e.g. animated splat positions).

GSplatShadowRenderer now applies the scene material's `gsplatModifyVS` chunk
to every per-light shadow material (recompiling only when the chunk changes)
and forwards the scene material's parameters (e.g. `uTime`) to them each
frame, so cast shadows stay in sync with the forward pass.

The Gaussian Splatting > Shadows example gains an "Animate" toggle that
enables a custom position/color vertex modifier, demonstrating the cast
shadow following the animation.
@github-actions

Copy link
Copy Markdown

Build size report

This PR changes the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2288.4 KB (+0.6 KB, +0.03%) 586.9 KB (+0.2 KB, +0.03%) 456.0 KB (+0.4 KB, +0.09%)
playcanvas.min.mjs 2285.8 KB (+0.6 KB, +0.03%) 586.0 KB (+0.2 KB, +0.03%) 455.6 KB (−0.2 KB, −0.04%)

@mvaligursky mvaligursky merged commit 85ed0f6 into main Jun 22, 2026
10 checks passed
@mvaligursky mvaligursky deleted the mv-gsplat-shadow-modify branch June 22, 2026 09:30
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.

1 participant