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

ShadowMapViewer: Add WebGPU version. #29331

Merged
merged 2 commits into from
Sep 5, 2024
Merged

ShadowMapViewer: Add WebGPU version. #29331

merged 2 commits into from
Sep 5, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Sep 5, 2024

Related issue: #29295

Description

This PR adds a version of ShadowMapViewer that is compatible with WebGPURenderer.

@Mugen87 Mugen87 added this to the r169 milestone Sep 5, 2024
//always end up with the scene's first added shadow casting light's shadowMap
//in the shader
//See: https://github.com/mrdoob/three.js/issues/5932
shadowMapUniform.value = light.shadow.map.texture;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shadow maps are implemented differently in WebGPURenderer since they use depth textures and don't rely on MeshDepthMaterial. Hence, the debug texture looks a bit different since we use the shadow color for visualization purposes.

Copy link

github-actions bot commented Sep 5, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 685.18
169.62
685.18
169.62
+0 B
+0 B
WebGPU 826
221.45
826.02
221.46
+24 B
+7 B
WebGPU Nodes 825.58
221.36
825.61
221.36
+443 B
+101 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 461.96
111.46
461.96
111.46
+0 B
+0 B
WebGPU 525.25
141.51
525.27
141.52
+24 B
+7 B
WebGPU Nodes 481.9
131.33
481.93
131.34
-43.32 kB
+9 B

@Mugen87 Mugen87 merged commit 4204d75 into mrdoob:dev Sep 5, 2024
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.

1 participant