Skip to content

PMREMGenerator: Fix compile methods and background usage. - #29297

Merged
Mugen87 merged 2 commits into
mrdoob:devfrom
Mugen87:dev3
Sep 2, 2024
Merged

PMREMGenerator: Fix compile methods and background usage.#29297
Mugen87 merged 2 commits into
mrdoob:devfrom
Mugen87:dev3

Conversation

@Mugen87

@Mugen87 Mugen87 commented Sep 2, 2024

Copy link
Copy Markdown
Collaborator

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.

Comment thread src/renderers/common/extras/PMREMGenerator.js Outdated
@github-actions

github-actions Bot commented Sep 2, 2024

Copy link
Copy Markdown

📦 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

Comment thread src/renderers/common/extras/PMREMGenerator.js
@Mugen87
Mugen87 merged commit b26848e into mrdoob:dev Sep 2, 2024
@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