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

Comparing ray/src/gen/gendaymtx.c (file contents):
Revision 2.10 by greg, Sat Apr 6 00:44:59 2013 UTC vs.
Revision 2.11 by greg, Tue Apr 30 17:05:27 2013 UTC

# Line 108 | Line 108 | double sky_clearness;                  /* Sky clearness */
108   double solar_rad;                       /* Solar radiance */
109   double sun_zenith;                      /* Sun zenith angle (radians) */
110   int     input = 0;                              /* Input type */
111 + int     output = 0;                             /* Output type */
112  
113   extern double dmax( double, double );
114   extern double CalcAirMass();
# Line 330 | Line 331 | main(int argc, char *argv[])
331                                  goto userr;
332                          }
333                          break;
334 +                case 'O':                       /* output type */
335 +                        switch (argv[i][2]) {
336 +                        case '0':
337 +                                output = 0;
338 +                                break;
339 +                        case '1':
340 +                                output = 1;
341 +                                break;
342 +                        default:
343 +                                goto userr;
344 +                        }
345 +                        if (argv[i][3])
346 +                                goto userr;
347 +                        break;
348                  case 'm':                       /* Reinhart subdivisions */
349                          rhsubdiv = atoi(argv[++i]);
350                          break;
# Line 510 | Line 525 | main(int argc, char *argv[])
525                  fprintf(stderr, "%s: done.\n", progname);
526          exit(0);
527   userr:
528 <        fprintf(stderr, "Usage: %s [-v][-d|-s][-r deg][-m N][-g r g b][-c r g b][-o{f|d}] [tape.wea]\n",
528 >        fprintf(stderr, "Usage: %s [-v][-d|-s][-r deg][-m N][-g r g b][-c r g b][-o{f|d}][-O{0|1}] [tape.wea]\n",
529                          progname);
530          exit(1);
531   fmterr:
# Line 569 | Line 584 | ComputeSky(float *parr)
584  
585                  /* Limit sky brightness */
586                  if (sky_brightness < 0.01)
587 <                        sky_brightness = 0.01;
587 >                        sky_brightness = 0.01;
588  
589                  /* Calculate illuminance */
590                  index = GetCategoryIndex();
# Line 582 | Line 597 | ComputeSky(float *parr)
597                  index = CalcSkyParamFromIllum();
598          }
599  
600 +        if (output == 1) {                      /* hack for solar radiance */
601 +                diff_illum = diff_irrad * WHTEFFICACY;
602 +                dir_illum = dir_irrad * WHTEFFICACY;
603 +        }
604 +
605          if (bright(skycolor) <= 1e-4) {                 /* 0 sky component? */
606                  memset(parr, 0, sizeof(float)*3*nskypatch);
607                  return;
# Line 801 | Line 821 | double CalcSkyClearness()
821          double sz_cubed;        /* Sun zenith angle cubed */
822  
823          /* Calculate sun zenith angle cubed */
824 <        sz_cubed = pow(sun_zenith, 3.0);
824 >        sz_cubed = sun_zenith*sun_zenith*sun_zenith;
825  
826          return ((diff_irrad + dir_irrad) / diff_irrad + 1.041 *
827                          sz_cubed) / (1.0 + 1.041 * sz_cubed);
# Line 832 | Line 852 | double CalcDiffuseIrradiance()
852   double CalcDirectIrradiance()
853   {
854          return CalcDiffuseIrradiance() * ((sky_clearness - 1.0) * (1 + 1.041
855 <                        * pow(sun_zenith, 3.0)));
855 >                        * sun_zenith*sun_zenith*sun_zenith));
856   }
857  
858   /* Calculate sky brightness and clearness from illuminance values */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines