Files
SimpleRayTracing/header/Material/SimpleLit.h
Misaki 3de6b83d32 Set C standard to C11 and add new assets
Changed CMakeLists.txt to set the C standard to C11.
Added multiple binary image files for new visual assets.
Added several new image files to enhance rendering capabilities.
Changed stb_image.h to improve support for various image formats.
Changed ray tracing engine to enhance ray creation and intersection.
Changed triangle structure to use a vertex array for better attribute handling.
Changed scene initialization to accommodate new texture management.
2025-04-29 01:43:52 +09:00

43 lines
1.7 KiB
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;
float roughness;
float metallic;
} simple_lit_data_t;
typedef struct
{
vec3s albedo;
float roughness;
float metallic;
const texture_t* albedo_texture;
const texture_t* roughness_texture;
const texture_t* metallic_texture;
} simple_lit_properties_t;
void simple_lit_data_default(const shading_context_t* context, const void* properties, void* data_out);
vec3s sample_bsdf_simple_lit(const shading_context_t* context, const void* properties, const compute_surface_data_f compute_surface_data, uint32_t sample_index, uint32_t bounce, float* pdf_out);
vec3s evaluate_bsdf_simple_lit(const shading_context_t* context, const void* properties, const compute_surface_data_f compute_surface_data);
float sample_bsdf_pdf_simple_lit(const shading_context_t* context, const void* properties, const compute_surface_data_f compute_surface_data);
inline material_entity_t material_create_simple_lit(const simple_lit_properties_t* properties, compute_surface_data_f surface_data, material_collection_t* collection)
{
return material_create(properties, sizeof(simple_lit_properties_t), surface_data, sample_bsdf_simple_lit, sample_bsdf_pdf_simple_lit, evaluate_bsdf_simple_lit, collection);
}
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_data_default, sample_bsdf_simple_lit, sample_bsdf_pdf_simple_lit, evaluate_bsdf_simple_lit, collection);
}
#endif // SIMPLE_LIT_H