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

Comparing ray/src/common/bsdf_t.c (file contents):
Revision 3.31 by greg, Thu Aug 8 05:26:56 2013 UTC vs.
Revision 3.35 by greg, Mon Mar 24 04:00:45 2014 UTC

# Line 284 | Line 284 | SDdotravTre(const SDNode *st, const double *pos, int c
284                  unsigned        skipmask = 0;
285                  csiz *= .5;
286                  for (i = st->ndim; i--; )
287 <                        if (1<<i & cmask)
287 >                        if (1<<i & cmask) {
288                                  if (pos[i] < cmin[i] + csiz)
289                                          for (n = 1 << st->ndim; n--; ) {
290                                                  if (n & 1<<i)
# Line 295 | Line 295 | SDdotravTre(const SDNode *st, const double *pos, int c
295                                                  if (!(n & 1<<i))
296                                                          skipmask |= 1<<n;
297                                          }
298 +                        }
299                  for (n = 1 << st->ndim; n--; ) {
300                          if (1<<n & skipmask)
301                                  continue;
# Line 516 | Line 517 | build_scaffold(float val, const double *cmin, double c
517                  sp->wmax = wid;
518          if (sp->alen >= sp->nall) {     /* need more space? */
519                  struct outdir_s *ndarr;
520 <                sp->nall += 1024;
520 >                sp->nall = (int)(1.5*sp->nall) + 256;
521                  ndarr = (struct outdir_s *)realloc(sp->darr,
522                                          sizeof(struct outdir_s)*sp->nall);
523                  if (ndarr == NULL) {
# Line 799 | Line 800 | SDsampTreCDist(FVECT ioVec, double randX, const SDCDst
800          SDsquare2disk(gpos, gpos[0], gpos[1]);
801                                          /* compute Z-coordinate */
802          gpos[2] = 1. - gpos[0]*gpos[0] - gpos[1]*gpos[1];
803 <        if (gpos[2] > 0)                /* paranoia, I hope */
803 <                gpos[2] = sqrt(gpos[2]);
803 >        gpos[2] = sqrt(gpos[2]*(gpos[2]>0));
804                                          /* emit from back? */
805          if ((cd->sidef == SD_BREFL) | (cd->sidef == SD_FXMIT))
806                  gpos[2] = -gpos[2];
807 <        if (cd->isodist) {              /* rotate isotropic result */
807 >        if (cd->isodist) {              /* rotate isotropic sample */
808                  rotangle = atan2(-ioVec[1],-ioVec[0]);
809 <                VCOPY(ioVec, gpos);
810 <                spinvector(ioVec, ioVec, zvec, rotangle);
809 >                spinvector(ioVec, gpos, zvec, rotangle);
810          } else
811                  VCOPY(ioVec, gpos);
812          return SDEnone;
# Line 849 | Line 848 | load_values(char **spp, float *va, int n)
848          char    *svnext;
849  
850          while (n-- > 0 && (svnext = fskip(*spp)) != NULL) {
851 <                *v++ = atof(*spp);
851 >                if ((*v++ = atof(*spp)) < 0)
852 >                        v[-1] = 0;
853                  *spp = svnext;
854                  eat_token(spp, ',');
855          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines