$darkmode
#include "scene.h"#include "app_settings.h"#include "billboard_rendering.h"#include "gl_debug.h"#include "glad/glad.h"#include "ibl_coordinator.h"#include "icosphere.h"#include "instanced_rendering.h"#include "log.h"#include "material.h"#include "platform/platform_fs.h"#include "platform/platform_utils.h"#include "profiler.h"#include "render_utils.h"#include "shader.h"#include "sphere_sorting.h"#include "utils.h"#include <stdio.h>#include <stdlib.h>#include <string.h>Data Structures | |
| struct | HdrScanContext |
Macros | |
| #define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
Functions | |
| static int | compare_strings (const void *string_a, const void *string_b) |
| static void | scene_hdr_file_callback (const char *filename, bool is_dir, void *user_data) |
| static void | scene_scan_hdr_files (Scene *scene) |
| static void | scene_init_instancing (Scene *scene) |
| static void | scene_init_state (Scene *scene) |
| static int | scene_init_core_shaders (Scene *scene) |
| static int | scene_init_billboard_shader (Scene *scene) |
| static int | scene_init_compute_resources (Scene *scene) |
| static int | scene_init_instanced_shader (Scene *scene, Shader **out_shader) |
| int | scene_init (Scene *scene) |
| Initializes the scene resources. More... | |
| static void | scene_cleanup_pbr_shaders (Scene *scene) |
| static void | scene_cleanup_shaders (Scene *scene) |
| static void | scene_cleanup_geometry_buffers (Scene *scene) |
| static void | scene_cleanup_buffers (Scene *scene) |
| static void | scene_cleanup_textures (Scene *scene) |
| static void | scene_cleanup_gpu_resources (Scene *scene) |
| void | scene_cleanup (Scene *scene) |
| Cleans up scene resources. More... | |
| 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 probe 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... | |
Variables | |
| static const char *const | HDR_TEXTURE_PATH = "assets/textures/hdr" |
| static const char *const | HDR_EXTENSION = ".hdr" |
| #define MIN | ( | a, | |
| b | |||
| ) | ((a) < (b) ? (a) : (b)) |
| const char* aa_mode_to_string | ( | AAMode | mode | ) |
Returns a string representation of the AA mode.
| mode | The AA mode. |
|
static |
|
static |
|
static |
Binds SH 3D textures (units 8-14) and probe 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.
| void scene_cleanup | ( | Scene * | scene | ) |
Cleans up scene resources.
| scene | Pointer to the scene structure. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| int scene_init | ( | Scene * | scene | ) |
Initializes the scene resources.
| scene | Pointer to the scene structure. |
|
static |
|
static |
|
static |
|
static |
|
static |
| 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.
| scene | Pointer to the scene. |
| view | View matrix. |
| proj | Projection matrix. |
| camera_pos | Camera position. |
| previous_view_proj | Previous frame's ViewProj matrix (for motion blur). |
| width | Viewport width. |
| height | Viewport height. |
|
static |
|
static |
|
static |
| void scene_update_gpu_buffers | ( | Scene * | scene | ) |
Updates GPU buffers for dynamic geometry (e.g. LOD changes).
| scene | Pointer to the scene. |
|
inlinestatic |
|
static |
|
static |