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

Comparing ray/src/rt/source.c (file contents):
Revision 2.85 by greg, Wed Dec 25 17:40:27 2024 UTC vs.
Revision 2.88 by greg, Tue Oct 21 16:12:05 2025 UTC

# Line 52 | Line 52 | marksources(void)                      /* find and mark source objects */
52          int  ns;
53                                          /* call us only once! */
54          if (nsources)
55 <                error(CONSISTENCY, "Multiple calls to marksources!");
55 >                error(CONSISTENCY, "multiple calls to marksources!");
56                                          /* initialize dispatch table */
57          initstypes();
58                                          /* find direct sources */
# Line 150 | Line 150 | distantsources(void)                   /* only mark distant sources */
150          int  ns;
151                                          /* call us only once! */
152          if (nsources)
153 <                error(CONSISTENCY, "Multiple calls to distantsources!");
153 >                error(CONSISTENCY, "multiple calls to distantsources!");
154                                          /* initialize dispatch table */
155          initstypes();
156                                          /* sources needed for sourcehit() */
# Line 200 | Line 200 | freesources(void)                      /* free all source structures */
200                  while (nsources--)
201                          freeobscache(&source[nsources]);
202   #endif
203 #ifdef SSKIPOPT
204                sskip_rsi(NULL);
205 #endif
203                  free(source);
204                  source = NULL;
205                  nsources = 0;
# Line 451 | Line 448 | direct(                                        /* add direct component */
448                  cntord[sn].brt = sintens(scp->coef);
449                  if (cntord[sn].brt <= 0.0)
450                          continue;
454 #ifdef SSKIPOPT
455                if (ssf_select != NULL && sskip_chk(ssf_select, scp->sno))
456                        scalescolor(scp->coef, r->scorr);
457 #endif
451                  VCOPY(scp->dir, sr.rdir);
452                  copyscolor(sr.rcoef, scp->coef);
453                                                  /* compute potential */
# Line 568 | Line 561 | srcscatter(                    /* compute source scattering into ray */
561          RAY  *r
562   )
563   {
564 <        int  oldsampndx;
564 >        unsigned long  oldsampndx;
565          int  nsamps;
566          RAY  sr;
567          SRCINDEX  si;
# Line 590 | Line 583 | srcscatter(                    /* compute source scattering into ray */
583                  nsamps = MAXSSAMP;
584   #endif
585          oldsampndx = samplendx;
586 <        samplendx = random()&0x7fff;            /* randomize */
586 >        samplendx = random()&0x7ffff;           /* randomize */
587          for (i = volumePhotonMapping ? 1 : r->slights[0]; i > 0; i--) {
588                  /* for each source OR once if volume photon map enabled */
589                  for (j = 0; j < nsamps; j++) {  /* for each sample position */
# Line 643 | Line 636 | srcscatter(                    /* compute source scattering into ray */
636                                  }
637                                                          /* other factors */
638                                  d *= si.dom * r->rot / (4.*PI*nsamps);
646 #ifdef SSKIPOPT
647                                if (ssf_select != NULL && sskip_chk(ssf_select, sr.rsrc))
648                                        d *= r->scorr;
649 #endif
639                                  scalescolor(sr.rcol, d);
640                          } else {
641                                  /* PMAP: Add ambient inscattering from

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)