[Radiance-general] Re: Light incident direction in function files

Greg Ward [email protected]
Mon, 4 Aug 2003 11:07:33 -0700


Hi Frank,

Only certain of the Radiance material types give access to the incident  
light direction.  The BRDF types (plasfunc, metfunc, transfunc,  
plasdata, metdata, transdata, and BRTDfunc) allow you to define  
functions that pass the source direction (x,y,z).  Since these are  
function parameters rather than system variables, you can only access  
them in the way described in the original Digests post (attached).  The  
prism material types (prism1 and prism2) actually define a separate set  
of variables, DxA, DyA, and DzA that correspond to the target light  
source direction, but these variables are only defined when evaluating  
these primitives.  The Radiance reference manual attempts to be  
complete it its obscure way in defining these things.  (This may be  
found in HTML form in the latest distribution or directly from the  
website at <http://floyd.lbl.gov/radiance/refer/ray.html>.)

The reason the incident light direction is not defined in general is  
because there is usually no need for it, and typically it is not known  
during pattern/texture evaluation.  What is your application for this  
information?

-Greg

> USING BRDF DATA
>
> From: [email protected]
> Subject: Re: Question concerning BRTDfunc's
> To: [email protected] (gregory ward)
> Date: Fri, 19 Feb 93 8:30:55 MEZ
>
> Hi Greg,
> thanks for your examples - they help. But as you assumed I have some  
> questions
> still. I believe I could most easily work with the data, eg transdata
> material types. I do not see, however, so far the relationship between
> the datafile and the functions eg in your reflector example. In order  
> to
> understand, it would be probably sufficient for me to know the meaning
> of the data in the sae_refl.dat file. I could then figure out the rest.
>
> How can I relate to the direction of the incident light? There is no  
> pre-
> defined vector in rayinit.cal, is there? I read x,y,z in some places,  
> but
> they seem to be general variables.
>
> What exactly are coordinate inices and coordinate index functions?
>
> I hope I do not take too much of your time. As feedback for you: There  
> are more
> and more people working with RADIANCE here in teh department. And the  
> more
> we find out about it and its proper use the better. I was just recently
> invited to give a talk and paper (for publication in a little book) on
> daylighting simulations. Ans as you can guess: RADIANCE and examples  
> calculated
> using it will make up the major part of the talk. So there is  
> spreading of
> the information.
>
> Best regards,
>                 Fred
> ----------------------------------------------------------------------- 
> -----
> Friedrich Sick   MAIL : Fraunhofer Institute for Solar Energy Systems
>                         Oltmannsstr. 22
>                         D 7800 Freiburg, West Germany
>                  PHONE: +49 (761) 4014 133    FAX: +49 (761) 4014 132
>                  EMAIL: [email protected]
> ----------------------------------------------------------------------- 
> -----
> *** NOTE:               NEW FAX NUMBER: +49 (761) 4014 132              
>   ***
> ----------------------------------------------------------------------- 
> -----
>
> Date: Fri, 19 Feb 93 09:06:12 PST
> From: greg (Gregory J. Ward)
> To: [email protected]
> Subject: Re: Question concerning BRTDfunc's
>
> Hi Fred,
>
> OK, working just with the reflector example, we defined sae_red thusly:
>
> void metdata sae_red
> 5 sae_refl sae_refl.dat reflector.cal sae_theta sae_phi
> 0
> 5 1 .01 .01 .9 .00258
>
> The first string argument above is a function that modifies the data  
> value
> in the file (correcting for the projected area of the object in this  
> case).
> The fourth and fifth string arguments are functions that for a given
> (normalized) source ray direction, compute WHICH VALUES to look up in  
> the
> data file.  This is a bit of a peculiar example, because we happen to  
> have
> data that gives reflectance as a function of the angle to the surface  
> normal
> (in degrees) and the angle between the reflected ray direction and the
> source incident direction.  Observe the definitions for these functions
> given in reflector.cal:
>
>                                 { entrance angle (source to normal) }
> sae_theta(x,y,z) = acos(x*Nx+y*Ny+z*Nz)*180/PI;
>                                 { observation angle (view to source) }
> sae_phi(x,y,z) = acos(-(x*Dx+y*Dy+z*Dz))*180/PI;
>
> Again, the x,y,z parameters to these functions, as supplied by the  
> Radiance
> renderer, are the normalized source ray direction.  In sae_theta, this
> vector is used in a dot-product against the surface normal (Nx,Ny,Nz)  
> to
> compute the polar angle.  In sae_phi, a dot product with the incident
> ray direction (Dx,Dy,Dz) (directed always towards the surface) to  
> compute
> the "observation angle" (ie. the angle between source ray and incident  
> ray).
---- clip ----


> From: Frank Eggenstein <[email protected]>
> Date: Mon Aug 4, 2003  5:58:13  AM US/Pacific
>
> Hi,
>
> can anybody tell me how to get the light incident direction in a  
> function file?
> In Digest v2n5 I found x,y,z. I tried this, but it doesn't work! :-(
> Radiance doesn't know these variables.
>
> Thank you very much for your help!
>
> Best regards,
>
> Frank