VRay and ZBrush - losing fine detail in disp map

Original post by Frederik Storm on CGTalk (I’m the ‘friend’ he mentions and the max + vray part of the equation). I thought it wise to post it here as well. Hope some of you might have an angle on this - and perhaps even a few pointers for doing character work with zbrush + max for animation (crossing fingers). :slight_smile:

Hey,
My problem is, as the title says, that I loose all fine details when I export my displacement map from zbrush, or at least it seems that any other program than zbrush, can’t read the details (zbrush reads all the fine details in the map when I apply the map to a newly imported OBJ).
Some pictures to illustrate:
This is my model rendered in zbrush, at subd 6.
http://www.frederikstorm.dk/images/doodles/kykloptextured10.jpg

And this is what a friend of mine gets when he tries to apply it to an imported OBJ in max:

I think the images speaks for themselves.

And just to compare the two maps:
http://www.frederikstorm.dk/test/dispnorm.jpg
This shows even more clearly just how poor the map is.

And this is where it gets really funny, 'cause zbrush apparently have no problem reading the fine details in the map, this is a little test I made in zbrush, where I exported the mesh at subd5, closed zbrush, opened it, and then imported the newly exported obj, and then applied the displacement map:
http://www.frederikstorm.dk/test/testdisplacementmapinzbrush.jpg

All the maps used are at 4096*4096

And the “funny” thing is, I get perfect normalmaps, no problem at all, but I must have totally missed some setting when exporting the displacement map, but I have tried for around 4-5 hours playing with the settings, and searching for some help on the web, but no luck.

I really hope some one out there know what we are doing wrong, and how to fix it.

On a total side note, my friend who did the max renderes, would like to know, why the normal map works so good as displacement map, this is the model with normal map applied as displacement map:

Obviously the shape is not quite right, but its still a lot better than the results with the displacement map applied as displacement map.

What are your displacement settings? With V-Ray, it might be better to use the ‘2d’ method and set the resolution to match that of your displacement map.

Best regards,
Vlado

These are my modifier settings - the only difference between the images using normal mapping for displacement and displacement map for displacement is the bitmaps being switched in max.

have you flipped the displacement map vertically?

Yes - had to do that for both maps.

did you flip it in photoshop?
as far as I remember zbrush exports a linear displacement map and max reads it as linear if you brought it into to photoshop to flip it you need to disable colour management or it will change the gamma of the displacement map.

Flipped in max’s bitmap loader.

I don’t quite understand. Is your problem with displacement map? if it is then its not a vray related problem.
Have you tried rendering with mental ray?

Generally you would need a lot more triangles to get the detail out of the mesh then a normal map which just changes the normals.

You also might want to use 3d mapping and see if you get better results. But before that, try applying the displacement map back to zbrush model inside zbrush and see if it retains the detail. If the detail is there then you know its the displacement settings that you need to tweak inside a renderer. If the displacement detail is not there then there is something wrong with the way you are exporting the maps.

It is a max / vray / (me?) problem.

1st part:

http://www.frederikstorm.dk/test/testdisplacementmapinzbrush.jpg

That is the mesh imported into back into zbrush in a clean scene and then applying the same displacement map I have. When I apply it in max I do not get the same amount of detail.

I’ve tried using 3D mapping but it delivers identical results, only at slower speeds.

2nd part:

I don’t understand why using a normal map FOR displacement is better than using displacement map for displacement? This is in max only.

did you try turning down bitmap blur? Also what format is your map. The reason the normal map looks better is because it has less range and more visible detail which is probably picked up by displacement better.
If your still having a problem you can post a portion of your map here and we can attempt to figure it out.

Yes - I tried disabling map filtering in the displacement modifier - and I tried using the vray bitmapfilter as well. :confused:

Displacement map crop:
http://helvede.net/vray/displace\_crop.png

Normal map crop:
http://helvede.net/vray/normal\_crop.png

I tried it and got the detail to show but only when I cranked the intensity of the displacement to be very high. You might want to look into doing this with another format perhaps it could be better.

I just tried cranking it way up myself as well. It shows more detail but not anywhere near the amount I get from the normal map. I get the maps as 16bit TIF - I put PNG online for direct viewing purposes - but I think you may be right on the dynamic range within the image.
Will have to poke my modeller to see wether he can alter the min/max range in ZBrush when computing the map and see if that will make a difference. Thanks for your inputs so far, I really appreciate it!

there is few things you can try. First make sure that you are applying the displacement to the base mesh which is the same base mesh as in zbrush. As zbrush will alter the base mesh level enough.
Also you might wan to experiment bringing the model at its highest level to mudbox and exporting a 32 bit exr displacement. Mudbox generally is better at exporting maps.
Lastly you can try experimenting with 32 bit displacements from zbrush but they don’t store negative information.

You’re really saving my day here! :slight_smile:

I imported the 900mb high-detail OBJ into Mudbox, then the lowpoly-cage and did a few trial and error displacement maps - trying to get the correct search distance (best guess seems like no guess at all…) - and this is the result applied in max. Heaps of difference this did! There’s some error areas but they’re very likely due to my modeller tampering too much with the mesh in ZBrush getting the model too far off it’s starting point, especially at the ears.

But I hope the issue with the map can be resolved in ZBrush so export can be more streamlined. I’ll talk to the modeller tomorrow again showing him the progress.

I’ll let you know as soon as my toy breaks again… thanks! :wink:

the artifacts are some one known to mudbox. I recommend getting latest service pack, but besides that you can do an auto search distance and then use half of that value, minimizing search distance will reduce the black dots on the displacement map.

I will look into the SP issue and try the search distance / half trick. Only when I made the last displacement map, I lowered it to way less than half of what Mudbox suggested. Perhaps another reason to update SP?

Got my modeller guy to export new maps from ZBrush - made to resemble the ones I got from Mudbox more closely.

It’s a lot better than the earliest ZB results but still a world apart from my Mudbox map export. And the silhouette of the character is altered altogether - not just from displacement height settings that might be a bit off, but the form altogether. And there’s the sharp edges that look like remnants from the low poly cage. I just can’t believe that it’s impossible to do this right directly from ZBrush… :I

well that could be something else. In zbrush and max if you are smoothing the model the uv’s are not smoothing the same. You have to ensure that the uv’s smooth correctly in both programs to get correct result.

He got some help from a Bioware guy - but you were right on the money, Morbid. Maybe I should just get you onboard the project as chief displacement problem-solver. :slight_smile:

He fixed the UV smoothing in ZBrush and then exported again:

Now we’re starting to get somewhere!

glad I could help :slight_smile:
this uv issue is really bad across different 3d apps too. In maya for example there is two ways you can smooth the uvs and none of them match max, where in max there is no option it just smoothes the uv’s but retains uv border its totally messy and undefined.