From feeaa34d62ace020d52095a345bc218b35602a13 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 7 Mar 2009 18:38:40 +0000 Subject: [PATCH] tweaked Scene::calculateLightContribution() and scenes/cyls.fart slightly git-svn-id: svn://anubis/fart/trunk@189 7f9b0f55-74a9-4bce-be96-3c2cd072584d --- main/Scene.cc | 5 +++-- scenes/cyls.fart | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/main/Scene.cc b/main/Scene.cc index 3e13f12..36569bb 100644 --- a/main/Scene.cc +++ b/main/Scene.cc @@ -311,7 +311,9 @@ double Scene::calculateLightContribution(const Ray & toLight, if ( hit.shape.isNull() ) break; - if ( dist_so_far + hit.dist > dist_to_light ) + double offset = hit.dist + 0.0001; + + if ( dist_so_far + offset > dist_to_light ) break; contrib *= hit.shape->getMaterial()->getTransparency(); @@ -319,7 +321,6 @@ double Scene::calculateLightContribution(const Ray & toLight, if ( contrib < SCENE_FACTOR_THRESHOLD ) break; - double offset = hit.dist + 0.0001; dist_so_far += offset; currentRay = currentRay.shift(offset); } diff --git a/scenes/cyls.fart b/scenes/cyls.fart index 07ba554..6946970 100644 --- a/scenes/cyls.fart +++ b/scenes/cyls.fart @@ -10,14 +10,14 @@ scene camera { - position <1.5, -1.0, 1.2> + position <1.0, -2, 1.2> look_at <0, 0, 0.4> up <0, 0, 1> } light { - position <3, -8, 5> + position <10, 0, 10> } define material cyan @@ -66,7 +66,7 @@ scene size <0.2, 0, 0.3> rotate 180, <1, 0, 0> translate <0, 0, 0.3> - material cyan + material cyan } cyl { size <0.2, 0, 0.3>