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.14 by schorsch, Tue Mar 30 16:13:01 2004 UTC vs.
Revision 2.18 by greg, Thu Oct 28 09:38:46 2010 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 360 | Line 360 | vstestvis(             /* pretest source visibility */
360                                  sr.rorg[i] = oc[i] + offsdir[i] + d*onorm[i];
361                                  sr.rdir[i] = -onorm[i];
362                          }
363 <                        sr.rmax = 0.0;
364 <                        rayorigin(&sr, NULL, PRIMARY, 1.0);
363 >                        rayorigin(&sr, PRIMARY, NULL, NULL);
364                  } while (!(*ofun[o->otype].funp)(o, &sr));
365                                          /* check against source */
366                  VCOPY(sr.rorg, sr.rop); /* starting from intersection */
# Line 375 | Line 374 | vstestvis(             /* pretest source visibility */
374                  }
375                  sr.revf = srcvalue;
376                  rayvalue(&sr);                  /* check sample validity */
377 <                if (bright(sr.rcol) <= FTINY)
377 >                if ((d = bright(sr.rcol)) <= FTINY)
378                          continue;
379                  nok++;                  /* got sample; check obstructions */
380                  rayclear(&sr);
381                  sr.revf = raytrace;
382                  rayvalue(&sr);
383 <                if (bright(sr.rcol) > FTINY)
383 >                if ((d1 = bright(sr.rcol)) > FTINY) {
384 >                        if (d - d1 > FTINY) {
385 > #ifdef DEBUG
386 >                                fprintf(stderr, "\tpartially shadowed\n");
387 > #endif
388 >                                return(f);      /* intervening transmitter */
389 >                        }
390                          nhit++;
391 +                }
392                  if (nhit > 0 && nhit < nok) {
393   #ifdef DEBUG
394                          fprintf(stderr, "\tpartially occluded\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines