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.1 by greg, Sat Jan 4 19:52:49 1992 UTC vs.
Revision 2.2 by greg, Sat Jan 4 23:36:40 1992 UTC

# Line 38 | Line 38 | static char SCCSid[] = "$SunId$ LBL";
38   #define  SP_TRAN        02              /* has transmitted specular */
39   #define  SP_PURE        010             /* purely specular (zero roughness) */
40   #define  SP_BADU        020             /* bad u direction calculation */
41 + #define  SP_FLAT        040             /* reflecting surface is flat */
42  
43   typedef struct {
43        RAY  *rp;               /* ray pointer */
44          OBJREC  *mp;            /* material pointer */
45 +        RAY  *rp;               /* ray pointer */
46          short  specfl;          /* specularity flags, defined above */
47          COLOR  mcolor;          /* color of this material */
48          COLOR  scolor;          /* color of specular component */
# Line 92 | Line 93 | double  omega;                 /* light source size */
93                   *  Compute specular reflection coefficient using
94                   *  anisotropic gaussian distribution model.
95                   */
96 <                                                /* roughness + source */
97 <                au2 = av2 = omega/(4.0*PI);
96 >                                                /* add source width if flat */
97 >                if (np->specfl & SP_FLAT)
98 >                        au2 = av2 = omega/(4.0*PI);
99 >                else
100 >                        au2 = av2 = 0.0;
101                  au2 += np->u_alpha * np->u_alpha;
102                  av2 += np->v_alpha * np->v_alpha;
103                                                  /* half vector */
# Line 160 | Line 164 | register RAY  *r;
164  
165          if (m->oargs.nfargs != (m->otype == MAT_TRANS2 ? 8 : 6))
166                  objerror(m, USER, "bad number of real arguments");
163        nd.rp = r;
167          nd.mp = m;
168 +        nd.rp = r;
169                                                  /* get material color */
170          setcolor(nd.mcolor, m->oargs.farg[0],
171                             m->oargs.farg[1],

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines