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

Comparing ray/src/rt/aniso.c (file contents):
Revision 2.11 by greg, Tue Mar 3 16:20:00 1992 UTC vs.
Revision 2.12 by greg, Thu Apr 16 13:29:06 1992 UTC

# Line 34 | Line 34 | extern double  specjitter;             /* specular sampling jitte
34   *  8  red      grn     blu     rspec   u-rough v-rough trans   tspec
35   */
36  
37 #define  BSPEC(m)       (6.0)           /* specularity parameter b */
38
37                                  /* specularity flags */
38   #define  SP_REFL        01              /* has reflected specular component */
39   #define  SP_TRAN        02              /* has transmitted specular */
# Line 198 | Line 196 | register RAY  *r;
196                  else
197                          setcolor(nd.scolor, 1.0, 1.0, 1.0);
198                  scalecolor(nd.scolor, nd.rspec);
201                                                /* improved model */
202                dtmp = exp(-BSPEC(m)*nd.pdot);
203                for (i = 0; i < 3; i++)
204                        colval(nd.scolor,i) += (1.0-colval(nd.scolor,i))*dtmp;
205                nd.rspec += (1.0-nd.rspec)*dtmp;
199                                                  /* check threshold */
200                  if (specthresh > FTINY &&
201 <                                ((specthresh >= 1.-FTINY ||
202 <                                specthresh + (.05 - .1*frandom()) > nd.rspec)))
201 >                                (specthresh >= 1.-FTINY ||
202 >                                specthresh > nd.rspec))
203                          nd.specfl |= SP_RBLT;
204                                                  /* compute refl. direction */
205                  for (i = 0; i < 3; i++)
# Line 224 | Line 217 | register RAY  *r;
217                          nd.specfl |= SP_TRAN;
218                                                          /* check threshold */
219                          if (specthresh > FTINY &&
220 <                                        ((specthresh >= 1.-FTINY ||
221 <                                        specthresh +
229 <                                            (.05 - .1*frandom()) > nd.tspec)))
220 >                                        (specthresh >= 1.-FTINY ||
221 >                                        specthresh > nd.tspec))
222                                  nd.specfl |= SP_TBLT;
223                          if (DOT(r->pert,r->pert) <= FTINY*FTINY) {
224                                  VCOPY(nd.prdir, r->rdir);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines