-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
ShadowMapViewer: Add WebGPU version. #29331
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
Conversation
| //always end up with the scene's first added shadow casting light's shadowMap | ||
| //in the shader | ||
| //See: https://github.com/mrdoob/three.js/issues/5932 | ||
| shadowMapUniform.value = light.shadow.map.texture; |
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.
Shadow maps are implemented differently in WebGPURenderer since they use depth textures and don't rely on MeshDepthMaterial. Hence, the debug texture looks a bit different since we use the shadow color for visualization purposes.
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.
@Mugen87 Do you, by chance, have a fiddle showing this helper being used, and rendering some representation of shadow camera depth correctly? 🙏
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.
@Mugen87 The helper is rendering black for me. A quick example would be greatly appreciated. I am hoping this helper can verify if the full extent of the depth range is being used.
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.
Maybe there is a regression since we don't have a dedicated example yet. How about we add a copy of webgl_shadowmap_viewer and name it webgpu_shadowmap_viewer. When then have some sample code for testing.
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.
OK. So to confirm, we don't render the depthTexture directly, but the shadow.map.texture, instead? And the texture should display a grayscale image of depth in [0, 1]?
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.
we don't render the depthTexture directly, but the shadow.map.texture, instead?
Yes. But to be honest I don't know anymore how the visualized texture looks like. Maybe it was just a black cutout.
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Related issue: #29295
Description
This PR adds a version of
ShadowMapViewerthat is compatible withWebGPURenderer.