Detailed explanation of SetPass Call in stats in Unity

Simple understanding of SetPassCall: Before calling DrawCall, before drawing this Pass, all rendering state configurations or BUFFER settings that need to be set are considered as the content of SetPassCall. Or called: SetGPUDataBeforeDraw will be more suitable for understanding (set GPU data before drawing, these data include rendering system, such as: DX or OpenGL status value, or Buffer data)

VBO is Vertex Buffer Object (vertex buffer object), vertex data block, in video memory, can be directly accessed by GPU.

IBO is Index Buffer Object (index buffer object), also known as EBO (Element Buffer Object, element buffer object). The index data block, in the video memory, can be directly accessed by the GPU.

VAO is Vertex Array Object (Vertex Array Object), which is used to record the context information of vertex attributes (Vertex Attribute) and IBO in video memory. After creating and binding a VAO, subsequent vertex attribute calls will be stored in this VAO.

Generally, in OpenGL, to draw an object is to provide, VBO, IBO (IBO does not necessarily need to be provided, you can use DrawArray to draw directly through VBO, if you use DrawArrayIndex, you need IBO, the previous VBO, IBO can also pass VAO is set after unified binding), and then specify the shader (VS (vertex shader), FS (fragment shader), other on-demand), you can call the DC (DrawCall) API to draw

In Unity's ShaderLab, you can see the code with the Pass block

In fact, the code of each Pass block is a process that can be used for complete SetDrawState, DrawCall

Because ShaderLab specifies a part of the setting configuration of the drawing state before DrawCall, such as: ZTest, ZWrite, Cull, Blend, ColorMask, Stencil, etc., and #param vert XXX, #param frag XXX in Pass are our VS, FS

Guess you like

Origin blog.csdn.net/Ling_SevoL_Y/article/details/130221073