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.4 by greg, Wed Oct 18 09:01:36 1989 UTC vs.
Revision 1.8 by greg, Tue May 7 17:45:49 1991 UTC

# Line 129 | Line 129 | register OBJREC  *m;
129   register RAY  *r;
130   {
131          NORMDAT  nd;
132        double  ldot;
133        double  omega;
132          double  dtmp;
133          COLOR  ctmp;
134          register int  i;
# Line 156 | Line 154 | register RAY  *r;
154          raytexture(r, m->omod);
155          nd.pdot = raynormal(nd.pnorm, r);       /* perturb normal */
156          multcolor(nd.mcolor, r->pcol);          /* modify material color */
157 +        r->rt = r->rot;                         /* default ray length */
158                                                  /* get specular component */
159          nd.rspec = m->oargs.farg[3];
160  
# Line 196 | Line 195 | register RAY  *r;
195          if (nd.tspec > FTINY && nd.alpha2 <= FTINY) {
196                  RAY  lr;
197                  if (rayorigin(&lr, r, TRANS, nd.tspec) == 0) {
198 <                        VCOPY(lr.rdir, r->rdir);
198 >                        for (i = 0; i < 3; i++)         /* perturb direction */
199 >                                lr.rdir[i] = r->rdir[i] - .75*r->pert[i];
200 >                        normalize(lr.rdir);
201                          rayvalue(&lr);
202                          scalecolor(lr.rcol, nd.tspec);
203 +                        multcolor(lr.rcol, nd.mcolor);  /* modified by color */
204                          addcolor(r->rcol, lr.rcol);
205 +                        if (nd.tspec > .5)
206 +                                r->rt = r->rot + lr.rt;
207                  }
208          }
209          if (r->crtype & SHADOW)                 /* the rest is shadow */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines