This article explains how bump and normal mapping works in V-Ray.
What is Bump and Normal Mapping?
Bump and normal mapping are shading effects that add surface detail. Unlike displacement, which creates additional polygons, bump and normal mapping create surface alterations without modifying the underlying geometry. Displacement generates better detail than bump and normal mapping, but bump and normal mapping renders faster than displacement and consumes a lot less memory than displacement.
Bump mapping uses a grayscale image to determine which point of the surface is a bump and which is a dent. It simulates light and shadow areas on the surface to create the effect. Darker colors make for a depth effect, while lighter colors correspond to bumps. Bump mapping offers a quick and efficient way to add surface detail. However, because of the different way it stores information, it generally offers lower-quality effect in comparison to normal maps. It offers less control and less precision over the shading effect. See below the bump map example for visualization of the effect.
The normal map is a color image, where the red, green, and blue channels correspond to one vector axis in 3D space (tangent, bitangent, and normal). Since normal maps use all three directions in a given space, they interact with the scene lighting in a way giving more believable results than bump maps. Normal maps set the surface alterations considering the environment light in the scene, depending on the space used. See below a detailed explanation how normal maps are applied in different spaces.
What are normal, tangent, and bitangent vectors?
A normal vector ("n") is a vector perpendicular to the surface (polygon). It goes right up from the polygon.
A tangent vector ("t") is a parallel vector to the surface (polygon).
One polygon can have many such parallel vectors and they can be arbitrarily chosen. Thus, the bitangent vector ("b"). That is a second vector parallel to the surface, but at the same time perpendicular to both the normal and the tangent vectors.
Having the three vectors defined determines the local coordinate system - tangent, object, world or screen space.
VRayMtl and other materials offer bump and normal mapping parameters, where you can specify how the connected map is applied. Additionally, V-Ray offers the Normal map texture for further control and flexibility.
Bump Map
The bump map is a grayscale image where each color point corresponds to the amount of bump or elevation at that point.
The example here shows a bitmap using white and black colors. The lighter color results in protruded surface area, while the black color appears as dented in the render.
Good use of a bump map is to produce effects such as noise, grain, scratches, etc.
Example of a grayscale bump map and the render result
Normal Map in Tangent Space
Tangent space is a local coordinate system defined by the three vectors - normal, tangent and bitangent. Tangent space is relative to the geometry normal, which makes it versatile. This is the most commonly used type of normal map, as it can be successfully reused in different scenes.
Channel mapping:
- Red – Coordinate of the first tangent direction
- Green – Coordinate of the second tangent direction
- Blue – Coordinate of the surface normal direction. The blue channel should be equal to or exceeding a value of 0.5, so that the normal vector is always above the surface.
A local normal (0.0, 0.0, 1.0) is equivalent to the original surface normal.
The values in the image are usually scaled and translated from [-1, 1] to [0, 1] range for storing in a bitmap image. E.g. the default normal (0.0, 0.0, 1.0) becomes (0.5, 0.5, 1.0), using mid-points in the range.
The bitmap image used for the map should be in Raw color space.
The graphic shows the original geometry normal, tangent and bitangent vectors that define the tangent space. The mapped normal is a new normal vector (coming from the normal map image in tangent space).
Example usage of normal map in tangent space
The most versatile normal map space in terms of usage, is the tangent space. It can be used for small and large scale, moving and deforming objects.
For this example, a normal map in tangent space is used to add surface detail to the totem objects.
Normal Map in Object Space
The normal map uses the object's local axes as coordinates. This means that the normals follow the object's transformation (scale, rotation).
Channel mapping:
- Red – Coordinate of the normal in the object's X direction
- Green – Coordinate of the normal in the object's Y direction
- Blue – Coordinate of the normal in the object's Z direction
The bitmap image should be in Raw color space.
It is useful for creating detailed normal maps tied to specific objects. The disadvantage of this map is since it maps the normals as relative to the object, if the object geometry is deformed, the map cannot be reused.
The values in the image are usually scaled and translated from [-1, 1] to [0, 1] range for storing in a bitmap image. E.g. the default normal (0.0, 0.0, 1.0) becomes (0.5, 0.5, 1.0), using mid-points in the range.
The graphic shows how object space is defined for two different objects - a cube and a sphere.
Normal Map in World Space
The normal map uses the world axes (XYZ of the given 3D application) as coordinates. The bitmap image should be in Raw color space.
This mode is useful for completely static objects (e.g. terrain). Since this map uses the world coordinates, it is not suitable for animated objects changing place or scale.
Channel mapping:
- Red – Coordinate of the normal in the world's X direction
- Green – Coordinate of the normal in the world's Y direction
- Blue – Coordinate of the normal in the world's Z direction
The values in the image are usually scaled and translated from [-1, 1] to [0, 1] range for storing in a bitmap image. E.g. the default normal (0.0, 0.0, 1.0) becomes (0.5, 0.5, 1.0), using mid-points in the range.
The graphic shows a cube relative to the World space coordinate system.
Normal Map in Screen Space
The normal map uses the space shown by the camera (or the viewport, or screen) as a coordinate system.
Channel mapping:
- Red – Coordinate of the normal in the camera's right direction
- Green – Coordinate of the normal in the camera's up direction
- Blue – Coordinate of the normal in the camera's front (depth) direction
The bitmap image should be in Raw color space.
This map mode is useful for geometry that moves together with the camera (e.g. some kind of a lens).
The values in the image are usually scaled and translated from [-1, 1] to [0, 1] range for storing in a bitmap image. E.g. the default normal (0.0, 0.0, 1.0) becomes (0.5, 0.5, 1.0), using mid-points in the range.
The graphic shows a cube relative to the Screen space coordinate system.
Notes
V-Ray uses the OpenGL format for normal maps. Keep this in mind when importing normal maps from a texture painting application, e.g. Substance Painter.