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.12 by greg, Mon Aug 12 08:20:55 1991 UTC vs.
Revision 1.13 by greg, Wed Oct 30 10:59:42 1991 UTC

# Line 91 | Line 91 | double  omega;                 /* light source size */
91                                                  /* worth using? */
92                  if (dtmp > FTINY) {
93                          copycolor(ctmp, np->scolor);
94 <                        dtmp *= omega;
94 >                        dtmp *= omega / np->pdot;
95                          scalecolor(ctmp, dtmp);
96                          addcolor(cval, ctmp);
97                  }
# Line 108 | Line 108 | double  omega;                 /* light source size */
108          if (ldot < -FTINY && np->tspec > FTINY && np->alpha2 > FTINY) {
109                  /*
110                   *  Compute specular transmission.  Specular transmission
111 <                 *  is unaffected by material color.
111 >                 *  is always modified by material color.
112                   */
113                                                  /* roughness + source */
114                  dtmp = np->alpha2 + omega/(2.0*PI);
# Line 116 | Line 116 | double  omega;                 /* light source size */
116                  dtmp = exp((DOT(np->pr->rdir,ldir)-1.)/dtmp)/(2.*PI)/dtmp;
117                                                  /* worth using? */
118                  if (dtmp > FTINY) {
119 <                        dtmp *= np->tspec * omega;
120 <                        setcolor(ctmp, dtmp, dtmp, dtmp);
119 >                        copycolor(ctmp, np->mcolor);
120 >                        dtmp *= np->tspec * omega / np->pdot;
121 >                        scalecolor(ctmp, dtmp);
122                          addcolor(cval, ctmp);
123                  }
124          }
# Line 154 | Line 155 | register RAY  *r;
155                                                  /* get modifiers */
156          raytexture(r, m->omod);
157          nd.pdot = raynormal(nd.pnorm, r);       /* perturb normal */
158 +        if (nd.pdot < .001)
159 +                nd.pdot = .001;                 /* non-zero for dirnorm() */
160          multcolor(nd.mcolor, r->pcol);          /* modify material color */
161          transtest = 0;
162                                                  /* get specular component */
# Line 238 | Line 241 | register RAY  *r;
241                          scalecolor(ctmp, nd.tdiff);
242                  else
243                          scalecolor(ctmp, nd.trans);
244 <                multcolor(ctmp, nd.mcolor);
244 >                multcolor(ctmp, nd.mcolor);     /* modified by color */
245                  addcolor(r->rcol, ctmp);
246                  flipsurface(r);
247          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines