zoukankan      html  css  js  c++  java
  • What are draw calls(绘制命令) and what are batches(批)

    Resolution

    It is important to know what are draw calls and what are batches. A draw call is a call to the graphics API to draw objects (e.g draw a triangle), while a batch is a group of draw calls to be drawn together. Batching objects to be drawn together, minimizes the state changes needed to draw each object inside the batch. This is turn leads to improved performance by reducing the CPU cost of rendering the objects.

    Unity groups in batches the objects to be drawn in two ways: Dynamic Batching and Static Batching. Only objects that share properties like textures or materials can be batched together.

    Static batching is the recommended(推荐的) batching technique(技巧) for objects that do not move and it render batched objects very fast. It has a trade off(trade off 权衡) regarding memory, as the meshes need to be combined into a single larger mesh, which is made of the union(并集) of all the smaller individual(个体) meshes in the scene that are marked as static and meet the criteria(标准) to be batched together. To do static batching, you need your objects to be static, thus mark them as static in the inspector.

    Dynamic batching on the other hand, tries to optimize the way non-static objects are rendered, by this transforming their vertices on the CPU, grouping many similar vertices together, and drawing them all in one go. It's limited to small meshes, as batching larger meshes dynamically is more expensive than not batching them.

    To learn more about how to batch objects or what are draw calls please see the official documentation here.

  • 相关阅读:
    d3js selections深入理解
    d3js scales深入理解
    d3js shape深入理解
    如何使用chrome devtool调试Mobile网页?
    为什么有时父元素无法包含子元素?
    base64编码以及url safe base64是怎么工作的?
    古老的CSS同高列问题
    springboot2.0整合redis的发布和订阅
    如何在centos7中设置redis服务器开机自启动
    1.Linux安装redis
  • 原文地址:https://www.cnblogs.com/sweetXiaoma/p/11489731.html
Copyright © 2011-2022 走看看