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

# Line 38 | Line 38 | static  gaussamp();
38   *      red     grn     blu     rspec   rough   trans   tspec
39   */
40  
41 #define  BSPEC(m)       (6.0)           /* specularity parameter b */
42
41                                  /* specularity flags */
42   #define  SP_REFL        01              /* has reflected specular component */
43   #define  SP_TRAN        02              /* has transmitted specular */
# Line 156 | Line 154 | register RAY  *r;
154   {
155          NORMDAT  nd;
156          double  transtest, transdist;
159        double  dtmp;
157          COLOR  ctmp;
158          register int  i;
159                                                  /* easy shadow test */
# Line 195 | Line 192 | register RAY  *r;
192                  else
193                          setcolor(nd.scolor, 1.0, 1.0, 1.0);
194                  scalecolor(nd.scolor, nd.rspec);
198                                                /* improved model */
199                dtmp = exp(-BSPEC(m)*nd.pdot);
200                for (i = 0; i < 3; i++)
201                        colval(nd.scolor,i) += (1.0-colval(nd.scolor,i))*dtmp;
202                nd.rspec += (1.0-nd.rspec)*dtmp;
195                                                  /* check threshold */
196 <                if (!(nd.specfl & SP_PURE) &&
205 <                                specthresh > FTINY &&
206 <                                (specthresh >= 1.-FTINY ||
207 <                                specthresh + .05 - .1*frandom() > nd.rspec))
196 >                if (!(nd.specfl & SP_PURE) && specthresh >= nd.rspec-FTINY)
197                          nd.specfl |= SP_RBLT;
198                                                  /* compute reflected ray */
199                  for (i = 0; i < 3; i++)
# Line 231 | Line 220 | register RAY  *r;
220                  if (nd.tspec > FTINY) {
221                          nd.specfl |= SP_TRAN;
222                                                          /* check threshold */
223 <                        if (!(nd.specfl & SP_PURE) && specthresh > FTINY &&
224 <                                        (specthresh >= 1.-FTINY ||
236 <                                specthresh + .05 - .1*frandom() > nd.tspec))
223 >                        if (!(nd.specfl & SP_PURE) &&
224 >                                        specthresh >= nd.tspec-FTINY)
225                                  nd.specfl |= SP_TBLT;
226                          if (r->crtype & SHADOW ||
227                                          DOT(r->pert,r->pert) <= FTINY*FTINY) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines