POV-Ray : Newsgroups : povray.newusers : Area lights vs spotlight Server Time
29 Jul 2024 16:23:46 EDT (-0400)
  Area lights vs spotlight (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Giuseppe Bilotta
Subject: Area lights vs spotlight
Date: 20 May 2005 06:59:09
Message: <18av7ijs3o5di$.qtnm5gxb1fb9$.dlg@40tude.net>
Hi all, this is probably a stupid question, but I'm going to ask it
anyway ...

In the search for the "perfect lighting", especially to obtain
realistic soft shadows. The suggested method is to use area lights.
Indeed, an area light circular and oriented comes pretty close. Of
course with the usual problem that too few lights in the area give
banding, and that jitter gives a somewhat spotty result.

So I wondering: with spotlights one can excellently define and
fine-tune *lights* which soften towards the rim.

I'm not sure how spotlights are coded, but I would assume they
calculate the inner and outer radius and then the intermediate results
are calculated with some mathematical function. Can't a similar
approach be used for *shadows*? Use the extreme points of the area
light to determine maximum and minimum shadowing and apply some
mathematical function inbetween, rather than banding it with
intermediate lights? (I guess a similar effect could be obtained by
using spotlights instead of point lights inside the area light)

-- 
Giuseppe "Oblomov" Bilotta


"Ma niente: prima si fanno delle cazzate,
 poi si studia che cazzate si sono fatte"
(Altan)
("And what about the history of the human race, dad?"
 "Oh, nothing special: first they make some foolish things,
  then you study what foolish things have been made")


Post a reply to this message

From: Daniel Hulme
Subject: Re: Area lights vs spotlight
Date: 20 May 2005 07:06:23
Message: <20050520120623.50c58429@dh286.pem.cam.ac.uk>
> I'm not sure how spotlights are coded, but I would assume they
> calculate the inner and outer radius and then the intermediate results
> are calculated with some mathematical function. Can't a similar
> approach be used for *shadows*? Use the extreme points of the area
> light to determine maximum and minimum shadowing and apply some
> mathematical function inbetween, rather than banding it with
> intermediate lights? (I guess a similar effect could be obtained by
> using spotlights instead of point lights inside the area light)
But how would a point between full illumination and full darkness know
how far it is from either? It is easy with spotlights: you just find the
off-axis angle for the light, and subtract angles. With shadows, you
don't know what the full shadow and full illumination angles are,
because they depend on the other objects.

-- 
Now  as he walked by the sea  of Galilee,  he saw  Simon and Andrew  his
brother casting a spam into the net:  for they were phishers.  And Jesus
said unto them, Come ye after me, and I will make you to become phishers
of men.  And  straightway  they forsook  their  nets,  and followed him.


Post a reply to this message

From: Giuseppe Bilotta
Subject: Re: Area lights vs spotlight
Date: 20 May 2005 10:15:22
Message: <15wg1wmtbrixj.ydjpj03t24da$.dlg@40tude.net>
I asked:
>> I'm not sure how spotlights are coded, but I would assume they
>> calculate the inner and outer radius and then the intermediate results
>> are calculated with some mathematical function. Can't a similar
>> approach be used for *shadows*? Use the extreme points of the area
>> light to determine maximum and minimum shadowing and apply some
>> mathematical function inbetween, rather than banding it with
>> intermediate lights? (I guess a similar effect could be obtained by
>> using spotlights instead of point lights inside the area light)

Daniel Hulme gently replied:
> But how would a point between full illumination and full darkness know
> how far it is from either? It is easy with spotlights: you just find the
> off-axis angle for the light, and subtract angles. With shadows, you
> don't know what the full shadow and full illumination angles are,
> because they depend on the other objects.

Actually I've been doing some tests and it's even worse; with curved
objects there are points that should be in shadow that aren't ...

So the problem is that the "true" way to do the things would be to
measure the ratio between the area of the area light which is seen by
the point and the total area of the area light, but such areas may be
complex to calculate, right?

Is there a way in POV-Ray to make projections from a point? Maybe it's
possible to design something that does this manually ...

-- 
Giuseppe "Oblomov" Bilotta

Hic manebimus optime


Post a reply to this message

From: Tim Nikias
Subject: Re: Area lights vs spotlight
Date: 20 May 2005 14:52:55
Message: <428e3207$1@news.povray.org>
> Is there a way in POV-Ray to make projections from a point? Maybe it's
> possible to design something that does this manually ...

What you're describing is what POV-Ray is doing. You define an array of
lights in arealights. It begins with the first four in the corners: if all
are shadowed, the pixel is considered in shadow. The adaptive step sets a
minimum limit of corners to check (note that adaptive 1 will check 9 points:
four in the corners, then every between the corners). Look it up in the
documentation, I'm a little lazy to write it all out. :-P

Basically, you can use an enormous array of lights, and POV-Ray will only
use the amount needed until it calculates to be certain that a given
threshold of accuracy is reached. Still, it slows down the rendering
process, as this arealight will be used for the entire scene.

Note though that with arealights, only the shadows will receive softening,
specular highlights are still treated like from a pointlight.

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Alain
Subject: Re: Area lights vs spotlight
Date: 20 May 2005 16:02:05
Message: <428e423d$1@news.povray.org>
Tim Nikias nous apporta ses lumieres en ce 2005-05-20 20:52:
>>Is there a way in POV-Ray to make projections from a point? Maybe it's
>>possible to design something that does this manually ...
> 
> 
> What you're describing is what POV-Ray is doing. You define an array of
> lights in arealights. It begins with the first four in the corners: if all
> are shadowed, the pixel is considered in shadow. The adaptive step sets a
> minimum limit of corners to check (note that adaptive 1 will check 9 points:
> four in the corners, then every between the corners). Look it up in the
> documentation, I'm a little lazy to write it all out. :-P
> 
> Basically, you can use an enormous array of lights, and POV-Ray will only
> use the amount needed until it calculates to be certain that a given
> threshold of accuracy is reached. Still, it slows down the rendering
> process, as this arealight will be used for the entire scene.
> 
> Note though that with arealights, only the shadows will receive softening,
> specular highlights are still treated like from a pointlight.
> 
> Regards,
> Tim
> 
I've done some observations about the adaptive in an area_light:
Adaptive_value	Smalest_aray_that_POV-Ray_try_to_use
	0	2*2
	1	3*3
	2	5*5
	3	9*9
	4	17*17
	5	33*33
	6	65*65
The formula I came about is: 2^(adaptive value)+1
If two of those points are different, then you try to find a point from the aray that
the closest to 
the mid distance between the two perceding points. (the default aray of 4*4 is bad in
this case)

Alain


Post a reply to this message

From: Giuseppe Bilotta
Subject: Re: Area lights vs spotlight
Date: 21 May 2005 05:02:52
Message: <mg2vt73fcg3i$.1m1sqeopdzgf9$.dlg@40tude.net>
On Fri, 20 May 2005 20:52:03 +0200, Tim Nikias wrote:

>> Is there a way in POV-Ray to make projections from a point? Maybe it's
>> possible to design something that does this manually ...
> 
> What you're describing is what POV-Ray is doing. You define an array of
> lights in arealights. It begins with the first four in the corners: if all
> are shadowed, the pixel is considered in shadow. The adaptive step sets a
> minimum limit of corners to check (note that adaptive 1 will check 9 points:
> four in the corners, then every between the corners). Look it up in the
> documentation, I'm a little lazy to write it all out. :-P

Yes, I had already read the documentation about it :) but I was
thinking about some more analytical process. After all, most POV-Ray
shapes have almost-everywhere-analytical boundaries, so it should be
possible to calculate their projection on a plane (the plane of the
light as seen by the point whose shadow has to be calculated), its
intersection with the area light (the "true" one, not the discretized
version) and the calculate the area of the visible part of the light.

Or would this be too expensive?

-- 
Giuseppe "Oblomov" Bilotta


"A me me la compra il mio babbo"
(Altan)
("When I grow up, I will fight for peace"
 "I'll have my daddy buy it for me")


Post a reply to this message

From: Tim Nikias
Subject: Re: Area lights vs spotlight
Date: 21 May 2005 06:19:01
Message: <428f0b15@news.povray.org>
> Or would this be too expensive?

Yup, I think so. For one, this will have to be done for EVERY pixel in the
image (unless the arealight is confined with a spotlight). Once you go into
transparencies and reflections, this complicated lighting technique will
have to be done for every refracted/reflected ray. I don't expect the
analytical method to be faster than the method used right now, as some
objects are quite complicated in themselves, solving them analytically to
find boundaries will surely take longer than simply sampling a set of
points.
For example, add some media, and you're in for a difficult ride.

It might be possible, but the workload to calculate it will be so high that
it'll probably still be faster to use the current adaptive technique.

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Warp
Subject: Re: Area lights vs spotlight
Date: 21 May 2005 08:28:58
Message: <428f298a@news.povray.org>
Tim Nikias <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:
> Yup, I think so. For one, this will have to be done for EVERY pixel in the
> image

  More, actually, if antialiasing is used.

-- 
                                                          - Warp


Post a reply to this message

From: Giuseppe Bilotta
Subject: Re: Area lights vs spotlight
Date: 21 May 2005 09:14:59
Message: <15c3z6afr3qns.1aqamezeragc1.dlg@40tude.net>
On Sat, 21 May 2005 12:18:11 +0200, Tim Nikias wrote:

> Yup, I think so.

I feared as much :)

> For one, this will have to be done for EVERY pixel in the
> image (unless the arealight is confined with a spotlight). Once you go into
> transparencies and reflections, this complicated lighting technique will
> have to be done for every refracted/reflected ray. I don't expect the
> analytical method to be faster than the method used right now, as some
> objects are quite complicated in themselves, solving them analytically to
> find boundaries will surely take longer than simply sampling a set of
> points.
> For example, add some media, and you're in for a difficult ride.

Good points. Of course there would be quite some room for
optimizations, like skipping every other pixel and/or using the result
from adjacent pixels, or starting with some bounding box projections
(simpler shapes) and then fine-tuning with true projections.

OTOH, to obtain satisfactory results one still needs to use a rather
large amount of points, especially when not using jitter.

Maybe another idea would be a different form of adaptive sampling:
start with no pre-fixed number of lights in the area light, but
proceed by halving until the shadow delta is "good enough" (where the
user chooses the "good enough" instead of the number of lights)?

-- 
Giuseppe "Oblomov" Bilotta

"I weep for our generation" -- Charlie Brown


Post a reply to this message

From: Daniel Hulme
Subject: Re: Area lights vs spotlight
Date: 21 May 2005 09:32:30
Message: <20050521143230.20a6a585@dh286.pem.cam.ac.uk>
> Maybe another idea would be a different form of adaptive sampling:
> start with no pre-fixed number of lights in the area light, but
> proceed by halving until the shadow delta is "good enough" (where the
> user chooses the "good enough" instead of the number of lights)?

I think this would be feasible but no better than the current method.
You would also have to think hard about how this affects specular
highlights.

Daniel
-- 
Now  as he walked by the sea  of Galilee,  he saw  Simon and Andrew  his
brother casting a spam into the net:  for they were phishers.  And Jesus
said unto them, Come ye after me, and I will make you to become phishers
of men.  And  straightway  they forsook  their  nets,  and followed him.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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