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.25 by greg, Mon Mar 24 06:07:46 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 165 | Line 165 | neighborhood_dist2(int x0, int y0, int x1, int y1)
165          double  d;
166          int     p[4];
167          int     i, j;
168
169        if ((x0 == x1) & (y0 == y1))
170                return(0.);
168                                                  /* check radius */
169          p[0] = x0; p[1] = y0; p[2] = x1; p[3] = y1;
170          for (i = 4; i--; ) {
# Line 225 | Line 222 | price_routes(PRICEMAT *pm, const RBFNODE *from_rbf, co
222              pm->prow = pricerow(pm,i);
223              srow = psortrow(pm,i);
224              for (j = to_rbf->nrbf; j--; ) {
225 <                double          d;              /* quadratic cost function */
225 >                double  d;                      /* quadratic cost function */
226                  d = Acos(DOT(vfrom, vto[j]));
227                  pm->prow[j] = d*d;
228                  d = R2ANG(to_rbf->rbfa[j].crad) - from_ang;
# Line 556 | Line 553 | mesh_from_edge(MIGRATION *edge)
553   static void
554   check_normal_incidence(void)
555   {
556 <        static const FVECT      norm_vec = {.0, .0, 1.};
556 >        static FVECT            norm_vec = {.0, .0, 1.};
557          const int               saved_nprocs = nprocs;
558          RBFNODE                 *near_rbf, *mir_rbf, *rbf;
559          double                  bestd;
# Line 606 | Line 603 | check_normal_incidence(void)
603          memcpy(mir_rbf, near_rbf, n);
604          mir_rbf->ord = near_rbf->ord - 1;       /* not used, I think */
605          mir_rbf->next = NULL;
606 +        mir_rbf->ejl = NULL;
607          rev_rbf_symmetry(mir_rbf, MIRROR_X|MIRROR_Y);
608          nprocs = 1;                             /* compute migration matrix */
609 <        if (mig_list != create_migration(mir_rbf, near_rbf))
609 >        if (create_migration(mir_rbf, near_rbf) == NULL)
610                  exit(1);                        /* XXX should never happen! */
611 <                                                /* interpolate normal dist. */
611 >        norm_vec[2] = input_orient;             /* interpolate normal dist. */
612          rbf = e_advect_rbf(mig_list, norm_vec, 2*near_rbf->nrbf);
613          nprocs = saved_nprocs;                  /* final clean-up */
614          free(mir_rbf);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines