Understanding Normal Map

The following page helps you understand how normal maps work.

Description

A normal map is a type of texture that you can use as input of a Texture Mapping in Speos to augment the detail of surfaces without increasing the number of polygons of the geometry. It stores information about the directions of the normals of a surface, which are vectors perpendicular to the surface at each point. This information is used to simulate the effects of lighting, giving the appearance of complex surface details such as bumps, grooves, and other textures.

Thus, normal maps are used to create the illusion of a more detailed surface by affecting how light interacts with it. This can make a geometry look much more complex and realistic.

Normap Map Principle

Normal maps do not modify the geometry. Instead, normal maps modify the normal vectors that are used in lighting calculations. The eye is tricked into seeing detailed textures that are not actually present in the geometry.

Normal maps use RGB images where the colors represent the X, Y, and Z components of the normal vectors. The red channel corresponds to the X axis, the green channel to the Y axis, and the blue channel to the Z axis.

When an incident ray hits the virtual surface based on the normal map, the normal map vector of this virtual surface is used to define the direction of the reflected ray.



Normal Map Vector Calculation

The normal map vector is calculated using the X, Y, Z components based on the RGB color of the point. However, there are differences in the mapping calculation of the X, Y, Z components between Computer Graphics input data and Speos input data.

The values in the table below are in 8-bit. But you can define a normal map in 16-bit for higher accuracy.

Computer Graphics mapping Speos mapping
  • X: -1 to +1 : Red: 0 to 255
  • Y: -1 to +1 : Green: 0 to 255
  • Z: 0 to -1 : Blue: 128 to 255
  • X: -1 to +1 : Red: 0 to 255
  • Y: -1 to +1 : Green: 0 to 255
  • Z: 0 to -1 : Blue: 0 to 255

As you can see, the B pixel value for the Z component is ranged [128;255] for Computer Graphics, whereas the whereas the B pixel value for the Z component is ranged [0;255] for Speos. This allows more accuracy, however this difference causes the normal map vector to change when you input a normal map coming from a third party solution.

As a consequence, you will require to adjust the normal map for the B pixel value on the range [0;255].