diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-11-19 20:30:14 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-11-19 20:31:06 -0500 |
commit | d47af986a7832add1c149235f44fa8f57b56e6d8 (patch) | |
tree | 40fbd4a5e84afa188c2f23a7727d3d9d2acb6840 /tests/libdimension/render.c | |
parent | 6137aed0179476eaa626660885f01ea3f04f988a (diff) | |
download | dimension-d47af986a7832add1c149235f44fa8f57b56e6d8.tar.xz |
Implement sky spheres.
Diffstat (limited to 'tests/libdimension/render.c')
-rw-r--r-- | tests/libdimension/render.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/libdimension/render.c b/tests/libdimension/render.c index 440333c..31518bf 100644 --- a/tests/libdimension/render.c +++ b/tests/libdimension/render.c @@ -66,8 +66,19 @@ dmnsn_new_test_scene(void) scene->camera->trans = trans; /* Background color */ - scene->background = dmnsn_color_from_sRGB((dmnsn_sRGB){ 0.0, 0.1, 0.2 }); - scene->background.filter = 0.1; + scene->background = dmnsn_clear; + + /* Sky sphere */ + scene->sky_sphere = dmnsn_new_sky_sphere(); + dmnsn_pattern *sky_gradient = dmnsn_new_gradient_pattern(dmnsn_y); + dmnsn_color_map *sky_gradient_color_map = dmnsn_new_color_map(); + dmnsn_add_color_map_entry(sky_gradient_color_map, 0.0, dmnsn_orange); + dmnsn_color background = dmnsn_color_from_sRGB((dmnsn_sRGB){ 0.0, 0.1, 0.2 }); + background.filter = 0.1; + dmnsn_add_color_map_entry(sky_gradient_color_map, 0.35, background); + dmnsn_pigment *sky_pigment + = dmnsn_new_color_map_pigment(sky_gradient, sky_gradient_color_map); + dmnsn_array_push(scene->sky_sphere->pigments, &sky_pigment); /* Light source */ dmnsn_light *light = dmnsn_new_point_light( |