Skip to content

ShadowMaskModel: Fix signatures.#30764

Merged
Mugen87 merged 3 commits into
mrdoob:devfrom
Mugen87:dev2
Mar 20, 2025
Merged

ShadowMaskModel: Fix signatures.#30764
Mugen87 merged 3 commits into
mrdoob:devfrom
Mugen87:dev2

Conversation

@Mugen87

@Mugen87 Mugen87 commented Mar 20, 2025

Copy link
Copy Markdown
Collaborator

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

github-actions Bot commented Mar 20, 2025

Copy link
Copy Markdown

📦 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

sunag commented Mar 20, 2025

Copy link
Copy Markdown
Collaborator

@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.

Comment thread src/nodes/functions/ShadowMaskModel.js Outdated
@sunag sunag added this to the r175 milestone Mar 20, 2025
@Mugen87

Mugen87 commented Mar 20, 2025

Copy link
Copy Markdown
Collaborator Author

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
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