$darkmode
Coordinator for progressive Image-Based Lighting (IBL) generation. More...
Go to the source code of this file.
Data Structures | |
| struct | IBLCoordinator |
| Manages the progressive IBL generation process. More... | |
Enumerations | |
| enum | IBLState { IBL_STATE_IDLE = 0 , IBL_STATE_LUMINANCE , IBL_STATE_LUMINANCE_WAIT , IBL_STATE_SPECULAR_INIT , IBL_STATE_SPECULAR_MIPS , IBL_STATE_IRRADIANCE , IBL_STATE_DONE } |
| States for the IBL generation state machine. More... | |
Functions | |
| void | ibl_coordinator_init (IBLCoordinator *coord, GLuint shader_spmap, GLuint shader_irmap, GLuint shader_lum_pass1, GLuint shader_lum_pass2) |
| Initializes the IBL coordinator with necessary shader resources. More... | |
| void | ibl_coordinator_cleanup (IBLCoordinator *coord) |
| Cleanups any pending resources held by the coordinator. More... | |
| void | ibl_coordinator_start (IBLCoordinator *coord, GLuint hdr_tex, int width, int height) |
| Starts the IBL generation process for a new HDR texture. More... | |
| IBLState | ibl_coordinator_update (IBLCoordinator *coord, uint64_t frame_count) |
| Advances the state machine by one step (slice or pass). More... | |
| 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. More... | |
| void | ibl_coordinator_reset (IBLCoordinator *coord) |
| Resets the coordinator to IDLE state. More... | |
Coordinator for progressive Image-Based Lighting (IBL) generation.
This module manages the state machine that generates Irradiance and Prefiltered Specular maps from an HDR environment map over multiple frames to avoid stalling the main thread.
| enum IBLState |
States for the IBL generation state machine.
| void ibl_coordinator_cleanup | ( | IBLCoordinator * | coord | ) |
Cleanups any pending resources held by the coordinator.
| coord | Pointer to the coordinator instance. |
| 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.
| coord | Pointer to the coordinator instance. |
| out_hdr_tex | Pointer to receive the HDR texture handle. |
| out_spec_tex | Pointer to receive the specular texture handle. |
| out_irr_tex | Pointer to receive the irradiance texture handle. |
| out_threshold | Pointer to receive the computed luminance threshold. |
| void ibl_coordinator_init | ( | IBLCoordinator * | coord, |
| GLuint | shader_spmap, | ||
| GLuint | shader_irmap, | ||
| GLuint | shader_lum_pass1, | ||
| GLuint | shader_lum_pass2 | ||
| ) |
Initializes the IBL coordinator with necessary shader resources.
| coord | Pointer to the coordinator instance. |
| shader_spmap | Handle to the specular pre-filter shader. |
| shader_irmap | Handle to the irradiance convolution shader. |
| shader_lum_pass1 | Handle to luminance pass 1 shader. |
| shader_lum_pass2 | Handle to luminance pass 2 shader. |
| void ibl_coordinator_reset | ( | IBLCoordinator * | coord | ) |
Resets the coordinator to IDLE state.
| coord | Pointer to the coordinator instance. |
| void ibl_coordinator_start | ( | IBLCoordinator * | coord, |
| GLuint | hdr_tex, | ||
| int | width, | ||
| int | height | ||
| ) |
Starts the IBL generation process for a new HDR texture.
| coord | Pointer to the coordinator instance. |
| hdr_tex | Handle to the source HDR texture (must be valid). |
| width | Width of the HDR texture. |
| height | Height of the HDR texture. |
| IBLState ibl_coordinator_update | ( | IBLCoordinator * | coord, |
| uint64_t | frame_count | ||
| ) |
Advances the state machine by one step (slice or pass).
| coord | Pointer to the coordinator instance. |
| frame_count | Current frame number (for logging purposes). |