To understand how this is done, look at the following sample code. These are the vectors that represent the UVW axes of the texture in 3D and can be used to perturb the normal. The bump basis vectors are used for this purpose. Given the gradient in UV space, you need to determine what direction in 3D (XYZ) space to perturb the corresponding normal. If you have a bump in a texture, for example a steep uphill, then you can perturb the normal to make it look like there is a steep hill. This gradient of values gives a direction in UV space where you can perturb the surface normal. You can then define a gradient on the surface, which can be thought of as the downhill or uphill directions. The 2D bump map can be thought of as its own surface with bright areas as hills and dark areas as valleys. The space along the surface is called the UV space. Rather, the surface normal is perturbed according to the information in the bump map to create variations in the smooth surface.Ī 2D bump map is applied to the surface of an object. Bump mapping is a technique that enables a surface to appear wrinkled or dimpled without the need to model these depressions geometrically.