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

Comparing ray/src/util/rfluxmtx.c (file contents):
Revision 2.40 by greg, Sat Aug 20 03:36:04 2016 UTC vs.
Revision 2.45 by greg, Sat May 13 01:50:54 2017 UTC

# Line 64 | Line 64 | typedef struct {
64          FVECT   uva[2];                 /* tangent axes */
65          int     ntris;                  /* number of triangles */
66          struct ptri {
67 <                float   afrac;                  /* fraction of total area */
67 >                double  afrac;                  /* fraction of total area */
68                  short   vndx[3];                /* vertex indices */
69          }       tri[1];                 /* triangle array (extends struct) */
70   } POLYTRIS;                     /* triangulated polygon */
# Line 138 | Line 138 | oconv_command(int ac, char *av[])
138          
139          if (ac-- <= 0)
140                  return(NULL);
141 +        if (verbose < 0) {      /* turn off warnings */
142 +                strcpy(cp, "-w- ");
143 +                cp += 4;
144 +        }
145          while (ac-- > 0) {
146                  strcpy(cp, *av++);
147                  while (*cp) cp++;
# Line 379 | Line 383 | finish_receiver(void)
383                          curparams.vup[1] = 1;
384          }
385                                          /* determine sample type/bin */
386 <        if (tolower(curparams.hemis[0]) == 'u' | curparams.hemis[0] == '1') {
386 >        if ((tolower(curparams.hemis[0]) == 'u') | (curparams.hemis[0] == '1')) {
387                  sprintf(sbuf, "if(-Dx*%g-Dy*%g-Dz*%g,0,-1)",
388                          curparams.nrm[0], curparams.nrm[1], curparams.nrm[2]);
389                  binv = savqstr(sbuf);
# Line 756 | Line 760 | sample_reinhart(PARAMS *p, int b, FILE *fp)
760          }
761          while (n--) {                   /* stratified sampling */
762                  SDmultiSamp(samp3, 3, (n+frandom())/sampcnt);
763 +                if (row >= RowMax-1)    /* avoid crowding at zenith */
764 +                        samp3[1] *= samp3[1];
765                  alt = (row+samp3[1])*RAH;
766                  azi = (2.*PI)*(col+samp3[2]-.5)/rnaz(row);
767                  duvw[2] = cos(alt);     /* measured from horizon */
768                  duvw[0] = tsin(azi)*duvw[2];
769 <                duvw[1] = tcos(azi)*duvw[2];
769 >                duvw[1] = -tcos(azi)*duvw[2];
770                  duvw[2] = sqrt(1. - duvw[2]*duvw[2]);
771                  for (i = 3; i--; )
772                          orig_dir[1][i] = -duvw[0]*p->udir[i] -
# Line 867 | Line 873 | prepare_sampler(void)
873                  curparams.udir[1] *= -1.;
874                  curparams.udir[2] *= -1.;
875          }
876 <        if (tolower(curparams.hemis[0]) == 'u' | curparams.hemis[0] == '1')
876 >        if ((tolower(curparams.hemis[0]) == 'u') | (curparams.hemis[0] == '1'))
877                  curparams.sample_basis = sample_uniform;
878          else if (tolower(curparams.hemis[0]) == 's' &&
879                                  tolower(curparams.hemis[1]) == 'c')
# Line 1305 | Line 1311 | main(int argc, char *argv[])
1311                          fputs(": -i, -I supported for pass-through only\n", stderr);
1312                          return(1);
1313                  }
1314 <                fmtopt[2] = (sizeof(RREAL)==sizeof(double)) ? 'd' : 'f';
1314 > #ifdef SMLFLT
1315 >                fmtopt[2] = 'f';
1316 > #else
1317 >                fmtopt[2] = 'd';
1318 > #endif
1319                  if (sampcnt <= 0) sampcnt = 10000;
1320          }
1321          sprintf(sampcntbuf, "%d", sampcnt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines