summaryrefslogtreecommitdiff
path: root/src/modules/ray
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/ray')
-rw-r--r--src/modules/ray/ray_camera.c2
-rw-r--r--src/modules/ray/ray_camera.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/ray/ray_camera.c b/src/modules/ray/ray_camera.c
index 5910094..8a06aa3 100644
--- a/src/modules/ray/ray_camera.c
+++ b/src/modules/ray/ray_camera.c
@@ -81,5 +81,5 @@ void ray_camera_frame_begin(ray_camera_t *camera, fb_fragment_t *fragment, ray_r
frame->cur_e = ray_3f_lerp(&frame->ne, &frame->se, frame->y_alpha);
ray->origin = camera->position;
- ray->direction = frame->cur_w;
+ ray->direction = ray_3f_normalize(&frame->cur_w);
}
diff --git a/src/modules/ray/ray_camera.h b/src/modules/ray/ray_camera.h
index 6e48839..b0c874a 100644
--- a/src/modules/ray/ray_camera.h
+++ b/src/modules/ray/ray_camera.h
@@ -69,7 +69,7 @@ static inline int ray_camera_frame_y_step(ray_camera_frame_t *frame)
frame->y_alpha += frame->y_delta;
frame->cur_w = ray_3f_lerp(&frame->nw, &frame->sw, frame->y_alpha);
frame->cur_e = ray_3f_lerp(&frame->ne, &frame->se, frame->y_alpha);
- frame->ray->direction = frame->cur_w;
+ frame->ray->direction = ray_3f_normalize(&frame->cur_w);
return 1;
}
© All Rights Reserved