ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/Ashikhmin.cal
Revision: 1.1
Committed: Mon Mar 24 20:51:16 2014 UTC (10 years ago) by greg
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R2P1
Log Message:
Added Ashikhmin-Shirley BRDF model

File Contents

# Content
1 { RCSid $Id$ }
2 {
3 Ashikhmin-Shirley BRDF model
4
5 Includes Schlick estimate of Fresnel fraction,
6 but unlike Radiance material, does not remove
7 this from diffuse component.
8 }
9 { Parameters (change these) }
10 MF : 30;
11 lcorr(r,g,b) : MF*(.265*r + .670*g + .065*b);
12 rho_d : lcorr(0.0039510616569, 0.0036905000484, 0.0027494885161);
13 rho_s : lcorr(0.0090625419097, 0.0083144131101, 0.0060292909118);
14 f0 : 0.9999999990000;
15 nu : 962.839595;
16 nv : 72.3236783;
17 { Lobe calculation }
18 abs(x) : if(x, x, -x);
19 max(a,b) : if(a-b, a, b);
20 Schlick(odoth) : f0 + (1-f0)*(1-odoth)^5;
21 lobe2(iz,oz,hx,hy,hz,odoth) : Schlick(odoth)*sqrt((nu+1)*(nv+1)) /
22 (8*PI*max(abs(iz),abs(oz))*odoth) *
23 abs(hz)^((hx*hx*nu + hy*hy*nv)/(1-hz*hz));
24 lobe1(iz,ox,oy,oz,hx,hy,hz,nf) :
25 lobe2(iz,oz,hx*nf,hy*nf,hz*nf,(ox*hx+oy*hy+oz*hz)*nf);
26 lobe(iz,ox,oy,oz,hx,hy,hz) : lobe1(iz,ox,oy,oz,hx,hy,hz,
27 1/sqrt(hx*hx+hy*hy+hz*hz));
28
29 ashikhmin(ix,iy,iz,ox,oy,oz) : if( -iz*oz, 0,
30 rho_d/PI + rho_s*lobe(iz,ox,oy,oz,ix+ox,iy+oy,iz+oz) );