Dave Girard's 101 Autodesk® Maya® Tips is now available in Kindle, interactive iPad edition and DRM-free EPUB/PDF editions. Work faster, cry less. Read more about the ebook.




Follow cgbeige on Twitter

Topics by tag:



Recently published articles by Dave G:



Free downloads by Dave G:



Mac OS X-only downloads:

Mixing Displacement Maps in Any Maya Renderer

Someone on CGSociety asked how to mix displacement maps in Maya, so I figured I’d give him some tips and make a blog post out of it, since I’ve seen this asked a few times in the past. This process works for all renderers since it uses Maya’s utilities, nothing specific to V-Ray or mental ray. Instead of doing it with blend materials or something like that, it’s all done by connecting your greyscale textures to a Plus/Minus/Average utility and sending the output from that to the Displacement slot of your Shading Network:

So, there you can see how there are two textures that combine to make one displacement map with different influences. In the video, I went about the connections in a slightly long way, using the 3D channels (RGB) and then connecting the 3D output to an [RGB to] Luminance utility. Because the displacement utility requires a scalar (greyscale) value, you have to stick an [RGB to] Luminance utility between the 3D output of the Plus/Minus/Average utility and the displacementShader node. I could have avoided that step and attached the checker and fractal textures to the 1D inputs (1D meaning one colour channel in this context) and sent the 1D output directly to the displacementShader output:

That does the same thing. But that process has a catch. Notice how, at the start of the video, the checker doesn’t affect the displacement until I hit Alpha Is Luminance in the Color Balance pane.
If you use the 1D input/output method, you’ll have to do that for all your textures. “Alpha Is Luminance” is a bit of a misnomer or at least it’s ambiguous – it should be “RGB Luminance is Alpha Output” and it just means “take my texture brightness and send that to the alpha output.” Even though they appear greyscale, the checker and fractal used here are RGB textures so they still need to have that checked off for the 1D workflow.

In the video you’ll also notice how I adjusted the height of the checker by increasing the “value” of the HSV to above 1 for the white and below 0 for the black. If you just increase the white values, your mesh will bloat outwards, which is probably not what you want. Using an even +20 and -20 gives you a “water line” that is at 0. Also, it’s worth mentioning that I changed the Checker Attributes but I could just as easily have changed the Color Gain (white) and Color Offset (black) values to get the same result. But, like with the Alpha Offset settings, you have to set the Color Offset to -0.5 of your Color Gain value to get the proper water line.

Upping the bar: mixing UV sets with displacement
Another thing the poster on CCSociety asked about was how to mix UV sets for his different displacement maps. This can come in handy if you want to use an unwrapped UV map from ZBrush for your sculpted mesh displacement but want to use a front-projected checker for another layer of displacement relative to the Maya camera.

This process is a little less straightforward because you Maya likes to have the texture explicitly attached to your mesh to create the UV linking setup. So the workaround is to temporarily link your texture to a slot in your material. Then, with multiple UV sets on your mesh, you can connect the texture in the UV linking editor:

Disconnect your texture from your shader and Maya will remember the UV linking and apply it to your displacement texture.

1 note | Permalink

  1. polygonspixelsandpaint posted this