« Discrete Tiled 2D Noise | Main | Ecorche Figure »
December 29, 2004
Randomly Shuffled Texture Tiles

This image was created with 3 randomly shuffled tiles. It uses discrete tiled noise

...and a limited set of texture map tiles to create the illusion of randomness and variety.

Let's begin.
Set up some discrete tiled noise as described here.
Or simply download the Maya 6 scene file discreteNoise.mb from here
You'll need that recipe -- be sure to follow that link!

Set up a number of V-ramps. You'll need as many ramps as you have tiles to shuffle. If you intend to shuffle 3 texture maps, you'll need three ramps. You are by no means limited to three.
Set the interpolation in the V-ramps to "None" and design them so that they are razor sharp black and white bands. Make sure the white portions of the bands (when all the ramps are considered together) exactly cover [0..1] V-parameter space without either underlapping or overlapping.

Run the quantized noise through the V-ramps by connecting the red channel of the noise outColor to the vCoord of the ramp input.

Notice what happens to the ramps after these connections are made. They become white blocks.
The "lower white-banded" ramp now becomes the set of all noise blocks that were dark gray.
The "middle white-banded ramp" now becomes the set of all noise blocks that were middle gray.
The "upper white-banded" ramp now becomes the set of all noise blocks that were bright gray.
Those blocks will become mattes that will control the presence or absence of one tile or another.

In effect we tile the objects three times over. Once with a solid grid of nothing but tile A, once with a solid grid of nothing but tile B, and once with a solid grid of nothing but tile C. Tricky compositing (from within the Maya shader) accomplishes the "shuffling."
By multiplying the grid of textures by the appropriate mattes, and by adding all the pieces together with the layered texture node, we cover the entire object with random textures.

If you forget to "repeat tile" the textures, you'll end up with this. The noise is a grid of blocks, so the textures must be a matching grid of blocks.
The noise in this case is tiled into a 10x10 grid, so you'll need to make sure you go into the place2dTexture node of each map and set the "repeats" for the texture tiling so as to create the same 10x10 grid of repeated textures.

Like so.
Remember: you can add more tiles and more ramps, just make sure you set the ramp spaces accordingly.
By adjusting the ramp ranges, you can skew the proportions by which each tile is represented.

If you create off-center features in your tiles (like the stars and moons above) and if you enable the "mirror" option in the place2dTexture nodes, you can "jiggle the grid" a little more and further the illusion of variety.
I understand Renderman may have this "shuffled texture" functionality built into it. Maya should add it.
Posted by digital artform at December 29, 2004 04:47 PM
Comments
I think you are missing some steps between 'set up the v ramps' and 'run the quantized noise'.
Posted by: Joe at September 2, 2005 06:31 PM
:)
quite interesting..
but i'm having a little bit of hard time getting mine to work
so, this discreet noise i manage, but it's a bit foggy really, what you've been doing afterwards...
i'm looking for a stain effect.. have an image dispersed like this on a surface
can you add a few more notes on how you 'jiggled' the grid :)
and can you think of a way to gain control on the scaling of each 'cell' - the image inserted in its respective tile..
thank you
Posted by: qvazk at January 27, 2006 07:30 AM
"can you add a few more notes on how you 'jiggled' the grid :) "
I don't literally jiggle it in this example; I create the illusion that it is jiggled by putting the star or moon off center in the image. Then when the mirror option is on in the mapping, you never know whether you are getting the tile in which it is original, mirrored, upside-down, or upside-down and mirrored.
Posted by: Joseph Francis at April 5, 2006 09:12 AM
HAI,
I AM HAVING A PROBLEM WITH LAYERED SHADER &
LAYERED tEXTURE, RAMP TEXTURE & Ramp Shader.
can u plz give a solution.
Posted by: UDAYA CHANDRAN at July 28, 2006 03:16 AM