How does the GLTF editor merge meshes of the same material?

1. What is model material batching?

  Model material batching is a technical means mainly used to optimize rendering performance and improve the frame rate of graphics applications. It reduces the number of draw calls during rendering by merging the materials of multiple models.

  In computer graphics, each model has one or more materials that define the appearance properties of the model's surface, such as texture, color, lighting, etc. When rendering a scene, draw calls need to be made for each material of each model, which involves a lot of rendering pipeline overhead and takes up a lot of GPU resources.

  The idea of ​​model material batching is to merge model materials with the same attributes to form a shared material. The specific operation is to integrate the vertex data and texture coordinates of these models and create a new merged material. Then, during the rendering process, these models can be batched all at once, requiring only one draw call, thereby reducing rendering pipeline overhead and the number of GPU resource accesses.

  By batching model materials, rendering performance and efficiency can be greatly improved. Especially in large-scale scenes, if there are a large number of models with the same attributes, using batching technology can significantly reduce the number of draw calls and increase the frame rate. This is important in fields such as game development, virtual reality, and computer graphics to provide a smooth interactive experience while maintaining good visual effects.

  In short, model material batching is a technical means to optimize rendering performance. By merging model materials with the same properties, it reduces the number of draw calls during the rendering process, thereby improving the frame rate and efficiency of graphics applications.

2. What problems can be solved by material batching?

  Model material batching refers to merging meshes of multiple models using the same material for rendering to reduce the number of rendering operations and thereby improve rendering performance. This technology can solve the following problems:

  1. Reduce rendering calls: In a game or application, each time a model is rendered, a series of rendering calls and state switches are required. These operations consume considerable time and resources. Through model material batching, multiple models can be combined into one batch for rendering, thereby reducing the number of rendering calls and improving rendering efficiency.
  2. Reduce CPU overhead: During the rendering process, if there are a large number of small models that need to be rendered, the rendering call of each model will become a CPU bottleneck, causing the CPU to be extremely busy. Through model material batching, multiple models can be combined into one batch for rendering, which reduces the number of rendering calls and thus reduces CPU overhead.
  3. Improve GPU utilization: In graphics rendering, GPU utilization is often affected by rendering calls. Through model material batching, multiple models can be combined into one batch for rendering, which reduces the number of rendering calls and improves GPU utilization. Especially when there are a large number of models with the same or similar materials, the effect is more significant.

3. How to batch model materials

  There are many modeling models on the market that have model batching functions, but due to the complex installation of the software, the large size of the software, and the professional nature of the software, it is more complicated to use. Therefore, using professional modeling software to complete simple model batch operations is not worth the gain.

  The GLTF editor  is a browser-based online model editing tool. There is no need to install software or plug-ins. It can be used by opening the browser. It is easy to operate and very practical.

  The following is an explanation of how to merge models based on the GLTF editor  . First, drag the model into the editor, as shown in the figure:

Before material merging

  You can see from the left panel of the image that the model has many of the same materials.

  So how to use the GLTF editor  to merge materials on the model? It's very simple. You only need to click the second button [Merge Mesh of the same material] on the editor toolbar, and the editor will automatically merge the same materials in the model. After the merger is completed, the modified model will be exported to a local GLB file. .

After material merging

The following is a comparison of rendering efficiency before and after material merging:

Before the model was batched, the FPS was 13

After the model is batched, the FPS is 47

Summarize

  Overall, model material batching can effectively optimize rendering performance by reducing the number of rendering calls, reducing CPU overhead and improving GPU utilization, allowing applications or games to improve frame rates and smoothness while maintaining high image quality. Spend.  

Original link: How to merge Mesh of the same material in the GLTF editor (mvrlink.com) 

Guess you like

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