aboutsummaryrefslogtreecommitdiff
path: root/ray.c
diff options
context:
space:
mode:
Diffstat (limited to 'ray.c')
-rw-r--r--ray.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ray.c b/ray.c
index 9d18bdb..35ec5b1 100644
--- a/ray.c
+++ b/ray.c
@@ -237,15 +237,15 @@ exit:
color_t *ray_trace(space_t *s, unsigned int x, unsigned int y)
{
+ // Init return color. Will be accumilated with all the detected light.
+ color_t *c = color_set(NULL, s->ambient.r, s->ambient.g, s->ambient.b);
+
// Setup primary ray
ray_t r;
r.start = &s->view.position;
r.direction = vector_copy(NULL, NULL);
viewpoint_ray(&s->view, r.direction, x, y);
- // Init return color. Will be accumilated with all the detected light.
- color_t *c = color_set(NULL, s->ambient.r, s->ambient.g, s->ambient.b);
-
// Run the recursive ray trace
ray_trace_recur(s, c, &r, 0, 1);