Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: correct shadows on material rebuilding. #28889

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

aardgoose
Copy link
Contributor

Related issue: #28874

The above PR broke shadows when materials are rebuilt after initial use. This is exhibited in the webgpu_clipping example, where disabling the global clipping planes, the shadows on the 'ground' object are removed.

On the rebuild of a material receiving shadows, the colorNode is the _defaultColorNode, and is not replaced with the correct version because the shadowNode already exists.

This PR preserves the colorNode used for materials that receive shadows and reuses it on material rebuild if required.

Copy link

📦 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

@Mugen87 Mugen87 added this to the r167 milestone Jul 16, 2024
@RenaudRohlinger
Copy link
Collaborator

Ah, I missed this one my bad. Good catch!

@RenaudRohlinger RenaudRohlinger merged commit b7b3859 into mrdoob:dev Jul 17, 2024
12 checks passed
@aardgoose aardgoose deleted the shadow branch July 17, 2024 08:07
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