10 #ifndef IBL_COORDINATOR_H
11 #define IBL_COORDINATOR_H
85 GLuint irmap_program, GLuint lum_pass1_program,
86 GLuint lum_pass2_program);
122 GLuint* out_spec_tex, GLuint* out_irr_tex,
123 float* out_threshold);
Common OpenGL definitions, RAII helpers, and utilities.
void ibl_coordinator_init(IBLCoordinator *coord, GLuint spmap_program, GLuint irmap_program, GLuint lum_pass1_program, GLuint lum_pass2_program)
Initializes the IBL coordinator with necessary shader resources.
Definition: ibl_coordinator.c:131
void ibl_coordinator_reset(IBLCoordinator *coord)
Resets the coordinator to IDLE state.
Definition: ibl_coordinator.c:158
IBLState
States for the IBL generation state machine.
Definition: ibl_coordinator.h:21
@ IBL_STATE_SPECULAR_INIT
Definition: ibl_coordinator.h:25
@ IBL_STATE_SPECULAR_MIPS
Definition: ibl_coordinator.h:26
@ IBL_STATE_IDLE
Definition: ibl_coordinator.h:22
@ IBL_STATE_DONE
Definition: ibl_coordinator.h:29
@ IBL_STATE_IRRADIANCE
Definition: ibl_coordinator.h:28
@ IBL_STATE_LUMINANCE
Definition: ibl_coordinator.h:23
@ IBL_STATE_LUMINANCE_WAIT
Definition: ibl_coordinator.h:24
void ibl_coordinator_start(IBLCoordinator *coord, GLuint hdr_tex, int width, int height)
Starts the IBL generation process for a new HDR texture.
Definition: ibl_coordinator.c:179
void ibl_coordinator_cleanup(IBLCoordinator *coord)
Cleanups any pending resources held by the coordinator.
Definition: ibl_coordinator.c:148
int ibl_coordinator_get_results(IBLCoordinator *coord, GLuint *out_hdr_tex, GLuint *out_spec_tex, GLuint *out_irr_tex, float *out_threshold)
Retrieves the results of the IBL generation.
Definition: ibl_coordinator.c:416
IBLState ibl_coordinator_update(IBLCoordinator *coord, uint64_t frame_count)
Advances the state machine by one step (slice or pass).
Definition: ibl_coordinator.c:374
Physically-Based Rendering (PBR) and Image-Based Lighting (IBL) utilities.
High-precision performance measurement (CPU and GPU).
Manages the progressive IBL generation process.
Definition: ibl_coordinator.h:36
GLuint lum_pass2_program
Definition: ibl_coordinator.h:57
int current_slice
Definition: ibl_coordinator.h:45
GLuint pending_spec_tex
Definition: ibl_coordinator.h:50
float threshold
Definition: ibl_coordinator.h:44
PBRIrrUniforms irr_uniforms
Definition: ibl_coordinator.h:63
PBRLumUniforms lum_uniforms
Definition: ibl_coordinator.h:65
GLuint irmap_program
Definition: ibl_coordinator.h:55
int width
Definition: ibl_coordinator.h:42
double stage_gpu_max
Definition: ibl_coordinator.h:71
int total_slices
Definition: ibl_coordinator.h:46
int total_mips
Definition: ibl_coordinator.h:41
int current_mip
Definition: ibl_coordinator.h:40
double stage_gpu_sum
Definition: ibl_coordinator.h:72
GLsync lum_sync
Definition: ibl_coordinator.h:39
PerfTimer global_timer
Definition: ibl_coordinator.h:68
int stage_slice_count
Definition: ibl_coordinator.h:73
GLuint pending_irr_tex
Definition: ibl_coordinator.h:51
PBRSpecUniforms spec_uniforms
Definition: ibl_coordinator.h:61
double stage_gpu_min
Definition: ibl_coordinator.h:70
PerfTimer stage_timer
Definition: ibl_coordinator.h:69
GLuint lum_pass1_program
Definition: ibl_coordinator.h:56
int height
Definition: ibl_coordinator.h:43
IBLState state
Definition: ibl_coordinator.h:38
GLuint spmap_program
Definition: ibl_coordinator.h:54
GLuint pending_hdr_tex
Definition: ibl_coordinator.h:49
CPU high-precision timer.
Definition: perf_timer.h:23