ZBrushCentral

Rendering Zbrush Displacement Maps in Maya

Hi, After following this tutorial (thanks) I was wondering about the Approximation Editor and if the number/settings given are considered a standard or just apply to this model?

Is there a formula to follow for rendering different models and determining settings or is it more trial and error?

Thanks.

From what I have found the settings are dependent on object scale as well as the level of high frequency detail in the model. The finer the detail you want to render the more dense the mesh needs to be tesselated at rendertime. The Approximation stage handles this and the settings you enter govern how much the mesh is subdivided. If it isnt subdivided enough the rendered model cannot hold the fine details. On the other hand, if you subdivide far too much MR will run out of memory and crash.

Everyone has their own approach but lately I have found that using just the subdivision approximation on unsmoothed geometry works perfectly. I start with min 2 max 5 and length aet to .01
Then I adjust the alpha gain and the min setting until I get the level of detail I want. Each model will be a bit different but knowing which settings to tweak and the best range of values helps speed up the process of getting to a presentable render. If you push the min max too high and set the length too log Mental Ray will run out of memory. This is why some displacement renders will crash. I posted a link a while back on render optimization which you may want to look at as well.

Scott

thank you, this just went into my notes.

I know this is an old thread…
but I’m having some serious issues with this displacement stuff…
I swear I’ve followed this tutorial to the T…and haven’t come up with anything satisfactory.

I just get a little displacement…but with absolutely no detail.

Might anyone have a maya file saved with everythingsetupright that I could examine??

I’m beginning to think it’s something wrong with mental Ray…

I’m running maya 6…
-tiktok

check out this. :slight_smile:

just a general question to whoever may know.

pinch and inflate don’t translate well into displacement maps, or do they? I’ve noticed that there is trouble with it.

Has anyone had nice inflated and pinched geo that translated well into displacement map?

tiktok: The MEL script Ryan posted kicks butt and is a great tool. You may also make sure your object is scaled up substantially and your alpha gain is high enough. Also try increasing the min setting as well as lowering the length setting. Often I find myself at .01 or even .001 (the latter is difficult on machines with less than 2 gig ram).

lovisx: Pinch and nudge details will not translate well when extracting the map using DpSubPix. From what I understand adaptive mode will allow you to extract better details from areas where you used those tools. I know I have seen strange artifacts in maps where I used nudge on the mesh. Inflate however has never caused an issue for me. If you see areas where you used the inflate brush seem to lack volume or look like they are collapsing in the render try using the mesh from zbrush instead of the original imported .obj. I mean, step up to the highest subd level then all the way back down to 1. Zbrush will slightly preterb the original mesh. If you export this as an obj and apply the displacement some areas where nudge and inflate were applied will work much much better. If you already have the original mesh bound in Maya (if you are using maya) add the zbrush preterbed mesh as a morph target and blendshape to it. it is a workaround I have used in the past and worked great.

Scott

This is my first time working with ZBrush (it’s Zbrush 2) and I’m having some severe difficulties. The Digital-Tutors CD I got was a big help, but doesn’t offer a solution to my problem… I’ve just gone through a ton of work making a Zbrush work from a previously imported Maya file. I’ve posted a picture of my render here. For some reason, however, when I go into ZBrush and generate a displacement map - or a normal map for instance - I get a messed-up triangle of color, which in no way looks like the other displacement maps I’ve seen. It’s an unintelligeble mess! I’m uploading my maya file but it won’t let me upload my .ztl file, since when it’s zipped up it’s still like 4 megabytes too big. Anyone know how I can give you guys this file? If someone (hopefully Scott) can figure out what’s the killer disparity between these two files, I’d be forever grateful! As of right now, I’m so frustrated with this whole process, and I’m frustrated that I can’t get this .ztl file online!! ACK! :cry:

Attachments

Full Demon.zip (64.9 KB)

Monster Head 1.jpg

Kangroo - When you upload a maya file please upload a .ma file. Not everyone has the same maya version and it limits your available pool of help. If it is a .ma file the file can be modified to open in any maya. :slight_smile: Will have to wait till later to look at this. the first thing I would check is if you have Uvs on it.

Best,

Ryan

Hey Kangaroo Number One vbmenu_register(“postmenu_224962”, true);

If you are trying to make a displacement map and you end up with color it sounds like you may be making a normal map instead… Something is amiss there.

