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.10 by greg, Fri Feb 21 14:50:23 1992 UTC vs.
Revision 2.15 by greg, Thu May 14 11:32:09 1992 UTC

# Line 121 | Line 121 | double  omega;                 /* light source size */
121                                                  /* worth using? */
122                  if (dtmp > FTINY) {
123                          copycolor(ctmp, np->scolor);
124 <                        dtmp *= omega / np->pdot;
124 >                        dtmp *= omega * sqrt(ldot/np->pdot);
125                          scalecolor(ctmp, dtmp);
126                          addcolor(cval, ctmp);
127                  }
# Line 146 | Line 146 | double  omega;                 /* light source size */
146                                                  /* worth using? */
147                  if (dtmp > FTINY) {
148                          copycolor(ctmp, np->mcolor);
149 <                        dtmp *= np->tspec * omega / np->pdot;
149 >                        dtmp *= np->tspec * omega * sqrt(ldot/np->pdot);
150                          scalecolor(ctmp, dtmp);
151                          addcolor(cval, ctmp);
152                  }
# Line 205 | Line 205 | register RAY  *r;
205                  nd.rspec += (1.0-nd.rspec)*dtmp;
206                                                  /* check threshold */
207                  if (specthresh > FTINY &&
208 <                                ((specthresh >= 1.-FTINY ||
209 <                                specthresh + (.05 - .1*frandom()) > nd.rspec)))
208 >                                (specthresh >= 1.-FTINY ||
209 >                                specthresh + .05 - .1*frandom() > nd.rspec))
210                          nd.specfl |= SP_RBLT;
211                                                  /* compute refl. direction */
212                  for (i = 0; i < 3; i++)
# Line 224 | Line 224 | register RAY  *r;
224                          nd.specfl |= SP_TRAN;
225                                                          /* check threshold */
226                          if (specthresh > FTINY &&
227 <                                        ((specthresh >= 1.-FTINY ||
228 <                                        specthresh +
229 <                                            (.05 - .1*frandom()) > nd.tspec)))
227 >                                        (specthresh >= 1.-FTINY ||
228 >                                specthresh + .05 - .1*frandom() > nd.tspec))
229                                  nd.specfl |= SP_TBLT;
230                          if (DOT(r->pert,r->pert) <= FTINY*FTINY) {
231                                  VCOPY(nd.prdir, r->rdir);
# Line 246 | Line 245 | register RAY  *r;
245                                                  /* diffuse reflection */
246          nd.rdiff = 1.0 - nd.trans - nd.rspec;
247  
248 <        if (r->ro->otype == OBJ_FACE || r->ro->otype == OBJ_RING)
248 >        if (r->ro != NULL && (r->ro->otype == OBJ_FACE ||
249 >                        r->ro->otype == OBJ_RING))
250                  nd.specfl |= SP_FLAT;
251  
252          getacoords(r, &nd);                     /* set up coordinates */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines