Update rendering, material handling, and shading logic
Changed README.md to update rendering settings and build instructions. Changed BSDF.h to add functions for normal unpacking and tangent transformation. Changed RayIntersection.h to include tangent vector in hit_result_t. Changed Common.h to include vec2.h for 2D vector handling. Changed String.h to add string_copy function and improve is_absolute_path. Changed GeometryUtilities.h to enhance quad creation with tangent calculations. Changed Mesh.h to include tangents in the vertex structure. Changed Triangle.h to add tangents in the vertex structure for better normal mapping. Changed Light.h to include tangents in the light shading context. Changed SkyLight.h to introduce a new structure for sky lights. Changed Material.h to include tangents in the shading context. Changed SimpleLit.h to add normal and tangent textures for detailed shading. Changed Texture.h to introduce a new structure for texture assets. Changed BSDF.c to add functions for unpacking normals and transforming tangents. Changed PathTracing.c to include tangents in the shading context. Changed RayIntersection.c to calculate normals and tangents in ray-triangle intersections. Changed Mesh.c to improve material texture loading and handle tangents. Changed Material.c to enhance material collection initialization and resizing. Changed SimpleLit.c to incorporate normal mapping with normal textures. Changed Texture.c to improve management of texture assets and resources.
This commit is contained in:
@@ -9,16 +9,13 @@
|
||||
|
||||
#define SKY_DATA_CAPACITY 64
|
||||
|
||||
typedef enum {
|
||||
SKY_TYPE_CONSTANT,
|
||||
} sky_type_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3s normal;
|
||||
vec3s hit_point;
|
||||
vec3s wo;
|
||||
vec3s normal;
|
||||
vec3s tangent;
|
||||
vec2s uv;
|
||||
vec3s wo;
|
||||
|
||||
uint16_t bounce_depth;
|
||||
|
||||
@@ -37,12 +34,12 @@ typedef vec3s (*evaluate_bsdf_sky_f) (const void* data, const light_shading_cont
|
||||
|
||||
typedef struct
|
||||
{
|
||||
evaluate_bsdf_sky_f evaluate_bsdf_sky;
|
||||
sky_type_t type;
|
||||
uint16_t data_size;
|
||||
|
||||
_Alignas(SKY_ALIGN)
|
||||
// Should we heap allocate this? It is a bit of a waste to have it on the stack.
|
||||
char data[SKY_DATA_CAPACITY];
|
||||
|
||||
evaluate_bsdf_sky_f evaluate_bsdf_sky;
|
||||
uint16_t data_size;
|
||||
} sky_light_t;
|
||||
|
||||
typedef enum
|
||||
|
||||
@@ -16,7 +16,6 @@ inline sky_light_t sky_create_constant_sky(const constant_sky_data_t* data)
|
||||
{
|
||||
sky_light_t light = {
|
||||
.evaluate_bsdf_sky = evaluate_bsdf_const_sky,
|
||||
.type = SKY_TYPE_CONSTANT,
|
||||
.data_size = sizeof(constant_sky_data_t),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user