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.4 by greg, Tue Mar 20 23:05:48 2018 UTC vs.
Revision 2.5 by greg, Wed Mar 21 17:56:08 2018 UTC

# Line 23 | Line 23 | my %vwraysC = ("-vf",1, "-vtv",0, "-vtl",0, "-vth",0,
23   # options we need to silently ignore
24   my %ignoreC = ("-t",1, "-ps",1, "-pt",1, "-pm",1);
25   # Starting options for rtrace (rpict values)
26 < my @rtraceA = split(' ', "rtrace -ffc -u- -dt .05 -dc .5 -ds .25 -dr 1 -aa .2 -ar 64 -ad 512 -as 128 -lr 7 -lw 1e-03");
26 > my @rtraceA = split(' ', "rtrace -u- -dt .05 -dc .5 -ds .25 -dr 1 " .
27 >                                "-aa .2 -ar 64 -ad 512 -as 128 -lr 7 -lw 1e-03");
28   my @vwraysA = ("vwrays", "-ff", "-pj", ".67");
29   my @vwrightA = ("vwright", "-vtv");
30   my @rpictA = ("rpict");
31   my $outpic;
32 + my $outzbf;
33   OPTION:                         # sort through options
34   while ($#ARGV >= 0 && "$ARGV[0]" =~ /^[-\@]/) {
35          # Check for file inclusion
# Line 82 | Line 84 | while ($#ARGV >= 0 && "$ARGV[0]" =~ /^[-\@]/) {
84          if ("$ARGV[0]" eq "-o") {
85                  shift @ARGV;
86                  $outpic = shift(@ARGV);
87 +        } elsif ("$ARGV[0]" eq "-z") {
88 +                push @rpictA, shift(@ARGV);
89 +                $outzbf = $ARGV[0];
90 +                push @rpictA, shift(@ARGV);
91          } elsif ("$ARGV[0]" eq "-n") {
92                  shift @ARGV;
93                  $nprocs = shift(@ARGV);
# Line 98 | Line 104 | if ($nprocs == 1) {            # may as well run rpict?
104          push(@rpictA, $ARGV[0]) if ($#ARGV == 0);
105          exec @rpictA ;
106   }
101 die "Need single octree argument\n" if ($#ARGV != 0);
102 push @rtraceA, (`@vwraysA -d`);
103 chomp $rtraceA[-1];
107   push @rtraceA, ("-n", "$nprocs");
108 < push @rtraceA, $ARGV[0];
109 < my @view = (`@vwrightA 0`);
110 < exec qq{@vwraysA | @rtraceA | getinfo -a "VIEW=@view"};
108 > die "Need single octree argument\n" if ($#ARGV != 0);
109 > my $oct = $ARGV[0];
110 > my $view = `@vwrightA 0`;
111 > my @res = split(/\s/, `@vwraysA -d`);
112 > if (defined $outzbf) {          # generating depth buffer?
113 >        my $tres = "/tmp/rtp$$";
114 >        system "@vwraysA | @rtraceA -fff -ovl $res[4] $oct > $tres" || exit 1;
115 >        system( q{getinfo -c rcalc -if4 -of -e '$1=$1;$2=$2;$3=$3' < } .
116 >                "$tres | pvalue -r -df -Y $res[3] +X $res[1] | " .
117 >                "getinfo -a 'VIEW=$view'" );
118 >        system( "getinfo - < $tres | rcalc -if4 -of > $outzbf" . q{ -e '$1=$4'} );
119 >        unlink $tres;
120 >        exit;
121 > }
122 >                                # no depth buffer, so simpler
123 > exec "@vwraysA | @rtraceA -ffc @res $oct | getinfo -a 'VIEW=$view'";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines