POV-Ray : Newsgroups : povray.unofficial.patches : Photon range finding Server Time
3 Sep 2024 00:18:09 EDT (-0400)
  Photon range finding (Message 1 to 6 of 6)  
From: Bob
Subject: Photon range finding
Date: 7 Jun 1999 03:58:05
Message: <375B7B72.EBA466EC@aol.com>
Some reverse engineering of your formulation here (never mind my
terminology please):

range_divider = 100000
intensity*128 = 0.00001
intensity = 0.000000078125
spread = 0.0002795084972
spacing_for_object = 0.015 (only approximation)
distance_from_light_to_object = 54 (only approximation in POV units)

So if a light is 54 POV units from the object having photon mapping using
a 0.015 spacing (? not sure which parameter this is in the photon
statement) then you would get the acceptable range value. Obviously these
last two things is what it all hinges upon. Increase the light to object
distance and you need to also increase the spacing.
Does this make sense? So to get good results always increase or decrease
both together? I can see where having a parameter to vary this without
need to move the light_source would be a good thing if so.


Nathan Kopp wrote:
> 
> Alan Kong wrote:
> >
> >   Nathan, rather than post the image for a third time I thought I'd
> > show the relevant part that illustrates how the caustics look now.
> > "range_divider 100000" fixed my scene. Is there a rule of thumb for
> > one to follow on setting this value?
> 
> I'm glad that worked!
> 
> There is a rule to follow, but it's not very straight forward.  First,
> you have to compute the photon spread at a distance of one unit:
> 
>   spread = spacing_for_object / distance_from_light_to_object;
> 
> Next, estimate the intensity of one photon (assume that the light has
> an intensity of <1,1,1> at the spot where the photons are recorded)
> 
>   intensity = spread*spread;
> 
> Finally, set the range divider using the following formula:
> 
>   range_divider = 1.0/(intensity*128.0);
> 
> These are the same formulas that my new code uses to automatically choose
> an appropriate range_divider.  I assume that the intensity of all photons
> in the scene will be very similar.  Hopefully, this formula will come up
> with a number close to 100000 for your scene (give or take an order of
> magnitude ;-)  ).
> 
> -Nathan

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

From: Nathan Kopp
Subject: Re: Photon range finding
Date: 7 Jun 1999 09:08:25
Message: <375BC3AF.CBC0A7D4@Kopp.com>
By 'spacing' I meant 'separation'.  In the future you won't have to
adjust range_divider manually.  Currently, the default value will work
unless you go shooting 9 million photons like Alan.  Most scenes need
less than 500,000, and the default value is good for that number.
The choice for range_divider doesn't need to be exact, since it
gives a range of many orders of magnitude.

Remember, range_divider only relates to the compression of one photon's
color from three floats down to four bytes.

-Nathan

Bob wrote:
> 
> Some reverse engineering of your formulation here (never mind my
> terminology please):
> 
> range_divider = 100000
> intensity*128 = 0.00001
> intensity = 0.000000078125
> spread = 0.0002795084972
> spacing_for_object = 0.015 (only approximation)
> distance_from_light_to_object = 54 (only approximation in POV units)
> 
> So if a light is 54 POV units from the object having photon mapping using
> a 0.015 spacing (? not sure which parameter this is in the photon
> statement) then you would get the acceptable range value. Obviously these
> last two things is what it all hinges upon. Increase the light to object
> distance and you need to also increase the spacing.
> Does this make sense? So to get good results always increase or decrease
> both together? I can see where having a parameter to vary this without
> need to move the light_source would be a good thing if so.
> 
> Nathan Kopp wrote:
> >
> > Alan Kong wrote:
> > >
> > >   Nathan, rather than post the image for a third time I thought I'd
> > > show the relevant part that illustrates how the caustics look now.
> > > "range_divider 100000" fixed my scene. Is there a rule of thumb for
> > > one to follow on setting this value?
> >
> > I'm glad that worked!
> >
> > There is a rule to follow, but it's not very straight forward.  First,
> > you have to compute the photon spread at a distance of one unit:
> >
> >   spread = spacing_for_object / distance_from_light_to_object;
> >
> > Next, estimate the intensity of one photon (assume that the light has
> > an intensity of <1,1,1> at the spot where the photons are recorded)
> >
> >   intensity = spread*spread;
> >
> > Finally, set the range divider using the following formula:
> >
> >   range_divider = 1.0/(intensity*128.0);
> >
> > These are the same formulas that my new code uses to automatically choose
> > an appropriate range_divider.  I assume that the intensity of all photons
> > in the scene will be very similar.  Hopefully, this formula will come up
> > with a number close to 100000 for your scene (give or take an order of
> > magnitude ;-)  ).
> >
> > -Nathan
> 
> --
>  omniVERSE: beyond the universe
>   http://members.aol.com/inversez/homepage.htm
>  mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

