Open In App

Normal Mapping in Computer Graphics

Last Updated : 29 Nov, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Computer Graphics has improved a lot in recent years. Nowadays it is much more realistic whether it is animated 3D videos or games. However, rendering such graphics with great detail can be quite hardware-intensive. That’s where normal mapping comes into the picture. It is a technique in computer graphics that uses mathematical computations to create detailed and realistic graphics without using extra polygons. It is a popular method for optimizing the rendering of computer graphics and adding details to it simultaneously. This technique uses something called normal maps which is a 2D image that contains information about the normals of the 3D object. In this article, we will look at what exactly is normal mapping.

Terminologies of Normal Graphics

Before heading into the article we need to look at some terminologies used in this article:

  • Polygons: In computer graphics, 3D objects are made of 2D shapes such as triangles or rectangles. These 2D shapes are called polygons. The more polygons a model has the more detailed it will look and the more computation it requires to render.
  • Normal Maps: Normal maps are 2D colorful images that show information about the normal vectors of 3D objects. A pixel in a normal map has three channels R, G, and B whose values represent the X, Y, and Z values of the normal vector of that point. For example, if a pixel is completely red meaning that its RGB value is (1,0,0), then the normal of the vector would point in the X direction.

What is Normal Mapping?

3D models are made up of polygons. The more polygons a model has the more detailed it will look. However, increasing the number of polygons in a model also makes it more complex and the more CPU processing it requires. So that’s where normal maps come into play. At its core, normal mapping revolves around one core concept: surface normals. As discussed in the previous section, normal maps are just texture images where each pixel stores the object’s surface normal vector in the form of RGB colours. Here red channel contains the value of the X axis, the green channel contains the value of the Y axis and the blue channel contains the value of the Z axis. Together, the RGB colour represents the value of the surface normal of that point.

How Surface Normal is Useful?

Because a surface normal vector tells a lot about the object’s geometry and by geometry, I mean all the intricate details of the object. For example, a normal map of a brick wall can tell us about all the intricate details, gaps, bumps, crevices, and cracks on it. The higher the resolution of the normal map the more details it shows. Now you may wonder how does computer uses those normal maps. When a 3D model is viewed in the computer under a light source, the software simulates light rays from the light source which hit the model and reflect away. When these rays hit the camera the model is visible to the screen (similar to how our eyes see real-world objects). Now when there are more polygons, more light rays are required to render the model, making the calculation very complex and time-consuming.

But if we use the normal maps we can utilize the surface normal vector data in it, so we can re-create a more detailed look with a low polygon model as if it were a detailed model. Normal mapping modifies the way light interacts with the model to create a more detailed look without modifying the underlying geometry. Thus, they can simulate minute surface details such as crevices, bumps, scratches, wrinkles, cracks, gaps and so on. Normal maps are computationally less intensive than polygons. Due to this, they are widely used in 3D software and video games.

This is a normal 3D model with very less polygons, you can see at the edges that the model is plain. This is an example of a model with a low amount of polygons.

normal

low polygon model

This is a 3D model with a high amount of polygons. Look at the edges and see that it is in the shape of the rocks the, same as the texture image. However, this model requires a lot of computation.

with_disp

high polygon model

This is the same as the first model but with normal maps. You can see the details that normal maps show. The shadows and minute details make it look more realistic. If you look at the edges, they are not bumpy like the second one. This denotes that normal maps only create an illusion without modifying the underlying geometry.

with_normal_map

a model with normal mapping

Use of Normal Maps

There are several places where you can see normal maps being used:

  • 3D modelling and texture painting software: 3D modelling software like Blender, Maya, 3DS Max, Cinema 4D, Houdini, and Zbrush and texture painting software such as Adobe Substance Painter extensively use normal maps.
  • Game engines: Game engines such as Unity, Unreal Engine, and Godot also use normal maps for creating a detailed view of the characters, background scenery and other 3D assets.
  • Shader programming language: Shader programming languages such as OpenGL and Vulkan also use normal maps.

Advantages of Normal Mapping

  • Detailed surfaces: Using normal maps along with 3D objects makes them look much more realistic having a detailed surface. They capture every minute detail of the model.
  • Efficient computation: Normal maps require fewer calculations and produce better results than using extra polygons in the object mesh. They are computationally less intensive.
  • Reusability: Once a normal map is generated it can be reused again and again. However, if the object is made up of actual polygons then it may require computations every time it is rendered, which is not the case with normal mapping.
  • Memory efficient: Normal maps are stored in texture images which are smaller in size than actual geometry information.

Disadvantages of Normal Mapping

  • Limited use: Normal maps do not modify the underlying geometry, so they are suitable for only creating small details in the geometry. In other cases, the actual geometry should be modified.
  • Creating normal maps: Creating high-quality normal maps requires special skills and specialized software. In some cases, the normal maps are needed to be created manually, which is a difficult task.

Conclusion

Despite some limitations, normal mapping has proved to be an effective technique for creating detailed and realistic computer graphics. It creates a perfect balance between the performance and visual details in a 3D model. However, normal mapping should be used only when applicable and relevant otherwise they may end up creating artifacts and unintended behaviour in the model.

Frequently Asked Questions

1. How are normal maps created?

Normal maps can be created by using 3D modelling software such as Blender, Maya, 3DS Max or it can be hand crafted manually with image editing software such as Adobe Photoshop or specialized software such as Substance Painter.

2. Can normal maps be used with 2D images, or are they exclusive to 3D models?

Normal mapping is primarily designed for 3D models to simulate three-dimensional surface details.

3. What are bump maps? How is it different from normal maps?

Bump maps are grayscale images that stores information about only the height of the model. Normal map stores the direction of the normal vectors which makes it much more detailed than bump maps. Bump maps are much more easier to generate than a normal map.

4. How are normal maps useful in video games?

Normal maps are useful in simulating realistic details such as wrinkles, gaps, bumps etc. They also help in adding details to game assets and terrains as well.

5. Are there any limitations to using normal mapping in certain scenarios?

Normal mapping does not alter the actual geometry of the object. If the model is viewed from very close distance may reveal the lack of actual depth in details in the model.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads