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

PMREMGenerator: Fix compile methods and background usage. #29297

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Sep 2, 2024

Related issue: -

Description

App code might use this pattern to configure the background:

const pmremGenerator = new THREE.PMREMGenerator( renderer );
pmremGenerator.compileEquirectangularShader();

const renderTarget = pmremGenerator.fromEquirectangular( texture );
scene.background = renderTarget.texture;

The PR fixes the PMREMGenerator.compile*() methods by making sure they are not using an undefined mesh for WebGPURenderer.compile(). Besides, it makes sure Scene.background accepts env maps with CubeUVReflectionMapping.

Copy link

github-actions bot commented Sep 2, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 685.6 kB
169.8 kB
685.6 kB
169.8 kB
+0 B
+0 B
WebGPU 821.7 kB
220.7 kB
821.8 kB
220.7 kB
+63 B
+15 B
WebGPU Nodes 821.3 kB
220.6 kB
821.3 kB
220.6 kB
+482 B
+109 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 462.2 kB
111.5 kB
462.2 kB
111.5 kB
+0 B
+0 B
WebGPU 522.1 kB
140.6 kB
522.2 kB
140.7 kB
+67 B
+24 B
WebGPU Nodes 478.8 kB
130.5 kB
478.8 kB
130.5 kB
-43.29 kB
+22 B

@Mugen87 Mugen87 merged commit b26848e into mrdoob:dev Sep 2, 2024
12 checks passed
@Mugen87 Mugen87 added this to the r169 milestone Sep 2, 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