zbrushmayatut

Salmon of the Pacific Northwest
Salmon of the Pacific Northwest
yuri alexander

This short guide covers the Zbrush-to-Maya pipeline. It will help you export your zbrush sculpts to Maya, without losing any detail using displacement maps.

The second part of this tutorial covers using the LayeredNode in Maya to combine displacement maps with tiling detail maps. 

This guide assumes you have a working knowledge of zbrush, and the concepts of UVs and textures. If I leave you hanging without a specific explanation, there are a number of tutorials available for any of these topics, which can be found with a google search.


About Displacement

There are a couple ways to do Zbrush-Maya displacement, including using 32bit displacement. They all have their pros and cons, but this guide covers my personal preference, which is a more traditional displacement map applied to the model.

 

For reference, 32 Bit displacement uses a more accurate method of storing displacement information, and can be generated natively by zbrush. There are two drawbacks to 32 bit displacement. The first, if you can even call it a drawback, is that the displacement is scale dependent, so it requires extra work if you have to scale your model at all once you have imported it into Maya.

 

The second drawback is the main reason that I continue to use traditional 16 bit displacement, which is that 32 bit displacement cannot be layered with other displacement maps, for instance, highly detailed tiling skin maps that mimic the surface of skin. So 32 bit displacement limits the detail resolution to both the zbrush polycount, and the size of the displacement map.

Zbrush
Zbrush
This is the Zbrush sculpt, it has about 8 million polygons.
Maya
Maya
This is the render, using displacement.

Step 1 – UV’s and Map Resolution

Step 1 is giving the object we are going to render UV’s. For test renders, still renders, learning renders, or exploring renders, it is fine to have non-optimized UV’s. For this project, I am just using zbrush UVMaster, which does a fine job of unwapping the model.

The only other consideration here is that we are going to give the model tiling displacement detail maps on top of the initial displacement map, so we need to be able to hide the UV seams from the camera. For characters, this typically means hiding the seams under clothing or behind the back, where the camera is less likely to see.

For this render, I used UVmaster to protect the front of the model, and moved the UV seams to the back. This way, there will be no rendering seams visible where the tiling detail displacement meets the edges of the UV’s.

 

After UV’s have been applied, we have to determine our map size. We don’t have to worry about resources too much, since this isn’t a game and since this is a still render. Our map size will mostly be determined by how poly-dense the object it. For a general rule of thumb, I have found these to be good indicators of necessary resolution:

  • If the object is 0-1 million polygons, use a 1024 map.
  • If the object is 1-2 million polygons, use a 2048 map.
  • If the object is 3-5 million, use a 4096
  • For 6-9 million, use 8092
  • Anything above that likely requires UV tiles.

 


Step 2 – Create the displacement map

Open the displacement editor in the zbrush sidebar and use these settings:

girltut6

  • Adaptive supposedly creates a higher resolution map. In my experience, its more of a superstition. It does take more time and system resources to produce, so turn it off if zbrush is giving you errors.
  • DPSubPix can also feel like a superstition, although when ‘adaptive’ is turned off, it does appear to make your maps slightly more crisp. I wouldn’t suggest using it with ‘adaptive’ on, but feel free to experiment for yourself.
  • FlipV flips your map automatically in the vertical, so you don’t have to worry about compensating for Zbrush’s flipped UVs.
  • 3 channels isn’t necessary, but it does fix an annoying import problem in Maya, so I always turn it on.

Before generating the displacement map, you will have to choose which subdiv level to generate from. Choose a level that is high enough to generally support the silhouette. Generating a displacement from too low of a subDiv will stress the displacement map (make it do too much) and cause errors and artifacts. Generally if I am working on an 8 million poly or higher character, I will generate at about 250,000-400,000 polygons.

When you have appropriate UV’s and have set the map size to the appropriate resolution, you can go ahead and Create and Export Map. Export the map at as a .TIF, although zbrush doesn’t give you a choice.

You can also export the model from Zbrush as a .OBJ. Make sure to export the model at the same subDiv level as the one you generated the Displacement map from.

 


Step 3 – Importing to Maya

There are a couple of things to consider in Maya. First is the issue of Scale. 32 bit displacement is scale dependent, but we are using 16 bit displacement, so it is up to you if scale is a concern. Scale does affect other aspects of the scene however, including some shader aspects (such as SSS), and some render aspects, such as lighting and occlusion.

For this reason I always try to use a somewhat accurate scale. If you have questions about setting and using scale, google it. For characters, the best way to measure scale is by measuring the head, and then scaling all the other elements to match. For reference, the average human head is about 55cm.

The other things to consider about importing zbrush OBJ’s:

  • OBJ’s edge normals are automatically hardened
  • In some versions of Maya, imported objects are automatically excluded from reflection and refraction.

First, to soften the edge normals, with the object selected:

In the Polygon menu, go to Normals->Unlock Normalsgirltut7
Then, go back to the Normals menu, then choose Soften Edgegirltut8

 

Second, to make sure reflections and refractions are activated for an imported object:

  1. select the imported object
  2. find the Attribute editor on the right side of the Maya interface
  3. Select the shape tab (typically the second tab from the left).
  4. Make sure that the checkboxes for Visible in Reflection & Refractions, respectively, are checked on.

girltut9

 


Step 4 – Applying Vray Displacement

The final step is applying vray displacement.

girltut18

Captur4

  • Displacement Mat. – Load your displacement into a texture, and plug it into this slot.
  • Displacement Amount determines the strength of this displacement. It just so happens that 1 was the correct value for me here, but this is not always, or even usually, the case. If you were using 32 bit displacement, and had not scaled your model, then you would use a value of 1 here. 16 bit displacement takes a bit of trial and error. Start with a value of 1, and increase or decrease to zone in on the appropriate amount.
  • Displacement shift – For 32 bit displacement, use a value of zero. For 16 bit, as we are using, use a value of Negative 1/2 of the displacement amount. So for an amount of 1, use -.5. For an amount of 4, use -2. For an amount of 25, use -12.5
  • Edge Length – You can think of edge length as a quality slider. The smaller the value, the more accurate the displacement. Start with a value of 4, and reduce for final renders.
  • Max subdivs determined the number of times the mesh can be subdivided in any one area, to create enough geometry to represent the displacement map correctly. Use higher values for higher quality. Typically I use difference between the max number of subdivs in zbrush, minus the subdivision that I exported the mesh at, plus 1. So for instance if my zbrush mesh has 10 subdivisions, and I exported my mesh at subdivision 4, then I would use 10-4=6; 6+1=7, so 7 Max Subdivs.

 

No comments so far.

Leave a Reply

Your email address will not be published. Website Field Is Optional