diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-06-14 01:48:35 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-06-14 01:48:35 +0000 |
commit | 3ce0bfcd0e16d909b7495f07c9e8a82e4781ee88 (patch) | |
tree | 98ba25a085f0a06ab41a152fff3f065909611a91 /libdimension/scene.c | |
parent | 9f8055ac23b829babe5ed469251435b64ac82831 (diff) | |
download | dimension-3ce0bfcd0e16d909b7495f07c9e8a82e4781ee88.tar.xz |
Make raytracing engine multi-threaded.
Diffstat (limited to 'libdimension/scene.c')
-rw-r--r-- | libdimension/scene.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/libdimension/scene.c b/libdimension/scene.c index 4a84823..048ad45 100644 --- a/libdimension/scene.c +++ b/libdimension/scene.c @@ -38,25 +38,3 @@ dmnsn_delete_scene(dmnsn_scene *scene) free(scene); } } - -void -dmnsn_raytrace_scene(dmnsn_scene *scene) -{ - unsigned int i, j; - dmnsn_object *object; - dmnsn_line ray; - - dmnsn_array_get(scene->objects, 0, &object); - - for (i = 0; i < scene->canvas->x; ++i) { - for (j = 0; j < scene->canvas->y; ++j) { - ray = (*scene->camera->ray_fn)(scene->camera, scene->canvas, i, j); - if ((*object->intersections_fn)(object, ray)->length > 0) { - dmnsn_set_pixel(scene->canvas, i, j, - dmnsn_color_from_XYZ(dmnsn_whitepoint)); - } else { - dmnsn_set_pixel(scene->canvas, i, j, scene->background); - } - } - } -} |