May 20, 2011 . Displacement Maps: Maya vs. Lightwave permalink ] [ trackback ]

Out of a curiousity to figure out how to improve detail on models without bloating the polygon count of the geometry, I took a closer look at displacement maps. I was surprised to find that Maya and Lightwave use displacement maps in fundamentally different ways.

First, I created a simple image in Photoshop to use as my displacement map (left). My goal was to apply the image to the face of a cube, rendering the pattern as new geometry.

Next, I created a cube in Lightwave’s Modeler with a UV map assigned to one face. After loading the model in Layout, I assigned the displacement map image to the UV map in the object properties (pull up the object properties, go to the “Deform” tab, and apply the texture to the “Displacment Map” texture button). When I rendered the object, the only difference was that the face with the map applied was pushed 1 meter in the direction of the displacement axis.

Suspecting the problem, I reopened the object in Modeler and subdivided the displacement face a few times to create more vertices. When I rendered that new geometry out with the displacement map applied, you can roughly see the displacement map, but with a lot of distortion and odd bending of polygons.

It turns out that Lightwave only applies displacement maps to existing vertices on the geometry. In order to get a more accurate representation of the displacement map, I would need to add more polygons to the face that will receive the displacement map. Since I wanted to use displacement maps to reduce the geometry of the base model, this defeats my purpose for using them.

Maya takes a different approach to displacement maps. I can apply a displacement map by adding it to the shader network for the material assigned to the face that I want to deform. First, I load the image file as an image node in Hypershade. Then I connect the alphaOut (or any of the individual colorOut values, since it’s a greyscale image) to a Multiply/Divide node (to control the strength of the deformation). Finally, I connect the output of that node to the “displacementMap” input of a surface (note: you can middle-mouse-drag the multiply/divide to the surface and choose “displacementMap”, or you can manually setup a “Displacement Map” node that connects to the surface’s Shader Group node — the first method is a shortcut for the second, but the shader network will look identical either way).

Now that the material is ready, I just assign it to a single polygon and render out the results. As you can see, Maya turned that single polygon into a much more complex piece of geometry during the render. The precision can be controlled using values in the “Displacement Map” section of the object properties (higher sample rates == higher precision). But even with high precision, you will still get some distortion and banding of the original image in the final render if you get too close to the object.

So it seems that displacement maps are great in Maya for smaller detail work that does not require close-up shots of the displacement. There are some other neat tricks I found using Maya at this short tutorial, including using temporary geometry in Maya to bake displacement maps and how to get ambient occlusion to work with the displaced geometry.

Posted at 3:01 pm [ 0 comments ] [ Categories: 3D ]
 
0 comments:
 
 
Leave a Reply

For spam filtering purposes, please copy the number 5615 to the field below:

Recent Posts
Recent Gallery Updates