Normal.js: Improve JSDoc by WestLangley · Pull Request #31341 · mrdoob/three.js · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Normal.js: Improve JSDoc #31341

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

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

WestLangley
Copy link
Collaborator

As the title says.

@WestLangley WestLangley added this to the r179 milestone Jun 30, 2025
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 337.69
78.76
337.69
78.76
+0 B
+0 B
WebGPU 557.35
154.34
557.35
154.34
+0 B
+0 B
WebGPU Nodes 556.27
154.12
556.27
154.12
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 468.91
113.42
468.91
113.42
+0 B
+0 B
WebGPU 632.96
171.33
632.96
171.33
+0 B
+0 B
WebGPU Nodes 588.09
160.72
588.09
160.72
+0 B
+0 B

@WestLangley
Copy link
Collaborator Author

What is the proper distinction between normalView and normalViewGeometry?

//

This may need clarification, too -- in a separate PR, that is.

https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language#normal

@sunag
Copy link
Collaborator

sunag commented Jun 30, 2025

What is the proper distinction between normalView and normalViewGeometry?

image

The transformed term reflects the modifications applied by processes such as skinning, morphing, and similar techniques. The term transformed also includes following the correct orientation of the face, so that the normals are inverted inside the geometry.

@WestLangley
Copy link
Collaborator Author

Trying to clarify...

normalView is the view-space normal, post skinning and morphs.

normalView honors the material sidedness.

//

normalViewGeometry in TSL is the same as the so-called nonPerturbedNormal in the WebGLRenderer shaders. That is, it is the view-space normal, unmodified by skinning or morphs.

  1. Does normalViewGeometry honor the material sidedness?
  2. Can normalViewGeometry be made private so we don't have to explain it?

@sunag
Copy link
Collaborator

sunag commented Jul 1, 2025

1, 2. No for both I imagine.

normalViewGeometry is used internally to construct the normalView, so not honoring material sidedness simplifies the process, besides being used in other examples like webgpu_tsl_earth of the normalWorldGeometry variant for some optimization techniques this may not be desired honoring material sideness, not making it private can help in more specific cases.

The developer could still use the function directionToFaceDirection() for honor the material sidedness.

const objectNormalView = directionToFaceDirection( normalViewGeometry );

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

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.