Make sure you have UVs on your model too. Since you said the map was a jumbled mess I suspect there are no UVs assigned. The easiest way to do that is to assign AUV tiles under tools>>texture in zbrush when you are at subDlevel1

After that click the create displacement map button under displacement in the same tools menu. The map will calculate and end up in the alpha pallatte when it finishes. The map should be black and while, not color, and rectangular (not triangular).

I dont have zbrush or maya on this machine as I am traveling for the next couple weeks but if you could post a screenshot of your problem map and detail the steps you take to create the displacement map it would help a lot.

Good luck an let us know if you have any more questions.

Scott

First off I’d like to say how thankful I am that people have already started to respond to my problems! After spending literally all day trying to tackle this problem, I feel like I’m close to success… close yet so, so far away. I’m posting screenshots of my Zbrush .ztl file, which is the one I’ve been working on non-stop. I ended up GUV tiling this, after I saw it recommended on another site. This time I experienced some success, as finally the image pattern matched that of the UV coordinates of the .obj file… I went through the tutorial-video Scott created, and it helped a lot in teaching me how to keep tweaking the program to get the results I was looking for. However, as you’ll see from the screenshots, the Zbrush image looks quite different than the Mental Ray displaced image. From looking at these two, does anyone have any ideas what may have happened, and why I’m getting such unfulfilling results? The map is 4Kx4K, but you’ll notice in places like the teeth, it’s garbled horribly. This is demoralizing, to say the least, since I spent quite a while on this character, only to see it’s teeth fall apart, it’s skin get split and overall just get all lumpy. I suppose it’s too much to hope that mental ray could turn out comparably detailed results, but I’ll leave that prediction to the experts in this forum! I’m basically trying to get a job in the industry, and I’m attempting to compile a demo reel. I’d like to get a fly-around of this head, but if the teeth are so messed up, I can’t hope to include this thing at all. :frowning:
-Roo

Attachments

Things dont look so good.jpg

Monster Head 1.jpg

Hey Roo,

Are the teeth completely displaced from the base mesh or are they in the original geometry? I find displacing long spikes and teeth can be problematic sometimes and I usually build such protrusions into the base mesh. Try rendering with just a subdivision approximation and not the displacement approximation on the mesh. The little fractures and creases I see on the render can usually be avoided by just using a subdivision node. As a last resort you can smooth the mesh once and it may help with areas that fracture like that.

I see you got the veining in the shoulder which is good.

I see some collapsing in the nasal region. This could be because the mesh you are using is the original one from Maya and not the zbrush altered one. I hope that makes sense. Ideally, you can displace your original geomety to look very close to the ztool if not exact or even better. In many cases it takes a load off the renderer when you can use the lowest subd level mesh as your model in maya. This is because you move vertices across the surface as you do higher level manipulations in zbrush. These little changes telegraph all the way down to the lowest subD level. Mental Ray cannot shift verts like this (displacement can only go in or out in the normal direction in Mental ray not across) and will run into problems with some complex forms that have been heavily altered in zbrush. As an example load your ztool then import the original .obj file again. Step up the subD levels and you will see how the highest subD level is altered by changing the vertex positions at the lowest level. I would reccomend exporting your level 1 mesh from zbrush and using that as a base in Maya. You will note the mesh from zbrush will look different than the original base mesh you started with. The same can be accomplished if you stored a morph target but exporting level 1 just seems easier to explain.
Also be very sure that the alpha offset is always - alphaGain/2 Having this value off can create a lot of problems.

Looking for lumpiness you mentioned I dont think I see it but I have not been able to tumble around the ztool. Just like when you are sculpting in clay and you move to a different room you will see differences in the surface. Zbrush deals with the surface lighting differently than maya. Lumpy forms that werent apparent in Zbrush can become more pronounced in Maya. Ryan posted a while back about the diffuse channel in Zbrush and how it is controled by a curve as opposed to the same in maya. He can explain this MUCH better than me (I really dont understand the particulars of it yet) but it does make a huge difference in the way your final render appears.

You may also try setting the surface shader to a gray closer to the ztool. Keep in mind the detail may well be there but it does not render off the bat like it does in Zbrush. The shadows are what define all forms and the shadows in Zbrush tend to be more pronounced. The shadows in your render are getting lost in a surface color that is very close in value to the shadows themselves.
Setting up a strong spotlight from the side can rake light across and help you judge if the displacements are getting there. Also keep in mind that a diffuse map can do wonders as well with finer details. These can be made (for now) using the cavity shader. More info on that in other threads.

Also note that the default camera in Maya is 25mm this is TOTALLY WHACKED as the normal lens length for a 35mm camera (the least distortion compared to the human field of vision) is 50mm. For the sake of troubleshooting you might change your focal length in Maya to 50 or even 100mm to reduce distortion. The camera in Zbrush has no perspective distortion so a longer lens will be closer to what you see in Zbrush.

That was kind of a lot (too much time on my hands :stuck_out_tongue: ) but those are all things I do when I am trying to tweak MR renders to look like Zbrush viewports. Some of those things are minor but they go a long way in reducing headaches especially when the detail is in the render you just cant see it for your settings. I hope this helps. One last thing you can do is just render a head rotation in zbrush itself! : ) Why bother with Mental Ray if you dont have to : )

Scott

First of all… Thanks, Scott Spencer for making the tutorial. I tried it on my phone tutorial model with limited success so I wanted to find out if the problem was with my OBJ and/or displacement map. So… I downloaded the sample displacement head and map and gave it a try…and it worked. See pic below. Now I have to figure out what I did wrong with the phone OBJand/or displacement map. But for now I have had success in Maya with the sample head.:D:+1:

Hey all, thanks Scott for the help. I tried all the things you suggested, and they definitely helped quite a bit, but in the end I ended up rendering it all in ZBrush, which I think ended up being a good idea. I think the main problem was that my low-poly mesh was simply too low-poly, and I made too many changes to the overall mesh (most importantly, you were right, I extruded the teeth in ZBrush, which I shall not do again) in ZBrush.
Last little question before I make my exit from this thread (for now). When I exported the consecutive .psd files from the ZBrush movie option onto my computer, I noticed a degredation in the image quality (it all got kinda blended together. I’ve uploaded a sample, to compare this with the earlier image I uploaded. This isn’t a huge problem, but does anyone have the answer?

Attachments

Oink.jpg

LM : Test head looks great! Good luck with your other projects!

Roo,
Cool Im glad some of that helped. I dont mean to give the impression you cannot get extreme displacements to render on a low poly mesh. Take the sword test file for instance. That is extremely low poly and I am able to make the renders look fine with just a subdivision approximation at about 4 and 6 min and max Spatial (those are the settings off the top of my head)

If you think the low poly mesh is “too low” just smooth it once or increase your subdivision approximation settings. If you at one time had a displacemenbt approximation attached to the mesh and you deleted it in the hypergraph this wont do. I have noticed that once a displacement node is attached it stays. Best to recreate the scene with just the subdivision node attached. You should be able to get a render off without the splits in the geometry no matter how low poly the head is.

I do think that the displaced teeth are best avoided tho. I have worked on a file with some spikes displaced on the head but they were smaller knobs and not a full set of choppers. It can of course be done and I am sure done well. I just know I ran into problems with it myself.

Best of luck!

Scott

Thanks Scott for taking your time to help others improve :smiley: Works fine downloaded your tutorial and learned alot thanks

First of all: Many thanks for that damn good tutorial. I appreciate your work.

I followed all your instructions with my own model and couldn’t get the desired result. I had to use the cage methode. I attached two images. One is rendered with zbrush and one with mental ray.

ZBrush:

alien_brown.jpg

I’ve got the same problem as someone before. My teeth don’t come out. Additionally, I have failures in the surface as u can see. Any ideas what I could change?

Attachments

Test_alien_head.jpg

Did you flip the Displacement map in V before exporting? It doesn’t look like your displacment map is aligned to your model at all.

If you did do it on export, you can open in Photoshop and flip vertically.

Clyde

Did you flip the Displacement map in V before exporting? It doesn’t look like your displacment map is aligned to your model at all.

No, I did not. I thought I am supposed to export it normal and then flip it vertically in for example photoshop. Do I have to do that flipping in V anyway??

You have to flip it in V one way or the other, but not both. I’m pretty sure from looking at the Mental Ray render that your displacement map is not aligned properly to your UVs. You might try flipping it again in V to see if it works.

Don’t give up on it until you see lines and details in the same position on your model in the MR render as they are in your ZBrush render.

Clyde