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

Comparing ray/src/rt/ambcomp.c (file contents):
Revision 2.52 by greg, Wed May 7 21:45:13 2014 UTC vs.
Revision 2.53 by greg, Thu May 8 04:02:40 2014 UTC

# Line 105 | Line 105 | vdb_edge(int db1, int db2)
105          case VDB_xY:    return(db2==VDB_x ? VDB_y : VDB_X);
106          case VDB_Xy:    return(db2==VDB_y ? VDB_x : VDB_Y);
107          }
108 <        error(INTERNAL, "forbidden diagonal in vdb_edge()");
108 >        error(CONSISTENCY, "forbidden diagonal in vdb_edge()");
109          return(-1);
110   }
111  
# Line 537 | Line 537 | add2gradient(FVECT grad, FVECT egrad1, FVECT egrad2, F
537  
538  
539   /* Compute anisotropic radii and eigenvector directions */
540 < static int
540 > static void
541   eigenvectors(FVECT uv[2], float ra[2], FVECT hessian[3])
542   {
543          double  hess2[2][2];
# Line 559 | Line 559 | eigenvectors(FVECT uv[2], float ra[2], FVECT hessian[3
559          if (i == 1)                     /* double-root (circle) */
560                  evalue[1] = evalue[0];
561          if (!i || ((evalue[0] = fabs(evalue[0])) <= FTINY*FTINY) |
562 <                        ((evalue[1] = fabs(evalue[1])) <= FTINY*FTINY) )
563 <                error(INTERNAL, "bad eigenvalue calculation");
564 <
562 >                        ((evalue[1] = fabs(evalue[1])) <= FTINY*FTINY) ) {
563 >                ra[0] = ra[1] = maxarad;
564 >                return;
565 >        }
566          if (evalue[0] > evalue[1]) {
567                  ra[0] = sqrt(sqrt(4.0/evalue[0]));
568                  ra[1] = sqrt(sqrt(4.0/evalue[1]));
# Line 828 | Line 829 | doambient(                             /* compute ambient component */
829                  K = 1.0;
830                  pg = NULL;
831                  dg = NULL;
832 +                crlp = NULL;
833          }
834          ap = hp->sa;                    /* relative Y channel from here on... */
835          for (i = hp->ns*hp->ns; i--; ap++)
# Line 863 | Line 865 | doambient(                             /* compute ambient component */
865                          if (ra[0] > maxarad)
866                                  ra[0] = maxarad;
867                  }
868 <                if (crlp != NULL)       /* flag encroached directions */
868 >                                        /* flag encroached directions */
869 >                if ((wt >= 0.5-FTINY) & (crlp != NULL))
870                          *crlp = ambcorral(hp, uv, ra[0]*ambacc, ra[1]*ambacc);
871                  if (pg != NULL) {       /* cap gradient if necessary */
872                          d = pg[0]*pg[0]*ra[0]*ra[0] + pg[1]*pg[1]*ra[1]*ra[1];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines