Skip to content

DA4. Discussion: Lighting, Shading, and Texture Mapping

Statement

We will be covering a lot of topics ranging from lighting within our 3D graphics scene to shading, textures, and bump and normal maps during this unit. All of these topics are related because all of them use the properties of illumination (lighting) to create effects.

For this discussion, post an initial response to the following:

  • Discuss the role of lighting in shading and bump and normal maps.
  • Explain how bump and normal maps use light and shadow to create the illusion of texture.

Answer

Introduction

A full scene in computer graphics (CG) is composed of many objects, each with its own geometry and material. We see things in real life because of the light hits them and then get reflected to our eyes. The same principle is applied in CG; light sources are used to illuminate the scene, and we see the objects based on their interactions with the light from these sources.

The material of an object involves multiple layers that each has its own interactions with the light, and the final appearance of the object is a combination of these interactions. Shading and texture mapping are two of these layers; and the image below shows a hippo object (model) and how it looks after applying shading and texture mapping (MIT, 2020).

Image 1: Effect Of Shading And Texture Mapping On A Hippo Object (MIT, 2020)
Effect Of Shading And Texture Mapping On A Hippo Object

Role of Lighting in Shading and Bump and Normal Maps

There are different types of lights that can be used in GC. Ambient light is the most basic and most used light; it is a constant light that illuminates the entire scene similar to weak light of a cloudy day. Directional light is used to simulate a light source that emits light in a single direction that travels infinitely far and is used to simulate sunlight. Other types of lights include point light and spot light (UoPeople, 2024).

Shading is the process of determining the color of every pixel in the frame buffer based on evaluating the context around it (objects, lights, etc.). The shading process is done by calculating the intensity of the light that hits the object and then applying the material properties of the object to determine the final color of the pixel.

Texture mapping is adding another surface layer to the object to give it a more realistic appearance. The texture is applied to the object by mapping the texture coordinates to the object’s surface that are stored in a texture map such as normal and bump maps. Normal and bump maps modify the shading of an object to simulate a 3D texture without adding more geometry; that is, they create the illusion of depth on a 2D surface (UoPeople, 2024).

Bump and Normal Maps Use Light and Shadow to Create the Illusion of Texture

Both bump and normal maps create the illusion of depth by manipulating the shading of an object. Bump maps store an 8-bit value that holds a gray scale (shadow) value for each pixel that represents relative height to the surface; when the gray scale is high it shows a up bump and down bump when it is low. The problem is that appearance relies on the angle of view, and a wrong view angle may break the scene (Pluralsight, 2014).

Normal maps work in a similar way but are more accurate as they store a value that holds the x, y, and z components of the normal vector for each pixel; hence, they create a 3D shadow that can be viewed from any angle (Pluralsight, 2014). These maps work by modifying the normal vector of each pixel, and the deviation of the normal from the pixel’s original normal changes its response to light and shadow, creating the illusion of depth (Unity Technologies, 2024).

Conclusion

To conclude, lighting is a crucial part of shading and texture mapping in CG. Before rendering any pixel, the rendering engine computes incoming light and consults any texture maps to determine the the deviation from the original color and computes the final color of the pixel. Shading, Normal, and Bump maps are all tools that use light and shadow to modify original color of the pixel to create more realistic scenes.

References

‌ ‌