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.73 by greg, Tue Nov 13 19:58:33 2018 UTC vs.
Revision 2.74 by greg, Wed Dec 5 02:12:23 2018 UTC

# Line 202 | Line 202 | raytrans(                      /* transmit ray as is */
202  
203  
204   int
205 + raytirrad(                      /* irradiance hack */
206 +        OBJREC  *m,
207 +        RAY     *r
208 + )
209 + {
210 +        if ((ofun[m->otype].flags & (T_M|T_X)) && m->otype != MAT_CLIP) {
211 +                if (istransp(m->otype) || isBSDFproxy(m)) {
212 +                        raytrans(r);
213 +                        return(1);
214 +                }
215 +                if (!islight(m->otype))
216 +                        return((*ofun[Lamb.otype].funp)(&Lamb, r));
217 +        }
218 +        return(0);              /* not a qualifying surface */
219 + }
220 +
221 +
222 + int
223   rayshade(               /* shade ray r with material mod */
224          RAY  *r,
225          int  mod
226   )
227   {
228 +        int     tst_irrad = do_irrad && !(r->crtype & ~(PRIMARY|TRANS));
229          OBJREC  *m;
230  
231          r->rxt = r->rmt = r->rot;       /* preset effective ray length */
# Line 219 | Line 238 | rayshade(              /* shade ray r with material mod */
238                  }
239                  ******/
240                                          /* hack for irradiance calculation */
241 <                if (do_irrad && !(r->crtype & ~(PRIMARY|TRANS)) &&
242 <                                (ofun[m->otype].flags & (T_M|T_X)) &&
243 <                                m->otype != MAT_CLIP) {
225 <                        if (istransp(m->otype) || isBSDFproxy(m)) {
226 <                                raytrans(r);
227 <                                return(1);
228 <                        }
229 <                        if (!islight(m->otype))
230 <                                m = &Lamb;
231 <                }
241 >                if (tst_irrad && raytirrad(m, r))
242 >                        return(1);
243 >
244                  if ((*ofun[m->otype].funp)(m, r))
245                          return(1);      /* materials call raytexture() */
246          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines