Reduce the number of drawcalls for ngui 3

Source: Internet
Author: User

After upgrading to ngui3, the number of drawcalls increased from 5 to 17 to 8. It should not be ngui. Later, I sorted out two points:
1. For the same Atlas, the number of drawcalls depends on the number of panels (actually the number of uipanel scripts ). For example, I have two sprite instances. The two sprite instances belong to the same Atlas but are located in different panels. In this case, the number of drawcall is 2, while that of ngui 2 is 1. We recommend that you use only one panel.
2. For sprite under the same panel of different Atlas, you can adjust the display level through depth. The Z value is useless, which is exactly the opposite of ngui 2. In addition, the depth values of Sprite of different atlas should not be interspersed back and forth. For example, in Atlas A, there are two sprite A and AA, and depth is 1 and 3, respectively. In Atlas B, there are two sprite B and BB, and depth is 2 and 4, respectively, then the total number of drawcall is 4 rather than 2. (In ngui 3, you can click panel to view the call details of each drawcall In the Inspector panel)

Simply put, the number of drawcalls is not only related to the number of Atlas, but also to the Atlas call sequence. It is best to use only one panel when using it. Sprite depth of different atlas should not be interspersed as much as possible.

Note: It is best to put the same panel in the same Atlas.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.