POV-Ray : Newsgroups : povray.programming : Strange piece of code Server Time
17 May 2024 07:55:04 EDT (-0400)
  Strange piece of code (Message 1 to 2 of 2)  
From: Celui
Subject: Strange piece of code
Date: 15 Jun 2005 12:25:01
Message: <web.42b05583856a31da367138710@news.povray.org>
Hello.

in lighting.cpp line 2772:


if (Cos_Shadow_Angle < EPSILON)
{
   return;
}

What's the role of this code ?
It disturbs me. It avoids lauching a new ray to the light source and put the
object into dark at that pixel even if the object is no under the shadow...

When I remove it, it works better !


lmagnin *at* ens-lyon *dot* fr


Post a reply to this message

From: Warp
Subject: Re: Strange piece of code
Date: 15 Jun 2005 14:12:36
Message: <42b06f94@news.povray.org>
Celui <lmagnin AT ens-lyon.fr> wrote:
> if (Cos_Shadow_Angle < EPSILON)
> {
>    return;
> }

> What's the role of this code ?

  If the cosine of the angle between the normal vector and the light
vector is negative it means that the normal vector is pointing away
from the light source. That is, the surface is pointing away from
the light source. It shouldn't thus be illuminated.
  I assume that if you remove that piece of code, all your surfaces
will be double-illuminated.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.