#include "sh_math.h"
#include "shader.h"
#include <cglm/cglm.h>
#include <pthread.h>
Go to the source code of this file.
|
| void | light_probe_grid_compute_aabb (LightProbeGrid *grid, const void *spheres, int count, size_t stride, float padding) |
| | Computes the AABB for the grid based on sphere instances. More...
|
| |
| void | light_probe_grid_init_cpu (LightProbeGrid *grid, int dim_x, int dim_y, int dim_z) |
| | Initializes the grid structure (CPU only). More...
|
| |
| void | light_probe_grid_init (LightProbeGrid *grid, int dim_x, int dim_y, int dim_z) |
| | Initializes the grid structure, creates SSBO, and starts worker thread. More...
|
| |
| void | light_probe_grid_set_bounds (LightProbeGrid *grid, vec3 aabb_min, vec3 aabb_max) |
| | Sets the grid AABB and computes cell sizes from dimensions. More...
|
| |
| void | light_probe_grid_set_scene (LightProbeGrid *grid, const void *spheres, int count, size_t stride) |
| | Updates the scene data used by the grid (copies it). More...
|
| |
| void | light_probe_grid_update_async (LightProbeGrid *grid) |
| | Signals the worker thread to perform an SH update. More...
|
| |
| void | light_probe_grid_sync (LightProbeGrid *grid) |
| | Checks if results are ready and uploads to GPU. Should be called on main thread. More...
|
| |
| void | light_probe_render_debug (LightProbeGrid *grid, mat4 view, mat4 proj) |
| | Renders debug spheres for the probes. More...
|
| |
| void | light_probe_grid_cleanup (LightProbeGrid *grid) |
| | Cleans up all resources (CPU, GPU, Threads). More...
|
| |
| void | light_probe_grid_free_cpu (LightProbeGrid *grid) |
| | Cleans up CPU resources. More...
|
| |
◆ anonymous enum
Number of 3D textures used for packing SH coefficients (7 = 28 channels for 9 L2 coeffs)
| Enumerator |
|---|
| SH_TEXTURE_COUNT | |
◆ anonymous enum
Starting texture unit for SH 3D textures.
| Enumerator |
|---|
| TEXTURE_UNIT_SH_START | |
◆ light_probe_grid_cleanup()
Cleans up all resources (CPU, GPU, Threads).
◆ light_probe_grid_compute_aabb()
| void light_probe_grid_compute_aabb |
( |
LightProbeGrid * |
grid, |
|
|
const void * |
spheres, |
|
|
int |
count, |
|
|
size_t |
stride, |
|
|
float |
padding |
|
) |
| |
Computes the AABB for the grid based on sphere instances.
- Parameters
-
| grid | Pointer to grid. |
| spheres | Array of sphere instances (generic pointer to avoid GL dep in header if needed). |
| count | Number of spheres. |
| stride | Stride between spheres. |
| padding | Padding to add to the AABB. |
◆ light_probe_grid_free_cpu()
◆ light_probe_grid_init()
| void light_probe_grid_init |
( |
LightProbeGrid * |
grid, |
|
|
int |
dim_x, |
|
|
int |
dim_y, |
|
|
int |
dim_z |
|
) |
| |
Initializes the grid structure, creates SSBO, and starts worker thread.
◆ light_probe_grid_init_cpu()
| void light_probe_grid_init_cpu |
( |
LightProbeGrid * |
grid, |
|
|
int |
dim_x, |
|
|
int |
dim_y, |
|
|
int |
dim_z |
|
) |
| |
Initializes the grid structure (CPU only).
- Parameters
-
| grid | Pointer to grid. |
| dim_x | Grid dimension X. |
| dim_y | Grid dimension Y. |
| dim_z | Grid dimension Z. |
◆ light_probe_grid_set_bounds()
| void light_probe_grid_set_bounds |
( |
LightProbeGrid * |
grid, |
|
|
vec3 |
aabb_min, |
|
|
vec3 |
aabb_max |
|
) |
| |
Sets the grid AABB and computes cell sizes from dimensions.
◆ light_probe_grid_set_scene()
| void light_probe_grid_set_scene |
( |
LightProbeGrid * |
grid, |
|
|
const void * |
spheres, |
|
|
int |
count, |
|
|
size_t |
stride |
|
) |
| |
Updates the scene data used by the grid (copies it).
◆ light_probe_grid_sync()
Checks if results are ready and uploads to GPU. Should be called on main thread.
◆ light_probe_grid_update_async()
Signals the worker thread to perform an SH update.
◆ light_probe_render_debug()
| void light_probe_render_debug |
( |
LightProbeGrid * |
grid, |
|
|
mat4 |
view, |
|
|
mat4 |
proj |
|
) |
| |
Renders debug spheres for the probes.
- Parameters
-
| grid | Pointer to grid. |
| view | View matrix. |
| proj | Projection matrix. |