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

Renderer: Add initTexture(). #29947

Merged
merged 1 commit into from
Nov 23, 2024
Merged

Renderer: Add initTexture(). #29947

merged 1 commit into from
Nov 23, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Nov 23, 2024

Related issue: #29898 (comment)

Description

The PR adds initTexture() in a snyc and async version so it is possible to avoid the texture decode overhead when textures are used in the first frame.

I've verified the implementation with the WebGPU and WebGL backend by making sure the below texture decode metric does not appear in Chrome's performance analysis tool when rendering the first frame:

image

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.13
79
339.13
79
+0 B
+0 B
WebGPU 482.5
133.72
482.81
133.76
+311 B
+36 B
WebGPU Nodes 481.96
133.62
482.27
133.66
+311 B
+37 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.56
149.19
550.87
149.23
+311 B
+36 B
WebGPU Nodes 506.44
138.91
506.75
138.95
+311 B
+36 B

@Mugen87 Mugen87 added this to the r171 milestone Nov 23, 2024
@sunag sunag merged commit 1e01d5f into mrdoob:dev Nov 23, 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.

2 participants