| 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; |
| 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; ) { |
| 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) { |