Skip to content

Use shadowCasterPS chunk for gsplat shadow output#9119

Merged
mvaligursky merged 1 commit into
mainfrom
mv-gsplat-shadow-chunk
Jul 24, 2026
Merged

Use shadowCasterPS chunk for gsplat shadow output#9119
mvaligursky merged 1 commit into
mainfrom
mv-gsplat-shadow-chunk

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Follow-up to #9116 — migrates the unified gsplat shadow caster to the shadowCasterPS chunk instead of a hardcoded output.

Changes:

  • chunks/gsplat/frag/gsplat.js (GLSL + WGSL) now #include "shadowCasterPS" under SHADOW_PASS and write getShadowOutput(), replacing vec4(gl_FragCoord.z, 0, 0, 1). The gsplat shadow material is rendered through the standard shadow pass, so it already receives the LIGHT_TYPE/SHADOW_TYPE/PERSPECTIVE_DEPTH defines from Add shadow pass support for ShaderMaterial using #include #9116 — no extra plumbing needed. Gsplat shadows are directional-only, which is fully within the chunk's supported range.
  • This fixes VSM shadows for gsplats: the previous hardcoded output wrote raw depth with a zero coverage value, which the EVSM receiver treats as "not covered", making VSM shadows effectively not work for gsplats. PCSS output is unchanged; PCF is unaffected (the shadow pass forces color-write-off and uses hardware depth for that path).

Examples:

  • gaussian-splatting/shadows gained a Shadow Type dropdown (all types, applied to all lights), plus vsmBlurSize/penumbraSize/penumbraFalloff tuned so VSM and PCSS look correct out of the box.

@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 2326.5 KB (+0.1 KB, +0.00%) 598.5 KB — 465.3 KB (+0.2 KB, +0.05%)
playcanvas.min.mjs 2323.9 KB (+0.1 KB, +0.00%) 597.4 KB (+0.0 KB, +0.00%) 464.6 KB (+0.2 KB, +0.04%)

@mvaligursky
mvaligursky merged commit 235b074 into main Jul 24, 2026
10 checks passed
@mvaligursky
mvaligursky deleted the mv-gsplat-shadow-chunk branch July 24, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant