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

Comparing ray/src/rt/normal.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:41:30 1989 UTC vs.
Revision 1.2 by greg, Sat Apr 15 12:23:22 1989 UTC

# Line 127 | Line 127 | register RAY  *r;
127          if (rdiff <= FTINY && tdiff <= FTINY && alpha2 <= FTINY)
128                  return;                         /* purely specular */
129  
130 <        ambient(ctmp, r);               /* compute ambient component */
131 <        scalecolor(ctmp, 1.0-trans);    /* from this side */
132 <        multcolor(ctmp, mcolor);        /* modified by material color */
133 <        addcolor(r->rcol, ctmp);        /* add to returned color */
134 <
135 <        if (trans > FTINY) {            /* ambient from other side */
130 >        if (rdiff > FTINY) {            /* ambient from this side */
131 >                ambient(ctmp, r);
132 >                if (alpha2 <= FTINY)
133 >                        scalecolor(ctmp, rdiff);
134 >                else
135 >                        scalecolor(ctmp, 1.0-trans);
136 >                multcolor(ctmp, mcolor);        /* modified by material color */
137 >                addcolor(r->rcol, ctmp);        /* add to returned color */
138 >        }
139 >        if (tdiff > FTINY) {            /* ambient from other side */
140                  flipsurface(r);
141 <                scalecolor(ctmp, trans);
141 >                ambient(ctmp, r);
142 >                if (alpha2 <= FTINY)
143 >                        scalecolor(ctmp, tdiff);
144 >                else
145 >                        scalecolor(ctmp, trans);
146                  multcolor(ctmp, mcolor);
147                  addcolor(r->rcol, ctmp);
148                  flipsurface(r);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines