Skip to content

Commit

Permalink
fix lighting offset
Browse files Browse the repository at this point in the history
  • Loading branch information
joppiesaus committed Aug 1, 2022
1 parent 86d6f3c commit 82ad313
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/color/light_calc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: jobvan-d <[email protected]> +#+ */
/* +#+ */
/* Created: 2022/06/02 15:13:07 by jobvan-d #+# #+# */
/* Updated: 2022/07/22 16:27:41 by rubennijhui ######## odam.nl */
/* Updated: 2022/08/01 17:30:36 by jobvan-d ######## odam.nl */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -84,7 +84,7 @@ t_color get_light(t_light_data *lighting)
ray.direction = lighting->light->position - lighting->point;
max_dist_sq = vec3f_len_sq(ray.direction);
vec3f_normalize(&ray.direction);
ray.origin = lighting->point + (lighting->normal * (1.0f / 3250.0f));
ray.origin = lighting->point + (ray.direction * 0.001f);
if (scene_intersects(lighting->scene, &ray, max_dist_sq))
color = make_color(0, 0, 0);
else
Expand Down

0 comments on commit 82ad313

Please sign in to comment.