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.99 by greg, Wed Nov 15 18:02:53 2023 UTC vs.
Revision 2.107 by greg, Sat Jan 25 04:57:56 2025 UTC

# Line 119 | 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 287 | Line 289 | rpict(                 /* generate image(s) */
289          do {
290                  if (seq && nextview(stdin) == EOF)
291                          break;
292 +                lastview.type *= seq > 1;
293                  pctdone = 0.0;
294                  if (pout != NULL) {
295                          int     myfd;
# Line 384 | Line 387 | render(                                /* render the scene */
387          char  *oldfile
388   )
389   {
390 +        const int  srcdrawing =         /* manually draw tiny light sources? */
391 +                (directvis && dblur <= FTINY && (mblur <= FTINY) | !lastview.type);
392          COLOR  *scanbar[MAXDIV+1];      /* scanline arrays of pixel values */
393          float  *zbar[MAXDIV+1];         /* z values */
394          char  *sampdens;                /* previous sample density */
# Line 450 | Line 455 | render(                                /* render the scene */
455          signal(SIGCONT, report);
456   #endif
457          ypos = vres-1 - i;                      /* initialize sampling */
458 <        if (directvis)
458 >        if (srcdrawing)
459                  init_drawsources(psample);
460          fillscanline(scanbar[0], zbar[0], sampdens, hres, ypos, hstep);
461                                                  /* compute scanlines */
# Line 471 | Line 476 | render(                                /* render the scene */
476                                  hres, ypos, hstep);
477                                                          /* fill bar */
478                  fillscanbar(scanbar, zbar, hres, ypos, ystep);
479 <                if (directvis)                          /* add bitty sources */
480 <                        drawsources(scanbar, zbar, 0, hres, ypos, ystep);
479 >                if (srcdrawing)                         /* add bitty sources */
480 >                        drawsources((COLORV **)scanbar, out_prims, zbar, 0, hres, ypos, ystep);
481                                                          /* write it out */
482   #ifdef SIGCONT
483                  signal(SIGCONT, SIG_IGN);       /* don't interrupt writes */
# Line 666 | Line 671 | pixvalue(              /* compute pixel value */
671          int  y
672   )
673   {
669        static COLORMAT xyz2myrgbmat;
674          RAY  thisray;
675          FVECT   lorg, ldir;
676          double  hpos, vpos, lmax;
# Line 700 | Line 704 | pixvalue(              /* compute pixel value */
704          rayorigin(&thisray, PRIMARY, NULL, NULL);
705  
706          rayvalue(&thisray);                     /* trace ray */
707 <
708 <        if (out_prims == stdprims) {            /* return color */
705 <                scolor_rgb(col, thisray.rcol);
706 <        } else if (out_prims == xyzprims) {
707 <                scolor_cie(col, thisray.rcol);
708 <                scalecolor(col, WHTEFFICACY);
709 <        } else if (NCSAMP > 3) {
710 <                COLOR   xyz;
711 <                if (xyz2myrgbmat[0][0] == 0)
712 <                        compxyz2rgbWBmat(xyz2myrgbmat, out_prims);
713 <                scolor_cie(xyz, thisray.rcol);
714 <                colortrans(col, xyz2myrgbmat, xyz);
715 <                clipgamut(col, xyz[CIEY], CGAMUT_LOWER, cblack, cwhite);
716 <        } else
717 <                copycolor(col, thisray.rcol);
707 >                                                /* -> color */
708 >        scolor_out(col, out_prims, thisray.rcol);
709  
710          return(raydistance(&thisray));          /* return distance */
711   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines