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.83 by greg, Wed Nov 15 18:02:53 2023 UTC vs.
Revision 2.84 by greg, Fri Apr 5 01:10:26 2024 UTC

# Line 338 | Line 338 | m_normal(                      /* color a ray that hit something normal *
338                  scalescolor(sctmp, nd.rdiff);
339                  if (nd.specfl & SP_RBLT)        /* add in specular as well? */
340                          saddscolor(sctmp, nd.scolor);
341 <                multambient(sctmp, r, hastexture ? nd.pnorm : r->ron);
341 >                multambient(sctmp, r, nd.pnorm);
342                  saddscolor(r->rcol, sctmp);     /* add to returned color */
343          }
344          if (nd.tdiff > FTINY) {         /* ambient from other side */
345 +                FVECT  bnorm;
346                  copyscolor(sctmp, nd.mcolor);   /* modified by color */
347                  if (nd.specfl & SP_TBLT) {
348                          scalescolor(sctmp, nd.trans);
349                  } else {
350                          scalescolor(sctmp, nd.tdiff);
351                  }
352 <                flipsurface(r);
353 <                if (hastexture) {
354 <                        FVECT  bnorm;
355 <                        bnorm[0] = -nd.pnorm[0];
355 <                        bnorm[1] = -nd.pnorm[1];
356 <                        bnorm[2] = -nd.pnorm[2];
357 <                        multambient(sctmp, r, bnorm);
358 <                } else
359 <                        multambient(sctmp, r, r->ron);
352 >                bnorm[0] = -nd.pnorm[0];
353 >                bnorm[1] = -nd.pnorm[1];
354 >                bnorm[2] = -nd.pnorm[2];
355 >                multambient(sctmp, r, bnorm);
356                  saddscolor(r->rcol, sctmp);
361                flipsurface(r);
357          }
358                                          /* add direct component */
359          direct(r, dirnorm, &nd);
# Line 388 | Line 383 | gaussamp(                      /* sample Gaussian specular */
383          fcross(v, np->pnorm, u);
384                                          /* compute reflection */
385          if ((np->specfl & (SP_REFL|SP_RBLT)) == SP_REFL &&
386 <                        rayorigin(&sr, SPECULAR, np->rp, np->scolor) == 0) {
386 >                        rayorigin(&sr, RSPECULAR, np->rp, np->scolor) == 0) {
387                  nstarget = 1;
388                  if (specjitter > 1.5) { /* multiple samples? */
389                          nstarget = specjitter*np->rp->rweight + .5;
# Line 453 | Line 448 | gaussamp(                      /* sample Gaussian specular */
448          copyscolor(sr.rcoef, np->mcolor);       /* modified by color */
449          scalescolor(sr.rcoef, np->tspec);
450          if ((np->specfl & (SP_TRAN|SP_TBLT)) == SP_TRAN &&
451 <                        rayorigin(&sr, SPECULAR, np->rp, sr.rcoef) == 0) {
451 >                        rayorigin(&sr, TSPECULAR, np->rp, sr.rcoef) == 0) {
452                  nstarget = 1;
453                  if (specjitter > 1.5) { /* multiple samples? */
454                          nstarget = specjitter*np->rp->rweight + .5;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines