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

Comparing ray/src/cv/bsdfmesh.c (file contents):
Revision 2.19 by greg, Sat Mar 8 18:16:48 2014 UTC vs.
Revision 2.22 by greg, Mon Mar 10 20:58:29 2014 UTC

# Line 20 | Line 20 | static const char RCSid[] = "$Id$";
20   #include "bsdfrep.h"
21  
22   #ifndef NEIGH_FACT2
23 < #define NEIGH_FACT2     0.2     /* empirical neighborhood distance weight */
23 > #define NEIGH_FACT2     0.1     /* empirical neighborhood distance weight */
24   #endif
25                                  /* number of processes to run */
26   int                     nprocs = 1;
# Line 150 | Line 150 | compute_nDSFs(const RBFNODE *rbf0, const RBFNODE *rbf1
150  
151          for (x = GRIDRES; x--; )
152              for (y = GRIDRES; y--; ) {
153 <                ovec_from_pos(dv, x, y);
154 <                dsf_grid[x][y].val[0] = nf0 * eval_rbfrep(rbf0, dv);
155 <                dsf_grid[x][y].val[1] = nf1 * eval_rbfrep(rbf1, dv);
153 >                ovec_from_pos(dv, x, y);        /* cube root (brightness) */
154 >                dsf_grid[x][y].val[0] = pow(nf0*eval_rbfrep(rbf0, dv), .3333);
155 >                dsf_grid[x][y].val[1] = pow(nf1*eval_rbfrep(rbf1, dv), .3333);
156              }
157   }      
158  
# Line 225 | Line 225 | price_routes(PRICEMAT *pm, const RBFNODE *from_rbf, co
225              pm->prow = pricerow(pm,i);
226              srow = psortrow(pm,i);
227              for (j = to_rbf->nrbf; j--; ) {
228 <                double          d;              /* quadratic cost function */
228 >                double  d;                      /* quadratic cost function */
229                  d = Acos(DOT(vfrom, vto[j]));
230                  pm->prow[j] = d*d;
231                  d = R2ANG(to_rbf->rbfa[j].crad) - from_ang;
# Line 400 | Line 400 | create_migration(RBFNODE *from_rbf, RBFNODE *to_rbf)
400          for (newmig = from_rbf->ejl; newmig != NULL;
401                          newmig = nextedge(from_rbf,newmig))
402                  if (newmig->rbfv[1] == to_rbf)
403 + {fprintf(stderr, "Edge already exists!\n");
404                          return(NULL);
405 + }
406                                                  /* else allocate */
407   #ifdef DEBUG
408          fprintf(stderr, "Building path from (theta,phi) (%.1f,%.1f) ",
# Line 562 | Line 564 | check_normal_incidence(void)
564          double                  bestd;
565          int                     n;
566  
567 +
568          if (dsf_list == NULL)
569                  return;                         /* XXX should be error? */
570          near_rbf = dsf_list;
# Line 606 | Line 609 | check_normal_incidence(void)
609          memcpy(mir_rbf, near_rbf, n);
610          mir_rbf->ord = near_rbf->ord - 1;       /* not used, I think */
611          mir_rbf->next = NULL;
612 +        mir_rbf->ejl = NULL;
613          rev_rbf_symmetry(mir_rbf, MIRROR_X|MIRROR_Y);
614          nprocs = 1;                             /* compute migration matrix */
615 <        if (mig_list != create_migration(mir_rbf, near_rbf))
615 >        if (create_migration(mir_rbf, near_rbf) == NULL)
616                  exit(1);                        /* XXX should never happen! */
617                                                  /* interpolate normal dist. */
618          rbf = e_advect_rbf(mig_list, norm_vec, 2*near_rbf->nrbf);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines