PDA

View Full Version : ZBrush Trouble with Displacement Map



sampei
04-02-2010, 04:33 PM
this one is for all the forum's zbrushers ! I'm working on a human model and despite I have previously used ZBrush on a fictional human-body-enabled character and (surprisingly) have not had any problems, I'm having some now.
When exporting the displacement map, I followed Steve Warner's guide, so I had adaptive mode and smooth UVs on and generated a map of 2048x2048 pixels, then flipped it on the V and exported it.
Exported the obj from subD level 1, opened the obj in modeler.
Now one thing I noticed is that in my original UV map (that I painstalkingly edited in modeler before exporting the obj for the zbrush treatment), every vertex is red and therefore I chose the weld UV command to normalize the seam. (if I'm not mistaken, red points on a UV represent the seams borders?).
Also I noticed that the UV interpolation was set back to linear rather than subpatch,so I set it to the latter.
Then I sent the model to layout and created the standard node network for the displacement (displacement map, scalar subtract, scalar multiply, vector scale and spot info's nornmal) and had as a result an unperfect displacement with rather odd spikes here and there, but mostly on the seams of the UV.
Now I opened the image editor and noticed that the displacement map I generated has some very strong white and black noise (similar to stiches!) near the seams. Is there a way to generate a more clean displacement map directly from Zbrush or do I have to clean it up in Photoshop ? I've attached the displacement map.
Also I checked the previous model I had worked on, and the displacement map does not have this strong noise, however the only difference is that in that model I had created my displacement map directly in ZBrush rather than in lightwave (and I had minor problems with the normal map).
well sorry for the long post! any help and advice is much appreciated as this is a piece that I want to include in my first modeling reel !
:beerchug:
ps_I also noticed that the UV check command in ZBrush which should locate overlapping geometry with the UV space finds healthy polys! (which I checked back in modeler)

jasonwestmas
04-02-2010, 09:19 PM
Don't use smooth UV, keep it linear when generating the Displacement. Use linear UVs in lightwave and export it to Zbrush as linear UV before you sculpt. I get problems otherwise when displacing sub-patches. The map should displace the subpatches fine when you render it because the displacement map is squashed and stretched appropriately when you generate it in Zbrush.

sampei
04-03-2010, 04:04 AM
ah I wish I'd knew that before, now I have to sculpt all over again :bangwall:
so I need to go back to my original model, change the UV interpolation (on the map tab) to linear, export the obj which i will then sculpt, and when I'm done can generate the displacement map but without "smooth UVs" activated right ?

jasonwestmas
04-03-2010, 08:24 AM
ah I wish I'd knew that before, now I have to sculpt all over again :bangwall:
so I need to go back to my original model, change the UV interpolation (on the map tab) to linear, export the obj which i will then sculpt, and when I'm done can generate the displacement map but without "smooth UVs" activated right ?

Did you smooth UV (SUV Modifier)when you subdivided your model in Zbrush? Or did you merely click on the smooth UV option in the Displacement map panel?

If you had Smooth UV on in the displacement map panel just turn it off and regenerate your map. Use Linear Interpolation in lightwave for your UVs. You can tell if things are lining up if you load your map into the backgound of the UV viewport.

If you used the SUV modifier then you could try importing your obj model again while your Ztool object is on sub-D level 1. I don't think that will work but you can try. I also get the best results if I revert to my saved morph target before generating the displacement map.

The main reason you don't want to use Smooth UV anything in ZB is because it smooth interpolates differently than Lightwave does. There may be a way to make them the same but I never figured that one out. Regardless, linear works great in my experience with Sub-Patches because the UV map PROJECTION gets smoothed when you subpatch the model.

jasonwestmas
04-03-2010, 08:32 AM
Another point is, don't bother exporting your Zbrush model back into lightwave if your original UVs and model were created in Lightwave. Just simply use linear UVs on everything and put the ZB displacement map on your ORIGINAL model in lightwave.

sampei
04-03-2010, 10:48 AM
hey Jason thanks for the useful replies.
First of all I merely clicked the smoothUV in the displacement sub panel, for loading the map in the UV viewport that's a good tip, I never thought of it ;)
I already started re-sculpting the human so it's fine, I really enjoy sculpting (well I prefer real clay but it's still a lot of fun!) and I basically achieved the same result in half the time.
I also tried exporting a quick displacement map, exported the obj, opened it in modeler, shot it to layout, and applied it. Seems fine !
And regarding not exporting the model from ZBrush I will also try and follow that advice, but the main lesson I learned here is to use linear interpolation for the UV.
However I have another question, if I use linear interpolation for the UVs and paint my surface maps (color, spec etc.) in Photoshop on top of the EPS there will be distortion since the subpatched model will have a linear UV map (if I'm not mistaken!?)...how do I overcome this ? Also I noticed that when exporting the EPS of a subpatch object's UV it exports it as if the object was unsubpatched (or if I chose linear interpolation, even if I have the UV set to subpatch interpolation)...obviously it's not too important since they are roughly the same, but is there a way to fix this ?
thanks for your help, really appreciate it !

jasonwestmas
04-03-2010, 03:53 PM
hey Jason thanks for the useful replies.
First of all I merely clicked the smoothUV in the displacement sub panel, for loading the map in the UV viewport that's a good tip, I never thought of it ;)
I already started re-sculpting the human so it's fine, I really enjoy sculpting (well I prefer real clay but it's still a lot of fun!) and I basically achieved the same result in half the time.
I also tried exporting a quick displacement map, exported the obj, opened it in modeler, shot it to layout, and applied it. Seems fine !
And regarding not exporting the model from ZBrush I will also try and follow that advice, but the main lesson I learned here is to use linear interpolation for the UV.
However I have another question, if I use linear interpolation for the UVs and paint my surface maps (color, spec etc.) in Photoshop on top of the EPS there will be distortion since the subpatched model will have a linear UV map (if I'm not mistaken!?)...how do I overcome this ? Also I noticed that when exporting the EPS of a subpatch object's UV it exports it as if the object was unsubpatched (or if I chose linear interpolation, even if I have the UV set to subpatch interpolation)...obviously it's not too important since they are roughly the same, but is there a way to fix this ?
thanks for your help, really appreciate it !

Glad to help! Yeah if you have a texture that can't be distorted by the linear UVs you can make new or copy to a separate UV map that has smooth interpolation. Use that smooth UVmap in the color or spec image node or T chip etc. Use the linear UVs for the displacement or normal map only. You can indeed use several UV maps for a single surface.

probiner
04-03-2010, 06:17 PM
Hey Sampei

Zbrush from what i remember tens to loose the smooth interpolation on the ride. Linear is the way to go if you don't want to have to bother everytime, checking if the UV still smooth, or having to re-import it in the end.

You can swap UV's of an already sculpted object, just go to Sds 1 and import the same mesh with whatever UV you want.

You also can have some nice EPS export with this Lscript (recent thread, you might have missed it) http://www.newtek.com/forums/showthread.php?t=107746


Smooth interpolation is a must have for painting Uv textures in Photoshop, since the UV distortion, altough irregular, it is smooth between polygons, and not snapped/discreet.
But LW has an issue with interpolation with other applications. The points where 2 open edges intersect and close (like in the picture), are normally smoothed in LW, while other aplications keep them sharp.
http://i153.photobucket.com/albums/s202/animatics/LW_UV_OPEN-EDGE.png

This makes the use of interpolation between LW and other applications, useless, or dependent of a at least level 8 freeze (catmull 3).

So Linear is safer between applicatons. A tip, would be to make sure that, since you are not using smooth interpolation, the UV map will have stetched portions of it. Check this vídeo i just uploaded to get an idea of how to compensate the UV for the SDS Deformation.
http://www.youtube.com/watch?v=GxiJo_nt5J0

Cheers

sampei
04-04-2010, 09:50 AM
thanks Jason, that sounds pretty logical, I should of thought of it :)
and thanks Pedro for the usefull links and info (yes i had missed that Lscript), I'm ever impressed by your technical knowledge ! I also can't wait to have a little time to check out your channel. :thumbsup:

lightmann
04-04-2010, 04:52 PM
Smooth interpolation is a must have for painting Uv textures in Photoshop, since the UV distortion, altough irregular, it is smooth between polygons, and not snapped/discreet.
But LW has an issue with interpolation with other applications. The points where 2 open edges intersect and close (like in the picture), are normally smoothed in LW, while other aplications keep them sharp.


in this case did you think in use liner edge interpolation? it works for me for seamless textures from zbrush

probiner
04-04-2010, 04:56 PM
Lightwave's Linear Edge is the interpolation that Zbrush gives when you choose Smooth UV, and it works, expect for thos points i've showned in the last post's image.
But if for some reason this is broken for you, go with linear.

Cheers

sampei
04-05-2010, 09:34 AM
oh so lightwave's linear edge = zbrushs smooth UV ??? good to know !
o btw that Lscript is awesome but it took something like 10 minutes to run !

jasonwestmas
04-05-2010, 11:07 AM
oh so lightwave's linear edge = zbrushs smooth UV ??? good to know !
o btw that Lscript is awesome but it took something like 10 minutes to run !

Not in my experience. Linear and Smooth UV Nmaps do match up some what but not exactly. I use smooth UV for generating normal maps in the Nmap panel. I do this for low poly game characters but the UVs don't match up exactly so I usually have to edit the Nmap in Photoshop.

sampei
04-06-2010, 07:02 AM
ok..I'm still getting these wierd black and white bright "stitches" in the generated displacement map but they don't seem to cause any trouble when I displace the model in layout. However I noticed that in other displacement maps I've seen from other people this doesn't seem to happen...maybe it has something to do with the UVs i created ?

jasonwestmas
04-06-2010, 07:41 AM
ok..I'm still getting these wierd black and white bright "stitches" in the generated displacement map but they don't seem to cause any trouble when I displace the model in layout. However I noticed that in other displacement maps I've seen from other people this doesn't seem to happen...maybe it has something to do with the UVs i created ?

You mean these stitches? I wouldn't worry about that, that is just how Zbrush Fixes seams. It could also be that you sculpted a recession too deep for the rays to decipher correctly. In which case you just have to paint it out in 16-bit greyscale mode in Photoshop.

sampei
04-06-2010, 07:56 AM
precisely those ! I get it, well if they start causing problems I can easily paint them out as you suggested. :thumbsup:

sampei
04-15-2010, 07:02 AM
I'm having more trouble, sorry in advance for the long post I've been off the net since my last so I've just been taking notes on a txt ;)

1) time it was painting the bump map directly into Zbrush. Everything was going well until I tried to paint black head's indentations on the nose and the subtle cuts in the lips: basically when I picked up the "tool" from the projection master the strokes distorted and streched, thus changing completely the way I had painted. I've attached some screen grabs of before and after "picking up".
I've noticed that the bump map on the other parts of the body (arms and hands) is fine, but when I attempt painting the head it distorts them.
Obviously I can paint the details directly into Photoshop but I am wondering if anyone had the same problem and if there is a solution...
oh another thing, as I thought the "stiches" on the displacement map caused some bad errors in the displaced model, I spent many hours editing the map in a painfully frustrating trial and error session from photoshop to layout to modeler to identify the poly locations on the islands...in the end I saved-trans the displaced object and opened it into modeler to find them.
unfortunately I wasn't aware of these probelms when I chose where to place the seams, which made it even harder...well i definetly learned a lesson there!
To be honest I think it's probably my own fault for sculpting the model to heavily, but since I amd displacing the exported obj from zbrush (I tried with the original lwo but the displacement looked very wierd) I didn't think I would have to many problems. As a last resort I might generate the uv map for the displacement in zbrush...
oh and one last thing I was meant to ask is, I was planning to pose my character, should I have done it before the sculpt ? I've tried to pose the displaced mesh and the deformations are terrible. less than 3 weeks to deadline!