Enhance build system and project documentation

Added LICENSE file with MIT License and copyright notice.
Added preview.png binary file for project assets.
Changed CMakeLists.txt to include asset copying command.
Changed mesh loading in Mesh.c to support smooth normals.
Changed ray origin biasing in PathTracing.c and shadow rays.
Changed ray-triangle intersection logic in RayIntersection.c.
Changed ray_intersect_bvh_count function in Debug.c to static.
Changed rendering functions in Scene.c with TODO for optimization.
Updated README.md with project description and build instructions.
Updated window dimensions in main.c for testing purposes.
This commit is contained in:
2025-04-21 21:03:08 +09:00
parent 6800810369
commit 59941241c3
13 changed files with 194 additions and 184 deletions

View File

@@ -84,7 +84,7 @@ vec4s path_trace(const scene_t* scene, ray_t ray, uint32_t sample_index, uint16_
throughput = glms_vec3_mul(throughput, glms_vec3_scale(bsdf, cos_theta / pdf_bsdf));
// We do Russian roulette to decide whether to continue tracing or terminate the path
if (depth > 2)
if (depth > 1)
{
float q = fminf(glms_vec3_max(throughput), 0.95f);
float rr_sample = sobol_sample(sample_index, sobol_get_dimension(depth, PRNG_TERMINATE));
@@ -97,7 +97,7 @@ vec4s path_trace(const scene_t* scene, ray_t ray, uint32_t sample_index, uint16_
throughput = glms_vec3_scale(throughput, 1.0f / q);
}
active_ray.origin = glms_vec3_add(closest_hit.point, glms_vec3_scale(closest_hit.normal, 1.192092896e-04F));
active_ray.origin = BIAS_RAY_ORIGION(closest_hit.point, closest_hit.normal);
active_ray.direction = wi;
prev_normal = closest_hit.normal;