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.12 by greg, Thu Jan 13 10:43:34 1994 UTC vs.
Revision 2.15 by greg, Mon Feb 28 08:54:02 1994 UTC

# Line 98 | Line 98 | RAY  *r;
98          else if (sourcehit(r))
99                  gotmat = rayshade(r, r->ro->omod);
100  
101 <        if (!gotmat)
101 >        if (r->ro != NULL && !gotmat)
102                  objerror(r->ro, USER, "material not found");
103  
104          if (trace != NULL)
# Line 156 | Line 156 | int  mod;
156                          if (irr_ignore(m->otype)) {
157                                  depth--;
158                                  raytrans(r);
159 <                                return;
159 >                                return(1);
160                          }
161                          if (!islight(m->otype))
162                                  m = &Lamb;
# Line 207 | Line 207 | double  coef;
207                  coef = 1.0;
208          else if (coef < 0.0)
209                  coef = 0.0;
210 +                                        /* compute foreground and background */
211 +        foremat = backmat = -1;
212                                          /* foreground */
213          copystruct(&fr, r);
214          if (fore != OVOID && coef > FTINY)
215                  foremat = rayshade(&fr, fore);
214        else
215                foremat = 0;
216                                          /* background */
217          copystruct(&br, r);
218          if (back != OVOID && coef < 1.0-FTINY)
219                  backmat = rayshade(&br, back);
220        else
221                backmat = foremat;
220                                          /* check */
221 +        if (foremat < 0)
222 +                if (backmat < 0)
223 +                        foremat = backmat = 0;
224 +                else
225 +                        foremat = backmat;
226 +        else if (backmat < 0)
227 +                backmat = foremat;
228          if ((foremat==0) != (backmat==0))
229                  objerror(r->ro, USER, "mixing material with non-material");
230                                          /* mix perturbations */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines