ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/LaFortune1.cal
Revision: 1.1
Committed: Tue Mar 18 16:16:37 2014 UTC (10 years, 1 month ago) by greg
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R2P1
Log Message:
Added implementations of Walter et al.'s BTDF model and LaFortune BRDF

File Contents

# Content
1 { RCSid $Id$ }
2 { LaFortune reflectance model with one lobe }
3
4 { Sample parameters (change these) }
5 rho_d : 0.136465483630983;
6 rho_s : 0.144594472775860;
7 Cx : -0.605122636448704;
8 Cy : -0.664960041454502;
9 Cz : 0.586571000768196;
10 n : 29.629194300125050;
11
12 { Useful functions }
13 max(a,b) : if(a-b, a, b);
14 abs(x) : if(x, x, -x);
15 noneg(x) : if(x, x, 0);
16
17 { Normalization factor based on parameters }
18 snf : (n+2)/(2*PI*max(abs(Cx),max(abs(Cy),abs(Cz)))^n);
19
20 { Note that we assume i and o vectors are normalized, both pointing away }
21
22 lafortune(ix,iy,iz,ox,oy,oz) : if( -iz*oz, 0,
23 rho_d/PI + rho_s*snf*noneg(Cx*ix*ox + Cy*iy*oy + Cz*iz*oz)^n );