aboutsummaryrefslogtreecommitdiff
path: root/ray.c
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-03-09 18:34:24 +0100
committerJulian T <julian@jtle.dk>2020-03-09 18:34:24 +0100
commitc94c3930af8c81568be50bdfaaac321b99e296d7 (patch)
treef776896e941b64076bdd067829a6ca9323cc67f7 /ray.c
parent7837a28251bc3b326423ba40ccac0c8ffe23f968 (diff)
Colors are floats now
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);