POV-Ray : Newsgroups : povray.documentation.inbuilt : Errors in light attenuation and height field documentation : Re: Errors in light attenuation and height field documentation Server Time
26 Jan 2022 13:11:01 EST (-0500)
  Re: Errors in light attenuation and height field documentation  
From: Cousin Ricky
Date: 24 Mar 2013 11:15:00
Message: <web.514f16dbe64ae1b678641e0c0@news.povray.org>
James Holsenback <nom### [at] nonecom> wrote:
> On 03/24/2013 02:01 AM, Cousin Ricky wrote:
> > At http://wiki.povray.org/content/Reference:Light_Source#Light_Fading in the
> > wiki and in section 3.4.4.1.9 of the 3.7 off-line documentation, an example
> > function is given to determine the brightness of a light source:
> >
> >    #declare Intensity_Factor = function (LD,FD,FP) {pow(1+(LD/FD),FP)/2};
> >
> > This should be:
> >
> >    #declare Intensity_Factor = function (LD,FD,FP) {(1+pow(LD/FD,FP))/2};
>
> Indeed I added (well ... plagiarized) it from a NG discussion, that I
> couldn't find to check if a mistake was made. I did however find and
> check my own personal notes from when was putting the entry together and
> it appears that I at least got it right. I couldn't comment of the
> correctness of the math. Care to elaborate?

I asked myself, how bright would the light source need to be in order to
illuminate an object to a certain level at a given distance.  What I came up
with turns out to be the reciprocal of the attenuation formula.  If you or
Trever thinks it should be otherwise, I'd like to see the derivation.

> Hmmm ... OK good find, but for some reason your correction looked
> incomplete. RE: from the declarations above shouldn't it be:
>
> HF_FUNCTION:
>    function (FieldResolution_X, FieldResolution_Y) { UserDefined_Function }

The parentheses are neither necessary nor permitted.  The following scene file
runs without parse errors:
______________________________________________________________

#version 3.7;
global_settings { assumed_gamma 1 }
camera { location <0, 5, -10> look_at 0 }
light_source { <-1, 1, -1> * 1000, rgb 1 parallel point_at 0 }

#declare fn_Hills = function
{ pigment { bumps warp { turbulence 0.5 } scale 0.12 }
}

height_field
{ function 500, 500 { fn_Hills (x, y, z).red }
  smooth
  translate -<0.5, 0, 0.5>
  scale <10, 1, 10>
  pigment { green 0.5 }
}
______________________________________________________________

> > In addition, the documentation does not explain height field functions.  I'm
> > having to figure out how it works by experimentation.
> >
> > The 3.6 documentation doesn't even describe the syntax of a height field
> > function.
>
> Maybe adding a link to http://wiki.povray.org/content/Reference:Function
> or one of it's sub-sections might do the trick ... maybe you have
> another section in mind.

No, this needs to be addressed in-place, as the syntax and semantics of the
construction are unique to the height field context.


Post a reply to this message

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