-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
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. |
Yeah, are there alternatives? Would |
<script type="module"> | ||
|
||
import * as THREE from 'three'; | ||
import { Fn, time, vec2, vec3, uv, texture, mix, checker, normalLocal, namespace, positionLocal, color, oscSine, attribute } from 'three/tsl'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
import * as THREE from 'three'; | ||
import { Fn, time, vec2, vec3, uv, texture, mix, checker, normalLocal, namespace, positionLocal, color, oscSine, attribute } from 'three/tsl'; | ||
|
||
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
import { tangentView } from './Tangent.js'; | ||
import { mat3 } from '../tsl/TSLBase.js'; | ||
import { Fn, mat3 } from '../tsl/TSLBase.js'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
I need to simplify this approach, I'm making little progress even after working all these days, at least the decisions I'll have to make are clearer now. I'm going to redo this implementation and revert the namespace implementation to something that can relate the material input and sub-build layers. |
Sound good! |
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 asnormalViewGeometry
.With the implementation of
namespace
, thenormalView
node, for example, will return the same asnormalViewGeometry
if used inside thematerial.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
andmorph
tocompute()
and leaving it with the fewest possible modifications, perhaps none for the target developer.