-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Separated to two constructors #346
Separated to two constructors #346
Conversation
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 would have been great to have a singlePrimitive : Boolean
parameter on Geometry
so we can apply the same single material to all the Geometry
but it's a good start. For example, in case on textured one we want to apply all around the geometry without repeating it.
Could you please just make the material optional (nullable) so we don't apply any if not required?
Thanks
@@ -25,7 +21,7 @@ open class CubeNode( | |||
* Should return the material to bind for the zero-based index of the primitive, must be less | |||
* than the [Geometry.submeshes] size passed to constructor. | |||
*/ | |||
materialInstances: (index: Int) -> MaterialInstance? = { materialInstance }, | |||
materialInstances: (index: Int) -> MaterialInstance, |
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 moving it to non nullable?
It could be usefull in case only some faces requiring material.
Same for every Geometries they could be used for collision purposes.
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 thought a face must be attached with a material. It is fixed now.
/** | ||
* Binds a material instance to all primitives. | ||
*/ | ||
materialInstance: MaterialInstance, |
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.
Should also be nullable for every geometries.
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
I don't think |
You're right but if we take the image texture example, actually, if we want to apply it to let say a Cube, we will have the same image displayed on each face and no way to have the same single image applied all around the Cube (each face displaying a part of the image). |
Separated BaseGeometryNode to two constructors. One with
materialInstance
that binds a material instance to all primitives, while the other withmaterialInstances
that binds one material instance to each face.