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

Comparing ray/src/gen/gensky.c (file contents):
Revision 2.5 by greg, Fri Mar 20 15:29:10 1992 UTC vs.
Revision 2.6 by greg, Tue Apr 14 10:29:24 1992 UTC

# Line 75 | Line 75 | char  *argv[];
75                  month = 0;
76          } else {
77                  month = atoi(argv[1]);
78 +                if (month < 1 || month > 12)
79 +                        userror("bad month");
80                  day = atoi(argv[2]);
81 +                if (day < 1 || day > 31)
82 +                        userror("bad day");
83                  hour = atof(argv[3]);
84 +                if (hour < 0 || hour >= 24)
85 +                        userror("bad hour");
86                  tsolar = argv[3][0] == '+';
87          }
88          for (i = 4; i < argc; i++)
# Line 151 | Line 157 | computesky()                   /* compute sky parameters */
157          if (zenithbr <= 0.0)
158                  if (cloudy) {
159                          zenithbr = 8.6*sundir[2] + .123;
160 <                        zenithbr *= 1000.0/SKYEFFICACY;
160 >                        zenithbr *= 1000.0/WHTEFFICACY;
161                  } else {
162                          zenithbr = (1.376*turbidity-1.81)*tan(altitude)+0.38;
163                          zenithbr *= 1000.0/SKYEFFICACY;
# Line 168 | Line 174 | computesky()                   /* compute sky parameters */
174          } else {
175                  F2 = 0.274*(0.91 + 10.0*exp(-3.0*(PI/2.0-altitude)) +
176                                  0.45*sundir[2]*sundir[2]);
177 <                groundbr = zenithbr*normsc(PI/2.0-altitude)/F2/PI;
177 >                groundbr = zenithbr*normsc(altitude)/F2/PI;
178                  printf("# Ground ambient level: %f\n", groundbr);
179                  if (sundir[2] > 0.0) {
180                          if (sundir[2] > .16)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines