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:
2025-04-29 17:58:10 +09:00
parent 3c3168af7a
commit fb1ff5cac6
21 changed files with 257 additions and 145 deletions

View File

@@ -30,11 +30,17 @@ typedef struct
uint8_t* data;
} texture_t;
typedef struct
{
char* full_name;
texture_t texture;
} texture_asset_t;
typedef struct
{
uint16_t count;
uint16_t size;
texture_t* buffer;
texture_asset_t* buffer;
} texture_collection_t;
typedef struct
@@ -67,7 +73,7 @@ inline texture_t* get_texture(const texture_collection_t* textures, texture_enti
return NULL;
}
return &textures->buffer[entity.id];
return &textures->buffer[entity.id].texture;
}
#endif // TEXTURE_H