-
-
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
AttributeNode: .nodeType is now optional #24050
Conversation
@@ -108,7 +108,7 @@ export const uniform = ( nodeOrType ) => { | |||
|
|||
}; | |||
|
|||
export const attribute = ( name, nodeOrType ) => nodeObject( new AttributeNode( name, getConstNodeType( nodeOrType ) ) ); | |||
export const attribute = ( name, nodeType ) => nodeObject( new AttributeNode( name, nodeType ) ); |
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 it is better to just make getConstNodeType
return undefined if input is undefined.
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.
What kind of use did you imagine when you implemented this function? For this case, I see only 3 type of usage:
// name only
attribute( 'color' );
// typed
attribute( 'color', 'vec3' );
// typed from primitive class
attribute( 'color', vec3 );
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.
It can handle attribute( 'color' )
(if make that change), attribute( 'color', 'vec3' )
and attribute( 'color', vec3() )
. Did not thought about attribute( 'color', vec3 )
, but it can also be easily added.
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.
Did not thought about attribute( 'color', vec3 ), but it can also be easily added.
Nice, is better use attribute( 'color', vec3 )
instead of attribute( 'color', vec3() )
because it's not allocate unnecessary object in memory. attribute( 'color', vec3() )
shouldn't have support.
* NodeBuilder: add .geometry property * AttributeNode: .nodeType is now optional * attribute: use optional node type parameter * fix nodeType parameter
Description
Usage:
This contribution is funded by Google via Igalia