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.52 by greg, Tue Dec 7 23:49:50 2021 UTC vs.
Revision 3.53 by greg, Wed Dec 15 01:38:50 2021 UTC

# Line 523 | Line 523 | SDqueryTre(const SDTre *sdt, float *coef,
523          const RREAL     *vtmp;
524          float           yval;
525          FVECT           rOutVec;
526 <        double          gridPos[4];
526 >        RREAL           gridPos[4];
527  
528          if (sdt->stc[tt_Y] == NULL)     /* paranoia, I hope */
529                  return 0;
# Line 561 | Line 561 | SDqueryTre(const SDTre *sdt, float *coef,
561                  spinvector(rOutVec, outVec, zvec, -atan2(-inVec[1],-inVec[0]));
562                  gridPos[0] = (.5-FTINY) -
563                                  .5*sqrt(inVec[0]*inVec[0] + inVec[1]*inVec[1]);
564 <                SDdisk2square(gridPos+1, rOutVec[0], rOutVec[1]);
564 >                disk2square(gridPos+1, rOutVec[0], rOutVec[1]);
565          } else if (sdt->stc[tt_Y]->ndim == 4) {
566 <                SDdisk2square(gridPos, -inVec[0], -inVec[1]);
567 <                SDdisk2square(gridPos+2, outVec[0], outVec[1]);
566 >                disk2square(gridPos, -inVec[0], -inVec[1]);
567 >                disk2square(gridPos+2, outVec[0], outVec[1]);
568          } else
569                  return 0;               /* should be internal error */
570                                          /* get BSDF value */
# Line 746 | Line 746 | SDgetTreCDist(const FVECT inVec, SDComponent *sdc)
746   {
747          unsigned long   cacheLeft = SDmaxCache;
748          const SDTre     *sdt;
749 <        double          inCoord[2];
749 >        RREAL           inCoord[2];
750          int             i;
751          int             mode;
752          SDTreCDst       *cd, *cdlast, *cdlimit;
# Line 781 | Line 781 | SDgetTreCDist(const FVECT inVec, SDComponent *sdc)
781                                  .5*sqrt(inVec[0]*inVec[0] + inVec[1]*inVec[1]);
782          } else if (sdt->stc[tt_Y]->ndim == 4) {
783                  if (mode != sdt->sidef) /* use reciprocity? */
784 <                        SDdisk2square(inCoord, inVec[0], inVec[1]);
784 >                        disk2square(inCoord, inVec[0], inVec[1]);
785                  else
786 <                        SDdisk2square(inCoord, -inVec[0], -inVec[1]);
786 >                        disk2square(inCoord, -inVec[0], -inVec[1]);
787          } else
788                  return NULL;            /* should be internal error */
789                                          /* quantize to avoid f.p. errors */
# Line 888 | Line 888 | SDsampTreCDist(FVECT ioVec, double randX, const SDCDst
888          const SDTreCDst *cd = (const SDTreCDst *)cdp;
889          const unsigned  target = randX*cumlmax;
890          bitmask_t       hndx, hcoord[2];
891 <        double          gpos[3], rotangle;
891 >        FVECT           gpos;
892 >        double          rotangle;
893          int             i, iupper, ilower;
894                                          /* check arguments */
895          if ((ioVec == NULL) | (cd == NULL))
# Line 918 | Line 919 | SDsampTreCDist(FVECT ioVec, double randX, const SDCDst
919          for (i = 2; i--; )
920                  gpos[i] = ((double)hcoord[i] + rand()*(1./(RAND_MAX+.5))) /
921                                  (double)((bitmask_t)1 << nBitsC);
922 <        SDsquare2disk(gpos, gpos[0], gpos[1]);
922 >        square2disk(gpos, gpos[0], gpos[1]);
923                                          /* compute Z-coordinate */
924          gpos[2] = 1. - gpos[0]*gpos[0] - gpos[1]*gpos[1];
925          gpos[2] = sqrt(gpos[2]*(gpos[2]>0));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines