WebGPU lightmapper support for shadow casting local lights and omni shadow shader cleanup#8338
Merged
mvaligursky merged 1 commit intomainfrom Jan 7, 2026
Merged
Conversation
…hadow shader cleanup
willeastcott
reviewed
Jan 6, 2026
| ), | ||
| jsx( | ||
| LabelGroup, | ||
| { text: ' 🟡 Soft' }, |
Contributor
There was a problem hiding this comment.
What're the additional spaces at the start of the label for?
Contributor
Author
There was a problem hiding this comment.
it was supposed to be indented .. as it applies to directional light only, but it didn't work :)
willeastcott
reviewed
Jan 6, 2026
| window.focus(); | ||
|
|
||
| const assets = { | ||
| script: new pc.Asset('script', 'script', { url: `${rootPath}/static/scripts/camera/orbit-camera.js` }) |
Contributor
There was a problem hiding this comment.
Can you use camera-controls.mjs (as I do in the new annotations example)?
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.
Summary
Enables lightmapper to work correctly on WebGPU with shadow casting omni/spot lights and cleans up shadow shader handling for omni lights by properly separating shadow coordinate calculation based on light type.
Changes
Lightmapper WebGPU Support
RenderPassShadowLocalNonClusteredinstead of deprecatedshadowRenderer.render()Dead Code Removal
renderer.jssetCamera()andclearView()methods (only used by old lightmapper path)shadow-renderer.jsrender()method (replaced by render passes)insideRenderPassparameter fromrenderFace()- now always assumes inside render passShader Cleanup - Omni Shadow Matrix
Omni lights use cubemap shadows that sample by direction, not matrix transformation. The
shadowMatrixuniform was incorrectly handled.lightFunctionShadow.js(GLSL & WGSL)getShadowSampleCoordOmni{i}()- dedicated function for omni lights withoutshadowMatrixparametergetShadowSampleCoord{i}()now only handles directional/spot lightsgetShadow{i}()dispatches to appropriate function based on light typelightDeclaration.js(GLSL & WGSL)shadowMatrixfor omni lights (not used)shadowMatrixfor omni cookies (needed for cube orientation)Example Updates
lights-baked.example.mjs