$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
scene_render.c File Reference
#include "app_settings.h"
#include "billboard_rendering.h"
#include "billboard_sorting.h"
#include "gl_debug.h"
#include "glad/glad.h"
#include "gpu_profiler.h"
#include "light_probes.h"
#include "profiler.h"
#include "scene.h"
#include "scene_gpu_resources.h"
#include "scene_shaders.h"
#include "scene_simulation.h"
#include "scene_visuals.h"
#include "shader.h"
#include "shockwave.h"
#include "skybox.h"
#include "trail_renderer.h"
#include <string.h>
Include dependency graph for scene_render.c:

Functions

const char * aa_mode_to_string (AAMode mode)
 Returns a string representation of the AA mode. More...
 
void scene_update_gpu_buffers (Scene *scene)
 Updates GPU buffers for dynamic geometry (e.g. LOD changes). More...
 
static void scene_bind_probe_textures (Scene *scene)
 Binds SH 3D textures (units 8-14) and light probe grid SSBO only when changed. Units 8-14 and SSBO binding 3 are exclusive to PBR passes — safe to cache. Invalidated after light_probe_grid_sync() which clobbers GL_TEXTURE_3D. More...
 
static void scene_bind_ibl_textures (Scene *scene)
 
static void scene_render_billboards (Scene *scene, mat4 view, mat4 proj, vec3 camera_pos, mat4 previous_view_proj, int width, int height)
 
static void scene_render_instanced (Scene *scene, mat4 view, mat4 proj, vec3 camera_pos, mat4 previous_view_proj)
 
static void stencil_begin_object_pass (void)
 
void scene_render (Scene *scene, GPUProfiler *profiler, mat4 view, mat4 proj, vec3 camera_pos, mat4 previous_view_proj, int width, int height)
 Renders the scene. More...
 

Function Documentation

◆ aa_mode_to_string()

const char* aa_mode_to_string ( AAMode  mode)

Returns a string representation of the AA mode.

Parameters
modeThe AA mode.
Returns
String representation.

◆ scene_bind_ibl_textures()

static void scene_bind_ibl_textures ( Scene *  scene)
static

◆ scene_bind_probe_textures()

static void scene_bind_probe_textures ( Scene *  scene)
static

Binds SH 3D textures (units 8-14) and light probe grid SSBO only when changed. Units 8-14 and SSBO binding 3 are exclusive to PBR passes — safe to cache. Invalidated after light_probe_grid_sync() which clobbers GL_TEXTURE_3D.

◆ scene_render()

void scene_render ( Scene *  scene,
GPUProfiler *  profiler,
mat4  view,
mat4  proj,
vec3  camera_pos,
mat4  previous_view_proj,
int  width,
int  height 
)

Renders the scene.

Parameters
scenePointer to the scene.
viewView matrix.
projProjection matrix.
camera_posCamera position.
previous_view_projPrevious frame's ViewProj matrix (for motion blur).
widthViewport width.
heightViewport height.
Here is the call graph for this function:

◆ scene_render_billboards()

static void scene_render_billboards ( Scene *  scene,
mat4  view,
mat4  proj,
vec3  camera_pos,
mat4  previous_view_proj,
int  width,
int  height 
)
static
Here is the call graph for this function:

◆ scene_render_instanced()

static void scene_render_instanced ( Scene *  scene,
mat4  view,
mat4  proj,
vec3  camera_pos,
mat4  previous_view_proj 
)
static
Here is the call graph for this function:

◆ scene_update_gpu_buffers()

void scene_update_gpu_buffers ( Scene *  scene)

Updates GPU buffers for dynamic geometry (e.g. LOD changes).

Parameters
scenePointer to the scene.

◆ stencil_begin_object_pass()

static void stencil_begin_object_pass ( void  )
inlinestatic