5
\$\begingroup\$

I'm using C++, DX11 and tessellation. After tessellating a triangle I apply displacement mapping to the new vertices. But they still have the original triangle's normal so the lighting calculation behaves like the surface was flat.

So I see two solutions: sampling a normal map (corresponding to the displacement map) or sampling the displacement map in a few more places to calculate the normal myself (both would be done in the shader).

Since I'm using already using another normal map (with more detail than the displacement map contains) a 2nd normal map seems a little like an overkill. And calculating the normals myself seems inefficient.

Both solutions would work though so my dilemma is really this - am I overthinking it? Should I just go with one of the above solutions? Or is there a better approach?

\$\endgroup\$
5
\$\begingroup\$

Applying two normal maps is not that bad. Many games apply multiple normal maps already because they're blending between texture layers (e.g. for terrain), so having a normal map representing the larger displacements and another normal map for fine details is pretty reasonable. Check out Blending in Detail by Colin Barré-Brisebois and Stephen Hill for a look at how to combine multiple normal maps.

Sampling the displacement map in a few places to estimate its slope is also a possibility, but think about this: you'll still have to combine the estimated slope with the fine detail normal map somehow. You effectively have two normal maps again, but one of them is being generated on the fly by filtering the displacement map.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.