Map Baker Displacement texture workflow

   11178   7   3
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
Member
197 posts
Joined: July 2015
Offline
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, Freelance
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
Member
197 posts
Joined: July 2015
Offline
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, Freelance
twitter.com/ambrosiussen_p
User Avatar
Member
2 posts
Joined: July 2005
Offline
Hi there,

thanks for posting this thread - I'm going to add my question to it as it is related.

I need to bake out position delta between an un-displaced model and a displaced model.
- in the maps baker 'Position' should do it for me, but there doesn't appear to be any means of normalizing the position space so it fits within an 8bit image - there is only the flag to enable position baking - no range settings for x,y and z
- in the standard texture baker I'm also having no luck - vector displacement appears to not align with my calculations (made by subtracting P_displaced from P_undisplaced.

I could solve all of this by being able to bake out an arbitrary point attribute - I can calculate this easily in an Attribute Wrangle SOP. My problem with this is I'm not sure how to make either the map baker or the Mantra baker see the custom attribute - any guidance on how to do this?

many thanks - Mathew
User Avatar
Member
275 posts
Joined: Sept. 2012
Offline
Mathew Lamb
Hi there,

thanks for posting this thread - I'm going to add my question to it as it is related.

I need to bake out position delta between an un-displaced model and a displaced model.
- in the maps baker 'Position' should do it for me, but there doesn't appear to be any means of normalizing the position space so it fits within an 8bit image - there is only the flag to enable position baking - no range settings for x,y and z
- in the standard texture baker I'm also having no luck - vector displacement appears to not align with my calculations (made by subtracting P_displaced from P_undisplaced.

I could solve all of this by being able to bake out an arbitrary point attribute - I can calculate this easily in an Attribute Wrangle SOP. My problem with this is I'm not sure how to make either the map baker or the Mantra baker see the custom attribute - any guidance on how to do this?

many thanks - Mathew



Baking the displacement does not give you what you are looking for, the P_displaced-P_rest ?
If not you could add a custom attribute to bake with map baker
Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts
http://fr.linkedin.com/in/vincentthomas [fr.linkedin.com]
User Avatar
Member
385 posts
Joined: July 2018
Offline
I am also struggling to make the baked height work. in my case i have a complex rock i want to bake small details to the low version.
Its difficult to guess the height range and the trace distance.
Iterations are not quick because it takes a while to bake.
Is there a way to know these values in a more precise way?
some sort of visualizer would be helpful to see the correct height range.

a lot of the times the height map is noisy, is that because of my geo or the map resolution?

Attachments:
1.JPG (65.6 KB)
2.JPG (57.2 KB)
3.JPG (370.0 KB)
4.JPG (93.3 KB)

User Avatar
Staff
99 posts
Joined: Feb. 2021
Offline
papsphilip
I am also struggling to make the baked height work. in my case i have a complex rock i want to bake small details to the low version.
Its difficult to guess the height range and the trace distance.
Iterations are not quick because it takes a while to bake.
Is there a way to know these values in a more precise way?
some sort of visualizer would be helpful to see the correct height range.

a lot of the times the height map is noisy, is that because of my geo or the map resolution?

I can take a look at it. Do you mind sending us a test file? If you can't share it here, feel free to email support@sidefx.com and let them know to assign it to me. Thanks!
Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
  • Quick Links