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.103 by greg, Mon Aug 12 18:57:00 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 340 | Line 342 | rpict(                 /* generate image(s) */
342                  if ((pa < .99) | (pa > 1.01))
343                          fputaspect(pa, stdout);
344                  fputnow(stdout);
345 <                fputprims(stdprims, stdout);
346 <                fputformat(COLRFMT, stdout);
347 <                putchar('\n');
345 >                if (out_prims == xyzprims) {
346 >                        fputformat(CIEFMT, stdout);
347 >                } else {
348 >                        fputprims(out_prims, stdout);
349 >                        fputformat(COLRFMT, stdout);
350 >                }
351 >                putchar('\n');          /* close header */
352                  if (zout != NULL)
353                          sprintf(cp=fbuf, zout, seq);
354                  else
# Line 378 | Line 384 | render(                                /* render the scene */
384          char  *oldfile
385   )
386   {
387 +        const int  srcdrawing =         /* manually draw tiny light sources? */
388 +                (directvis && dblur <= FTINY && (mblur <= FTINY) | !lastview.type);
389          COLOR  *scanbar[MAXDIV+1];      /* scanline arrays of pixel values */
390          float  *zbar[MAXDIV+1];         /* z values */
391          char  *sampdens;                /* previous sample density */
# Line 444 | Line 452 | render(                                /* render the scene */
452          signal(SIGCONT, report);
453   #endif
454          ypos = vres-1 - i;                      /* initialize sampling */
455 <        if (directvis)
455 >        if (srcdrawing)
456                  init_drawsources(psample);
457          fillscanline(scanbar[0], zbar[0], sampdens, hres, ypos, hstep);
458                                                  /* compute scanlines */
# Line 465 | Line 473 | render(                                /* render the scene */
473                                  hres, ypos, hstep);
474                                                          /* fill bar */
475                  fillscanbar(scanbar, zbar, hres, ypos, ystep);
476 <                if (directvis)                          /* add bitty sources */
477 <                        drawsources(scanbar, zbar, 0, hres, ypos, ystep);
476 >                if (srcdrawing)                         /* add bitty sources */
477 >                        drawsources((COLORV **)scanbar, 3, zbar, 0, hres, ypos, ystep);
478                                                          /* write it out */
479   #ifdef SIGCONT
480                  signal(SIGCONT, SIG_IGN);       /* don't interrupt writes */
# Line 693 | Line 701 | pixvalue(              /* compute pixel value */
701          rayorigin(&thisray, PRIMARY, NULL, NULL);
702  
703          rayvalue(&thisray);                     /* trace ray */
704 <
705 <        copycolor(col, thisray.rcol);           /* return color */
704 >                                                /* -> color */
705 >        scolor_out(col, out_prims, thisray.rcol);
706  
707          return(raydistance(&thisray));          /* return distance */
708   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines