-
Notifications
You must be signed in to change notification settings - Fork 360
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
Add a 2d checkerboard pattern node #1328
Add a 2d checkerboard pattern node #1328
Conversation
Add a 2d checkerboard pattern node.
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.
Thanks for this proposal, @crydalch, and it seems like a very natural node to include in MaterialX. I had just one suggestion below on the name of the node.
libraries/stdlib/stdlib_defs.mtlx
Outdated
Node: <checkerboard> | ||
A 2D checkerboard pattern. | ||
--> | ||
<nodedef name="ND_checkerboard_float" node="checkerboard" nodegroup="procedural2d"> |
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.
@crydalch The design of this node seems very reasonable to me, though it seems worthwhile to consider the idea of returning a color3
value instead of a float, with the two colors of the checkerboard specified as color1
and color2
inputs (defaulting to white and black).
I don't have a strong opinion on which design is better for MaterialX, but for reference here are a few examples of checkerboard
nodes that use the color1/color2 approach:
https://docs.unity3d.com/Packages/[email protected]/manual/Checkerboard-Node.html
https://learn.foundry.com/mari/Content/reference_guide/nodes/Checkerboard.html
https://help.autodesk.com/view/ARNOL/ENU/?guid=arnold_user_guide_ac_texture_shaders_ac_texture_checkerboard_html
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 would be nice to cover a reasonable "maximum" possible flexibility (which seems to be Arnold) and anything that supports less can restrict what inputs are modifiable / exposed. e.g. frequency in u and v allows for "stripe" textures to be created. A "customized" version of this would sync u and v values. Does this sound reasonable?
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 like this idea @jstone-lucasfilm
An early version of the node did have color inputs/outputs, but I don't recall why I went away from that... but regardless, I'll make that change. Thank you for the suggestion and references.
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.
The color1/color2 output approach and parameterization looks good to me. Just thinking aloud, I am wondering if there is any use for the originally-proposed "float" output variant, which would output exactly a 0 or a 1, which the color1/color2 variant would call? I'm generally a fan of breaking larger more full-featured nodes into atomic pieces when some of the sub-pieces could be useful outside the full-featured node, and it feels to me like the "generate a checkerboard pattern" portion could fall into that category. But if the only reasonable use of a 0/1 float output checkerboard would be to drive the color1/color2 color type node, then this is fine as-is. |
@dbsmythe Looking at similar nodes in DCC tools, my thinking is that the current color-based approach is the most general-purpose, and artists can extract a single channel from the output color when they need scalar results. Here are some of the DCC examples that we were looking at earlier in the thread: https://docs.unity3d.com/Packages/[email protected]/manual/Checkerboard-Node.html |
Add a 2d checkerboard pattern node.