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 ); |