diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-12-23 02:04:32 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-12-23 02:04:32 -0500 |
commit | a9ce26a1cd786690b4b8f4b54fc7077b3d3569e5 (patch) | |
tree | 1d6e3676224699d828180a15edbca8a3ed39d75a /dimension | |
parent | ff44d1b89812c1c7ef86c848937f17a59c64a66e (diff) | |
download | dimension-a9ce26a1cd786690b4b8f4b54fc7077b3d3569e5.tar.xz |
Separate finishes into single-purpose finishes.
Diffstat (limited to 'dimension')
-rw-r--r-- | dimension/realize.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/dimension/realize.c b/dimension/realize.c index f795d0f..6ebcdd1 100644 --- a/dimension/realize.c +++ b/dimension/realize.c @@ -547,12 +547,26 @@ dmnsn_realize_astree(const dmnsn_astree *astree) } /* Default finish */ - scene->default_texture->finish = dmnsn_new_phong_finish(1.0, 0.0, 1.0); + dmnsn_finish *ambient = dmnsn_new_ambient_finish( + dmnsn_color_mul(0.1, dmnsn_white) + ); + dmnsn_finish *diffuse = dmnsn_new_diffuse_finish(0.6); + if (!ambient || !diffuse) { + dmnsn_delete_finish(diffuse); + dmnsn_delete_finish(ambient); + dmnsn_delete_scene(scene); + return NULL; + } + scene->default_texture->finish = dmnsn_new_finish_combination( + ambient, + diffuse + ); if (!scene->default_texture->finish) { + dmnsn_delete_finish(diffuse); + dmnsn_delete_finish(ambient); dmnsn_delete_scene(scene); return NULL; } - scene->default_texture->finish->ambient = 0.1; /* Background color */ scene->background = dmnsn_black; |