Skip to content
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

Various Pattern nodes for AEC and MFG #1411

Merged

Conversation

ashwinbhat
Copy link
Contributor

Collection of Pattern nodes for Circles, Hexagons, Cloverleafs, Grecian and Squares
Cloverleafs
cloverleafs
Grecian
grecian
Hexagon
hexagons
Squares
squares
Circles
circles

Added comments
Removed unnecessary nodedefs/xpos/ypos tags
Nodes moved to Procedurals section
adding imgui.ini to .gitignore
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 14, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@crydalch
Copy link
Contributor

This is great, super awesome! Have you considered per-tile variation/randomization? That was the trickiest part of the shape nodes we were working to contribute, hehe, but is pretty important for artists. It's hard to "tack-on" because it's tied to how the tiles/shapes are generated, especially for randomizing individual shape features.

I'll link to a gist with our nodes, so they can be inspected for comparison.

@jstone-lucasfilm
Copy link
Member

@crydalch I like this suggestion, and perhaps random variation would make a great future contribution, building upon the core nodes defined here? For example, one could imagine a future circlesrandom that builds upon the circle node in this changelist, with additional controls for random colors and placement, and this seems independent of the more structured circles node defined here.

@zicher3d
Copy link

A modular approach to patterns is an interesting topic. Might require a bit of planning before throwing nodes at the problem. I'm all for proceduralism having worked on Substance in the past and knocked my head on other procedural node-based tools. But then we should have a plan for a "prclib" where changes can be more accepted than stdlib, and where a series of well planned foundational nodes can be used to build up a library of patterns.
There might be a feature or two missing now that would prevent full procedurals, but we can learn from existing solutions.

@crydalch
Copy link
Contributor

crydalch commented Jul 14, 2023

Procedural patterns is interesting, but is far beyond where my original comment about randomizing tiles was intended.

See our original PR for exmaple images of what I meant by per-tile randomization: #1329 (comment)

Apologies if my comment about randomization implied sophisticated procedural patterns/textures.

@crydalch
Copy link
Contributor

In the past, the number of individual node primitives in MaterialX has been raised as a big concern. So I think if we assume that we'll have N shape nodes, then N random-shape nodes, it's going to fly in the face of that guidance.

Even setting that aside, it makes sense that tiling and randomization should really be built-into tiling shape nodes...

@jstone-lucasfilm
Copy link
Member

@crydalch There's definitely a balance to strike between providing "ubernodes" that can accomplish everything, and providing very granular functionality that promotes reuse and recombination. In this case, I think the circle node is a great low-level primitive that will find reuse in many contexts, and I can imagine a wider set of "tiling shape" nodes that would be built on top of it. I like the idea of the current circles node as a very minimalistic member of that "tiling shape" set, but of course I'm open to ideas on other structures as well.

This changelist removes "uivisible" attributes that are at their default value of "true", just to streamline the declarations of the new nodes.
This changelist removes the update to the root gitignore file for now, as we'd ideally like to address this issue in the graph editor instead, where the INI file for ImGui is written to a more natural folder on the Windows platform.
This changelist removes pre-release versioning data for the new nodes, and we can add release versioning data if needed before merging
@zicher3d
Copy link

I still think that this PR is a set of basic nodes for common patterns, and it could fit as part of stdlib, but if we want to expand and create more complex basic nodes, with multiple parameters for tweaking and randomizing things, then it's better to separate them into a prclib where thing will grow and change frequently.
Note that the ten or so nodes I posted are a quarter of the size of the whole stdlib_ng.mtlx file. These things tends to get big quickly.
image

@meshula
Copy link

meshula commented Jul 15, 2023

I'm curious about the periodic aliasing in the Grecian and Squares samples. Is that a consequence of upload to github, or would it make sense to examine anti-aliasing? I imagine the same question applies to all the shapes, but for those two it's visible to my eye.

This changelist removes explicit node outputs from the new pattern graphs, as these are not required in MaterialX.
@ashwinbhat
Copy link
Contributor Author

I'm curious about the periodic aliasing in the Grecian and Squares samples. Is that a consequence of upload to github, or would it make sense to examine anti-aliasing? I imagine the same question applies to all the shapes, but for those two it's visible to my eye.

Yes it appears to be so.
I had run MaterialXView.exe --material TestSuite\stdlib\procedural\squares.mtlx --captureFilename squares.png --screenWidth 800 --screenHeight 600 --mesh resources\Geometry\plane.obj
In the viewer it appears to be ok.

@ashwinbhat
Copy link
Contributor Author

grecian.zip

@meshula
Copy link

meshula commented Jul 17, 2023

Thanks for uploading that, seeing the good pixels makes me happy :)

@zicher3d
Copy link

Adding some hero images of the patterns in Maya/LookdevX
image
image
image
image
image

This changelist aligns the node inputs of the tiling 2D shape nodes to align with tiledimage, replacing their "spacing" input with "uvtiling" and "uvoffset" inputs.
@jstone-lucasfilm
Copy link
Member

@zicher3d I've now made the second proposed change as well, aligning the inputs of the tiling shape nodes with those of tiledimage. In my local tests, this approach seems more artist-friendly and consistent with MaterialX conventions, but let me know how the new proposed interface looks to you.

@zicher3d
Copy link

Ok with the tiling rename.

For the uvtiling/offset let me review it tomorrow. The reason of my "Size/Spacing" choice is because, if UVs are used in real-world mode (0-1 matches a scene unit, a technique used in our CAD apps and 3dsMax), those values will create a measured pattern.
If this change doesn't break it we are ok.

@jstone-lucasfilm
Copy link
Member

@zicher3d Let me know what you find in testing, and we can likely adjust the graph logic to maintain the consistency of real-world units if that's an important consideration.

@jstone-lucasfilm
Copy link
Member

Following up on a discussion with @ashwinbhat and @zicher3d, I've split the original grecian node into two simpler line primitives, grid and crosshatch, allowing artists to recombine them in a wider variety of ways.

Here are a few renders from the latest set of example materials, giving a sense of how these line patterns look in practice:

Grid node:
Grid

Crosshatch node:
Crosshatch

Union of grid and crosshatch (just one of many possible combinations):
Union

@jstone-lucasfilm jstone-lucasfilm merged commit b1f7275 into AcademySoftwareFoundation:main Aug 23, 2023
14 checks passed
Michaelredaa pushed a commit to Michaelredaa/MaterialX that referenced this pull request Oct 21, 2023
A collection of pattern nodes for lines, circles, cloverleafs, and hexagons
@zicher3d zicher3d deleted the zicher3d/patterns branch March 13, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants