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 1.6 by greg, Mon Oct 16 18:57:02 1989 UTC vs.
Revision 1.10 by greg, Tue Mar 27 11:40:05 1990 UTC

# Line 59 | Line 59 | double  rw;
59          r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
60          setcolor(r->pcol, 1.0, 1.0, 1.0);
61          setcolor(r->rcol, 0.0, 0.0, 0.0);
62 +        r->rt = 0.0;
63          return(r->rlvl <= maxdepth && r->rweight >= minweight ? 0 : -1);
64   }
65  
66  
67   rayvalue(r)                     /* compute a ray's value */
68 < register RAY  *r;
68 > RAY  *r;
69   {
70          extern int  (*trace)();
71  
72          if (localhit(r, &thescene) || sourcehit(r))
73 <                rayshade(r, r->ro->omod);
73 >                raycont(r);
74  
75          if (trace != NULL)
76                  (*trace)(r);            /* trace execution */
77   }
78  
79  
80 + raycont(r)                      /* check for clipped object and continue */
81 + register RAY  *r;
82 + {
83 +        if (r->clipset != NULL && inset(r->clipset, r->ro->omod))
84 +                raytrans(r);
85 +        else
86 +                rayshade(r, r->ro->omod);
87 + }
88 +
89 +
90   raytrans(r)                     /* transmit ray as is */
91 < RAY  *r;
91 > register RAY  *r;
92   {
93          RAY  tr;
94  
# Line 85 | Line 96 | RAY  *r;
96                  VCOPY(tr.rdir, r->rdir);
97                  rayvalue(&tr);
98                  copycolor(r->rcol, tr.rcol);
99 +                r->rt = r->rot + tr.rt;
100          }
101   }
102  
# Line 95 | Line 107 | int  mod;
107   {
108          static int  depth = 0;
109          register OBJREC  *m;
98                                        /* check for clipped surface */
99        if (r->clipset != NULL && r->rot < FHUGE &&
100                        inset(r->clipset, mod)) {
101                raytrans(r);
102                return;
103        }
110                                          /* check for infinite loop */
111          if (depth++ >= MAXLOOP)
112                  objerror(r->ro, USER, "possible modifier loop");
# Line 206 | Line 212 | register RAY  *r;
212           *  still fraught with problems since reflected rays and similar
213           *  directions calculated from the surface normal may spawn rays behind
214           *  the surface.  The only solution is to curb textures at high
215 <         *  incidence (Rdot << 1).
215 >         *  incidence (namely, keep DOT(rdir,pert) < Rdot).
216           */
217  
218          for (i = 0; i < 3; i++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines