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 1.5 by greg, Tue Aug 6 08:22:06 1991 UTC vs.
Revision 1.6 by greg, Thu Oct 24 13:43:22 1991 UTC

# Line 17 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17  
18   #include  <math.h>
19  
20 + #include  "color.h"
21  
22   extern char  *strcpy(), *strcat(), *malloc();
23   extern double  stadj(), sdec(), sazi(), salt();
# Line 133 | Line 134 | computesky()                   /* compute sky parameters */
134          if (zenithbr <= 0.0)
135                  if (cloudy) {
136                          zenithbr = 8.6*sundir[2] + .123;
137 <                        zenithbr *= 1000.0*.0064/3.;
137 >                        zenithbr *= 1000.0/SKYEFFICACY;
138                  } else {
139                          zenithbr = (1.376*turbidity-1.81)*tan(altitude)+0.38;
140 <                        zenithbr *= 1000.0*.0064/3.;
140 >                        zenithbr *= 1000.0/SKYEFFICACY;
141                  }
142          if (zenithbr < 0.0)
143                  zenithbr = 0.0;
# Line 151 | Line 152 | computesky()                   /* compute sky parameters */
152                  printf("# Ground ambient level: %f\n", groundbr);
153                  if (sundir[2] > 0.0) {
154                          if (sundir[2] > .16)
155 <                                solarbr = 2.47e6 - 3.15e5/sundir[2];
155 >                                solarbr = (1.5e9/SUNEFFICACY) *
156 >                                        (1.147 - .147/sundir[2]);
157                          else
158 <                                solarbr = 5e5;
158 >                                solarbr = 1.5e9/SUNEFFICACY*(1.147-.147/.16);
159                          groundbr += solarbr*6e-5*sundir[2]/PI;
160                  } else
161                          dosun = 0;
# Line 167 | Line 169 | printsky()                     /* print out sky */
169          if (dosun) {
170                  printf("\nvoid light solar\n");
171                  printf("0\n0\n");
172 <                printf("3 %f %f %f\n", solarbr, solarbr, solarbr);
172 >                printf("3 %.2e %.2e %.2e\n", solarbr, solarbr, solarbr);
173                  printf("\nsolar source sun\n");
174                  printf("0\n0\n");
175                  printf("4 %f %f %f 0.5\n", sundir[0], sundir[1], sundir[2]);
# Line 177 | Line 179 | printsky()                     /* print out sky */
179          printf("2 skybright skybright.cal\n");
180          printf("0\n");
181          if (cloudy)
182 <                printf("3 1 %f %f\n", zenithbr, groundbr);
182 >                printf("3 1 %.2e %.2e\n", zenithbr, groundbr);
183          else
184 <                printf("7 -1 %f %f %f %f %f %f\n", zenithbr, groundbr, F2,
185 <                                sundir[0], sundir[1], sundir[2]);
184 >                printf("7 -1 %.2e %.2e %.2e %f %f %f\n", zenithbr, groundbr,
185 >                                F2, sundir[0], sundir[1], sundir[2]);
186   }
187  
188  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines