ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/LaFortune1.cal
Revision: 1.2
Committed: Mon Jun 10 13:56:52 2019 UTC (4 years, 11 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R3, HEAD
Changes since 1.1: +2 -3 lines
Log Message:
Added max() and min() as .cal library functions

File Contents

# User Rev Content
1 greg 1.2 { RCSid $Id: LaFortune1.cal,v 1.1 2014/03/18 16:16:37 greg Exp $ }
2 greg 1.1 { 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     abs(x) : if(x, x, -x);
14     noneg(x) : if(x, x, 0);
15    
16     { Normalization factor based on parameters }
17 greg 1.2 snf : (n+2)/(2*PI*max(abs(Cx),abs(Cy),abs(Cz))^n);
18 greg 1.1
19     { Note that we assume i and o vectors are normalized, both pointing away }
20    
21     lafortune(ix,iy,iz,ox,oy,oz) : if( -iz*oz, 0,
22     rho_d/PI + rho_s*snf*noneg(Cx*ix*ox + Cy*iy*oy + Cz*iz*oz)^n );