ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/test/renders/aniso.cal
Revision: 1.3
Committed: Fri Feb 1 16:20:00 2019 UTC (5 years, 3 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R3, HEAD
Changes since 1.2: +3 -3 lines
Log Message:
Made safer calls to Exp() function to avoid errors pointed out by DGM.

File Contents

# Content
1 { RCSid $Id: aniso.cal,v 1.2 2018/12/01 02:06:04 greg Exp $ }
2 { Ward-Geisler-Moroder-Duer anisotropic BSDF model }
3
4 { Final 5 real arguments are alpha_x and alpha_y roughnesses and Up vector }
5
6 ax = arg(AC-4); { ax is roughness in Up orientation }
7 ay = arg(AC-3);
8
9 arefl(hx,hy,hz) = Exp(-(hx*hx/(ax*ax) + hy*hy/(ay*ay))/(hz*hz)) *
10 (hx*hx + hy*hy + hz*hz) /
11 (PI*ax*ay*hz*hz*hz*hz);
12
13 axmit(hx,hy,hz) = Exp(-(hx*hx/(ax*ax) + hy*hy/(ay*ay))/(hz*hz)) /
14 (4*PI*ax*ay);
15
16 dobsdf(sdx,sdy,sdz) = if(sdz, arefl(Idx+sdx, Idy+sdy, Idz+sdz),
17 axmit(Idx+sdx, Idy+sdy, Idz-sdz) / sqrt(-sdz*Idz) );
18
19 absdf(ox,oy,oz) = dobsdf(Ldx(ox,oy,oz), Ldy(ox,oy,oz), Ldz(ox,oy,oz));