ShadowMapViewer: Add WebGPU version.#29331
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.
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.
@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.
@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.
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.
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.
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.