POV-Ray : Newsgroups : povray.unofficial.patches : Photon range finding : Re: Photon range finding Server Time
2 Nov 2024 17:21:58 EDT (-0400)
  Re: Photon range finding  
From: Nathan Kopp
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

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