GafferHQ / gaffer

Gaffer is a node-based application for lookdev, lighting and automation
http://www.gafferhq.org
BSD 3-Clause "New" or "Revised" License
956 stars 206 forks source link

Add output type of "int" to "random" node #1154

Closed edmondeng closed 9 years ago

edmondeng commented 9 years ago

Hi,

The goal is to use random values to drive the switching of shader networks as well as to override the randomization.

e.g. -multiple types tree bark to be applied to instantiated trees. -choices of brick textures to be applied to instantiated buildings

By adding "int" output and user defined range to the "random" node, we can then set the value on the geometry to be read in an SL shader (Ticket #6996] SL switch based on attribute index range) which can have multiple shader network inputs. We can also with the existing nodes do the user defined override.

johnhaddon commented 9 years ago

This would be quick to add, but i'm wondering if the addition of another range plug (for ints) and another output plug (for the int) is going to make the Random node a bit confusing? Is there anything stopping you just plugging the float output of a random node into an int plug in this case?

andrewkaufman commented 9 years ago

I gave Edmond a little demo script of what you're describing and he's happy with it.

edmondeng commented 9 years ago

Yeah Andrew's example will work. e