POV-Ray : Newsgroups : povray.general : Area Lights : Re: Area Lights Server Time
7 Aug 2024 15:15:11 EDT (-0400)
  Re: Area Lights  
From: Michael Andrews
Date: 29 Aug 2001 05:27:11
Message: <3B8CB6E9.C922EE79@reading.ac.uk>
Warp wrote:
>   Wrong. The corners are located at
> 
> P-U/2-V/2, P+U/2-V/2
> P-U/2+V/2, P+U/2+V/2
> 
> and the length of the sides is U and V.

But if you jitter the points it gets even better; the corners become

P - U*(M/(M-1))/2 - V*(N/(N-1))/2, P + U*(M/(M-1))/2 - V*(N/(N-1))/2
P - U*(M/(M-1))/2 + V*(N/(N-1))/2, P + U*(M/(M-1))/2 + V*(N/(N-1))/2

where M and N are the number of samples along U and V.

This is caused by

      Jitter_u = (DBL)u;
      Jitter_v = (DBL)v;

      if (Light_Source->Jitter)
      {
        Jitter_u += FRAND() - 0.5;
        Jitter_v += FRAND() - 0.5;
      }

and then

      if (Light_Source->Area_Size1 > 1)
      {
        ScaleFactor = Jitter_u/(DBL)(Light_Source->Area_Size1 - 1) -
0.5;

        VScale (NewAxis1, Light_Source->Axis1, ScaleFactor)
      }
      else
      {
        Make_Vector(NewAxis1, 0.0, 0.0, 0.0);
      }

      if (Light_Source->Area_Size2 > 1)
      {
        ScaleFactor = Jitter_v/(DBL)(Light_Source->Area_Size2 - 1) -
0.5;

        VScale (NewAxis2, Light_Source->Axis2, ScaleFactor)
      }
      else
      {
        Make_Vector(NewAxis2, 0.0, 0.0, 0.0);
      }

in the standard rectangular area lights, I haven't been able to work my
way completely through the circular area light code yet to see if it
dose the same.

Can someone check that I've read this right? And if I have, has it been
corrected in v3.5?

Enough for now,
	Mike Andrews.


Post a reply to this message

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