-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGPURenderer: Add PCFShadowMap
support.
#28926
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
@@ -113,6 +113,7 @@ | |||
directionalLight.position.set( 100, 100, 100 ); | |||
directionalLight.castShadow = true; | |||
directionalLight.shadow.mapSize.set( 2048, 2048 ); | |||
directionalLight.shadow.bias = - 0.0001; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the root cause yet but lights with WebGPURenderer
seems to need a shadow bias more often. I suspect this is related to the shadow compare operation which is different compared to WebGLRenderer
. The previous approach used MeshDepthMaterial
with RGBA packing, the new approach uses a depth texture attachment.
Changing the depth texture type to THREE.FloatType
did not help.
Side note: I have observed a few issue with shadow casting lights and
|
I've tried to fix this via be1bd9f which is inspired by I'll revert the commit for now and save this task for another PR. My hope was it would be an easy fix but it seems more thought is required to get this work. |
This reverts commit be1bd9f.
At the time I wrote this code I used There are more items for me to review just describing in case I forget. |
Fix typo.
Related issue: -
Description
This PR makes sure
PCFShadowMap
can be used withWebGPURenderer
. It is also the default shadow map type now similar toWebGLRenderer
(previously the default type wasnull
).I have slightly refactored
AnalyticLightNode
to make the code more consistent to what we had before inshadowmap_pars_fragment
.