$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
skybox.c File Reference
#include "skybox.h"
#include "glad/glad.h"
#include "render_utils.h"
#include "shader.h"
#include <cglm/types.h>
Include dependency graph for skybox.c:

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...
 

Function Documentation

◆ skybox_cleanup()

void skybox_cleanup ( Skybox skybox)

Cleans up GPU resources.

Parameters
skyboxPointer to the struct.

◆ skybox_init()

void skybox_init ( Skybox skybox,
Shader shader 
)

Initializes skybox geometry and caches uniform locations.

Parameters
skyboxPointer to the struct.
shaderThe compiled skybox shader wrapper.
Here is the call graph for this function:

◆ skybox_render()

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.

Parameters
skyboxPointer to the struct.
shaderShader to use.
env_mapPrimary HDR cubemap texture.
fallback_texDummy texture if env_map is invalid.
inv_view_projInverse of the current View-Proj matrix.
blur_lodLevel of mip-map detail (0.0 for sharp, higher for blurry).
Here is the call graph for this function: