The problem was this one subtraction. Seriously.
This commit is contained in:
parent
e638764340
commit
6dcb9dd37f
1 changed files with 1 additions and 1 deletions
|
@ -260,7 +260,7 @@ Scene::trace_ray(const Ray &ray,
|
|||
Ray shadowRay;
|
||||
|
||||
for (PointLight *l : lights) {
|
||||
light_direction = (intersection - l->GetOrigin()).normalize();
|
||||
light_direction = (l->GetOrigin() - intersection).normalize();
|
||||
ldotn = light_direction.dot(normal);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue