ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/WalterBTDF.cal
(Generate patch)

Comparing ray/src/cal/cal/WalterBTDF.cal (file contents):
Revision 1.1 by greg, Tue Mar 18 16:16:37 2014 UTC vs.
Revision 1.2 by greg, Wed Mar 19 19:06:20 2014 UTC

# Line 1 | Line 1
1   { RCSid $Id$ }
2   {
3 <        BTDF model by Walter et al.
3 >        Isotropic BTDF model by Walter et al.
4   }
5                          { Model parameters (change these) }
6   ksint : 0.126221381019119;
# Line 12 | Line 12 | alpha : 0.149990535073450;
12                          { Useful functions }
13   s(x) : x*x;
14   abs(x) : if(x, x, -x);
15 + noneg(x) : if(x, x, 0);
16 +
17 +                        { Lobe calculation }
18   G(x) : 2/(1 + sqrt(1 + s(alpha)*(1-s(x))/s(x)));
19   F(w) : f0 + (1-f0)*(1-w)^5;
20   D(htn) : s(alpha)/PI/s( s(htn)*(s(alpha)-1) + 1 );
21  
22 <                        { Lobe calculation }
20 < lobe3(wiht,woht,win,won,htn) : abs(wiht)*abs(woht)/(abs(win)*abs(won)) *
22 > lobe3(wiht,woht,win,won,htn) : abs(wiht*woht/(win*won)) *
23                  s(sigma_o)*(1-F(wiht))*D(htn)*G(win)*G(won) /
24                          s(sigma_i*wiht + sigma_o*woht);
25  
# Line 30 | Line 32 | lobe1(ix,iy,iz,ox,oy,oz,htx,hty,htz) : lobe2(ix,iy,iz,
32                          { Final function call - transmission only! }
33                          { vectors normalized, pointing away from surface }
34   walter(ix,iy,iz,ox,oy,oz) : if(iz*oz, 0,
35 <                                ksint * lobe1(ix,iy,iz,ox,oy,oz,
35 >                                ksint*noneg(lobe1(ix,iy,iz,ox,oy,oz,
36                                  -sigma_i*ix-sigma_o*ox,
37                                  -sigma_i*iy-sigma_o*oy,
38 <                                -sigma_i*iz-sigma_o*oz) );
38 >                                -sigma_i*iz-sigma_o*oz)) );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines