Skip to content

WebGPURenderer: Fix shadows on objects with receiveShadow=false#28874

Merged
RenaudRohlinger merged 1 commit into
mrdoob:devfrom
RenaudRohlinger:utsubo/fix/webgpu-receiveshadow
Jul 15, 2024
Merged

WebGPURenderer: Fix shadows on objects with receiveShadow=false#28874
RenaudRohlinger merged 1 commit into
mrdoob:devfrom
RenaudRohlinger:utsubo/fix/webgpu-receiveshadow

Conversation

@RenaudRohlinger
Copy link
Copy Markdown
Collaborator

Description
Currently the meshes will always receive shadows if their castShadow property is true regardless if receiveShadow is false. This PR fixes the issue by resetting the colorNode in AnalyticLightNode when the shadow map is not needed.

For example, here the box is defined with the following properties:

box.castShadow = true;
box.receiveShadow = false;

Before:
Screenshot 2024-07-15 at 17 27 39

After:
Screenshot 2024-07-15 at 17 27 19

This contribution is funded by Utsubo

@RenaudRohlinger RenaudRohlinger added this to the r167 milestone Jul 15, 2024
@github-actions
Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
683.5 kB (169.2 kB) 683.5 kB (169.2 kB) +0 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
460.7 kB (111.1 kB) 460.7 kB (111.1 kB) +0 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants