Tutorial: ZBrush to modo – 32 bit Displacement

Posted by on Mar 31, 2013 in Tutorials | 6 comments

Tutorial: ZBrush to modo – 32 bit Displacement

Tutorial

 

This tutorial is going to be similar to the one I have on how to get a displacement map from ZBrush to Vray for Maya. We’re going to look at how to get the ZBrush – modo workflow going.

 

Displacment maps. The words sends shivers down the spine of any CG artist. It’s a topic I’ve spent countless hours trying to wrap my head around. In this tutorial we’ll look at a reliable way to use 32 bit displacement maps in modo generated in ZBrush.  You have significantly more data to work with so your displacement will be more accurate and will contain more information. I’ll assume you know the difference between a normal, bump and displacement map, and why a displacement map is necessary. If not, you have some googling to do.

 

Let’s get started.   Here is the mesh in Zbrush which I want to transfer to modo. It’s about 4 mill polys and it’s fairly detailed.  It has been retopologized to make sure that the topology is good, and it has UVs with little to no stretching. It’s extremely important that your UV map is good, otherwise you’re going to see nasty artifacts and stretching in the render once you apply your maps.    

 

 

Alright, let’s jump into ZBrush We’re going to use Multi Map Exporter (MME), which is a relative recent plugin in ZBrush. You can find it under Zplugin in your top menu. This is your friend and you should know it well. Before we had this thing of beauty, we had to export every map manually, which is a tedious process. With the MME, you can export several maps at the same time where you have more control over them. It also supports multiple UV tiles. This is a huge thing when you’re working in a production and your UVs are laid out over several tiles. Traditionally, multiple tiles are hard and convoluted to work with in ZBrush, so this is wonderful. More info regarding the MME

Tutorial04

Open the plugin up and you should hopefully not be too overwhelmed by the wall of text and buttons. Check Displacement in the very top.  Here you can adjust your size, export map for all visible subtools, et cetera.

Set the size to whatever you need, in my case I need a 2k map.

Enable Flip V which will flip the maps vertically, which you always have to do in Zbrush due to some weird voodoo by Pixologic.

Next, hit the friendly looking button which says Export Options. This is where the options for the various maps can be found. You want to click Displacement to bring up the options for the displacement map.

Tutorial05

Now we have a couple of settings which we need to know about

SubDiv Level: This dictates which subD level the displacement map will be generated from. You normally want this set to 1 as the displacement will then be generated from the lowest level, meaning that the map will have the difference between the lowest and highest level. This overrides the current subD level your model is currently in, which means that if your model is set to level 5 and your SubDiv is set to level 1, then the map will be generated from level 1. I sometimes use this to make bump maps. If I set my SubDiv level to 4 out of 6, the displacement generated will only include the finer details, so it can be used as a bump.

 

Adaptive: If pressed, the map will be of higher quality, but it will take longer to generate. I always have this on when exporting a final displacement. I leave it unchecked when doing tests.

 

DpSubPix: Now this is an interesting one. Initially I thought this was only a quality slider, where 0 was the worst and 4 was the best. It’s not. This is what Matthew Yetter from Pixologic writes about it.

 

This is most likely unnecessary and is definitely a significant drain on resources. DPSubPix is mostly a dinosaur, held over from when ZBrush couldn’t handle models in the 10′s of millions of polygons. What that slider does is to virtually subdivide the model a number of times equal to the slider setting before then creating the map. Its purpose is to let you create a larger map than what your current number of polys would allow.

For example:

A 1 million poly mesh is ~ equal to a 1K texture map. If you want a 4K map, that would mean that you’d get a lot of artifacting caused by interpolation while the map is being created. You’d want to divide the model twice to bring it to 16 million polys, which is ~ equal to the number of pixels in a 4K map. In ZBrush 2, you couldn’t get to 16 million polys so you’d use a DPSubPix value of 2 and get a nice, clean map. With ZBrush 4.x you CAN hit that many polys easily and so you can subdivide the model yourself, do some more detailing and then create the displacement map without DPSubPix.

Now if you have a 20 million poly model and you’re using a DPSubPix value of 4, guess what happens? You’re telling ZBrush to first calculate over 5 billion polygons and then create the maps. Even just a DPSubPix value of 1 is enough to hit 80 million polys. Not only will it make most any computer puke, it’s also calculating WAY more data than the displacement map could possibly hold.”

The TL;DR version? Disable it. It takes A LOT longer to extract the map. One test I did took 23 seconds with it disabled and 5 minutes with it set to 4. The quality was identical.

 

 

