feat(gsplat): apply vertex-modify to hybrid cast shadows#8937
Merged
Conversation
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.
Build size reportThis PR changes the size of the minified bundles.
|
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.
Cast shadows from the hybrid (GPU-sort) gsplat renderer now follow the same per-vertex animation as the forward pass.
Changes:
GSplatShadowRendererapplies the scene gsplat material'sgsplatModifyVSchunk 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:
gsplatModifyVSvertex shader (animated splat position + color), demonstrating the cast shadow tracking the animation.