Files
SimpleRayTracing/header/Material/SimpleLit.h
Misaki 9a1069db90 Add HDR files and improve light handling
Added three binary files: `golden_gate_hills_1k.hdr`, `rogland_sunset_1k.hdr`, and `studio_small_03_1k.hdr`.
Added a new inline function `weight_nee_light` in `BSDF.h` to compute the weighted contribution of light based on the next event estimation (NEE).
Added a new function pointer type `sky_free_f` in `Light.h` for freeing sky light data.
Added a new structure `hdr_sky_data_t` in `SkyLight.h` to hold HDR sky data, including texture and intensity.
Changed the `RAY_EPSILON` definition in `Common.h` to a new value.
Changed the `light_collection_free` function in `Light.h` to include freeing sky light data if it exists.
Changed the `sky_create_hdr_sky` function in `SkyLight.h` to initialize HDR sky data and compute marginal and conditional distributions.
Changed the `texture_load` function in `Texture.h` to accept a `stride` parameter for different texture formats.
Changed the `evaluate_bsdf_directional` function in `LightEvaluation.c` to handle light intensity checks.
Changed the `evaluate_bsdf_const_sky` function in `SkyLight.c` to use a pointer for sky data and added checks for intensity.
Removed TODO comments related to handling triangle and material removal in `Triangle.h` and `Light.h`.
Removed the old `weight_sky_light` function in `SkyLight.h` and replaced it with the new `weight_nee_light` function.
Updated the `scene_setup` function in `main.c` to change camera position and light direction, and to load HDR textures.
Increased the sample count in the rendering configuration in `main.c` for better quality rendering.
2025-05-02 01:25:56 +09:00

36 lines
868 B
C

#ifndef SIMPLE_LIT_H
#define SIMPLE_LIT_H
#include "Material.h"
#include "Rendering/Texture.h"
#include "cglm/struct/vec3.h"
typedef struct
{
vec3s albedo;
vec3s normal;
float roughness;
float metallic;
} surface_data_t;
typedef struct
{
vec3s albedo;
float roughness;
float metallic;
texture_entity_t albedo_texture;
texture_entity_t normal_texture;
texture_entity_t roughness_texture;
texture_entity_t metallic_texture;
} simple_lit_properties_t;
path_output simple_lit_render_loop(const void* properties, const shading_context_t* context);
inline material_entity_t material_create_simple_lit_default(const simple_lit_properties_t* properties, material_collection_t* collection)
{
return material_create(properties, sizeof(simple_lit_properties_t), simple_lit_render_loop, collection);
}
#endif // SIMPLE_LIT_H