summaryrefslogtreecommitdiffstats
path: root/dimension
diff options
context:
space:
mode:
Diffstat (limited to 'dimension')
-rw-r--r--dimension/realize.c18
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;