-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
TSL: Editor #26270
TSL: Editor #26270
Conversation
Super handy! |
@@ -97,7 +97,7 @@ export const tangentGeometry = nodeImmutable( TangentNode, TangentNode.GEOMETRY | |||
export const tangentLocal = nodeImmutable( TangentNode, TangentNode.LOCAL ); | |||
export const tangentView = nodeImmutable( TangentNode, TangentNode.VIEW ); | |||
export const tangentWorld = nodeImmutable( TangentNode, TangentNode.WORLD ); | |||
export const transformedTangentView = label( tangentView, 'TransformedTangentView' ); | |||
export const transformedTangentView = temp( tangentView, 'TransformedTangentView' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we can no longer use label
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think temp()
would be responsible for creating a temporary variable, with a name or anonymous (automatic). label()
must force the assignment of a name, usually related to bindings: uniform/textures/...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but here we exactly create a variable with the given name, aren't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that's what I mentioned above about with a name or anonymous... Seems easier to use node.temp( 'myVar' )
instead of node.temp().label( 'myVar' )
. label()
now doesn't create variables anymore, it just helps to define a name when it is declared.
@@ -80,10 +80,8 @@ class VarNode extends Node { | |||
|
|||
export default VarNode; | |||
|
|||
export const label = nodeProxy( VarNode ); | |||
export const temp = label; | |||
export const temp = nodeProxy( VarNode ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove label
from VarNode then I suggest to also remove name
argument from it?
examples/webgpu_tsl_editor.html
Outdated
<script type="module"> | ||
|
||
import * as THREE from 'three'; | ||
import * as NODES from 'three/nodes'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we used to import nodes as Nodes
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed certain users using NODES
, I have doubts what to do here, all namespaces are uppercase by default, should we keep it or change it? @mrdoob
Live
https://raw.githack.com/mrdoob/three.js/dev/examples/webgpu_tsl_editor.html
Description
In this editor we can better observe the code generated in WGSL and soon GLSL.
/cc @mrdoob