From: Bob
Subject: Re: Photon range finding
Date: 7 Jun 1999 22:33:35
Message: <375C80E1.CC66E72E@aol.com>
Think I'll stick to rendering only. No programming math for me, thankyou.
But back to the question about light source distance :) is it directly proportional to
the "separation" then? In other words, the closer or farther away a light, a narrower
or
wider separation is needed to keep the same end result?


Nathan Kopp wrote:
> 
> By 'spacing' I meant 'separation'.  In the future you won't have to
> adjust range_divider manually.  Currently, the default value will work
> unless you go shooting 9 million photons like Alan.  Most scenes need
> less than 500,000, and the default value is good for that number.
> The choice for range_divider doesn't need to be exact, since it
> gives a range of many orders of magnitude.
> 
> Remember, range_divider only relates to the compression of one photon's
> color from three floats down to four bytes.
> 

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

From: Nathan Kopp
Subject: Re: Photon range finding
Date: 7 Jun 1999 22:57:17
Message: <375C85F0.ACC33FE1@Kopp.com>
Not really.  The separation keyword allows you to specify the spacial
separation of photons at the center of the target object.  Of course,
photons are always spreading out (from the light source location) so the
actual spacing is always increasing as the photon moves farther from the
light source (unless it gets focused by a lens, of course).

I could have made the user specify an angular spacing (or a total number of
photons, for that matter) instead of a spacial separation.  I chose
spacial separation because it correlates directly with the size of the
gather radius (which the user must also specify).  Thus, once you have
the settings figured out for a scene, you can scale the separation
values and gather radius by the same amount to increase/decrease the
total number of photons.

As you move the light source closer and farther from the target object,
the angular density of the photons will change, but the total number of
photons will remain approximately the same.

-Nathan Kopp

Bob wrote:
> 
> Think I'll stick to rendering only. No programming math for me, thankyou.
> But back to the question about light source distance :) is it directly proportional
to
> the "separation" then? In other words, the closer or farther away a light, a
narrower or
> wider separation is needed to keep the same end result?
>


Post a reply to this message

From: Bob
Subject: Re: Photon range finding
Date: 8 Jun 1999 01:20:41
Message: <375CA803.F2304D76@aol.com>
I see, what my mind was doing was thinking of it as a relative thing which a person
setting the objects and lights up would be adjusting for (like so many other
tweakings).
This makes more sense to me now as a kind of photon falloff with distance, that is to
say the farther a light the less photons counted (less dense). Or am I going off the
track there? Well, anyway, it's making more and more sense all the time.


Nathan Kopp wrote:
> 
> Not really.  The separation keyword allows you to specify the spacial
> separation of photons at the center of the target object.  Of course,
> photons are always spreading out (from the light source location) so the
> actual spacing is always increasing as the photon moves farther from the
> light source (unless it gets focused by a lens, of course).
> 
> I could have made the user specify an angular spacing (or a total number of
> photons, for that matter) instead of a spacial separation.  I chose
> spacial separation because it correlates directly with the size of the
> gather radius (which the user must also specify).  Thus, once you have
> the settings figured out for a scene, you can scale the separation
> values and gather radius by the same amount to increase/decrease the
> total number of photons.
> 
> As you move the light source closer and farther from the target object,
> the angular density of the photons will change, but the total number of
> photons will remain approximately the same.
> 
> -Nathan Kopp
> 
> Bob wrote:
> >
> > Think I'll stick to rendering only. No programming math for me, thankyou.
> > But back to the question about light source distance :) is it directly
proportional to
> > the "separation" then? In other words, the closer or farther away a light, a
narrower or
> > wider separation is needed to keep the same end result?
> >

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

From: Nathan Kopp
Subject: Re: Photon range finding
Date: 9 Jun 1999 00:07:47
Message: <375DE7F3.CB7E0855@Kopp.com>
I agree that another parameter to tweak is bad, so in the next version, the
computer will automatically choose a good setting for range_divider so you
should not ever have to worry about it again.  :-)

-Nathan

Bob wrote:
> 
> I see, what my mind was doing was thinking of it as a relative thing which a person
> setting the objects and lights up would be adjusting for (like so many other
tweakings).
> This makes more sense to me now as a kind of photon falloff with distance, that is
to
> say the farther a light the less photons counted (less dense). Or am I going off the
> track there? Well, anyway, it's making more and more sense all the time.
>


Post a reply to this message

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