Added: - Updated `.gitignore` to ignore the `[Bb]uild/` directory. - Additional tasks added to the roadmap in `README.md` for light unit standardization and GPU backend support. Changed: - Removed line in `settings.json` that disabled error squiggles for C/C++ code. - Modified `Triangle.h` to include `material_id` in `triangle_t` and reorganized properties. - Reordered parameters in `triangle_collection_init` for clarity. - Updated `shading_context_t` in `Material.h` and added size parameter to `material_create`. - Streamlined initialization in `scene_init` and updated `scene_free` for proper resource management. - Updated `window_create` in `Window.h` to accept a `render_job_t` parameter. - Introduced `renderer_start` in `Renderer.c` to handle rendering jobs and optimized pixel rendering logic.
24 lines
792 B
C
24 lines
792 B
C
#ifndef SIMPLE_LIT_H
|
|
#define SIMPLE_LIT_H
|
|
|
|
#include "Material.h"
|
|
#include "cglm/types-struct.h"
|
|
|
|
typedef struct
|
|
{
|
|
vec3s albedo;
|
|
float roughness;
|
|
float metallic;
|
|
}simple_lit_data_t;
|
|
|
|
vec3s sample_bsdf_simple_lit(const void* data, vec3s normal, vec3s wo, uint32_t sample_index, uint32_t bounce, float* pdf_out);
|
|
vec3s evaluate_bsdf_simple_lit(const shading_context_t* context, const void* data);
|
|
float sample_bsdf_pdf_simple_lit(const void* data, vec3s normal, vec3s wo, vec3s wi);
|
|
|
|
inline material_entity_t material_create_simple_lit(simple_lit_data_t* lit_data, material_collection_t* collection)
|
|
{
|
|
return material_create(sample_bsdf_simple_lit, sample_bsdf_pdf_simple_lit, evaluate_bsdf_simple_lit, lit_data, sizeof(simple_lit_data_t), collection);
|
|
}
|
|
|
|
#endif // SIMPLE_LIT_H
|