summaryrefslogtreecommitdiffstats
path: root/libdimension/raytrace.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-07-29 00:38:18 -0600
committerTavian Barnes <tavianator@gmail.com>2011-07-29 00:38:18 -0600
commit5a8b1d413e98abd10b8ca6b1eb5eb91987f39ebf (patch)
tree705f357b3e8acddce87578f46cb8f9cb013b36eb /libdimension/raytrace.c
parent9de8a544bc0bae9ebbc2eed10c120a7e14af441e (diff)
downloaddimension-5a8b1d413e98abd10b8ca6b1eb5eb91987f39ebf.tar.xz
Support rendering image subregions.
This is the first step to supporting distributed renders.
Diffstat (limited to 'libdimension/raytrace.c')
-rw-r--r--libdimension/raytrace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c
index 06878fd..cb5c8b6 100644
--- a/libdimension/raytrace.c
+++ b/libdimension/raytrace.c
@@ -184,8 +184,8 @@ dmnsn_raytrace_scene_concurrent(void *ptr, unsigned int thread,
/* Get the ray corresponding to the (x,y)'th pixel */
dmnsn_line ray = dmnsn_camera_ray(
scene->camera,
- ((double)x)/(scene->canvas->width - 1),
- ((double)y)/(scene->canvas->height - 1)
+ ((double)(x + scene->region_x))/(scene->outer_width - 1),
+ ((double)(y + scene->region_y))/(scene->outer_height - 1)
);
/* Shoot a ray */