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

Comparing ray/src/rt/raytrace.c (file contents):
Revision 2.84 by greg, Sun Jan 31 20:55:04 2021 UTC vs.
Revision 2.85 by greg, Wed Jun 9 18:21:10 2021 UTC

# Line 535 | Line 535 | rayreject(             /* check if candidate hit is worse than cu
535                  return(1);              /* shouldn't happen */
536          if (r->ro == NULL)
537                  return(0);              /* ditto */
538 <        if ((mnew = findmaterial(o)) == NULL)
539 <                return(1);              /* new has no material */
540 <        if ((mray = findmaterial(r->ro)) == NULL)
538 >        mnew = findmaterial(o);
539 >        mray = findmaterial(r->ro);     /* check material transparencies */
540 >        if (mnew == NULL) {
541 >                if (mray != NULL)
542 >                        return(1);      /* new has no material */
543 >        } else if (mray == NULL) {
544                  return(0);              /* old has no material(!) */
545 <        if (istransp(mnew->otype))
546 <                return(1);              /* new is transparent */
547 <        if (istransp(mray->otype))
545 >        } else if (istransp(mnew->otype)) {
546 >                if (!istransp(mray->otype))
547 >                        return(1);      /* new is transparent */
548 >        } else if (istransp(mray->otype)) {
549                  return(0);              /* old is transparent */
550 +        }
551                          /* weakest priority to later modifier definition */
552          return (r->ro->omod >= o->omod);
553   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines