Baking Displacement: bloated mesh

Hurdy3DHurdy3D Posts: 1,048

Hello,

Maybe one of you has a clue what's going on here.
I got zBrush a few days ago and want to bake in zBrush die HD morph of an expression to a displacement map.
But what ever I do, the height map also bloats the mesh additionally. Here in DAZ Studio:



It's clearly visible that the displacement causes seams. The Displacement is only applied to the face. The seams are the result of the displacement maps adding height, in places it shouldn't.

Here the same map used in Blender:



And just for comparison without any displacement:



If I look on the map, it's clear why this happening. Even if there is no HD information, the mesh is overall grey instead of black on non affacted parts.
This is clearly obvious in the ears. They should be completely black, but they are gray. Even if I bake a mesh without any HD information I get a grey map which bloats than the mesh.



Here as a comparison the mesh without any HD information



And here with (I managed to project a layer):



This seems to be a pretty basic problem in that it seems not to be possible to generate a displacement mesh that has only the diff between two meshes.
Any idea how I achieve this and why has a displacement map some kind of default grey?
I guess that be caused by thegeometry of the basemesh is too different from the subdivded mesh?

 

demo01.jpg
1149 x 1464 - 155K
demo02.jpg
900 x 900 - 59K
demo03.jpg
900 x 900 - 57K
demo04.jpg
1708 x 1702 - 81K
demo05.jpg
1735 x 1812 - 181K
demo06.jpg
1735 x 1812 - 190K

Comments

  • Matt_CastleMatt_Castle Posts: 2,592

    Displacement can be funny about seams, particularly as different programs may interpret the maps in specifically linear or gamma colour spaces.

    When I'm exporting displacements from Blender, I always use floating point EXR files, as the two programs agree very closely about how to interpret those (and once converted to 16-bit greyscale, the files aren't actually that large).

  • PrefoXPrefoX Posts: 241

    grey means no displacement, white positiv, black negative displacement

  • Hurdy3DHurdy3D Posts: 1,048
    edited January 2023

    Matt_Castle said:

    Displacement can be funny about seams, particularly as different programs may interpret the maps in specifically linear or gamma colour spaces.

    When I'm exporting displacements from Blender, I always use floating point EXR files, as the two programs agree very closely about how to interpret those (and once converted to 16-bit greyscale, the files aren't actually that large).

     

    Yes, I'm using EXR. However, I found a solution.
    I baked the displacement two times. One time with the HD morph and one time only the bash mesh with the same subdivision level.
    Then I use both layers and do in Affinity Photo a Difference blend layer, which gives me the result I want.

     

     

    PrefoX said:

    grey means no displacement, white positiv, black negative displacement

    Not necessarily. For some reason I don't understand is the recommendation to use 32bit EXR displacement at a midlevel of 0:
    This means black is no displacement. But I have no idea how negative displacement should work.

    Post edited by Hurdy3D on
  • felisfelis Posts: 4,370

    You must be aware of that in Daz Studio you can set minimum and maximum displacement, and the map will be linear between those to points.

  • richardandtracyrichardandtracy Posts: 5,705
    edited January 2023

    ..But I have no idea how negative displacement should work.

    If the displacement map is set, say, to have max and min values of 1 to -1 cm, then the black will cause a vertex displacement of -1 cm (or a dent of 1cm at that vertex with a straight facet edge to the next displaced vertex), grey (0.5, 0.5, 0.5) will be zero & white will give a vertex displacement of +1cm (or a lump of height 1cm at that vertex). The displacement at the pixel covering the vertex is the only one that is applied. To get finer grained detail, you need to have smaller facets and so more vertices.  I like to think that the vertices created by subD have the applicable displacement applied - however I have not explicitly tried it to find out. Originally I had assumed iRay displacements acted all over the surface like 3DL displacement maps, but I found the hard way, it does not.

    Regards,

    Richard

    Post edited by richardandtracy on
  • FrinkkyFrinkky Posts: 388

    richardandtracy said:

    Originally I had assumed iRay displacements acted all over the surface like 3DL displacement maps, but I found the hard way, it does not.

     Does iray only subdivide the surface the displacement map is applied to? If that is correct, that's potentially good news - it would be more efficient than subdividing an entire figure.

  • felisfelis Posts: 4,370

    Frinkky said:

    richardandtracy said:

    Originally I had assumed iRay displacements acted all over the surface like 3DL displacement maps, but I found the hard way, it does not.

     Does iray only subdivide the surface the displacement map is applied to? If that is correct, that's potentially good news - it would be more efficient than subdividing an entire figure.

    When you are adding a displacement map. you can set the subD level for that displacement. 

  • That's great. I will check to confirm next time I need to do it, but it sounds promising.

    Regards,

    Richard

  • Richard HaseltineRichard Haseltine Posts: 101,116
    edited January 2023

    felis said:

    Frinkky said:

    richardandtracy said:

    Originally I had assumed iRay displacements acted all over the surface like 3DL displacement maps, but I found the hard way, it does not.

     Does iray only subdivide the surface the displacement map is applied to? If that is correct, that's potentially good news - it would be more efficient than subdividing an entire figure.

    When you are adding a displacement map. you can set the subD level for that displacement. 

    The actual division of the model will be the greatest of the render division level in the Parameters pane and the division levels of all its surfaces, it isn't possible to set higher levels to apply to only one surface. The level set in the Parameters pane is used for SubD, any additional levels from a surface setting just divide without changing the shape.

    Post edited by Richard Haseltine on
  • felisfelis Posts: 4,370

    Let's say i have a character with a subD of 1, and I then add a displacement map to the face and set that to displacement subD of 3.

    Is then

    A) The whole character set to subD 3

    B) The character remains at sibD 1, but the displacement for the face is calcilated from the base subD of 1 added a "flat" (added geometry but no shaping) subD of 2.

    My assumptions is B) else it wouldn't make sense to have a value for displacement subD.

  • gniiialgniiial Posts: 208
    edited January 2023

    In that particular case I would have opened a psd/gimp, made a quick "wand selection" of all the blackness in the picture(s), would have enlarged it(them), would have used a soft selection edge between 21-70 px (sometimes one has to try a little) and would have filled all the blackness again with pure black. Saved out as an png or jpg... done... I mean if I understand it right, you want to create simple effects in the face. That's sooo far from any seam, that you don't even need so many space for grey plus or minus directed areas. Hope this tip may help... 

    Post edited by gniiial on
  • felis said:

    Let's say i have a character with a subD of 1, and I then add a displacement map to the face and set that to displacement subD of 3.

    Is then

    A) The whole character set to subD 3

    B) The character remains at sibD 1, but the displacement for the face is calcilated from the base subD of 1 added a "flat" (added geometry but no shaping) subD of 2.

    My assumptions is B) else it wouldn't make sense to have a value for displacement subD.

    Yes, 2 - the mesh is divided once and smoothed, then it is dvided twice more.

  • DrHemulenDrHemulen Posts: 85

    A late reply, but I just think I figured this out. This happens because Zbrush for some reason changes the base mesh when you subdivide. So basically everything is a little different from the original mesh, and then every point has a value in the displacement map.

    It is easy to fix: Store a morph target before you begin. Then, before you export restore the morph target. This restores the base mesh to it's original geometry, and only the things you changed in your hi res modelling are represented in the map. I don't quiiiite understand why, but it works. That's Zbrush for you I guess :D

    Example: 
    Top: 1: Generated displacement map 2: Generated displacement map after restoring morph target 3:Zbrush sculpt
    Bottom: Disp map 2 used in Daz.

    disp.jpg
    1172 x 813 - 90K
Sign In or Register to comment.