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.105 by greg, Fri Nov 15 20:47:42 2024 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 384 | 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 450 | 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 471 | 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 666 | Line 670 | pixvalue(              /* compute pixel value */
670          int  y
671   )
672   {
669        static COLORMAT xyz2myrgbmat;
673          RAY  thisray;
674          FVECT   lorg, ldir;
675          double  hpos, vpos, lmax;
# Line 698 | 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 <        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);
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