![openrct2 maps openrct2 maps](https://i.imgur.com/X3mqnjc.png)
There are two possible approaches to expose many textures to the shader at once: array textures and texture atlases. Most OpenGL implementations only allow up to 32 texture samplers in a single shader, which is way too limited. To be able to execute many draw commands that access textures in one draw call, they all need to be accessible from the fragment shader simultaneously.
![openrct2 maps openrct2 maps](https://i.imgur.com/gheFHjp.jpg)
The parameters are derived directly from the OpenGL implementation before it was optimized. There are three possible draw calls and their parameters are defined in structs that can be found in the src/drawing/engines/opengl/DrawCommands.h file. Command buffersÄraw commands are queued in so-called command buffers, named after the constructs in the OpenGL GL_NV_command_list extension and Vulkan API. Flushing here means that they are actually sent to the GPU to be processed. Once an operation is executed that depends on previously drawn contents in one way or another, like the post-processing pass or presentation to the screen, the draw operations that are still in the queue are flushed. The parameters include details like bounds, texture, and tertiary colour. To that effort, all of the draw calls in a single frame are not executed immediately, but added to a queue with their parameters.
![openrct2 maps openrct2 maps](https://user-images.githubusercontent.com/23201434/140837623-e8e612a8-1ffa-42e2-934a-82b6d9121f2b.png)
This is necessary to minimise the overhead of CPU -> GPU communication and state changes on the graphics card. The OpenGL renderer implementation is based around the idea of batching as many drawing operations as possible into a single draw call for the graphics card.