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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 2.15 by greg, Fri Jun 18 10:14:42 1993 UTC vs.
Revision 2.20 by greg, Fri Dec 8 18:49:12 1995 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 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 53 | Line 53 | int  vresolu = 0;                      /* vertical resolution */
53   double  dstrsrc = 0.0;                  /* square source distribution */
54   double  shadthresh = .05;               /* shadow threshold */
55   double  shadcert = .5;                  /* shadow certainty */
56 < int  directrelay = 1;                   /* number of source relays */
56 > int  directrelay = 2;                   /* number of source relays */
57   int  vspretest = 512;                   /* virtual source pretest density */
58   int  directvis = 1;                     /* sources visible? */
59 < double  srcsizerat = .25;               /* maximum ratio source size/dist. */
59 > double  srcsizerat = .2;                /* maximum ratio source size/dist. */
60  
61 + COLOR  cextinction = BLKCOLOR;          /* global extinction coefficient */
62 + double  salbedo = 0.;                   /* global scattering albedo */
63 + double  seccg = 0.;                     /* global scattering eccentricity */
64 + double  ssampdist = 0.;                 /* scatter sampling distance */
65 +
66   double  specthresh = .15;               /* specular sampling threshold */
67   double  specjitter = 1.;                /* specular sampling jitter */
68  
69 + int  backvis = 1;                       /* back face visibility */
70 +
71   int  maxdepth = 6;                      /* maximum recursion depth */
72   double  minweight = 4e-3;               /* minimum ray weight */
73  
74   COLOR  ambval = BLKCOLOR;               /* ambient value */
75   double  ambacc = 0.2;                   /* ambient accuracy */
76 < int  ambres = 32;                       /* ambient resolution */
77 < int  ambdiv = 128;                      /* ambient divisions */
76 > int  ambres = 128;                      /* ambient resolution */
77 > int  ambdiv = 512;                      /* ambient divisions */
78   int  ambssamp = 0;                      /* ambient super-samples */
79   int  ambounce = 0;                      /* ambient bounces */
80   char  *amblist[128];                    /* ambient include/exclude list */
# Line 133 | Line 140 | char  *fname;
140                  setmode(fileno(fp), O_BINARY);
141   #endif
142                                          /* set up output */
143 <        if (imm_irrad)
137 <                outvals = "v";
138 <        else
139 <                setoutput(outvals);
143 >        setoutput(outvals);
144          switch (outform) {
145          case 'a': putreal = puta; break;
146          case 'f': putreal = putf; break;
# Line 166 | Line 170 | char  *fname;
170                  if (imm_irrad)
171                          irrad(orig, direc);
172                  else
173 <                        traceray(orig, direc);
173 >                        rad(orig, direc);
174                                                          /* flush if time */
175                  if (--nextflush == 0) {
176                          fflush(stdout);
# Line 241 | Line 245 | register char  *vs;
245   }
246  
247  
248 < traceray(org, dir)              /* compute and print ray value(s) */
248 > rad(org, dir)                   /* compute and print ray value(s) */
249   FVECT  org, dir;
250   {
247        register int  (**tp)();
248
251          VCOPY(thisray.rorg, org);
252          VCOPY(thisray.rdir, dir);
253 +        thisray.rmax = 0.0;
254          rayorigin(&thisray, NULL, PRIMARY, 1.0);
255          if (castonly)
256                  localhit(&thisray, &thescene) || sourcehit(&thisray);
257          else
258                  rayvalue(&thisray);
259 <
257 <        if (ray_out[0] == NULL)
258 <                return;
259 <        for (tp = ray_out; *tp != NULL; tp++)
260 <                (**tp)(&thisray);
261 <        if (outform == 'a')
262 <                putchar('\n');
259 >        printvals(&thisray);
260   }
261  
262  
# Line 274 | Line 271 | FVECT  org, dir;
271          }
272          rayorigin(&thisray, NULL, PRIMARY, 1.0);
273                                          /* pretend we hit surface */
274 <        thisray.rot = 1.0;
274 >        thisray.rot = 1.0-1e-4;
275          thisray.rod = 1.0;
276          VCOPY(thisray.ron, dir);
277          for (i = 0; i < 3; i++)         /* fudge factor */
278                  thisray.rop[i] = org[i] + 1e-4*dir[i];
279                                          /* compute and print */
280          (*ofun[Lamb.otype].funp)(&Lamb, &thisray);
281 <        oputv(&thisray);
281 >        printvals(&thisray);
282 > }
283 >
284 >
285 > printvals(r)                    /* print requested ray values */
286 > RAY  *r;
287 > {
288 >        register int  (**tp)();
289 >
290 >        if (ray_out[0] == NULL)
291 >                return;
292 >        for (tp = ray_out; *tp != NULL; tp++)
293 >                (**tp)(r);
294          if (outform == 'a')
295                  putchar('\n');
296   }
# Line 354 | Line 363 | RAY  *r;
363  
364          if (every_out[0] == NULL)
365                  return;
366 <        if (traincl == 1 && r->ro == NULL)
367 <                return;
368 <        if (traincl != -1 && traincl != inset(traset, r->ro->omod))
366 >        if (r->ro == NULL) {
367 >                if (traincl == 1)
368 >                        return;
369 >        } else if (traincl != -1 && traincl != inset(traset, r->ro->omod))
370                  return;
371          tabin(r);
372          for (tp = every_out; *tp != NULL; tp++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines