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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 2.59 by greg, Sun Dec 13 19:13:04 2009 UTC vs.
Revision 2.62 by greg, Mon Dec 14 07:31:37 2009 UTC

# Line 320 | Line 320 | rayirrad(                      /* compute irradiance rather than radiance
320          RAY *r
321   )
322   {
323 +        void    (*old_revf)(RAY *) = r->revf;
324 +
325          r->rot = 1e-5;                  /* pretend we hit surface */
326          VSUM(r->rop, r->rorg, r->rdir, r->rot);
327          r->ron[0] = -r->rdir[0];
# Line 327 | Line 329 | rayirrad(                      /* compute irradiance rather than radiance
329          r->ron[2] = -r->rdir[2];
330          r->rod = 1.0;
331                                          /* compute result */
332 +        r->revf = raytrace;
333          (*ofun[Lamb.otype].funp)(&Lamb, r);
334 +        r->revf = old_revf;
335   }
336  
337  
# Line 338 | Line 342 | rtcompute(                     /* compute and print ray value(s) */
342          double  dmax
343   )
344   {
345 <        if (imm_irrad) {                /* set up ray */
345 >                                        /* set up ray */
346 >        rayorigin(&thisray, PRIMARY, NULL, NULL);
347 >        if (imm_irrad) {
348                  VSUM(thisray.rorg, org, dir, 1.1e-4);
349                  thisray.rdir[0] = -dir[0];
350                  thisray.rdir[1] = -dir[1];
351                  thisray.rdir[2] = -dir[2];
352                  thisray.rmax = 0.0;
353 +                thisray.revf = rayirrad;
354          } else {
355                  VCOPY(thisray.rorg, org);
356                  VCOPY(thisray.rdir, dir);
357                  thisray.rmax = dmax;
358 +                if (castonly)
359 +                        thisray.revf = raycast;
360          }
352        rayorigin(&thisray, PRIMARY, NULL, NULL);
353                                        /* special case evaluators */
354        if (castonly)
355                thisray.revf = raycast;
356        else if (imm_irrad)
357                thisray.revf = rayirrad;
358
361          if (ray_pnprocs > 1) {          /* multiprocessing FIFO? */
362                  if (ray_fifo_in(&thisray) < 0)
363                          error(USER, "lost children");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines