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: New normal nodes approach #29137

Merged
merged 10 commits into from
Aug 14, 2024
Merged

WebGPURenderer: New normal nodes approach #29137

merged 10 commits into from
Aug 14, 2024

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Aug 14, 2024

Related issue: Closes #28939, #29121

Description

Thanks to the once deferred function we can use constants as functions that will be executed at compile time. This approach is superior to the current ones that use transformedNormalView.assign() and I think we can use it not so soon in positionLocal and positionPrevious as well.

Copy link

github-actions bot commented Aug 14, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
685.4 kB (169.7 kB) 685.4 kB (169.7 kB) +0 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
462 kB (111.4 kB) 462 kB (111.4 kB) +0 B
@sunag sunag marked this pull request as ready for review August 14, 2024 16:23
@sunag sunag merged commit f571082 into mrdoob:dev Aug 14, 2024
12 checks passed
@sunag sunag deleted the dev-normals branch August 14, 2024 17:01
@sunag sunag added this to the r168 milestone Aug 14, 2024
@@ -40,7 +39,6 @@ class NodeMaterial extends Material {

this.fog = true;
this.lights = false;
this.normals = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Glad to see normals is gone! 🎉

@Mugen87 Mugen87 mentioned this pull request Aug 17, 2024
0b5vr added a commit to pixiv/three-vrm that referenced this pull request Aug 19, 2024
Starting from r168, `setupNormal` returns the normal node instead of assigning inside the `NodeMaterial.setupNormal`

See: mrdoob/three.js#29137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants