ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/skybright.cal
(Generate patch)

Comparing ray/src/gen/skybright.cal (file contents):
Revision 2.2 by greg, Fri Mar 20 12:23:37 1992 UTC vs.
Revision 2.6 by gwlarson, Thu Jul 9 13:06:20 1998 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines