Normal-Tangent Mirror Test Normal-Tangent Test Orientation Test

Description

This asset is part of the KhronosGroup/glTF-Sample-Models asset repository.

Description sourceAsset source

Normal-Tangent Test

Screenshot

screenshot

Description

This model compares normal maps of various orientations to actual geometry, to test if tangent vectors are being calculated and handled correctly. Note that this model (NormalTangentTest) does not supply tangent vectors, and specifically tests a rendering engine's ability to generate the tangent vectors at runtime. To test supplied tangent vectors, see NormalTangentMirrorTest.

This test is best performed with an environment map that contains a clear horizon line, so it is easy to spot if the reflection of the horizon is level. The screenshot above shows a successful render of this model from the front. All of the test blocks show similar reflections.

Top down

Top-down View

Viewing off-axis, such as top-down in this case, breaks the illusion provided by normal-mapping. From this angle, the viewer can see the difference between real geometry on the left test cells, and normal-mapped quads on the right. Normal-mapping works best when viewed face-on.

Back Side

Back-side View

The back of the model shows concave geometry and normal maps, like looking into a set of mirror-bowls. It is expected to see the sky below the ground in the reflections. Above is a correct rendering of the back.

Problem: Flipped Y Axis (or flipped green channel)

Incorrect flipped Y

In the above image, note the test cells on the right half of each pair. A red border has been added for emphasis on the incorrect results. Here, the real geometry reflects level horizon lines, but the normal-mapped geometry appears to reflect several different orientations.

This is a common problem, that often indicates the rendering engine has mis-interpreted the direction of the normal Y vector, supplied by the green channel of the normal map. Some systems intentionally use or expect left-handed normal maps, however, glTF specifies that its own normal maps should use the OpenGL convention with right-handed coordinates. This issue can often be fixed by flipping the normal Y vector, or inverting the intensity of the green channel of the normal map. Fixes should be applied such that glTF models contain only the specified OpenGL normal convention, and rendering engines automatically adapt this to their own internal convention as needed.

License Information

Copyright 2017-2018 Analytical Graphics, Inc. CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/ Model and textures by Ed Mackey.