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.89 by greg, Wed Jul 31 22:29:18 2024 UTC vs.
Revision 2.93 by greg, Mon Dec 9 00:44:29 2024 UTC

# Line 61 | Line 61 | rayorigin(             /* start new ray from old one */
61                  r->rweight = rw;
62                  r->crtype = r->rtype = rt;
63                  r->rsrc = -1;
64 + #ifdef SSKIPOPT
65 +                r->scorr = 1.f;
66 + #endif
67                  r->clipset = NULL;
68                  r->revf = raytrace;
69                  copycolor(r->cext, cextinction);
# Line 73 | Line 76 | rayorigin(             /* start new ray from old one */
76                          return(-1);             /* illegal continuation */
77                  }
78                  r->rlvl = ro->rlvl;
79 +                r->rsrc = ro->rsrc;
80 + #ifdef SSKIPOPT
81 +                r->scorr = ro->scorr;
82 + #endif
83                  if (rt & RAYREFL) {
84                          r->rlvl++;
85 <                        r->rsrc = -1;
85 >                        if (r->rsrc >= 0)       /* malfunctioning material? */
86 >                                r->rsrc = -1;
87                          r->clipset = ro->clipset;
88                          r->rmax = 0.0;
89                  } else {
82                        r->rsrc = ro->rsrc;
90                          r->clipset = ro->newcset;
91 <                        r->rmax = ro->rmax <= FTINY ? 0.0 : ro->rmax - ro->rot;
91 >                        r->rmax = (ro->rmax > FTINY)*(ro->rmax - ro->rot);
92                  }
93                  r->revf = ro->revf;
94                  copycolor(r->cext, ro->cext);
# Line 212 | Line 219 | raytirrad(                     /* irradiance hack */
219          RAY     *r
220   )
221   {
222 <        if (ofun[m->otype].flags & (T_M|T_X) && m->otype != MAT_CLIP) {
223 <                if (istransp(m->otype) || isBSDFproxy(m)) {
222 >        if (m->otype != MAT_CLIP && ismaterial(m->otype)) {
223 >                if (istransp(m) || isBSDFproxy(m)) {
224                          raytrans(r);
225                          return(1);
226                  }
# Line 454 | Line 461 | raynormal(             /* compute perturbed normal for ray */
461                  return(r->rod);
462          }
463          newdot = -DOT(norm, r->rdir);
464 <        if ((newdot > 0.0) != (r->rod > 0.0)) {         /* fix orientation */
464 >        if ((newdot > 0.0) ^ (r->rod > 0.0)) {          /* fix orientation */
465                  for (i = 0; i < 3; i++)
466                          norm[i] += 2.0*newdot*r->rdir[i];
467                  newdot = -newdot;
# Line 543 | Line 550 | rayreject(             /* check if candidate hit is worse than cu
550                          return(1);      /* old has material, new does not */
551          } else if (mray == NULL) {
552                  return(0);              /* new has material, old does not */
553 <        } else if (istransp(mnew->otype)) {
554 <                if (!istransp(mray->otype))
553 >        } else if (istransp(mnew)) {
554 >                if (!istransp(mray))
555                          return(1);      /* new is transparent, old is not */
556 <        } else if (istransp(mray->otype)) {
556 >        } else if (istransp(mray)) {
557                  return(0);              /* old is transparent, new is not */
558          }
559          if (rod <= 0) {                 /* check which side we hit */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines