Home Technical Talk

Having trouble with displacement maps. Please Help.

polycounter lvl 12
Offline / Send Message
Hayden Zammit polycounter lvl 12
Hi guys. This isn't related that much to game art, but I've asked in a few different forums and no one answers. I've always got great comments here, so I here I am.

I'm working on this sci fi interior in Maya. I'm using mental ray with Global Illumination and Final Gather. My problem is with the displacement maps. They deform my mesh alright, but that seem to break it apart at the edges. Here's what I mean:

First pic shows with Displacement maps applied.

http://i.imagehost.org/view/0998/1_77

And here's an in-Maya shot of the mesh.

http://i.imagehost.org/view/0647/2_27

See? Whenever I render it creates holes or something right on the edges. It's like it breaks up the faces or something. It is driving me insane. Any help would be greatly appreciated.


cheers.

Replies

  • sampson
    Offline / Send Message
    sampson polycounter lvl 9
    ah yes. this is because (i think) - you pretty much need to make displacements from a higher poly mesh. If you try to make one in just photoshop, this will happen because the faces are being pushed up and down on their normal. get eeet? and they seperate.
    what does your displacement map look like?
  • Hayden Zammit
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    Thanks for much for replying. Here's what my displacement map is: http://i.imagehost.org/view/0386/3_18

    It just seems weird that its doing this. I tried it in new scene files and everything, so you might be right. Displacement maps seem pretty flawed if there's no workaround for this.

    You say I need to make the displacement from a higher poly mesh. What do you mean by that exactly? That the mesh needs to be smoothed?
  • sampson
    Offline / Send Message
    sampson polycounter lvl 9
    yeah think about it -> if a face that is like | vertical is being told to move like 10 pixels foward on its normal, and the face above it which si like / is being told the same thing. then theres going to be a gap.

    you could try making where the uv meets that edge 50% grey so it doesnt get shifted...

    and i meant making the displacement from highpoly mesh then render to texture..
  • Hayden Zammit
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    yeah think about it -> if a face that is like | vertical is being told to move like 10 pixels foward on its normal, and the face above it which si like / is being told the same thing. then theres going to be a gap.
    Yep, I know what ya mean. I was thinking the same thing for a while. No doubt you're right and that would be it.

    Okay, so I tried just having a displacement map that was just a fill of 50% grey. Still no improvement.

    Just tried having the fill of the displacement pure black and the lines and what I want to displace white. That seems to make it work okay, though I guess I lose some flexibility this way as I can't have things displacing at both a negative and positive value.

    Thanks Sampson, you've been a great help. I've got it working well enough for this render.

    I'll post a final render when its all done.
    and i meant making the displacement from highpoly mesh then render to texture..
    I'm still curious about this. So how would I do that exactly? On that side I want some lines going through the mesh via displacement. I wouldn't have to model those lines in would I?
  • Clockwork
    Hmm, if you want a proper displacement map, you need both a high poly and low poly version of your mesh. There's some quick and easy ways of adding high poly details to your model, like sculpting (Zbrush/Mudbox). Depending on the app you use the specific method of baking might differ slightly, but generally the two meshes are placed together, on top of each other, in some apps the high poly mesh is placed in a background layer, the details from the high poly mesh is baked/rendered to a displacement map (texture). Which you can apply to your low poly.
  • Hayden Zammit
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    Hmm, if you want a proper displacement map, you need both a high poly and low poly version of your mesh. There's some quick and easy ways of adding high poly details to your model, like sculpting (Zbrush/Mudbox). Depending on the app you use the specific method of baking might differ slightly, but generally the two meshes are placed together, on top of each other, in some apps the high poly mesh is placed in a background layer, the details from the high poly mesh is baked/rendered to a displacement map (texture). Which you can apply to your low poly.

    Yep, the same workflow for one of the ways of making normal maps. Still, it should work the same if I draw the displacement map in Photoshop though.
  • chronic
    Offline / Send Message
    chronic polycounter lvl 10
    displacement wont work on low res objects that have hardened normals - you must smooth your normals and calculate the displacement map with that in mind.
  • Hayden Zammit
    Offline / Send Message
    Hayden Zammit polycounter lvl 12
    Yeah, starting to realize that now. Thanks for all the help. I've learnt some useful things with displacement maps.
Sign In or Register to comment.