POV-Ray : Newsgroups : povray.general : Area Lights Server Time
7 Aug 2024 17:27:59 EDT (-0400)
  Area Lights (Message 1 to 9 of 9)  
From: Ben Chambers
Subject: Area Lights
Date: 21 Aug 2001 23:48:38
Message: <3b832b96@news.povray.org>
After some experimentation, it seems to me that area lights are centered at
their location, which is not what I had understood previously.  From the
documentation, I had understood that area lights had a corner at their
location, with the sides of the rectangle going off in the given axes;
however, from experimentation it seems that the location of the light is the
center of the rectangle.

Is this correct and, if so, do the docs say so? (I never saw anything like
that in the docs, and checked to see if I had missed it but didn't find
anything...)

...Chambers


Post a reply to this message

From: Bill DeWitt
Subject: Re: Area Lights
Date: 21 Aug 2001 23:54:11
Message: <3b832ce3$1@news.povray.org>
"Ben Chambers" <bdc### [at] hotmailcom> wrote in message
news:3b832b96@news.povray.org...
> After some experimentation, it seems to me that area lights are centered
at
> their location, which is not what I had understood previously.

    Yeah, they throw a shadow that seems to come from a rectangle, but they
illuminate from the center. If you want to illuminate from a rectangle, you
must make a grid of lights.


Post a reply to this message

From: Warp
Subject: Re: Area Lights
Date: 22 Aug 2001 05:43:00
Message: <3b837ea4@news.povray.org>
Ben Chambers <bdc### [at] hotmailcom> wrote:
: From the
: documentation, I had understood that area lights had a corner at their
: location, with the sides of the rectangle going off in the given axes;

  Exactly which part of the documentation gives you this idea?

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Ben Chambers
Subject: Re: Area Lights
Date: 23 Aug 2001 02:51:33
Message: <3b84a7f5@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3b837ea4@news.povray.org...
> Ben Chambers <bdc### [at] hotmailcom> wrote:
> : From the
> : documentation, I had understood that area lights had a corner at their
> : location, with the sides of the rectangle going off in the given axes;
>
>   Exactly which part of the documentation gives you this idea?

From the section "Area Lights":

The area_light command defines the size and orientation of the area light as
well as the number of lights in the light source array. The vectors <Axis_1>
and <Axis_2> specify the lengths and directions of the edges of the light.
Since the area lights are rectangular in shape these vectors should be
perpendicular to each other. The larger the size of the light the thicker
the soft part of shadows will be. The integers Size_1 and Size_2 specify the
number of rows and columns of point sources of the. The more lights you use
the smoother your shadows will be but the longer they will take to render.

Specifically, the part about the vectors specifying the lengths of the edges
of the light.  For example, if we have a point P and two vectors U and V, I
would expect the four corners to be
P,   P+U
P+V, P+U+V

Thus, two sides would have a length of |U| and two sides would have a length
of |V|.
However, experimentation shows that the four corners are actually
P-U-V, P+U-V
P-U+V, P+U+V
With the center of the rectangle (more or less :) being located at P.

And so, two sides would have a length of 2*|U| and the other two would have
2*|V|.
Is this the way POV is supposed to behave?  Personally, I like it better (it
makes it easier to position area lights) but it was not what I expected.

...Chambers


Post a reply to this message

From: Warp
Subject: Re: Area Lights
Date: 23 Aug 2001 10:00:09
Message: <3b850c65@news.povray.org>
Ben Chambers <bdc### [at] hotmailcom> wrote:
: However, experimentation shows that the four corners are actually
: P-U-V, P+U-V
: P-U+V, P+U+V
: With the center of the rectangle (more or less :) being located at P.

: And so, two sides would have a length of 2*|U| and the other two would have
: 2*|V|.

  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.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Ben Chambers
Subject: Re: Area Lights
Date: 23 Aug 2001 11:44:37
Message: <3b8524e5@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3b850c65@news.povray.org...
> Ben Chambers <bdc### [at] hotmailcom> wrote:
> : However, experimentation shows that the four corners are actually
> : P-U-V, P+U-V
> : P-U+V, P+U+V
> : With the center of the rectangle (more or less :) being located at P.
>
> : And so, two sides would have a length of 2*|U| and the other two would
have
> : 2*|V|.
>
>   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.

Thanks, this makes sense.  It was easier to see that P was the midpoint than
to see exactly how far out the lights went.  Maybe the docs could explain
this better in 3.5?  (Or maybe not, I don't know how much still has to be
done...)

...Chambers


Post a reply to this message

From: Y
Subject: Re: Area Lights
Date: 23 Aug 2001 12:26:07
Message: <3b852e9f$1@news.povray.org>
> >   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.
>
> Thanks, this makes sense.  It was easier to see that P was the midpoint than
> to see exactly how far out the lights went.  Maybe the docs could explain
> this better in 3.5?  (Or maybe not, I don't know how much still has to be
> done...)
>
> ...Chambers
>
Hmmmm ... guess I always assumed that was how it was ...
but then Ben has an inquiring mind and wants to know ;)
Interesting ... glad you brought it up.
--
Y
wondering what else I don't know ;)


Post a reply to this message

From: Warp
Subject: Re: Area Lights
Date: 23 Aug 2001 13:47:44
Message: <3b8541c0@news.povray.org>
Ben Chambers <bdc### [at] hotmailcom> wrote:
: Maybe the docs could explain this better in 3.5?

  They probably will.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Michael Andrews
Subject: Re: Area Lights
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.