Author Topic: Do heightmaps have to be centered around 50% gray?  (Read 130 times)

I am trying to determine under what circumstances it is important for heightmaps to be constructed so that the primary surface of the material is at 50% grey. Obviously this is the neutral value for tessellation + displacement, but if your material is primarily going to be used in a game engine, and presumably with parallax occlusion, does that still matter? If anything, you might want your primary surface to be as high value as possible since that seems to lead to less distortion around the edges of an occluded texture, at least.

If I'm working on a material like concrete, where there's going to be a lot more damage, etc below the main surface of the concrete than stuff stuck on top, I'd effectively be sacrificing half of my value range to normalize the material around 50%.

But I don't know how important if at all it is to consider this kind of thing, so I thought I'd seek some advice.

To reduce artifacts as much as possible due to texture compression you want to use the full black to white range whenever possible, but there are indeed situations where you're better off sacrificing some of the range for better looking results.

It partially depends on the displacement shader you're using. Shaders differ a lot between different software, so always check what they do on your target software. Some only push the surface up, others just down and others do both.

Generally speaking you don't want the object as a whole to look bloated or shrunk, so when you have a mostly flat material it's best to normalize your heightmap around where most of the surface is. So in case of your concrete example, if the shader normalizes around 0.5, the flat surface of the concrete should be at 0.5 to cause the least unwanted deformation.

Then again, when the shader is normalized around 0.5, you can indeed get seams at the corners. First of all, avoid hard corners in your model when using offset, as they will get split.
Convex corners, like all edges on a cube, are best not moved 'down' too much, so raise the bottom value as desired. In extreme cases you can place all values between 0.5 and 1 to completely avoid these seams, but this does of course cause bloating of the object.
Concave corners are best not moved 'up', so the opposite is true if they're the one causing issues.

So, to sum it up, just do whatever looks best in individual use cases.
Esger van der Post.
Game design student and texturing addict.