$darkmode
#include "billboard_rendering.h"#include "gl_common.h"#include "instanced_rendering.h"#include "render_utils.h"#include <assert.h>#include <stddef.h>Functions | |
| void | billboard_group_init (BillboardGroup *group, const SphereInstance *data, int count) |
| Initializes the billboard group and allocates GPU memory. More... | |
| void | billboard_group_update (BillboardGroup *group, const SphereInstance *data, int count) |
| Updates instance data on the GPU. More... | |
| void | billboard_group_update_from_buffer (BillboardGroup *group, GLuint src_buffer, int count) |
| Updates instance data on the GPU by copying from another GPU buffer (e.g. SSBO). More... | |
| static void | setup_billboard_instance_attributes (void) |
| static void | create_billboard_vao (GLuint *vao, GLuint geometry_vbo, GLuint instance_vbo) |
| void | billboard_group_prepare (BillboardGroup *group, GLuint quad_vbo, GLuint wire_quad_vbo, GLuint wire_cube_vbo) |
| Prepares the VAO by linking a shared quad VBO with internal instance data. More... | |
| void | billboard_group_draw (BillboardGroup *group) |
| Executes the instanced draw call for all billboards in the group. More... | |
| void | billboard_group_cleanup (BillboardGroup *group) |
| Releases all GPU resources allocated for the billboard group. More... | |
| void | billboard_group_draw_debug_fill (BillboardGroup *group) |
| Draws filled quads for each instance (for debug transparency). More... | |
| void | billboard_group_draw_debug_quads (BillboardGroup *group) |
| Draws wireframe quads for each instance. More... | |
| void | billboard_group_draw_debug_boxes (BillboardGroup *group) |
| Draws wireframe boxes for each instance. More... | |
Variables | |
| static const int | WIRE_CUBE_VERTEX_COUNT = 24 |
| void billboard_group_cleanup | ( | BillboardGroup * | group | ) |
Releases all GPU resources allocated for the billboard group.
| group | Pointer to the group. |
| void billboard_group_draw | ( | BillboardGroup * | group | ) |
Executes the instanced draw call for all billboards in the group.
| group | Pointer to the group. |
| void billboard_group_draw_debug_boxes | ( | BillboardGroup * | group | ) |
Draws wireframe boxes for each instance.
Assumes the correct shader is already bound.
| group | Pointer to the group. |
| void billboard_group_draw_debug_fill | ( | BillboardGroup * | group | ) |
Draws filled quads for each instance (for debug transparency).
Assumes the correct shader is already bound.
| group | Pointer to the group. |
| void billboard_group_draw_debug_quads | ( | BillboardGroup * | group | ) |
Draws wireframe quads for each instance.
Assumes the correct shader is already bound.
| group | Pointer to the group. |
| void billboard_group_init | ( | BillboardGroup * | group, |
| const SphereInstance * | data, | ||
| int | count | ||
| ) |
Initializes the billboard group and allocates GPU memory.
RESOURCE MANAGEMENT:
| group | Pointer to the group (must be zero-initialized). |
| data | Initial instance data (can be NULL if only allocating). |
| count | Number of instances to allocate for. |
| void billboard_group_prepare | ( | BillboardGroup * | group, |
| GLuint | quad_vbo, | ||
| GLuint | wire_quad_vbo, | ||
| GLuint | wire_cube_vbo | ||
| ) |
Prepares the VAO by linking a shared quad VBO with internal instance data.
| group | Pointer to the group. |
| quad_vbo | VBO containing basic quad geometry (usually from render_utils). |
| wire_quad_vbo | VBO for debug wireframe quad. |
| wire_cube_vbo | VBO for debug wireframe unit box. |
| void billboard_group_update | ( | BillboardGroup * | group, |
| const SphereInstance * | data, | ||
| int | count | ||
| ) |
Updates instance data on the GPU.
Typically used for per-frame updates like sorting or movement.
| group | Pointer to the group. |
| data | New instance data. |
| count | Number of instances to update. |
| void billboard_group_update_from_buffer | ( | BillboardGroup * | group, |
| GLuint | src_buffer, | ||
| int | count | ||
| ) |
Updates instance data on the GPU by copying from another GPU buffer (e.g. SSBO).
Use this when the sorted data is already on the GPU to avoid CPU roundtrips.
| group | Pointer to the group. |
| src_buffer | Handle of the source buffer. |
| count | Number of instances to update. |
|
static |
|
static |
|
static |