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: Support Scene.backgroundRotation. #29762

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Oct 29, 2024

Related issue: -

Description

The PR makes sure WebGPURenderer supports Scene.backgroundRotation.

@@ -279,7 +279,7 @@ class Nodes extends DataMap {

if ( scene.backgroundBlurriness > 0 || background.mapping === CubeUVReflectionMapping ) {

backgroundNode = pmremTexture( background, normalWorld );
backgroundNode = pmremTexture( background );
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Passing normalWorld should be obsolete since Background.js defines getUV(). So PMREMNode should fetch the correct uvs via:

if ( uvNode === null && builder.context.getUV ) {
uvNode = builder.context.getUV( this );
}

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 691.67
171.43
691.67
171.43
+0 B
+0 B
WebGPU 819.79
221.18
820.19
221.32
+403 B
+140 B
WebGPU Nodes 819.3
221.05
819.7
221.19
+403 B
+135 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 463.82
112.17
463.82
112.17
+0 B
+0 B
WebGPU 540.65
146.12
541.03
146.24
+385 B
+121 B
WebGPU Nodes 496.64
135.92
497.03
136.06
+385 B
+145 B

@Mugen87 Mugen87 requested a review from sunag October 29, 2024 12:12
@sunag sunag merged commit 184cc6b into mrdoob:dev Oct 29, 2024
12 checks passed
@Mugen87 Mugen87 added this to the r170 milestone Oct 29, 2024
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.

2 participants