Introduction of some graphics concepts, personal excerpts or sorting, as the entry quotes of personal articles;
Draw Call:
Simply put, the CPU calls the image programming interface, such as the glDrawElements command in OpenGL or the DrawIndexedPrimitive command in DirectX, to command the GPU to perform rendering operations;
The reason for the performance in Draw Call is generally the CPU; the reason is that before each Draw Call is called, the CPU needs to send a lot of content to the GPU, including data, status, and commands. At this stage, the CPU needs to complete a lot of work. For example, check the rendering status, etc.; once the CPU completes these preparations, the GPU can start this rendering; GPU rendering capabilities are very strong, rendering 200 or 2000 triangles is usually no difference, if there are too many Draw Calls, the CPU Will spend a lot of time on submitting Draw Call, causing CPU overload;
To minimize Draw Calls, you can use the idea of batch processing, that is, to merge many small Draw Calls into one large Draw Call; merge processing is more suitable for those static objects, such as objects that will not move. These static objects are only It needs to be merged once; dynamic objects can also be merged, but because they are constantly moving, each frame needs to be merged again and then sent to the GPU, which will have a certain impact on time and space;