Bump mapping

Bump mapping is a technique that is used for reducing the vertex count of a mesh and involves simulating the finer details, such as bumps, on the surface of an object. The required simulation is performed by manipulating the normals of the object before being used for the lighting calculations.

While normal mapping is a suitable technique for most uses, it is not as effective in VR as the player can easily change their viewing angle of a normal mapped texture. Therefore, the illusion of depth is broken as this change of perspective is not accounted for within the normal mapping technique.

Also, normal mapping cannot account for the use of stereoscopic lenses that are used in VR headsets as the normal is only generated from one viewpoint. Therefore, each eye receives the same normal which looks incorrect to the human eye.

Video comparing different methods of bump mapping

The following video shows an example of both normal mapping, and parallax occlusion mapping:


Mitigation technique - Normal mapping

Normal mapping is the most common implementation of bump mapping and involves creating both a high and low polygon version of a mesh during the modeling process. A normal map is then created by exporting from the high polygon version, and the normals of the finer details are then stored in the normal map texture.

When rendering, the fragment shader samples from the normal map and normals are generated from the sampled values. These generated normals are then combined with the surface normals of the low polygon version before being used when calculating lighting. The lighting then shows the finer surface details, without the need to render the individual vertices of theses details.

While normal mapping is, typically, not as effective in VR, normal maps are still more effective than a flat material. Especially when careful consideration is given to the positioning of the normal maps when lighting a scene.

Mitigation technique - Parallax occlusion mapping

Parallax occlusion mapping is a technique similar to normal mapping. However, it accounts for the angle of the viewer, relative to the surface normal, when displacing the texture coordinates.

Therefore, at steeper viewing angles, the texture coordinates are displaced by a higher degree. This maintains the illusion of depth.

Parallax occlusion mapping is a computationally expensive process. So only use this technique on smaller materials that the viewer can get close to. Textures that are further away gain little from parallax occlusion mapping because the viewing angle cannot change considerably.

Implementing normal mapping in Unity

Normal mapping is available in many built-in shaders within Unity.

To add normal mapping to a material:

  1. Select the material in the Project Window.
  2. Open the Material Inspector Panel and select a shader that includes support for normal mapping, such as Standard, Universal Render Pipeline, or Bumped Diffuse for mobile.
  3. Finally, set the required Normal Map texture.

Implementing parallax occlusion mapping in Unity

Parallax occlusion mapping can be done using the built-in shaders in Unity.

To add parallax occlusion mapping to a material:

  1. Select the material in the Project Window.
  2. Open the Material Inspector Panel and select a shader that supports parallax diffuse mapping. For example, the Standard shader.
  3. Finally, set the required Albedo, Normal Map, and Height Map texture.

Previous Next