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

Comparing ray/src/rt/glass.c (file contents):
Revision 2.9 by greg, Thu Jun 6 10:23:28 1996 UTC vs.
Revision 2.15 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  glass.c - simpler shading function for thin glass surfaces.
9 *
10 *     11/14/86
6   */
7  
8 < #include  "ray.h"
8 > #include "copyright.h"
9  
10 + #include  "ray.h"
11   #include  "otypes.h"
12 + #include  "rtotypes.h"
13  
14   /*
15   *  This definition of glass provides for a quick calculation
# Line 44 | Line 41 | static char SCCSid[] = "$SunId$ LBL";
41   #define  RINDEX         1.52            /* refractive index of glass */
42  
43  
44 < m_glass(m, r)           /* color a ray which hit a thin glass surface */
45 < OBJREC  *m;
46 < register RAY  *r;
44 > extern int
45 > m_glass(                /* color a ray which hit a thin glass surface */
46 >        OBJREC  *m,
47 >        register RAY  *r
48 > )
49   {
50          COLOR  mcolor;
51          double  pdot;
# Line 69 | Line 68 | register RAY  *r;
68  
69          setcolor(mcolor, m->oargs.farg[0], m->oargs.farg[1], m->oargs.farg[2]);
70  
71 +                                                /* get modifiers */
72 +        raytexture(r, m->omod);
73          if (r->rod < 0.0)                       /* reorient if necessary */
74                  flipsurface(r);
75          mirtest = transtest = 0;
76          mirdist = transdist = r->rot;
77 <                                                /* get modifiers */
78 <        raytexture(r, m->omod);
78 <        if (hastexture = DOT(r->pert,r->pert) > FTINY*FTINY)
77 >                                                /* perturb normal */
78 >        if ( (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) ) {
79                  pdot = raynormal(pnorm, r);
80 <        else {
80 >        } else {
81                  VCOPY(pnorm, r->ron);
82                  pdot = r->rod;
83          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines