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

Comparing ray/src/util/rtpict.pl (file contents):
Revision 2.19 by greg, Sat Dec 4 16:29:29 2021 UTC vs.
Revision 2.20 by greg, Sun Apr 10 03:46:27 2022 UTC

# Line 34 | Line 34 | my $outpatt = '^-o[vrxlLRXnNsmM]+';
34   my $refDepth = "";
35   my $irrad = 0;
36   my $persist = 0;
37 + my $ambounce = 0;
38 + my $ambcache = 1;
39 + my $ambfile;
40   my $outlyr;
41   my $outdir;
42   my $outpic;
# Line 77 | Line 80 | while ($#ARGV >= 0 && "$ARGV[0]" =~ /^[-\@]/) {
80          }
81          # Check rtrace options
82          if (defined $rtraceC{$ARGV[0]}) {
83 <                $persist ||= ("$ARGV[0]" =~ /^-PP?$/);
83 >                if ("$ARGV[0]" =~ /^-PP?$/) {
84 >                        $persist = 1;
85 >                } elsif ("$ARGV[0]" eq '-ab') {
86 >                        $ambounce = $ARGV[1];
87 >                } elsif ("$ARGV[0]" eq '-aa') {
88 >                        $ambcache = ($ARGV[1] > 0.0);
89 >                } elsif ("$ARGV[0]" eq '-af') {
90 >                        $ambfile = "$ARGV[1]";
91 >                }
92                  push @rtraceA, $ARGV[0];
93                  push @rpictA, shift(@ARGV);
94                  for (my $i = $rtraceC{$rpictA[-1]}; $i-- > 0; ) {
# Line 138 | Line 149 | my $oct = $ARGV[0];
149   my $view = `@vwrightA 0`;
150   chomp $view;
151   my @res = split(/\s/, `@vwraysA -d`);
152 + #####################################################################
153 + ##### Run overture calculation?
154 + if ($nprocs > 1 && $ambounce > 0 && $ambcache && defined($ambfile)) {
155 +        my $oxres = int($res[1]/6) + 1;
156 +        my $oyres = int($res[3]/6) + 1;
157 +        print STDERR "Running $oxres by $oyres overture calculation " .
158 +                        "to populate '$ambfile'...\n";
159 +        system "cnt $oxres $oyres | sort -R | @vwraysA -i -x $oxres -y $oyres -pj 0 " .
160 +                "| @rtraceA -ff -ov '$oct' > /dev/null";
161 +        die "Failure running overture\n" if ( $? );
162 +        print STDERR "Finished overture.\n";
163 + }
164   #####################################################################
165   ##### Generating picture with depth buffer?
166   if (defined $outzbf) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines