$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
scene_init.c File Reference
#include "billboard_rendering.h"
#include "ibl_coordinator.h"
#include "instanced_rendering.h"
#include "light_probes.h"
#include "log.h"
#include "material.h"
#include "platform/platform_fs.h"
#include "platform/platform_utils.h"
#include "render_utils.h"
#include "scene.h"
#include "scene_gpu_resources.h"
#include "scene_internal.h"
#include "scene_shaders.h"
#include "scene_simulation.h"
#include "scene_visuals.h"
#include "utils.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for scene_init.c:

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)
 
void scene_init_instancing (Scene *scene)
 Initialize instanced rendering data from the material library. More...
 
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...
 

Variables

static const char *const HDR_TEXTURE_PATH = "assets/textures/hdr"
 
static const char *const HDR_EXTENSION = ".hdr"
 

Macro Definition Documentation

◆ MIN

#define MIN (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Function Documentation

◆ compare_strings()

static int compare_strings ( const void *  string_a,
const void *  string_b 
)
static

◆ scene_hdr_file_callback()

static void scene_hdr_file_callback ( const char *  filename,
bool  is_dir,
void *  user_data 
)
static

◆ scene_init()

int scene_init ( Scene *  scene)

Initializes the scene resources.

Parameters
scenePointer to the scene structure.
Returns
1 on success, 0 on failure.
Here is the call graph for this function:

◆ scene_init_billboard_shader()

static int scene_init_billboard_shader ( Scene *  scene)
static
Here is the call graph for this function:

◆ scene_init_compute_resources()

static int scene_init_compute_resources ( Scene *  scene)
static
Here is the call graph for this function:

◆ scene_init_core_shaders()

static int scene_init_core_shaders ( Scene *  scene)
static
Here is the call graph for this function:

◆ scene_init_instanced_shader()

static int scene_init_instanced_shader ( Scene *  scene,
Shader **  out_shader 
)
static
Here is the call graph for this function:

◆ scene_init_instancing()

void scene_init_instancing ( Scene *  scene)

Initialize instanced rendering data from the material library.

Builds the SphereInstance array, uploads it to VBO, and configures billboard + instanced groups. Also seeds the light probe grid.

Used by scene_init (via scene_init_instanced_shader) and scene_toggle_nbody.

Here is the call graph for this function:

◆ scene_init_state()

static void scene_init_state ( Scene *  scene)
static
Here is the call graph for this function:

◆ scene_scan_hdr_files()

static void scene_scan_hdr_files ( Scene *  scene)
static
Here is the call graph for this function:

Variable Documentation

◆ HDR_EXTENSION

const char* const HDR_EXTENSION = ".hdr"
static

◆ HDR_TEXTURE_PATH

const char* const HDR_TEXTURE_PATH = "assets/textures/hdr"
static