$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
ssbo_rendering.h File Reference

Buffer-backed instancing for ultra-large-scale rendering. More...

#include "gl_common.h"
#include <cglm/types.h>
Include dependency graph for ssbo_rendering.h:
This graph shows which files directly or indirectly include this file:

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...
 

Detailed Description

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.

Function Documentation

◆ ssbo_group_bind_mesh()

void ssbo_group_bind_mesh ( SSBOGroup group,
GLuint  vbo,
GLuint  nbo,
GLuint  ebo 
)

Binds a mesh (VBO/EBO) to the SSBO VAO.

Parameters
groupPointer to the struct.
vboVertex buffer.
nboNormal buffer.
eboElement (index) buffer.

◆ ssbo_group_cleanup()

void ssbo_group_cleanup ( SSBOGroup group)

Releases GPU resources.

Parameters
groupPointer to the struct.

◆ ssbo_group_draw()

void ssbo_group_draw ( SSBOGroup group,
size_t  index_count 
)

Renders the group using instanced drawing.

Parameters
groupPointer to the struct.
index_countNumber of indices per sphere mesh.

◆ ssbo_group_init()

void ssbo_group_init ( SSBOGroup group,
const SphereInstanceSSBO data,
int  count 
)

Initializes an SSBO group with instance data.

Parameters
groupPointer to the struct.
dataArray of instance data.
countNumber of instances.