-
-
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
Nodes: Define stack.assign()
as default.
#26881
Conversation
@@ -48,7 +48,7 @@ const shaderNodeHandler = { | |||
|
|||
const nodeElement = NodeElements.get( prop.slice( 0, prop.length - 'Assign'.length ) ); | |||
|
|||
return ( ...params ) => nodeObj.assign( nodeElement( nodeObj, ...params ) ); | |||
return node.isStackNode ? ( ...params ) => nodeObj.assign( params[ 0 ], nodeElement( ...params ) ) : ( ...params ) => nodeObj.assign( nodeElement( nodeObj, ...params ) ); |
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.
Could we please also do this in the if ( NodeElements.has( prop ) )
clause? Then we can remove StackNode.loop
and StackNode.assign
.
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.
(Fixed in #26821)
@@ -68,6 +69,23 @@ class StackNode extends Node { | |||
|
|||
assign( targetNode, sourceValue ) { | |||
|
|||
sourceValue = nodeObject( sourceValue ); |
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 don't think we need all of this, we can just remove this function and rely on ShaderNode.
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.
(Fixed in #26821)
Related issue: #26820, #26821 (comment)
Description
Using
StackNode.assign()
instead ofVarNode.assign()
makes the control flow less confusing and more optimized,StackNode
can work as the lines of code are when creating the Shader, thus being able to add statements and conditions in correct sequences, for example.A revision was made to the Lighting Model in favor of the standard.