$darkmode
Buffer-backed instancing for ultra-large-scale rendering. More...
Go to the source code of this file.
Data Structures | |
| struct | SphereInstanceSSBO |
| Aligned structure for SSBO storage (std430 layout). More... | |
| struct | SSBOGroup |
| GPU resources for an SSBO-based render group. More... | |
Functions | |
| void | ssbo_group_init (SSBOGroup *group, const SphereInstanceSSBO *data, int count) |
| Initializes an SSBO group with instance data. More... | |
| void | ssbo_group_bind_mesh (SSBOGroup *group, GLuint vbo, GLuint nbo, GLuint ebo) |
| Binds a mesh (VBO/EBO) to the SSBO VAO. More... | |
| void | ssbo_group_draw (SSBOGroup *group, size_t index_count) |
| Renders the group using instanced drawing. More... | |
| void | ssbo_group_cleanup (SSBOGroup *group) |
| Releases GPU resources. More... | |
Buffer-backed instancing for ultra-large-scale rendering.
This module uses Shader Storage Buffer Objects (SSBO) to pass instance data to the shaders. SSBOs allow for much larger data sets than standard uniform buffers or vertex attributes on some hardware.
| void ssbo_group_bind_mesh | ( | SSBOGroup * | group, |
| GLuint | vbo, | ||
| GLuint | nbo, | ||
| GLuint | ebo | ||
| ) |
Binds a mesh (VBO/EBO) to the SSBO VAO.
| group | Pointer to the struct. |
| vbo | Vertex buffer. |
| nbo | Normal buffer. |
| ebo | Element (index) buffer. |
| void ssbo_group_cleanup | ( | SSBOGroup * | group | ) |
Releases GPU resources.
| group | Pointer to the struct. |
| void ssbo_group_draw | ( | SSBOGroup * | group, |
| size_t | index_count | ||
| ) |
Renders the group using instanced drawing.
| group | Pointer to the struct. |
| index_count | Number of indices per sphere mesh. |
| void ssbo_group_init | ( | SSBOGroup * | group, |
| const SphereInstanceSSBO * | data, | ||
| int | count | ||
| ) |
Initializes an SSBO group with instance data.
| group | Pointer to the struct. |
| data | Array of instance data. |
| count | Number of instances. |