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

Comparing ray/src/cv/bsdfinterp.c (file contents):
Revision 2.20 by greg, Sun Oct 26 17:35:53 2014 UTC vs.
Revision 2.21 by greg, Fri Jan 29 16:21:55 2016 UTC

# Line 343 | Line 343 | tryagain:
343              const RBFVAL        *rbf0i = &miga[0]->rbfv[0]->rbfa[i];
344              const float         w0i = rbf0i->peak;
345              const double        rad0i = R2ANG(rbf0i->crad);
346 +            C_COLOR             cc0;
347              ovec_from_pos(v0, rbf0i->gx, rbf0i->gy);
348 +            c_decodeChroma(&cc0, rbf0i->chroma);
349              for (j = 0; j < mtx_ncols(miga[0]); j++) {
350                  const float     ma = mtx_coef(miga[0],i,j);
351                  const RBFVAL    *rbf1j;
352 +                C_COLOR         ccs;
353                  double          srad2;
354                  if (ma <= cthresh)
355                          continue;
356                  rbf1j = &miga[0]->rbfv[1]->rbfa[j];
357 +                c_decodeChroma(&ccs, rbf1j->chroma);
358 +                c_cmix(&ccs, 1.-s, &cc0, s, &ccs);
359                  srad2 = R2ANG(rbf1j->crad);
360                  srad2 = (1.-s)*(1.-t)*rad0i*rad0i + s*(1.-t)*srad2*srad2;
361                  ovec_from_pos(v1, rbf1j->gx, rbf1j->gy);
# Line 368 | Line 373 | tryagain:
373                      rad2 = srad2 + t*rad2*rad2;
374                      rbf->rbfa[n].peak = w0i * ma * (mb*mbfact + mc*mcfact) *
375                                          rad0i*rad0i/rad2;
376 +                    if (rbf_colorimetry == RBCtristimulus) {
377 +                        C_COLOR cres;
378 +                        c_decodeChroma(&cres, rbf2k->chroma);
379 +                        c_cmix(&cres, 1.-t, &ccs, t, &cres);
380 +                        rbf->rbfa[n].chroma = c_encodeChroma(&cres);
381 +                    } else
382 +                        rbf->rbfa[n].chroma = c_dfchroma;
383                      rbf->rbfa[n].crad = ANG2R(sqrt(rad2));
384                      ovec_from_pos(v2, rbf2k->gx, rbf2k->gy);
385                      geodesic(v2, v1, v2, t, GEOD_REL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines