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.46 by greg, Fri Jun 10 20:44:00 2005 UTC vs.
Revision 2.49 by schorsch, Mon Sep 19 11:30:10 2005 UTC

# Line 29 | Line 29 | static const char      RCSid[] = "$Id$";
29   #include  "source.h"
30   #include  "otypes.h"
31   #include  "resolu.h"
32 + #include  "random.h"
33  
34   CUBE  thescene;                         /* our scene */
35   OBJECT  nsceneobjs;                     /* number of objects in our scene */
# Line 46 | Line 47 | char  *outvals = "v";                  /* output specification */
47  
48   int  do_irrad = 0;                      /* compute irradiance? */
49  
50 + int  rand_samp = 0;                     /* pure Monte Carlo sampling? */
51 +
52   void  (*trace)() = NULL;                /* trace call */
53  
54   char  *tralist[128];                    /* list of modifers to trace (or no) */
# Line 195 | Line 198 | rtrace(                                /* trace rays from file */
198                                  nextflush = hresolu;
199                          }
200                  } else {
201 <                        samplendx++;
201 >                        samplendx = rand_samp ? random() : samplendx+1;
202                                                          /* compute and print */
203                          if (imm_irrad)
204                                  irrad(orig, direc);
# Line 636 | Line 639 | oputW(                         /* print contribution */
639          RAY  *r
640   )
641   {
642 <        COLOR   contr;
642 >        double  contr[3];
643  
644          raycontrib(contr, r, PRIMARY);
645 <        (*putreal)(colval(contr,RED));
646 <        (*putreal)(colval(contr,GRN));
647 <        (*putreal)(colval(contr,BLU));
645 >        (*putreal)(contr[RED]);
646 >        (*putreal)(contr[GRN]);
647 >        (*putreal)(contr[BLU]);
648   }
649  
650  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines