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

Comparing ray/src/rt/aniso.c (file contents):
Revision 2.66 by greg, Fri Dec 6 01:34:21 2024 UTC vs.
Revision 2.72 by greg, Fri Jun 20 18:05:30 2025 UTC

# Line 118 | Line 118 | diraniso(              /* compute source contribution */
118                   */
119                                                  /* add source width if flat */
120                  if (np->specfl & SP_FLAT)
121 <                        au2 = av2 = omega * (0.25/PI);
121 >                        au2 = av2 = (1. - dstrsrc) * omega * (0.25/PI);
122                  else
123                          au2 = av2 = 0.0;
124                  au2 += np->u_alpha*np->u_alpha;
# Line 265 | Line 265 | m_aniso(                       /* shade ray that hit something anisotropic
265                                                  /* diffuse reflection */
266          nd.rdiff = 1.0 - nd.trans - nd.rspec;
267  
268 <        if (r->ro != NULL && isflat(r->ro->otype))
268 >        if (r->ro != NULL && isflat(r->ro->otype) &&
269 >                        DOT(r->pert,r->pert) <= FTINY*FTINY)
270                  nd.specfl |= SP_FLAT;
271  
272          getacoords(&nd);                        /* set up coordinates */
# Line 323 | Line 324 | getacoords(            /* set up coordinate system */
324          if (normalize(np->v) == 0.0) {
325                  if (fabs(np->u_alpha - np->v_alpha) > 0.001)
326                          objerror(np->mp, WARNING, "illegal orientation vector");
327 <                getperpendicular(np->u, np->pnorm, 1);  /* punting */
327 >                getperpendicular(np->u, np->pnorm, 0);  /* punting */
328                  fcross(np->v, np->pnorm, np->u);
329                  np->u_alpha = np->v_alpha = sqrt( 0.5 *
330                          (np->u_alpha*np->u_alpha + np->v_alpha*np->v_alpha) );
# Line 360 | Line 361 | agaussamp(             /* sample anisotropic Gaussian specular */
361                                  nstarget = 1;
362                  }
363                  scolorblack(scol);
364 <                dimlist[ndims++] = (int)(size_t)np->mp;
364 >                dimlist[ndims_inc()] = (int)(size_t)np->mp;
365                  maxiter = MAXITER*nstarget;
366                  for (nstaken = ntrials = 0; (nstaken < nstarget) &
367                                                  (ntrials < maxiter); ntrials++) {
# Line 408 | Line 409 | agaussamp(             /* sample anisotropic Gaussian specular */
409                          scalescolor(scol, d);
410                          saddscolor(np->rp->rcol, scol);
411                  }
412 <                ndims--;
412 >                dec_ndims();
413          }
414                                          /* compute transmission */
415          copyscolor(sr.rcoef, np->mcolor);               /* modify by material color */
# Line 427 | Line 428 | agaussamp(             /* sample anisotropic Gaussian specular */
428                          } else
429                                  nstarget = 1;
430                  }
431 <                dimlist[ndims++] = (int)(size_t)np->mp;
431 >                dimlist[ndims_inc()] = (int)(size_t)np->mp;
432                  maxiter = MAXITER*nstarget;
433                  for (nstaken = ntrials = 0; (nstaken < nstarget) &
434                                                  (ntrials < maxiter); ntrials++) {
# Line 463 | Line 464 | agaussamp(             /* sample anisotropic Gaussian specular */
464                          saddscolor(np->rp->rcol, sr.rcol);
465                          ++nstaken;
466                  }
467 <                ndims--;
467 >                dec_ndims();
468          }
469   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines