Skip to content

TSL: Remove transformed* prefix - WIP #31177

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 2 commits into
base: dev
Choose a base branch
from

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented May 26, 2025

Related issue: #30849

Description

Removing the transformed prefix from normals also simplifies the shader creation process, making it less confusing.

For those who need normals without the fine surface transformations (fragment), a suffix called Geometry has been added, such as normalViewGeometry.

With the implementation of namespace, the normalView node, for example, will return the same as normalViewGeometry if used inside the material.normalNode input, and if used outside, it will use the final calculation.

This is also more in line with the strategy of moving the vertex calculations from skinning and morph to compute() and leaving it with the fewest possible modifications, perhaps none for the target developer.

@sunag sunag mentioned this pull request Apr 22, 2025
12 tasks
Copy link

github-actions bot commented May 26, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 337.26
78.64
337.26
78.64
+0 B
+0 B
WebGPU 551.84
153.07
552.22
153.14
+378 B
+70 B
WebGPU Nodes 551.19
152.91
551.57
152.98
+378 B
+71 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 468.44
113.28
468.44
113.28
+0 B
+0 B
WebGPU 626.86
169.75
627.57
169.92
+715 B
+170 B
WebGPU Nodes 581.71
159.08
582.61
159.27
+902 B
+187 B

@sunag sunag added this to the r177 milestone May 26, 2025
@mrdoob
Copy link
Owner

mrdoob commented May 27, 2025

Curious about why you called it "namespace". Wondering if there are more intuitive names...

@sunag
Copy link
Collaborator Author

sunag commented May 27, 2025

Curious about why you called it "namespace". Wondering if there are more intuitive names...

I slept thinking about it too hehe. Namespace is used to separate blocks and generate prefixes, it is one of the things that happens although the execution behavior is very specific, executing within one namespace and another. It is a named flow control referring to the input of the material, perhaps we could link it to a naming referring to this process.

@mrdoob
Copy link
Owner

mrdoob commented May 28, 2025

Yeah, are there alternatives? Would block be an alternative?

@sunag sunag modified the milestones: r177, r178 May 28, 2025
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