$darkmode
Infinite-distance background rendering (fullscreen quad approach). More...
#include "gl_common.h"#include "shader.h"#include <cglm/cam.h>#include <cglm/mat4.h>#include <cglm/types.h>Go to the source code of this file.
Data Structures | |
| struct | Skybox |
| Persistent state and resource handles for the environment renderer. More... | |
Functions | |
| void | skybox_init (Skybox *skybox, Shader *shader) |
| Initializes skybox geometry and caches uniform locations. More... | |
| void | skybox_render (Skybox *skybox, Shader *shader, GLuint env_map, GLuint fallback_tex, const mat4 inv_view_proj, float blur_lod) |
| Renders the skybox to the current framebuffer. More... | |
| void | skybox_cleanup (Skybox *skybox) |
| Cleans up GPU resources. More... | |
Infinite-distance background rendering (fullscreen quad approach).
This module renders the environment map using a raycasting approach on a full-screen quad, which is more efficient than a traditional cube mesh and easier to integrate with depth-based post-processing.
| void skybox_cleanup | ( | Skybox * | skybox | ) |
Cleans up GPU resources.
| skybox | Pointer to the struct. |
Initializes skybox geometry and caches uniform locations.
| skybox | Pointer to the struct. |
| shader | The compiled skybox shader wrapper. |
| void skybox_render | ( | Skybox * | skybox, |
| Shader * | shader, | ||
| GLuint | env_map, | ||
| GLuint | fallback_tex, | ||
| const mat4 | inv_view_proj, | ||
| float | blur_lod | ||
| ) |
Renders the skybox to the current framebuffer.
| skybox | Pointer to the struct. |
| shader | Shader to use. |
| env_map | Primary HDR cubemap texture. |
| fallback_tex | Dummy texture if env_map is invalid. |
| inv_view_proj | Inverse of the current View-Proj matrix. |
| blur_lod | Level of mip-map detail (0.0 for sharp, higher for blurry). |