|
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
|
#include "billboard_renderer.h"#include "billboard_sorter.h"#include "bool_utils.h"#include "gl_common.h"#include "render_utils.h"#include "scene_uniforms.h"#include "sphere_types.h"#include "utils.h"#include <assert.h>#include <stddef.h>#include <string.h>Functions | |
| static void | create_billboard_vao (GLuint *vao, GLuint geometry_vbo, GLuint instance_vbo) |
| 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. | |
| static void | billboard_renderer_update_from_buffer (BillboardRenderer *renderer, GLuint src_buffer, int count) |
| static void | update_billboard_ubo (const BillboardRenderParams *params, void *billboard_ubo_ptr) |
| static void | draw_primary_pass (BillboardRenderer *renderer, GLuint pbr_billboard_shader, int instance_count) |
| static void | update_debug_uniform_locations (BillboardRenderer *renderer, GLuint debug_line_shader) |
| static void | draw_debug_overlays (BillboardRenderer *renderer, const BillboardRenderParams *params, GLuint debug_line_shader, GLuint sorted_ssbo) |
| 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. | |
Variables | |
| static const int | WIRE_CUBE_VERTEX_COUNT = 24 |
| void billboard_renderer_cleanup | ( | BillboardRenderer * | renderer | ) |
Releases all GPU resources allocated for the billboard renderer.
| renderer | Pointer to the renderer struct. |
| 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.
| renderer | Pointer to the renderer struct. |
| params | Stateless parameter block. |
| pbr_billboard_shader | Shader used for the primary PBR pass. |
| debug_line_shader | Shader used for the wireframe debug overlays. |
| billboard_ubo_ptr | Mapped UBO pointer to copy the BillboardUBO struct to. |
| void billboard_renderer_init | ( | BillboardRenderer * | renderer, |
| int | initial_capacity | ||
| ) |
Initializes the billboard renderer and allocates internal sorter buffers.
| renderer | Pointer to the renderer struct. |
| initial_capacity | Expected number of instances. |
| 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.
| renderer | Pointer to the renderer struct. |
| quad_vbo | VBO containing basic quad geometry. |
| wire_quad_vbo | VBO for debug wireframe quad. |
| wire_cube_vbo | VBO for debug wireframe unit box. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |