$darkmode
#include "material.h"#include "io.h"#include "log.h"#include "utils.h"#include <cJSON.h>#include <limits.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>Macros | |
| #define | MAT_DEFAULT_ROUGHNESS 0.5F |
| #define | MAT_DEFAULT_ALBEDO 0.0F |
| #define | MAT_DEFAULT_METALLIC 0.0F |
Enumerations | |
| enum | { MAX_MATERIAL_CONFIG_SIZE = 2 * 1024 * 1024 } |
| enum | { MAX_MATERIAL_COUNT = 10000 , RGB_COMPONENTS = 3 } |
Functions | |
| static void | parse_material_name (cJSON *element, PBRMaterial *mat) |
| static void | parse_albedo_array (cJSON *element, PBRMaterial *mat) |
| static void | parse_material_properties (cJSON *element, PBRMaterial *mat) |
| static PBRMaterial * | allocate_materials (int count) |
| static int | parse_materials_from_json (cJSON *json_root, PBRMaterial *materials, int max_count) |
| MaterialLib * | material_load_presets (const char *path) |
| Loads a set of material presets from a configuration file. More... | |
| void | material_free_lib (MaterialLib *lib) |
| Frees all memory associated with a material library. More... | |
| #define MAT_DEFAULT_ALBEDO 0.0F |
| #define MAT_DEFAULT_METALLIC 0.0F |
| #define MAT_DEFAULT_ROUGHNESS 0.5F |
|
static |
| void material_free_lib | ( | MaterialLib * | lib | ) |
Frees all memory associated with a material library.
| lib | Pointer to the library to destroy. |
| MaterialLib* material_load_presets | ( | const char * | path | ) |
Loads a set of material presets from a configuration file.
| path | Path to the material description file. |
|
static |
|
static |
|
static |
|
static |