« Ecorche Figure | Main | Sample a Maya File Texture »

January 02, 2005

Jittered Tiles

rippledTiles.jpg
Continuous noise in red and green, when applied to the offsetU and offsetV attributes of a tiled UV map, can create the impression of "digital ripple glass."

Download continuousNoise.mb Maya 6 scene file

jitteredTiles.jpg
Discrete noise, when similarly applied, can shake a repeating array of UV-mapped textures seemingly "out of its grid," adding variety to your 3D CG work.

Download discreetNoiseUV_8.mb Maya 6 scene file

unJitteredTiles.jpg
The idea is to cause discrete noise to become tiled at the same rate as a texture map is tiled. If the noise is red and green, and if red and green are connected to the offsetU and offsetV attributes of a place2dTexture node, then the tiles can be "jittered" out of place. In the example above, I have created a "dimmer switch" in the form of a one-color gray ramp which, when multiplied by the output of the discrete noise function, can cause the tiles to drift out of their normally rigid grid positions.

Some Caveats
You don't have to use a ramp as your tile texture. You can use a file node containg any image you wish. Just make sure the subject of the tile is surrounded by a big fat bland border. You are not actually altering the grid, you are only rattling a small texture around within that grid. If your texture does not sit within a big fat bland border, you will destroy the illusion. For best results, surround your texture figure with a big region of transparency.

illusionDestroyed.jpg
If you "turn up the dimmer" too high, you will knock the textures into the borders between "cells" and destroy the illusion. If you want more density or closer packing, you'll have to use more layers and transparency mapping. If you work at it, you can use quantized noise to weave one layer randomly over and under another layer, or color correct or rotate individual cells.

The use of gray blocks of noise and a wacky ramp full of yellows, reds, greens, and blacks to turn 1-dimensional (gray) offsets into 2-dimensional (red and green UV) offsets is a total kludge. The noise function shoud be the sum of a blocky red function added to a blocky green function.

shaderBug1.jpg
I have tried many times to get this to work. There seems to be a particularly ugly Maya bug which prevents this from succeeding. The red offsets work fine alone. Ditto the green. But when you try to sum them, they turn into stripes, or cause Maya to freeze, or work in hardware rendering but crash in software rendering.

UPDATE:

The 2-color noise works fine in Maya 4:
Download file

The 2-color noise fails badly in Maya 6 software rendering, although it seems to work in the Maya 6 hardware renderer:
Download file

Posted by digital artform at January 2, 2005 05:43 PM

Comments

Substituting a plusMinus node for the layered texture node and connecting the outputs of noise1 and noise2 into input.0 and input.1 of the plusMinus node and connecting the output of the plusMinus into your lambert color.input seems to work fine.

Posted by: Chris at January 8, 2005 02:48 AM

Thanks for writing.

Regardless of whether I use Layered Textures, a plusMinus Node, or direct connection of attributes to channels, I find the shader works in some places but not in others. Particularly, it seems to work in XP SP1.

Maya has logged it as a bug.

They provided a workaround using stepped ramps instead of a script to step through the U's and V's which works well, but is a drag to set up. The ramps need a scripts of their own in order to be created with many steps.

Download file MD_render_QuantizedNoiseRamp01.mb

Posted by: digital artform at January 8, 2005 10:52 AM

The methododlogy hads been historicaly called bombing!

Actualy theres a way to do jittering over the grid, its explained in some of the older sigraph text, tough granted not so easy to accomplish in maya without actualy coding a plugin.

Posted by: joojaa at January 9, 2005 04:32 PM

Bombing, eh? So it is. I found this site referring to the term "bombing" with regard to texture maps.

http://www.cs.umbc.edu/~wyvern/textures/intro.html

Thanks for writing.

Posted by: digital artform at January 9, 2005 11:33 PM

Post a comment




Remember Me?

(you may use HTML tags for style)