-
Notifications
You must be signed in to change notification settings - Fork 364
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
Adds Random Float and Random Color nodes #1330
Adds Random Float and Random Color nodes #1330
Conversation
Adds Random Float and Random Color nodes, to simplify generating randomized signals in a material.
Thanks for these contributions, @crydalch, and these are clearly fundamental nodes that are worthwhile to add. I'll just highlight the validation warnings generated in testing, which are minor but valuable to fix:
|
I'm wondering would it make sense to use one category name like |
@kwokcb I think that's a good suggestion, to define a single |
@jstone-lucasfilm and @kwokcb I'm not sure we should merge all of them together into a single . We can provide a much better experience if users select which type of randomization they want up-front. No matter what the input type is, the users knows what the output will be. Overloading a single node will result in a large matrix of input and output signature combinations (which will only get worse as more types are added). We've been guilty of this ourselves; VEX's Random node is overloaded - and it has a menu of 61 combinations of input/output signatures! Even when you narrow down the items based on the input type, it's still a really long menu for users to parse. I'd also suggest that random is not one of those cases where you will need that flexibility anyway. In the middle of an existing shading network, and In general I'm all-for reducing nodes, but in this case I think letting users decide up-front makes for much better UX. |
Hi @crydalch, I can see your point about overloading the same node category too much, and about trying to switch to a different variant after the fact -- though I think any polymorphic node runs into this issue of remapping to something that still is sensible? The "key" seems to be that So maybe one "guiding principle" is to use the same category if the "input signature" matches, but otherwise it's a new category ? Alternatively perhaps an attribute hint can be used to "partition" the variants into groups, like I'm "wobbling" on the fence for this one but still leaning towards one "logical" category for random number generation. BTW, Amazing you could create 61 variations of random :). |
@crydalch I wonder if the distinction that we want to make is between Here are a few industry examples of the https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/utilities/random_value.html And here are a few links that suggest the need for a https://help.maxon.net/r3d/katana/en-us/Content/html/Hair+Random+Color.html |
@crydalch Looking at the current UI for MaterialX graphs in Houdini 19.5, for example, I could see the idea of a |
@jstone-lucasfilm indeed, that's how it works in Houdini. My hesitation is not that the inputs might be different, or that tools won't have a menu to choose the signature. I hesitate because I've had to use nodes with lots of combinations of input and output signatures - and that menu gets rather long. Even when Houdini filters it based on connected inputs, there's still more thinking/deciding/clicking a user must go through. When an artist types "random" into the Tab menu (or equivalent in their DCC) and they see I know a lot of UX is dependent on DCCs and artist tools, but why not make the available options clear for everyone using MaterialX? I don't think reducing the various "randomvalue" options down into 1 node is an optimization that helps the user. Maybe there are advantages for codegen, to having an overloaded "randomvalue" node? I'm also concerned that future developers will just happily overload the random node, because it's there... and eventually that menu's going to be long. Asking users to spend time selecting from signature menus more than just a few options, for the sake of reducing a handful of random nodes into one, doesn't feel like it's worthwhile for users... |
To me, the question of "should this node and that node really be just one kind of node with different signatures" boils down to one easily-answered question: do the nodes do basically the exact same thing, other than the types they operate on. In this case, the answer is clearly "no": has two inputs ("in" and "seed") and computes a random value using cellnoise2d and those two input values, while generates 3 separate 's internally then uses that to compute a random HSV color. It's a lot bigger of a change than just input signatures- it's a different function. Separate note: it looks like the nodegraph for randomcolor_float is generating three different seeds for hue, saturation and value (good), but they look like they'd all be the same because all three are adding "0" to "seed", and that "0" isn't exposed as an interface input? I think it'd be fine to just choose different non-zero "random-looking" values for the 2nd and 3rd seed offsets and not complicate the interface with additional seed or seed_offset inputs. |
@dbsmythe Just to clarify, the latest suggestion is not that we merge The suggestion is instead that we provide @crydalch What are your thoughts on that proposal? This is similar to what you suggest above, with the main difference being that we wouldn't need to support separate |
Ah I get it: what was proposed as would instead be called . That makes sense to a point, but I would expect there should also be color3 and color4 variants of (in addition to float and the 3 vector types), that would simply be 3 or 4 random floats combined into a color3 or color4 output type. This then makes the name "randomcolor" a bit confusing; I would suggest calling the "return a random color between two HSV values" node instead, to emphasize the HSV nature of the randomly-chosen color. |
@jstone-lucasfilm I don't think we need to have a random node for every type possible, but my opinion (which I've clearly not communicated well, my apologies) is that nodes with long signature menus aren't good UX. Obviously they are necessary in many/most cases - I just don't agree that an overloaded I'd suggest these nodes:
Maybe that's a better balance? Users will have some clear options from their tool menu when typing "random", each node has some unique controls/behaviors, and it avoids a single node with extremely long signature menu. How does that sound? |
Signed-off-by: Jonathan Stone <[email protected]>
… removed the randomvector nodes for now (those can be tackled at a later time).
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 just had a chance to test this in the Graph Editor, and the new random nodes look fantastic, with artistically meaningful behavior for both integer and float variants. Thanks so much for following through on this important contribution, @crydalch!
Add Random Float and Random Color nodes, to simplify generating randomized signals in a material.
Adds Random Float and Random Color nodes, to simplify generating randomized signals in a material.
@Cinifreak suggested a very similar node on ASWF, so we'll collaborate on this PR.