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

Comparing ray/src/rt/virtuals.c (file contents):
Revision 2.15 by greg, Fri Apr 15 04:44:52 2005 UTC vs.
Revision 2.17 by greg, Thu Sep 7 05:20:54 2006 UTC

# Line 309 | Line 309 | vstestvis(             /* pretest source visibility */
309          FVECT  onorm;
310          FVECT  offsdir;
311          SRCINDEX  si;
312 <        double  or, d;
312 >        double  or, d, d1;
313          int  stestlim, ssn;
314          int  nhit, nok;
315          register int  i, n;
# Line 361 | Line 361 | vstestvis(             /* pretest source visibility */
361                                  sr.rdir[i] = -onorm[i];
362                          }
363                          sr.rmax = 0.0;
364 <                        rayorigin(&sr, NULL, PRIMARY, 1.0);
364 >                        rayorigin(&sr, PRIMARY, NULL, NULL);
365                  } while (!(*ofun[o->otype].funp)(o, &sr));
366                                          /* check against source */
367                  VCOPY(sr.rorg, sr.rop); /* starting from intersection */
# Line 373 | Line 373 | vstestvis(             /* pretest source visibility */
373                          if (!srcray(&sr, NULL, &si) || sr.rsrc != sn)
374                                  continue;       /* can't get there from here */
375                  }
376 <                srcvalue(&sr);                  /* check sample validity */
377 <                if (bright(sr.rcol) <= FTINY)
376 >                sr.revf = srcvalue;
377 >                rayvalue(&sr);                  /* check sample validity */
378 >                if ((d = bright(sr.rcol)) <= FTINY)
379                          continue;
380                  nok++;                  /* got sample; check obstructions */
381                  rayclear(&sr);
382 +                sr.revf = raytrace;
383                  rayvalue(&sr);
384 <                if (bright(sr.rcol) > FTINY)
384 >                if ((d1 = bright(sr.rcol)) > FTINY) {
385 >                        if (d - d1 > FTINY) {
386 > #ifdef DEBUG
387 >                                fprintf(stderr, "\tpartially shadowed\n");
388 > #endif
389 >                                return(f);      /* intervening transmitter */
390 >                        }
391                          nhit++;
392 +                }
393                  if (nhit > 0 && nhit < nok) {
394   #ifdef DEBUG
395                          fprintf(stderr, "\tpartially occluded\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines