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:
2025-05-05 01:59:13 +09:00
parent 4b29de15cd
commit f940569ca3
21 changed files with 190 additions and 85 deletions

View File

@@ -12,6 +12,7 @@ typedef struct
vec3s origin;
vec3s direction;
vec3s inverse_direction;
float esp;
uint8_t sign;
} ray_t;
@@ -31,9 +32,12 @@ vec3s offset_ray_origin(vec3s point, vec3s normal, vec3s wo);
hit_result_t ray_intersect_triangle(const ray_t* ray, const triangle_t* triangle);
bool ray_intersect_aabb(const ray_t* ray, aabb_t aabb, float* enter_out, float* exit_out);
void ray_intersect_bvh(const ray_t* ray, const bvh_node_t* bvh_nodes,
const uint64_t* primitive_indices, const triangle_collection_t* all_triangles, uint64_t node_index,
float* closest_out, hit_result_t* best_hit_out);
hit_result_t ray_intersect_scene(const ray_t* ray, const scene_t* scene);
void ray_intersect_bvh_closest(const ray_t* ray, const bvh_node_t* bvh_nodes,
const uint64_t* primitive_indices, const triangle_collection_t* all_triangles, uint64_t node_index,
float* closest_out, hit_result_t* best_hit_out);
void ray_intersect_bvh_any(const ray_t* ray, const bvh_node_t* bvh_nodes, const uint64_t* primitive_indices, const triangle_collection_t* all_triangles, uint64_t node_index, hit_result_t* any_hit_out);
hit_result_t ray_intersect_scene_closest(const ray_t* ray, const scene_t* scene);
hit_result_t ray_intersect_scene_any(const ray_t* ray, const scene_t* scene);
#endif // RAY_INTERSECTION_H