Smooth UV: This will smooth your UV, as you might have guessed. Might or might not be preferable, depending on your project. If unpressed, your UVs will be rigid, which might be what you want. By default, modo will smooth your UVs so this might be preferable. In this example though, I will NOT smooth the uvs. It’s extremely important that you’re consistent here, otherwise you will have issues with seams.

 

Mid: This is the mid range for the displacement. When using 32 bit maps, you want your mid range to be set to 0. By default the mid range will be 0.5, meaning 50% grey, which makes no sense when using 32 bit images.

 

3 Channels:  Will give the displacement information in all channels instead of just the red one. Enable this.

32 Bit: Enable this. Otherwise you cant get a 32 bit map.

exr: You want to enable this, as this will save your files as EXR-files, which are far superior to tif-files when it comes to displacement maps.

 

Scale: Don’t touch this.

Intensity: Don’t touch. There is a way where you can use the intensity with 32 bit maps, but frankly, there’s no need to do so.

16 Bit Scale: Only relevant when using 16 bit maps.

Get scale: Can be handy, but don’t touch this for this particular workflow.

 

In short, there are the settings you want for top quality:

 

 

 

Now hit Create All Maps and chose the directory you want to save it to. Yo Give it a couple of minutes and you should be set. As a general rule, I never touch the computer while Zbrush is calculating. Sometimes it freezes and crashes when you touch it.   Export your base mesh at the level you want, preferably the lowest one.

 

ProTip:

Leave the ZBrush window active while the maps are being generated. This will make the maps generate faster, according to the developer of MME. It will generate regardless of ZBrush being the active window, but it will slow down if you Alt+Tab to something else.

 

There’s a bug in modo which means you can’t import 32 bit TIFF-files. It’s easy to go around though: Open the newly generated map in Photoshop and simply save it as an .EXR It will look something like this. Just because you cant see all the information doesnt mean it’s not there.

 

 

 

Modo time!

File – Import and select your Obj file. Organize your file and give the different items appropriate names. This will save you so much trouble later on.

Remember how we made the displacement map with Smooth Uvs unchecked? Now is the time to change this. Click on the mesh item and enable Linear UVs

 

Here you can see the difference between linear and smooth UVs.

 

Linear                                                                                                         Smooth

 

 

 

 

Lets head over to the new, sexy render layout found in modo 701. Select the model you want to displace, here the body, hit to give it a material. Again, give it a proper name.

 

Now we need to assign the displacment map to our fishy.  The easiest way is to simply drag it from the explorer to the shader tree. By default it will be set as Diffuse Color. As this is a scalar map (as opposed to a color map) the gamma should be set to 1.0. In other words, dont touch the gamma if you’re rendering in linear workflow. If you’re not rendering in linear workflow, shame on you; you should.  

 

Right Click on the newly imported texture map, Surface Shading – Displacement

 

 

This is what it looks like currently. Apparently nothing is happening. Either the map simply isnt working, or it’s not strong enough. In this case, it’s simply not strong enough.

 

This is the million dollar question: How the heck to you know how strong you should set the displacement map to be? What magical numbers work every time? I’m going to be completely honest here: I dont know. In vray, there is a way to do it which works every time, but I havent found anything like this in modo yet.   That said, setting the Displacement Distance to 1 meter seems to work in most cases, but this can vary from scene to scene.

 

 

This is with a Displacement Distance set to 1 m, rendered out.

If you want to have better visual results with the displacement, enable Displacement as Bump under Settings

 

 

And there we go! That’s how you successfully render a displacement map from Zbrush in modo. It’s really a rather simple procedure once you know how.

 

Tutorial

 

I hope this is helpful!

 

If you have questions, corrections or general comments, feel free to email me at henning.sanden [at] gmail.com

  • http://www.facebook.com/tmagero Tiago Magero

    You are awesome.

  • http://www.facebook.com/mblackshore Michael Blackshore

    The answer to your million dollar question is about the offset I believe, the strength of the displacement map.
    There is a way to get those values right everytime, infact Zbrush knows these values.

    But these values will not be written to the obj file.
    You can either export a .ma file and open it up in maya to get the values out.
    Or you could press on go Z when you have created the map without the multi texture exporter.

    In maya, you will find these values under color balance on the displacement texture.

    In modo you will find these values on Low & High Value.

    Was that what you where asking for?

    Thanks for the 32bit tip! Gonna check it out!

  • werkvoll

    How fast is the modo render in comparison to maya vray?

  • Ken

    Thanks a lot!

  • Flasher

    Thanx for the tutorial. Really a time saver :)

    Cheers

  • http://www.ateliernarasca.com Dorian Iten

    Thanks for putting this together, much appreciated!