Map Baker Displacement texture workflow

   326   3   1
User Avatar
Member
55 posts
Joined: Nov. 2015
Offline
Hello,
I'm trying to generate a simple displacement map for a low to high poly model(experimenting with planes at the moment). The map baker “height” output doesn't seem to work in nearest distance mode and not properly in normal trace mode, not sure what going on there. I however did manage to bake a vector displacement map by using the attribute mapping feature to bake the high poly mesh world position into the low poly mesh's uv space(using P as the attribute). Did the same thing for the low poly mesh's world position by wiring the low poly mesh into both inputs and subtracted one from the other to generate a vector displacement map. That seems to work but details are not captured accurately and they seem to be slightly offset from he original model. My questions are:

1)Why is the height map producing empty results? In nearest distance mode I keep getting a gradient which seems to indicate the average height of the low poly mesh over the high poly one but there are no high resolution details in the map. It doesn't matter if the high poly mesh has normals or even UV, I'm always getting this weird gradient result. In normal mode I can't use it and I understand why it doesn't work as both models basically overlap(just like they would in a LOD situation).
2)What's the position map supposed to be? I assumed it was world position of the high poly mesh baked into the low poly's UV space. I keep getting an empty teal map with no details. Again regardless of trace mode settings.
3)Is there a better/more accurate way of generating vector or scalar displacement maps using the tool?
User Avatar
Staff
144 posts
Joined: July 2015
Online
Hi,

1) Nearest distance is not a good baking mode for height, since it will quite literally sample the nearest position found, which is often not what you want. (extremely useful for reprojecting texturemaps on the same geo with different UVs though) A much better method is to use the Surface Normal or Cage method. The highpoly also doesnt need normals or UVs, since its measuring the distance between geometry, and using the intrinsic primitive normals when no user specified normal has been found.

2) The position map is exactly what you said. A normalized version of the highpoly position baked onto the lowpoly UVs. The teal color could be perfectly okay depending on where your geometry is located. (though sounds suspicious)Try baking the example file we have on Github to see if you get better results there. https://github.com/sideeffects/SideFXLabs/tree/Development/hip [github.com] (see maps_baker_demoscene.hip)

3) Scalar heightmaps should be high quality with the tool already. Vector displacement we however dont support yet. Those could be added without all too much trouble, so please do RFE that with support and I will take a look at it.
Paul Ambrosiussen
Technical Artist - SideFXLabs
twitter.com/ambrosiussen_p
User Avatar
Member
55 posts
Joined: Nov. 2015
Offline
Thanks for the explanation Paul. So I'm still having issues with height maps as I might not be understanding the logic correctly. I've attached a simple scene that attempts to generate a height map on a grid from a scanned wall model. In normals mode it works for some parts but the rest of the texture is just a gradient. I hope this example can illustrate the issue I'm having.



https://drive.google.com/file/d/1G6IQLtovkvn03kSgupmX64GQUFZWS_VV/view?usp=sharing [drive.google.com]
User Avatar
Staff
144 posts
Joined: July 2015
Online
I checked out your file, and there are two things that stand out.
1. You're using an older version of MapsBaker (v3 instead of v4) Though this is not an issue.. My results below are using the version you're using.
2. You need to tweak the height remapping range. By default it uses -1 to 1. This is way too big for your case, so by simply changing that to -0.3 to 0.3 I got it looking much better. (Better use of available pixel value range, and therefore also visible by the eye)
3. The trace distance needs to be increased. A value of 0.1 might not be enough for your case. (use the visualize toggle to check) I set it to 1, since there isnt really any overlapping geo, so no harm done to play extra safe.

I attached the file with my changes to this thread, so if you hit bake you should be getting the same I did.



Image Not Found
Edited by Ambrosiussen - Nov. 4, 2020 16:37:51

Attachments:
test.hiplc (90.4 MB)
Height_Baker.PNG (290.5 KB)

Paul Ambrosiussen
Technical Artist - SideFXLabs
twitter.com/ambrosiussen_p
  • Quick Links