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.24 by greg, Mon Mar 8 12:37:18 1993 UTC vs.
Revision 2.25 by greg, Thu May 27 15:27:57 1993 UTC

# Line 36 | Line 36 | static  agaussamp();
36   *  8  red      grn     blu     rspec   u-rough v-rough trans   tspec
37   */
38  
39 #define  BSPEC(m)       (6.0)           /* specularity parameter b */
40
39                                  /* specularity flags */
40   #define  SP_REFL        01              /* has reflected specular component */
41   #define  SP_TRAN        02              /* has transmitted specular */
# Line 183 | Line 181 | register OBJREC  *m;
181   register RAY  *r;
182   {
183          ANISODAT  nd;
186        double  dtmp;
184          COLOR  ctmp;
185          register int  i;
186                                                  /* easy shadow test */
# Line 222 | Line 219 | register RAY  *r;
219                  else
220                          setcolor(nd.scolor, 1.0, 1.0, 1.0);
221                  scalecolor(nd.scolor, nd.rspec);
225                                                /* improved model */
226                dtmp = exp(-BSPEC(m)*nd.pdot);
227                for (i = 0; i < 3; i++)
228                        colval(nd.scolor,i) += (1.0-colval(nd.scolor,i))*dtmp;
229                nd.rspec += (1.0-nd.rspec)*dtmp;
222                                                  /* check threshold */
223 <                if (specthresh > FTINY &&
232 <                                (specthresh >= 1.-FTINY ||
233 <                                specthresh + .05 - .1*frandom() > nd.rspec))
223 >                if (specthresh >= nd.rspec-FTINY)
224                          nd.specfl |= SP_RBLT;
225                                                  /* compute refl. direction */
226                  for (i = 0; i < 3; i++)
# Line 247 | Line 237 | register RAY  *r;
237                  if (nd.tspec > FTINY) {
238                          nd.specfl |= SP_TRAN;
239                                                          /* check threshold */
240 <                        if (specthresh > FTINY &&
251 <                                        (specthresh >= 1.-FTINY ||
252 <                                specthresh + .05 - .1*frandom() > nd.tspec))
240 >                        if (specthresh >= nd.tspec-FTINY)
241                                  nd.specfl |= SP_TBLT;
242                          if (DOT(r->pert,r->pert) <= FTINY*FTINY) {
243                                  VCOPY(nd.prdir, r->rdir);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines