CGPersia Forums
Release Blog CGPeers Register FAQ IRC Chat
Go Back   CGPersia Forums > CGPersia Home > General CG Help & Support
Reload this Page Vray 2 Displacement Mapping Problem
General CG Help & Support Baffled by something? Ask for support here! NOT FOR SITE ISSUES OR REQUESTS

Reply
 
Thread Tools Search this Thread
Old 06-03-2011   #1
Khanaks's Avatar
Original Poster
Join Date: Mar 2011
Posts: 175
Thanks (Given): 53
Thanks (Received): 29
Default Vray 2 Displacement Mapping Problem

Dear Forum,

I'm a Vray 3ds Max newbie, trying to apply a displacement map to my character. It has been imported from zbrush. I've exported the disp map in tif format and at 4096 res. After

1. Converted model to editable poly
2. Applying a Turbosmooth; increasing rendered interations to 4
3. Applying a Vray Disp Mod; increasing amount to 5
4. Configuring the render; placing a sun, activated indirect GI.

There is no displacement in height or depth of my model in Vray RT-activeshade and production.

Can any kind Cgpersian help me?


This is my first attempt at using 3ds max and Vray. I've moved from maya. GoZ is able to transfer all the maps. It just the displacement and normal mapping that is fucked up.

FML
Thanks

Last edited by Khanaks; 06-03-2011 at 09:32 PM.
is Offline  
Reply With Quote
Old 06-03-2011   #2
JavierTF
JavierTF's Avatar
Join Date: May 2011
Posts: 17
Thanks (Given): 0
Thanks (Received): 5
I think you can not view the displacement results in Vray RT mode....you need to do a render production. Of course you have to add that disp image in the displacement map section too(in materials/maps or in the modifier list VraydisplacementMod/texmap) .
So do a Render production using Shift+q, rendering menu or go to the teapot that you have in the icons.

Last edited by JavierTF; 06-03-2011 at 09:10 PM.
is Offline  
Reply With Quote
Old 06-03-2011   #3
Khanaks
Khanaks's Avatar
Original Poster
Join Date: Mar 2011
Posts: 175
Thanks (Given): 53
Thanks (Received): 29
Link(s):
 
Sadly no diffrence. No displacement of my model in production or in activeshade. I must be doing something wrong. What is the normal procedure to achieve displacement from a model in Vray 3ds Max?
is Offline  
Reply With Quote
Old 06-03-2011   #4
JavierTF
JavierTF's Avatar
Join Date: May 2011
Posts: 17
Thanks (Given): 0
Thanks (Received): 5
Link(s):
 
I know two ways to do the Vraydisplacement. First of all you have to apply a texture in the diffuse map to apply a texture to the object. Do you know how to do this??...if you donŽt know how, say to me and iŽll explain it too, ok?. But anyway....doing this that i put here you have to view the results of displacement:

1. Applying the mod in modifier list VrayDisplacementMod that you used before. Select the object and apply this mod. After that go to modifier that you applied and click in the button texmap and select bitmaps in standard materials. Search your tiff disp map and accept. Increase the amount that you like and finally go to the render production to view the results.

2. The other way that i know is using directly in Vray materials(push M). In the maps tabs you have a channel of displacement, change the porcentage that you want to apply and click the button and select bitmap and after this search your image. Render.


Two video tutorials:
Link(s):
 
Link(s):
 

Last edited by JavierTF; 06-03-2011 at 10:01 PM.
is Offline  
Reply With Quote
Old 06-03-2011   #5
cdizzle
Join Date: Oct 2009
Posts: 686
Thanks (Given): 394
Thanks (Received): 285
Vray doesn't like TIFF files. Convert to EXR.

If your displacement is 16-bit, then the scale of your object will affect the Vray displacement height value. Also, you will need to put the offset to its proper value, usually (-height/2). If you're using 32-bit displacement from ZBrush, did you change the mid-value to 0 before creating it? Otherwise, you'll still need to do the offset thing.

Good luck!
is Offline  
Reply With Quote
Old 06-03-2011   #6
Khanaks
Khanaks's Avatar
Original Poster
Join Date: Mar 2011
Posts: 175
Thanks (Given): 53
Thanks (Received): 29
Link(s):
 
Thank you, but how do you chane the mid value to 0?
is Offline  
Reply With Quote
Old 06-04-2011   #7
cdizzle
Join Date: Oct 2009
Posts: 686
Thanks (Given): 394
Thanks (Received): 285
This is what I like to do in order to create displacement maps in ZBrush. This works really well for me in Mental Ray, Vray, and Renderman(most of the time). I've scraped this process together after a lot of research, and it involves tips from a lot of professionals.

1. In the subtool subpallette, change the PA Blur setting to 8. This is a little-known bug, but can make a difference in the accuracy of your map.

2. In the displacement subpallette, open any texture (can be one of the default ZBrush ones). This allows you to change the mid-value setting in there to 0. After you set it to 0, change the texture back to off/no texture.

3. In the displacement subpallette, turn on Adaptive. This can sometimes be really slow or even cause ZBrush to crash - especially when you're making a 4K+ map. If this happens, it is ok to leave Adaptive turned off. It usually doesn't really help make your map better, but if you can leave it on that never hurts.

4. In the displacement subpallette, set DPSubpix to 1. This setting can also slow down your map creation a lot, and with high resolution maps there is no reason to set this very high. If you want to increase it, I wouldn't go past 2.

5. Finally, turn on 32-bit and Smooth UV and create your displacement map as a TIFF file.

6. Convert your map from TIFF to EXR for Vray, or .map for Mental Ray. It's best to use something like Nuke to convert to EXR, as Photoshop can sometimes mess with the color profile. If you don't have Nuke get it from here (it's awesome) or get Picturenaut - which is a free image editor for HDR images.

You may notice that your map looks different, in that all the areas that would usually be 50% gray are now black, This is because of the mid-value setting we set to 0. Now, your 32-bit displacement map has positive AND negative values, and the value that represents 'no displacement' is 0. This allows us to set the displacement height/amount value in Vray to 1, and leave the offset at 0.

I have been using Vray for Maya, but the important thing in either Vray is to make sure that your model is properly subdivided at rendertime (which you are using Turbosmooth for) and that your displacement values are set as stated above.

IMPORTANT: Because your map is 32-bit floating point, you need to tell Vray to allow negative color values. In Vray for Maya, this is done by adding the 'Allow Negative Colors' attribute to the map's file node (where you select the map). I'm not sure how this can be done in Max, but it has to be done. Alternatively, there is a setting in the Vray render settings, under the Misc. tab, that says something like "Allow Negative Shader Colors" or something. This will allow negative values throughout the whole scene, which should work fine also.

Also, JavierTF is right in that you can't have real-time displacement, so you can't use VrayRT for this. I hope this helps you out. Please let me know how it goes. Good luck.
is Offline  
Reply With Quote
1 Thanks, 0 . - Khanaks thanked for this post
Old 06-04-2011   #8
Khanaks
Khanaks's Avatar
Original Poster
Join Date: Mar 2011
Posts: 175
Thanks (Given): 53
Thanks (Received): 29
Than you cdizzle, for your nice response. However I cannot find a "Allow Negative Shader Color" in Max. Does anyone know where that is?
is Offline  
Reply With Quote
Old 06-05-2011   #9
cdizzle
Join Date: Oct 2009
Posts: 686
Thanks (Given): 394
Thanks (Received): 285
Hi, Khanaks. Glad you found some of that information useful.

I searched around a little bit, and found this page in the official Vray help on the VrayDisplacementMod:

Link(s):
 
I believe the 'Texmap Min.' and 'Texmap Max.' is the setting you want. You will have to know the proper range of values in your displacement map, unfortunately, which isn't the case in Vray for Maya. However, it shouldn't be hard to find the minimum and maximum values in your map.

Hope this helps. Please let me know if you get it working. Good luck!
is Offline  
Reply With Quote
Old 06-05-2011   #10
Khanaks
Khanaks's Avatar
Original Poster
Join Date: Mar 2011
Posts: 175
Thanks (Given): 53
Thanks (Received): 29
Thank you cdizzle, but i am not sure how to find the range of values of my map. What are the displacement map values? I never though displacement mapping could be so difficult for myself.
is Offline  
Reply With Quote
Old 06-06-2011   #11
Khanaks
Khanaks's Avatar
Original Poster
Join Date: Mar 2011
Posts: 175
Thanks (Given): 53
Thanks (Received): 29
Recap: i've exported a cavity (as opposed to a disp) map and piped it into a VrayDispMod and displacement occured YAY!11

HOWever, the model is now massively bloated and distorted. CGPersians please rescue this fool.
is Offline  
Reply With Quote
Old 06-06-2011   #12
cdizzle
Join Date: Oct 2009
Posts: 686
Thanks (Given): 394
Thanks (Received): 285
Alrighty, let's see. I'm kind of surprised that this isn't more simple in Max, because it is super simple in Maya.

First, in order to find the minimum and maximum values in your displacement map you can use the CurveTool node in Nuke. This node has a Max Luma Pixel setting, which will analyze a series of frames (in this case, just one frame) and then give you the minimum and maximum values for the image(s). To do this, add a CurveTool node, change the curve type to Max Luma Pixel, click Go! and set the frame range to 1. Then go to the MaxLumaData tab and it will show you the min and max values. These can then be put in the Texmap Min. and Textmap Max. fields in Vray.

Unfortunately, I haven't found a way to do this in Photoshop on a 32-bit image. If anyone knows, I'd really appreciate them taking the time to tell us.

Also, what kind of displacement are you using within the VrayDisplacementMod? You should be using 3D Mapping if you want to continue using your Turbosmooth modifier, or you can get rid of the Turbosmooth and set the displacement type to Subdivision. Either way, don't use the 2D Mapping type.

As far as those Texmap Min. and Texmap Max. settings go, I'm not sure if it has to be a very specific range, or if the range you enter merely has to be big enough so that your displacement values fall within that range. Have you tried just doing -1 and 1? I would try that first, and if you are still getting clipping you can do something like -5 to 5. Otherwise, just put in the values you find in Nuke.

Finally, the cavity map thing you did won't work with the steps I gave you because it is not 32-bit and requires an offset and all that. It sounds like you need to do some more research on this whole thing. Have you used displacement with any other renderer before?

Anyway, hope this helps. Report back here with what you find. Good luck!
is Offline  
Reply With Quote