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

Comparing ray/src/rt/rpict.c (file contents):
Revision 2.97 by greg, Fri Dec 3 18:10:48 2021 UTC vs.
Revision 2.105 by greg, Fri Nov 15 20:47:42 2024 UTC

# Line 48 | Line 48 | static const char RCSid[] = "$Id$";
48   CUBE  thescene;                         /* our scene */
49   OBJECT  nsceneobjs;                     /* number of objects in our scene */
50  
51 + extern RGBPRIMP  out_prims;             /* output color primitives (NULL if spectral) */
52 +
53   int  dimlist[MAXDIM];                   /* sampling dimensions */
54   int  ndims = 0;                         /* number of sampling dimensions */
55   int  samplendx;                         /* sample index number */
# Line 92 | Line 94 | double specjitter = 1.;                /* specular sampling jitter *
94   int  backvis = 1;                       /* back face visibility */
95  
96   int  maxdepth = 7;                      /* maximum recursion depth */
97 < double  minweight = 1e-3;               /* minimum ray weight */
97 > double  minweight = 1e-4;               /* minimum ray weight */
98  
99   char  *ambfile = NULL;                  /* ambient file name */
100   COLOR  ambval = BLKCOLOR;               /* ambient value */
# Line 117 | Line 119 | time_t  tstart;                                /* starting time */
119  
120   int  hres, vres;                        /* resolution for this frame */
121  
122 + extern void     sskip_ray(RAY *r, double h, double v);
123 +
124   static VIEW     lastview;               /* the previous view input */
125  
126   static void report(int);
# Line 340 | Line 344 | rpict(                 /* generate image(s) */
344                  if ((pa < .99) | (pa > 1.01))
345                          fputaspect(pa, stdout);
346                  fputnow(stdout);
347 <                fputprims(stdprims, stdout);
348 <                fputformat(COLRFMT, stdout);
349 <                putchar('\n');
347 >                if (out_prims == xyzprims) {
348 >                        fputformat(CIEFMT, stdout);
349 >                } else {
350 >                        fputprims(out_prims, stdout);
351 >                        fputformat(COLRFMT, stdout);
352 >                }
353 >                putchar('\n');          /* close header */
354                  if (zout != NULL)
355                          sprintf(cp=fbuf, zout, seq);
356                  else
# Line 378 | Line 386 | render(                                /* render the scene */
386          char  *oldfile
387   )
388   {
389 +        const int  srcdrawing =         /* manually draw tiny light sources? */
390 +                (directvis && dblur <= FTINY && (mblur <= FTINY) | !lastview.type);
391          COLOR  *scanbar[MAXDIV+1];      /* scanline arrays of pixel values */
392          float  *zbar[MAXDIV+1];         /* z values */
393          char  *sampdens;                /* previous sample density */
# Line 444 | Line 454 | render(                                /* render the scene */
454          signal(SIGCONT, report);
455   #endif
456          ypos = vres-1 - i;                      /* initialize sampling */
457 <        if (directvis)
457 >        if (srcdrawing)
458                  init_drawsources(psample);
459          fillscanline(scanbar[0], zbar[0], sampdens, hres, ypos, hstep);
460                                                  /* compute scanlines */
# Line 465 | Line 475 | render(                                /* render the scene */
475                                  hres, ypos, hstep);
476                                                          /* fill bar */
477                  fillscanbar(scanbar, zbar, hres, ypos, ystep);
478 <                if (directvis)                          /* add bitty sources */
479 <                        drawsources(scanbar, zbar, 0, hres, ypos, ystep);
478 >                if (srcdrawing)                         /* add bitty sources */
479 >                        drawsources((COLORV **)scanbar, out_prims, zbar, 0, hres, ypos, ystep);
480                                                          /* write it out */
481   #ifdef SIGCONT
482                  signal(SIGCONT, SIG_IGN);       /* don't interrupt writes */
# Line 691 | Line 701 | pixvalue(              /* compute pixel value */
701                  return(0.0);
702  
703          rayorigin(&thisray, PRIMARY, NULL, NULL);
704 <
704 > #ifdef SSKIPOPT
705 >        sskip_ray(&thisray, hpos, vpos);        /* source skip hack */
706 > #endif
707          rayvalue(&thisray);                     /* trace ray */
708 <
709 <        copycolor(col, thisray.rcol);           /* return color */
708 >                                                /* -> color */
709 >        scolor_out(col, out_prims, thisray.rcol);
710  
711          return(raydistance(&thisray));          /* return distance */
712   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines