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.6 by greg, Fri Jan 25 23:17:31 2013 UTC vs.
Revision 2.7 by greg, Sat Jan 26 00:59:08 2013 UTC

# Line 515 | Line 515 | ComputeSky(float *parr)
515   {
516          int index;                      /* Category index */
517          double norm_diff_illum;         /* Normalized diffuse illuimnance */
518        double zlumin;                  /* Zenith luminance */
518          int i;
519          
520          /* Calculate atmospheric precipitable water content */
# Line 582 | Line 581 | ComputeSky(float *parr)
581          /* Normalization coefficient */
582          norm_diff_illum = diff_illum / norm_diff_illum;
583  
585        /* Calculate relative zenith luminance */
586        zlumin = CalcRelLuminance(sun_zenith, 0.0);
587
588        /* Calculate absolute zenith illuminance */
589        zlumin *= norm_diff_illum;
590
584          /* Apply to sky patches to get absolute radiance values */
585          for (i = 1; i < nskypatch; i++) {
586 <                scalecolor(parr+3*i, zlumin*(1./WHTEFFICACY));
586 >                scalecolor(parr+3*i, norm_diff_illum*(1./WHTEFFICACY));
587                  multcolor(parr+3*i, skycolor);
588          }
589   }
# Line 945 | Line 938 | double CalcRelHorzIllum( float *parr )
938          double rh_illum = 0.0;  /* Relative horizontal illuminance */
939  
940          for (i = 1; i < nskypatch; i++)
941 <                rh_illum += parr[3*i+1] * rh_cos(i);
941 >                rh_illum += parr[3*i+1] * rh_cos(i) * rh_dom[i];
942  
943 <        return rh_illum * (2.0 * PI / (nskypatch-1));
943 >        return rh_illum;
944   }
945  
946   /* Calculate earth orbit eccentricity correction factor */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines