Comparison of rendering effects between bump map and normal map

1. What is bump map?

  Bump mapping is a rendering technique in computer graphics used to simulate tiny bump textures on a given surface. By fine-tuning the lighting value of each pixel in the direction of the surface normal, you can add visual bumpiness to a smooth surface.

  In a bump map, each pixel contains a normal vector that represents the direction of the surface at that point. These normal vectors are usually stored as a texture in a two-dimensional image called a bump map. During the rendering process, the lighting calculation results of each pixel are adjusted based on the information of the normal vector, so that the reflection of light on the surface appears to produce a slight bumpy effect.

  Bump mapping can be used to increase the detail and realism of objects, such as simulating concave and convex texture effects on surfaces such as stone, skin, fabric, etc. This technique can be implemented by creating a bump map in the 3D modeling software, or by dynamically generating the bump map during the rendering process.

  It should be noted that bump mapping is only a visual effect and does not change the actual object geometry. It is a computationally efficient technique that adds detail to smooth surfaces without increasing polygon count.

2. What is a normal map?

  Normal mapping is a mapping technology in computer graphics that is used to simulate the effect of bumpy textures on flat surfaces. By providing a normal vector for each pixel, normal maps can make the surface of the rendered object look detailed and concave.

  In a normal map, each pixel contains a normal vector, which represents the direction of the surface at that point. These normal vectors are usually stored as textures in a two-dimensional image called a normal map. During the rendering process, the lighting calculation results of each pixel are adjusted based on the normal information in the normal map, causing the normal vector of the surface to change, thereby presenting a bumpy texture effect.

  Compared to bump maps, normal maps provide a more detailed and realistic bump effect. It can be used to simulate the bumpy textures of various materials, such as stone, wood, metal, etc. Normal maps are usually generated by professional 3D modeling software and used together with the model's texture map.

  It should be noted that the normal map is only a visual effect and does not change the actual object geometry. It is a technique that simulates details during rendering, enhancing the realism and detail of objects.

3. Comparison of bump map and normal map effects

  Below I will use the GLTF editor to show the differences between bump maps and discovery maps.

  Open the GLTF editor  and import an aircraft model in GLB format into the editor, as shown in the figure:

  We use the GLTF editor  to set bump maps for the wings of the aircraft. Steps: 1. Select the fuselage of the aircraft in the scene, and the material settings panel will pop up on the right; 2. Find the bump map settings component in the panel and upload the material map directly. That’s it (the material map is made in advance and saved locally), the effect is as follows:

GLTF editor’s   bump mapping effect on the fuselage

  It doesn't seem like a big problem.

  Let’s look at the normal map again:

The effect of the GLTF editor   on the normal map of the fuselage

  You can see that the fuselage has been somewhat deformed. Why is this?

  Normal maps do not directly cause distortion of the model's geometry. However, when using normal maps, the calculation of vertex normals during rendering may cause some visual distortion.

  When using normal maps, the normals of a vertex are typically calculated based on the model's initial geometric information and then interpolated to determine its exact location on the surface. However, due to the role of the normal map, the normal information in the normal map is used in the lighting calculation process, which makes the lighting effect of the surface have a bumpy feel.

  The interpolation and normal transformation during this calculation process will cause some visual deformation effects. Especially on curved surfaces, corners, or fine details of the model, there may be some smooth transitions or loss of detail due to the interpolation of normals between vertices. Such deformations are usually more pronounced at closer viewing distances from the model.

  In order to minimize the model deformation caused by normal maps, some optimization strategies can be adopted, such as increasing the vertex density of the model, using higher-resolution normal maps, adjusting the interpolation algorithm, or using other geometric detail enhancement techniques. At the same time, for specific scenes and situations, you can also consider using other mapping techniques or more complex geometric models to achieve more accurate effects.

4. Summary

  Bump Mapping and Normal Mapping are texture mapping techniques commonly used in computer graphics to simulate the bumpy effect of the surface. They have some differences in implementation:

working principle:

  • Bump map: Bump map simulates the bump effect by modifying the normal vector of the pixel and changing the lighting calculation results. It is calculated from a grayscale image (grayscale values ​​represent height information) and the normal vector of the model. Adjust the direction and intensity of the normal vector according to the gray value of the pixel in the grayscale image.
  • Normal map: The normal map directly affects the lighting calculation results by providing the normal vector of each pixel. The normal of each pixel is represented by an RGB texture image. During the rendering process, the normal vectors in the normal map are used to adjust the lighting calculations for each pixel to produce a bump effect.

Precision and detail:

  • Bump map: Bump map can simulate a more complex bump effect, and can control the bump levels of different levels of detail through different gray values ​​of the grayscale image. But compared to the normal map, its detail accuracy is slightly lower.
  • Normal map: Normal map can provide higher detail accuracy and can simulate more realistic surface texture. The normal information of each pixel can accurately specify the direction of its surface, making the rendering results more detailed and accurate.

Implementation complexity:

  • Bump map: The implementation of bump map is relatively simple, requiring only a grayscale image and the calculation of the normal vector. It is also relatively efficient in terms of performance.
  • Normal map: The implementation complexity of normal map is relatively high. It needs to generate and store the normal information of each pixel. At the same time, the normal calculation of each pixel needs to be performed during rendering. This will increase memory usage and rendering overhead.

  In general, bump maps are suitable for some simple bump effects, while normal maps are more suitable for providing higher precision and realistic bump texture effects. Depending on the specific usage scenario and needs, you can choose the appropriate mapping technology to achieve the desired visual effect.

  

Original link: The difference between bump maps and normal maps (mvrlink.com)

Guess you like

Origin blog.csdn.net/ygtu2018/article/details/133159494