$darkmode
Environment and IBL management module. More...
#include "app_settings.h"#include "async_loader.h"#include "gl_common.h"#include "ibl_coordinator.h"#include "postprocess.h"Go to the source code of this file.
Data Structures | |
| struct | EnvManager |
| Encapsulates state for environment loading, transitions, and IBL. More... | |
Functions | |
| int | env_manager_load (EnvManager *mgr, AsyncLoader *loader, const char *filename) |
| Starts an asynchronous load of an environment map. More... | |
| void | env_manager_process_loading_step (EnvManager *mgr, GLuint *recycled_hdr_tex, IBLCoordinator *ibl) |
| Processes the multi-frame HDR environment loading state machine. More... | |
| int | env_manager_trigger_transition (EnvManager *mgr, AsyncLoader *loader, const char *filename) |
| Triggers a new environment transition. More... | |
| void | env_manager_update_ibl (EnvManager *mgr, Scene *scene, PostProcess *postproc, uint64_t frame_count, int width, int height) |
| Updates the IBL state machine and handles transition events. More... | |
| void | env_manager_update_transition (EnvManager *mgr, Scene *scene, PostProcess *postproc, double delta_time, uint64_t frame_count) |
| Updates the environment transition animation. More... | |
| void | env_manager_render_overlay (const EnvManager *mgr, const Scene *scene) |
| Renders the transition overlay (fade/crossfade). More... | |
Environment and IBL management module.
This module handles HDR texture file scanning, environment map loading, and manages the state machine for progressive Image-Based Lighting (IBL) updates.
| int env_manager_load | ( | EnvManager * | mgr, |
| AsyncLoader * | loader, | ||
| const char * | filename | ||
| ) |
Starts an asynchronous load of an environment map.
| mgr | Pointer to the environment manager. |
| loader | Pointer to the async loader. |
| filename | Basename of the HDR file to load. |
| void env_manager_process_loading_step | ( | EnvManager * | mgr, |
| GLuint * | recycled_hdr_tex, | ||
| IBLCoordinator * | ibl | ||
| ) |
Processes the multi-frame HDR environment loading state machine.
| mgr | Pointer to the environment manager. |
| recycled_hdr_tex | Pointer to the recycled HDR texture handle. |
| ibl | Pointer to the IBL coordinator. |
| void env_manager_render_overlay | ( | const EnvManager * | mgr, |
| const Scene * | scene | ||
| ) |
Renders the transition overlay (fade/crossfade).
| mgr | Pointer to the environment manager. |
| scene | Pointer to the scene (contains debug shader and quad). |
| int env_manager_trigger_transition | ( | EnvManager * | mgr, |
| AsyncLoader * | loader, | ||
| const char * | filename | ||
| ) |
Triggers a new environment transition.
| mgr | Pointer to the environment manager. |
| loader | Pointer to the async loader. |
| filename | HDR file to load. |
| void env_manager_update_ibl | ( | EnvManager * | mgr, |
| Scene * | scene, | ||
| PostProcess * | postproc, | ||
| uint64_t | frame_count, | ||
| int | width, | ||
| int | height | ||
| ) |
Updates the IBL state machine and handles transition events.
This function combines the logic of checking IBL progress and updating the transition state (loading -> fade out/in).
| mgr | Pointer to the environment manager. |
| scene | Pointer to the scene (for texture management). |
| postproc | Pointer to post-process (for exposure). |
| frame_count | Current frame count. |
| width | Current window width (for snapshot). |
| height | Current window height (for snapshot). |
| void env_manager_update_transition | ( | EnvManager * | mgr, |
| Scene * | scene, | ||
| PostProcess * | postproc, | ||
| double | delta_time, | ||
| uint64_t | frame_count | ||
| ) |
Updates the environment transition animation.
| mgr | Pointer to the environment manager. |
| scene | Pointer to the scene. |
| postproc | Pointer to post-process. |
| delta_time | Time elapsed since last frame. |
| frame_count | Current frame count. |