POV-Ray : Newsgroups : povray.binaries.images : Light Fading Documentation Error : Re: Light Fading Documentation Error Server Time
7 Nov 2024 02:23:30 EST (-0500)
  Re: Light Fading Documentation Error  
From: clipka
Date: 25 Dec 2016 16:02:05
Message: <586033cd$1@news.povray.org>
Am 25.12.2016 um 20:45 schrieb Cousin Ricky:

> It is well known that POV-Ray's light_source attenuation does not use
> true Newtonian fading (prior to 3.7.1, anyway).  To mitigate this, the
> 3.7 user manual suggests the formula
> 
>   Intensity_Factor = function (LD,FD,FP) {pow(1+(LD/FD),FP)/2}
...
> Back when POV-Ray 3.7.0 was being finalized, I noticed that this formula
> seemed to be incorrect, and I posted my concern to to p.d.i in March
> 2013.  I proposed that the proper formula is {(1+pow(LD/FD,FP))/2}.

I haven't verified your claims regarding the test images, but from the
maths I come to the same conclusion as you do.

The docs say, "The following example, that takes the inverse of the
above formula [...]" -- here, "inverse" needs to be interpreted as
"reciprocal", i.e. the multiplicative inverse of the attenuation, not
some inverse function mapping the attenuation back to distance.

As such, this "inverse" is easily computed by swapping the numerator and
denominator of the attenuation formula.

> James was skeptical, saying that he correctly copied the formula from
> his source, but didn't check the math.  I had checked the math, but no
> further action was taken.

My geuss that it drowned in the height field related portion of the
thread, and I'd recommend you bring this to Jim's attention again.

> P.S. I had always assumed that the reason POV-Ray used an attenuation
> formula that maxed out at 2 was to cope with limited dynamic range.  But
> with CLipka's recent gamma thread and the brightness of the back wall in
> frame 4, it occurred to me that this might be another non-linear gamma
> hack.

My personal bet would be that it has nothing to do with gamma, but that
the author was a bit more afraid of divide-by-zero errors than necessary
in this case.

Or that person did indeed intend to model a light source of
non-infinitesimal size.


Post a reply to this message

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