Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Mar 20, 2025

Fixed #30762.

Description

The direct() and finish() methods of ShadowMaskModel have outdated signatures. It seems when refactoring shadow and lighting related code the interface of this class was overlooked.

The PR restores ShadowMaterial with WebGPURenderer. However, ShadowNodeMaterial does not show the shadow mask for some reason. The following fiddles is using ShadowMaterial and fixed with the PR but when using ShadowNodeMaterial, the plane gets black. https://jsfiddle.net/tbmgkf4s/

@sunag Before I dive into this more deeply, do you have an idea what's going wrong?

@github-actions
Copy link

github-actions bot commented Mar 20, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.08
78.29
336.08
78.29
+0 B
+0 B
WebGPU 525.17
146.28
525.21
146.28
+40 B
-5 B
WebGPU Nodes 524.63
146.18
524.67
146.18
+40 B
-5 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 465.15
112.18
465.15
112.18
+0 B
+0 B
WebGPU 597.97
162.56
598.01
162.57
+40 B
+7 B
WebGPU Nodes 553.1
152.04
553.1
152.04
+0 B
+0 B

@sunag
Copy link
Collaborator

sunag commented Mar 20, 2025

@sunag Before I dive into this more deeply, do you have an idea what's going wrong?

It's probably related to this #30530

The signature of the light model functions has been changed.

@sunag sunag added this to the r175 milestone Mar 20, 2025
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Mar 20, 2025

I've found the issue. ShadowNodeMaterial did not set transparent to true. I've missed that setDefaultValues() only sets values for undefined properties.

@Mugen87 Mugen87 merged commit 6b28459 into mrdoob:dev Mar 20, 2025
12 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.

WebGPU - ShadowNodeMaterial not working

2 participants