[Bf-funboard] A needed node.

David Jeske davidj at gmail.com
Tue Jul 2 11:44:52 CEST 2013

> > 1) would it be nice to have a "random value" node which is easier to use
> > than the modulo node? (I'm thinking yes...since these magical floating
> > point divides don't have good mathematical distribution)
> Yes, a simple random node is what I want.

I'll look into it. In the meantime, you can get the random numbers you want
by using my method with the existing Math->Modulo node. Plug object.random
into one input, and put a random "seed" number into the second slot,
different for each instance of the modulo node. Just like I did in this

> http://www.pasteall.org/pic/54700

.. or you can use the Perlin noise texture method I explain below...

> Page 50 to 55 of the osl-languagespec.pdf has a lot of types of output
> of the noise pattern generation function that would be great to have
> as built in nodes!

That's a good place to get ideas, but as far as implementation... OSL does
not currently run on the GPU.

Cycles currently has a 2D Perlin Noise Texture Node which runs on the CPU
and GPU. You can also use this to generate random color values by plugging
the object-location into the Noise Texture once for each color-channel, and
tweaking some perlin parameters differently for each color channel.

Here you can see this Perlin Random method alongside my previous Modulo


Other uses of a random number would be ...

> selecting palette choices,

This can be done easily today with object.random and a ColorRamp.

> picking textures from a list

This sounds interesting. Can you think of some specific examples of using

I think this can be done today with a combination of
Math->GreaterThan/LessThan, and Mix nodes, but it would be a huge mess. I
can imagine a "Shader Multiplexer" node, where an input factor would select
between different shader inputs. It would be easier to use if it had a
variable number of inputs. I also wonder if it needs some kind of ColorRamp
like configuration or not. Hard to guess without a use-case.

making a random point cloud, vectors for explosions

I'm confused here. Are you talking about the new particle-nodes stuff?
Particle systems already have random factors.

> or other random things, to do small adjustments to just about anything you
> don't want constant, like green color of a tree's leaves. The color of
> gravel pieces.

Makes sense. This is possible today in a few different ways, but I see the
benefit of having an "easy to find and use" multi-seed random node that
artists can just drop in.

More information about the Bf-funboard mailing list