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.7 by greg, Tue Jul 21 10:36:37 1992 UTC vs.
Revision 2.11 by greg, Wed Jan 20 15:19:51 1993 UTC

# Line 50 | Line 50 | double  shadthresh = .05;              /* shadow threshold */
50   double  shadcert = .5;                  /* shadow certainty */
51   int  directrelay = 1;                   /* number of source relays */
52   int  vspretest = 512;                   /* virtual source pretest density */
53 < int  directinvis = 0;                   /* sources invisible? */
53 > int  directvis = 1;                     /* sources visible? */
54   double  srcsizerat = .25;               /* maximum ratio source size/dist. */
55  
56   double  specthresh = .15;               /* specular sampling threshold */
# Line 73 | Line 73 | extern OBJREC  Lamb;                   /* a Lambertian surface */
73   static RAY  thisray;                    /* for our convenience */
74  
75   static int  oputo(), oputd(), oputv(), oputl(), oputL(),
76 <                oputp(), oputn(), oputs(), oputw(), oputm();
76 >                oputp(), oputn(), oputN(), oputs(), oputw(), oputm();
77  
78   static int  (*ray_out[10])(), (*every_out[10])();
79   static int  castonly;
# Line 86 | Line 86 | static int  (*putreal)();
86   quit(code)                      /* quit program */
87   int  code;
88   {
89 + #ifndef  NIX
90 +        headclean();            /* delete header file */
91 +        pfclean();              /* clean up persist files */
92 + #endif
93          exit(code);
94   }
95  
# Line 118 | Line 122 | char  *fname;
122                  sprintf(errmsg, "cannot open input file \"%s\"", fname);
123                  error(SYSTEM, errmsg);
124          }
125 + #ifdef MSDOS
126 +        if (inform != 'a')
127 +                setmode(fileno(fp), O_BINARY);
128 + #endif
129                                          /* set up output */
130          setoutput(outvals);
131          switch (outform) {
# Line 198 | Line 206 | register char  *vs;
206                  case 'p':                               /* point */
207                          *table++ = oputp;
208                          break;
209 <                case 'n':                               /* normal */
209 >                case 'n':                               /* perturbed normal */
210                          *table++ = oputn;
211 +                        castonly = 0;
212                          break;
213 +                case 'N':                               /* unperturbed normal */
214 +                        *table++ = oputN;
215 +                        break;
216                  case 's':                               /* surface */
217                          *table++ = oputs;
218                          break;
# Line 396 | Line 408 | register RAY  *r;
408  
409  
410   static
411 < oputn(r)                                /* print normal */
411 > oputN(r)                                /* print unperturbed normal */
412   register RAY  *r;
413   {
414          if (r->rot < FHUGE) {
# Line 408 | Line 420 | register RAY  *r;
420                  (*putreal)(0.0);
421                  (*putreal)(0.0);
422          }
423 + }
424 +
425 +
426 + static
427 + oputn(r)                                /* print perturbed normal */
428 + RAY  *r;
429 + {
430 +        FVECT  pnorm;
431 +
432 +        if (r->rot >= FHUGE) {
433 +                (*putreal)(0.0);
434 +                (*putreal)(0.0);
435 +                (*putreal)(0.0);
436 +                return;
437 +        }
438 +        raynormal(pnorm, r);
439 +        (*putreal)(pnorm[0]);
440 +        (*putreal)(pnorm[1]);
441 +        (*putreal)(pnorm[2]);
442   }
443  
444  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines