reworked Vector::reflect() to reflect an INCOMING ray
git-svn-id: svn://anubis/fart/trunk@371 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
1 parent
15e4aa1dc0
commit
1eee61002e
2 files changed
+7
-7
No files matched your search
+2
-2
@@ -155,7 +155,7 @@ Color Scene::traceRayRecurse(const Ray & ray, int depth, double factor)
|
||||
{
|
||||
color *= (1.0 - reflectance);
|
||||
Vector reflected_direction =
|
||||
(-ray.getDirection()).reflect(hit.normal);
|
||||
ray.getDirection().reflect(hit.normal);
|
||||
Ray newRay(hit.position, reflected_direction);
|
||||
Vector jitter_surface_point = newRay[0.0001];
|
||||
Ray jitterNewRay(jitter_surface_point, reflected_direction);
|
||||
@@ -257,7 +257,7 @@ Color Scene::computePhong(const refptr<Material> material,
|
||||
Vector directionToLight = jitterPosition - surfacePoint;
|
||||
directionToLight.normalize();
|
||||
Vector reflectedLightDirection =
|
||||
directionToLight.reflect(surfaceNormal);
|
||||
(-directionToLight).reflect(surfaceNormal);
|
||||
|
||||
Ray surfaceToLight(surfacePoint, directionToLight);
|
||||
Color light_contribution =
|
||||
|
||||
Reference in new issue
Block a user