1 Command buffer introduction
Command buffer: Buffer used to store rendering commands .
The Command buffer holds a list of rendering commands, such as (set render target, draw mesh, etc.), which can be set to be executed at different points during camera rendering .
CommandBuffer literally means a command. It is a custom rendering command provided by Unity to developers. It depends on the camera and is used to expand the rendering effect of the rendering pipeline. We can specify the CommandBuffer according to the parameters to add execution commands at the green points:
Use the Command buffer to help us tell the pipeline what kind of drawing operation to perform.
In OpenGL, during the rendering process, Buffer Objects such as VAO, VBO, and FBO are frequently bound due to the needs of the rendering process. Such repetitive operations are cumbersome and lack scalability. Therefore, some repetitive operations can be extracted and encapsulated: use the Shader class to be responsible for compilation, add some reading models to the Model class, bind VAO, VBO operation functions, etc.
: VAO vertex array buffer object, VBO primitive index buffer object, FBO frame buffer object.
By dividing the rendering process into Passes and writing them one by one, it is easier to identify what should be done in each rendering process and what results should be calculated.