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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.123 by greg, Fri Apr 5 01:10:26 2024 UTC vs.
Revision 2.124 by greg, Wed Nov 6 20:16:58 2024 UTC

# Line 458 | Line 458 | sumambient(            /* get interpolated ambient value */
458                  if (delta_r2 >= maxangle*maxangle)
459                          continue;
460                  /*
461 <                 *  Modified ray behind test
461 >                 *  Original ray behind test
462                   */
463 <                VSUB(ck0, r->rop, av->pos);
464 <                d = DOT(ck0, uvw[2]);
463 >                d = 0.0;
464 >                for (j = 0; j < 3; j++)
465 >                        d += (r->rop[j] - av->pos[j])*(r->ron[j] + uvw[2][j]);
466 >                d *= 0.5;
467                  if (d < -minarad*ambacc)
468                          continue;
469 <                d /= av->rad[0];
470 <                delta_t2 = d*d;
469 <                if (delta_t2 >= ambacc*ambacc)
469 >                /* Pre-empt following test if we can */
470 >                if (fabs(d) >= av->rad[0]*ambacc)
471                          continue;
472                  /*
473                   *  Elliptical radii test based on Hessian

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines