Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Aug 18, 2025

Related issue: #29331 (comment)

Description

At the moment we need a base texture that is compatible for initialization. Since DepthTexture does not allow sampling, I used textureLoad().

In WebGPURenderer, the beauty pass in the shadow map rendering process is used to color the shadow and individual opacity, as seen in webgpu_shadowmap_opacity.

For this reason, we need to use DepthTexture, which would be the better option anyway.

/cc @WestLangley

@sunag sunag changed the title ShadowMapViewerGPU: Fix depthTexture usage ShadowMapViewerGPU: Fix DepthTexture usage Aug 18, 2025
@sunag
Copy link
Collaborator Author

sunag commented Aug 18, 2025

@WestLangley
Copy link
Collaborator

I am not a fan of that example. I have your changes working on webgpu_lights_spotlight.html, instead.

@sunag
Copy link
Collaborator Author

sunag commented Aug 18, 2025

I am not a fan of that example. I have your changes working on webgpu_lights_spotlight.html, instead.

Oh yes, this is certainly not the final work.

Flip the UVs and render with near white, far black.
@WestLangley
Copy link
Collaborator

It seems the live example needs to be updated following my commit. But once you are happy, I'd remove this example from the PR. JMHO.

@Mugen87 Mugen87 added this to the r180 milestone Aug 20, 2025
@sunag sunag marked this pull request as ready for review August 20, 2025 15:39
@sunag sunag merged commit 18128b8 into mrdoob:dev Aug 20, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants