Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Nov 19, 2024

Description

material.shadowPositionNode was losing the custom position reference after the first shadow structure was created, due to caching.

Before Now
image image
// to reproduce this problem put this code in `webgpu_shadowmap` example
const mesh = new THREE.Mesh( new THREE.BoxGeometry( 7, 4, 7 ), new THREE.MeshStandardMaterial( { color: 0x00ff00 } ) );
mesh.receiveShadow = true;
mesh.castShadow = true;
mesh.position.set( 0, 2, 0 );
scene.add( mesh );

@sunag sunag added this to the r171 milestone Nov 19, 2024
@sunag sunag changed the title WebGPURenderer: Fix shadowPosition cache WebGPURenderer: Fix shadowPositionNode cache Nov 19, 2024
@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.13
79
339.13
79
+0 B
+0 B
WebGPU 478.67
132.72
478.72
132.72
+50 B
+1 B
WebGPU Nodes 478.13
132.6
478.18
132.6
+50 B
+2 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 464.59
111.96
464.59
111.96
+0 B
+0 B
WebGPU 546.83
148.16
546.88
148.18
+50 B
+14 B
WebGPU Nodes 502.71
137.88
502.76
137.89
+50 B
+7 B

@sunag sunag marked this pull request as ready for review November 19, 2024 05:38
@sunag sunag merged commit cef3838 into mrdoob:dev Nov 19, 2024
12 checks passed
@sunag sunag deleted the dev-fix-shadowPosition branch November 19, 2024 05:40
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.

1 participant