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.38 by greg, Mon Aug 29 15:42:34 1994 UTC vs.
Revision 2.42 by greg, Tue Jan 23 16:27:31 1996 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1993 Regents of the University of California */
1 > /* Copyright (c) 1995 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 64 | Line 64 | int  vspretest = 512;                  /* virtual source pretest dens
64   int  directvis = 1;                     /* sources visible? */
65   double  srcsizerat = .25;               /* maximum ratio source size/dist. */
66  
67 + COLOR  cextinction = BLKCOLOR;          /* global extinction coefficient */
68 + double  salbedo = 0.;                   /* global scattering albedo */
69 + double  seccg = 0.;                     /* global scattering eccentricity */
70 + double  ssampdist = 0.;                 /* scatter sampling distance */
71 +
72   double  specthresh = .15;               /* specular sampling threshold */
73   double  specjitter = 1.;                /* specular sampling jitter */
74  
75 + int  backvis = 1;                       /* back face visibility */
76 +
77   int  maxdepth = 6;                      /* maximum recursion depth */
78   double  minweight = 5e-3;               /* minimum ray weight */
79  
# Line 391 | Line 398 | char  *zfile, *oldfile;
398          fprtresolu(hres, vres, stdout);
399                                          /* recover file and compute first */
400          i = salvage(oldfile);
401 +        if (i >= vres)
402 +                goto alldone;
403          if (zfd != -1 && i > 0 &&
404                          lseek(zfd, (long)i*hres*sizeof(float), 0) == -1)
405                  error(SYSTEM, "z-file seek error in render");
# Line 446 | Line 455 | char  *zfile, *oldfile;
455          }
456                                                  /* clean up */
457          signal(SIGCONT, SIG_IGN);
458 <        if (zfd != -1) {
450 <                if (write(zfd, (char *)zbar[0], hres*sizeof(float))
458 >        if (zfd != -1 && write(zfd, (char *)zbar[0], hres*sizeof(float))
459                                  < hres*sizeof(float))
460 <                        goto writerr;
460 >                goto writerr;
461 >        fwritescan(scanbar[0], hres, stdout);
462 >        if (fflush(stdout) == EOF)
463 >                goto writerr;
464 > alldone:
465 >        if (zfd != -1) {
466                  if (close(zfd) == -1)
467                          goto writerr;
468                  for (i = 0; i <= psample; i++)
469                          free((char *)zbar[i]);
470          }
458        fwritescan(scanbar[0], hres, stdout);
459        if (fflush(stdout) == EOF)
460                goto writerr;
471          for (i = 0; i <= psample; i++)
472                  free((char *)scanbar[i]);
473          if (sampdens != NULL)
# Line 602 | Line 612 | int  x, y;                     /* pixel position */
612   {
613          static RAY  thisray;
614  
615 <        if (viewray(thisray.rorg, thisray.rdir, &ourview,
616 <                        (x+pixjitter())/hres, (y+pixjitter())/vres) < 0) {
615 >        if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview,
616 >                        (x+pixjitter())/hres, (y+pixjitter())/vres)) < -FTINY) {
617                  setcolor(col, 0.0, 0.0, 0.0);
618                  return(0.0);
619          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines