ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/genskyvec.pl
(Generate patch)

Comparing ray/src/util/genskyvec.pl (file contents):
Revision 2.2 by greg, Mon Jul 13 23:45:08 2009 UTC vs.
Revision 2.3 by greg, Wed Dec 9 21:30:48 2009 UTC

# Line 7 | Line 7
7   #
8   use strict;
9   my @skycolor = (0.960, 1.004, 1.118);
10 + my $mf = 4;
11   while ($#ARGV >= 0) {
12          if ("$ARGV[0]" eq "-c") {
13                  @skycolor = @ARGV[1..3];
14                  shift @ARGV; shift @ARGV; shift @ARGV;
15 +        } elsif ("$ARGV[0]" eq "-m") {
16 +                $mf = $ARGV[1];
17 +                shift @ARGV;
18          }
19          shift @ARGV;
20   }
# Line 48 | Line 52 | if (defined $sunline) {
52   my $rhcal = '
53   DEGREE : PI/180;
54   x1 = .5; x2 = .5;
51 MF : 2^2;
55   alpha : 90/(MF*7 + .5);
56   tnaz(r) : select(r, 30, 30, 24, 24, 18, 12, 6);
57   rnaz(r) : if(r-(7*MF-.5), 1, MF*tnaz(floor((r+.5)/MF) + 1));
# Line 70 | Line 73 | Dx = sin(Razi)*cos_ralt;
73   Dy = cos(Razi)*cos_ralt;
74   Dz = sin(Ralt);
75   ';
76 < my $nbins = 2306;       # This needs to be consistent with MF setting above
76 > my $nbins = `rcalc -n -e MF:$mf -e \'$rhcal\' -e \'\$1=Rmax+1\'`;
77 > chomp $nbins;
78   # Create octree for rtrace
79   my $octree = "/tmp/gtv$$.oct";
80   open OCONV, "| oconv - > $octree";
# Line 79 | Line 83 | print OCONV "skyfunc glow skyglow 0 0 4 @skycolor 0\n"
83   print OCONV "skyglow source sky 0 0 4 0 0 1 360\n";
84   close OCONV;
85   # Run rtrace and average output for every 16 samples
86 < my $tregcommand = "cnt $nbins 16 | rcalc -of -e '$rhcal' " .
86 > my $tregcommand = "cnt $nbins 16 | rcalc -of -e MF:$mf -e '$rhcal' " .
87          q{-e 'Rbin=$1;x1=rand(recno*.37-5.3);x2=rand(recno*-1.47+.86)' } .
88          q{-e '$1=0;$2=0;$3=0;$4=Dx;$5=Dy;$6=Dz' } .
89          "| rtrace -h -ff -ab 0 -w $octree | total -if3 -16 -m";
# Line 90 | Line 94 | my @bestdir;
94   if (@sundir) {
95          my $somega = ($sundir[3]/360)**2 * 3.141592654**3;
96          my $cmd = "cnt " . ($nbins-1) .
97 <                " | rcalc -e '$rhcal' -e Rbin=recno " .
97 >                " | rcalc -e MF:$mf -e '$rhcal' -e Rbin=recno " .
98                  "-e 'dot=Dx*$sundir[0] + Dy*$sundir[1] + Dz*$sundir[2]' " .
99                  "-e 'cond=dot-.866' " .
100                  q{-e '$1=if(1-dot,acos(dot),0);$2=Romega;$3=recno' };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines