Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
Loading...
Searching...
No Matches
billboard_renderer.h File Reference

Unified billboard sorting and rendering system. More...

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

Go to the source code of this file.

Data Structures

struct  BillboardRenderParams
 Parameters required to execute a billboard rendering pass, decoupled from Scene. More...
 
struct  BillboardRenderer
 Manages billboard rendering buffers, VAO state, and the internal sorter. More...
 

Functions

void billboard_renderer_init (BillboardRenderer *renderer, int initial_capacity)
 Initializes the billboard renderer and allocates internal sorter buffers.
 
void billboard_renderer_prepare (BillboardRenderer *renderer, GLuint quad_vbo, GLuint wire_quad_vbo, GLuint wire_cube_vbo)
 Prepares the VAO by linking the shared quad, wire quad, and wire cube VBOs.
 
void billboard_renderer_draw (BillboardRenderer *renderer, const BillboardRenderParams *params, GLuint pbr_billboard_shader, GLuint debug_line_shader, void *billboard_ubo_ptr)
 Executes the sorting, UBO upload, and drawing commands for all billboards.
 
void billboard_renderer_cleanup (BillboardRenderer *renderer)
 Releases all GPU resources allocated for the billboard renderer.
 

Detailed Description

Unified billboard sorting and rendering system.

Function Documentation

◆ billboard_renderer_cleanup()

void billboard_renderer_cleanup ( BillboardRenderer *  renderer)

Releases all GPU resources allocated for the billboard renderer.

Parameters
rendererPointer to the renderer struct.
Here is the call graph for this function:

◆ billboard_renderer_draw()

void billboard_renderer_draw ( BillboardRenderer *  renderer,
const BillboardRenderParams *  params,
GLuint  pbr_billboard_shader,
GLuint  debug_line_shader,
void *  billboard_ubo_ptr 
)

Executes the sorting, UBO upload, and drawing commands for all billboards.

Parameters
rendererPointer to the renderer struct.
paramsStateless parameter block.
pbr_billboard_shaderShader used for the primary PBR pass.
debug_line_shaderShader used for the wireframe debug overlays.
billboard_ubo_ptrMapped UBO pointer to copy the BillboardUBO struct to.
Here is the call graph for this function:

◆ billboard_renderer_init()

void billboard_renderer_init ( BillboardRenderer *  renderer,
int  initial_capacity 
)

Initializes the billboard renderer and allocates internal sorter buffers.

Parameters
rendererPointer to the renderer struct.
initial_capacityExpected number of instances.
Here is the call graph for this function:

◆ billboard_renderer_prepare()

void billboard_renderer_prepare ( BillboardRenderer *  renderer,
GLuint  quad_vbo,
GLuint  wire_quad_vbo,
GLuint  wire_cube_vbo 
)

Prepares the VAO by linking the shared quad, wire quad, and wire cube VBOs.

Parameters
rendererPointer to the renderer struct.
quad_vboVBO containing basic quad geometry.
wire_quad_vboVBO for debug wireframe quad.
wire_cube_vboVBO for debug wireframe unit box.
Here is the call graph for this function: