From 7a48ecd394f7b3b8f0f6e18606f681ffac3e3a7c Mon Sep 17 00:00:00 2001 From: Julian T Date: Wed, 25 Mar 2020 18:53:37 +0100 Subject: Create new fitting scene to test area lights --- ray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ray.c') diff --git a/ray.c b/ray.c index a41866c..eba29c0 100644 --- a/ray.c +++ b/ray.c @@ -276,7 +276,7 @@ int ray_trace_recur(space_t *s, color_t *dest, ray_t *ray, unsigned hop, COORD_T // Calculate normal vector vector_t N; - obj_norm_at(o, &N, r.start); + obj_norm_at(o, &N, r.start, ray->direction); // Check if we should calculate light if (o->m->defuse + o->m->specular > ZERO_APROX) { @@ -290,7 +290,7 @@ int ray_trace_recur(space_t *s, color_t *dest, ray_t *ray, unsigned hop, COORD_T } // Calculate reflection vector - if (hop < 2 && o->m->reflective > ZERO_APROX) { + if (hop < 10 && o->m->reflective > ZERO_APROX) { vector_scale(r.direction, &N, 2 * vector_dot(ray->direction, &N)); vector_sub(r.direction, ray->direction, r.direction); -- cgit v1.2.3