ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/skybright.cal
Revision: 2.7
Committed: Sat Feb 22 02:07:24 2003 UTC (21 years, 1 month ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Changes since 2.6: +1 -2 lines
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# Content
1 { RCSid: $Id$ }
2 {
3 Sky brightness function for sunny and cloudy skies.
4
5 Additional arguments required for calculation of skybright:
6
7 A1 - 1 for CIE clear, 2 for CIE overcast,
8 3 for uniform, 4 for CIE intermediate
9 A2 - zenith brightness
10 A3 - ground plane brightness
11 A4 - normalization factor based on sun direction
12 A5,A6,A7 - sun direction
13 }
14
15 cosgamma = Dx*A5 + Dy*A6 + Dz*A7;
16
17 gamma = Acos(cosgamma); { angle from sun to this point in sky }
18
19 zt = Acos(A7); { angle from zenith to sun }
20
21 eta = Acos(Dz); { angle from zenith to this point in sky }
22
23 wmean(a, x, b, y) : (a*x + b*y) / (a + b);
24
25 skybr = wmean((Dz+1.01)^10,
26 select(A1, sunnysky, cloudysky, unifsky, intersky),
27 (Dz+1.01)^-10, A3);
28
29 sunnysky = A2 * (.91 + 10*exp(-3*gamma) + .45*cosgamma*cosgamma)
30 * if( Dz - .01, 1.0 - exp(-.32/Dz), 1.0) / A4;
31
32 cloudysky = A2 * (1 + 2*Dz)/3;
33
34 unifsky = A2;
35
36 intersky = A2 * ( (1.35*sin(5.631-3.59*eta)+3.12)*sin(4.396-2.6*zt)
37 + 6.37 - eta ) / 2.326 *
38 exp(gamma*-.563*((2.629-eta)*(1.562-zt)+.812)) / A4;