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.41 by schorsch, Tue Mar 30 16:13:00 2004 UTC vs.
Revision 2.42 by greg, Mon Sep 20 17:32:04 2004 UTC

# Line 94 | Line 94 | diraniso(              /* compute source contribution */
94                   *  modified by the color of the material.
95                   */
96                  copycolor(ctmp, np->mcolor);
97 <                dtmp = ldot * omega * np->rdiff / PI;
97 >                dtmp = ldot * omega * np->rdiff * (1.0/PI);
98                  scalecolor(ctmp, dtmp);
99                  addcolor(cval, ctmp);
100          }
# Line 105 | Line 105 | diraniso(              /* compute source contribution */
105                   */
106                                                  /* add source width if flat */
107                  if (np->specfl & SP_FLAT)
108 <                        au2 = av2 = omega/(4.0*PI);
108 >                        au2 = av2 = omega * (0.25/PI);
109                  else
110                          au2 = av2 = 0.0;
111                  au2 += np->u_alpha*np->u_alpha;
# Line 122 | Line 122 | diraniso(              /* compute source contribution */
122                                                  /* gaussian */
123                  dtmp = DOT(np->pnorm, h);
124                  dtmp = (dtmp1 + dtmp2) / (dtmp*dtmp);
125 <                dtmp = exp(-dtmp) * (0.25/PI)
126 <                                * sqrt(ldot/(np->pdot*au2*av2));
125 >                dtmp = exp(-dtmp) / (4.0*PI * np->pdot * sqrt(au2*av2));
126                                                  /* worth using? */
127                  if (dtmp > FTINY) {
128                          copycolor(ctmp, np->scolor);
# Line 137 | Line 136 | diraniso(              /* compute source contribution */
136                   *  Compute diffuse transmission.
137                   */
138                  copycolor(ctmp, np->mcolor);
139 <                dtmp = -ldot * omega * np->tdiff / PI;
139 >                dtmp = -ldot * omega * np->tdiff * (1.0/PI);
140                  scalecolor(ctmp, dtmp);
141                  addcolor(cval, ctmp);
142          }
# Line 147 | Line 146 | diraniso(              /* compute source contribution */
146                   *  is always modified by material color.
147                   */
148                                                  /* roughness + source */
149 <                au2 = av2 = omega / PI;
149 >                au2 = av2 = omega * (1.0/PI);
150                  au2 += np->u_alpha*np->u_alpha;
151                  av2 += np->v_alpha*np->v_alpha;
152                                                  /* "half vector" */
# Line 168 | Line 167 | diraniso(              /* compute source contribution */
167                  } else
168                          dtmp = 0.0;
169                                                  /* gaussian */
170 <                dtmp = exp(-dtmp) * (1.0/PI)
172 <                                * sqrt(-ldot/(np->pdot*au2*av2));
170 >                dtmp = exp(-dtmp) / (PI * np->pdot * sqrt(au2*av2));
171                                                  /* worth using? */
172                  if (dtmp > FTINY) {
173                          copycolor(ctmp, np->mcolor);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines