Update AOV support, ray intersection logic, and README
Added: - AOV support for normals, albedo, and depth marked as completed. - New function `normal_unpack` in `BSDF.h`. - New field `esp` in `ray_t` structure in `RayIntersection.h`. Changed: - Updated `normal_ts_to_ws` to accept an additional parameter. - Refactored `weight_nee_light` for clarity. - Modified `RAY_EPSILON` for improved precision. - Updated `path_output` structure to include a `normal` field. - Normalized unpacked normal vector in `normal_unpack` function. - Updated `path_trace` to use closest hit ray intersection. - Updated `render_aov` to utilize closest hit logic. - Modified `ray_create` to initialize `esp` based on ray origin. - Improved accuracy in `offset_ray_origin` calculations. - Updated ray intersection logic in `ray_intersect_triangle` and `ray_intersect_aabb` to include epsilon checks. - Updated `evaluate_bsdf_directional` and `evaluate_bsdf_const_sky` for shadow rays. - Adjusted `sample_bsdf_simple_lit` for incoming light direction calculations. - Enhanced `render_pixel` to manage AOV flags effectively. - Changed camera rotation and light intensity in `scene_setup`. - Simplified texture loading by removing unnecessary sRGB conversion. Modified: - Several binary image files have been updated.
This commit is contained in:
@@ -82,16 +82,7 @@ texture_entity_t texture_load(const char* filename, bool srgb, stride_t stride,
|
||||
switch (stride)
|
||||
{
|
||||
case UINT_8:
|
||||
uint8_t* img_data = stbi_load(filename, &width, &height, &channels, 0);
|
||||
if (srgb)
|
||||
{
|
||||
// Convert to linear space if the texture is in sRGB format
|
||||
for (int i = 0; i < width * height * channels; i++)
|
||||
{
|
||||
img_data[i] = (uint8_t)(powf(img_data[i] / 255.0f, 2.2f) * 255.0f);
|
||||
}
|
||||
}
|
||||
data = (char*)img_data;
|
||||
data = stbi_load(filename, &width, &height, &channels, 0);
|
||||
break;
|
||||
|
||||
case UINT_16:
|
||||
|
||||
Reference in New Issue
Block a user