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 1.10 by greg, Tue Jun 25 13:29:22 1991 UTC vs.
Revision 1.11 by greg, Tue Jun 25 15:48:11 1991 UTC

# Line 254 | Line 254 | register int  sn;      /* target source number */
254          double  or, d;
255          int  infront;
256          int  ssn;
257 <        int  nhit;
257 >        int  nhit, nok;
258          register int  i, n;
259                                  /* return if pretesting disabled */
260          if (vspretest <= 0)
# Line 280 | Line 280 | register int  sn;      /* target source number */
280                                  /* sample */
281          or = sqrt(or2);
282          ssn = 25*n;
283 <        nhit = 0;
283 >        nhit = nok = 0;
284          while (n-- > 0) {
285                                          /* get sample point */
286                  do {
# Line 316 | Line 316 | register int  sn;      /* target source number */
316                  rayvalue(&sr);
317                  if (bright(sr.rcol) <= FTINY)
318                          continue;
319 +                nok++;
320                                          /* check against obstructions */
321                  srcray(&sr, NULL, sn);
322                  rayvalue(&sr);
323 <                if (bright(sr.rcol) <= FTINY) {
324 <                        if (nhit > 0) {
323 >                if (bright(sr.rcol) > FTINY)
324 >                        nhit++;
325 >                if (nhit > 0 && nhit < nok) {
326   #ifdef DEBUG
327 <                                fprintf(stderr, "\tpartially occluded\n");
327 >                        fprintf(stderr, "\tpartially occluded\n");
328   #endif
329 <                                return(f);      /* need to shadow test */
330 <                        }
329 <                } else
330 <                        nhit++;
329 >                        return(f);              /* need to shadow test */
330 >                }
331          }
332          if (nhit == 0) {
333   #ifdef DEBUG

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines