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: Add fromSceneAsync() #29951

Merged
merged 2 commits into from
Nov 24, 2024
Merged

PMREMGenerator: Add fromSceneAsync() #29951

merged 2 commits into from
Nov 24, 2024

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Nov 23, 2024

Related issue: #29942

Description

Based on the PR we can see that the webgl_animation_keyframes example emits a lot of error messages that may not make much sense to the user and it doesn't load the IBL properly.

image

This is because PMREMGenerator is being used without the WebGPU Backend being initialized. This PR aims to improve the error messages by guiding the user to replace functions like pmremGenerator.fromScene() with pmremGenerator.fromSceneAsync().

After this PR.

image

The user can fix it using:

scene.environment = ( await pmremGenerator.fromSceneAsync( new RoomEnvironment(), 0.04 ) ).texture;

image

@sunag sunag added this to the r171 milestone Nov 23, 2024
Copy link

github-actions bot commented Nov 23, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.13
79
339.13
79
+0 B
+0 B
WebGPU 483.69
134.01
484.71
134.2
+1.02 kB
+191 B
WebGPU Nodes 483.16
133.9
484.18
134.1
+1.02 kB
+192 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 550.99
149.23
552.01
149.42
+1.02 kB
+194 B
WebGPU Nodes 506.87
138.94
507.89
139.13
+1.02 kB
+192 B

@sunag sunag marked this pull request as ready for review November 24, 2024 01:03
@sunag sunag merged commit 34ba512 into mrdoob:dev Nov 24, 2024
12 checks passed
@sunag sunag deleted the dev-pmrem-rev branch November 24, 2024 03:11
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