--- ray/src/util/rtpict.pl 2022/04/11 14:59:54 2.23 +++ ray/src/util/rtpict.pl 2023/11/15 18:02:53 2.27 @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# RCSid $Id: rtpict.pl,v 2.23 2022/04/11 14:59:54 greg Exp $ +# RCSid $Id: rtpict.pl,v 2.27 2023/11/15 18:02:53 greg Exp $ # # Run rtrace in parallel mode to simulate rpict -n option # May also be used to render layered images with -o* option @@ -15,7 +15,8 @@ my %rtraceC = ('-dt',1, '-dc',1, '-dj',1, '-ds',1, '-d '-ab',1, '-af',1, '-ai',1, '-aI',1, '-ae',1, '-aE',1, '-av',3, '-aw',1, '-aa',1, '-ar',1, '-ad',1, '-as',1, '-me',3, '-ma',3, '-mg',1, '-ms',1, '-lr',1, '-lw',1, - '-ap',2, '-am',1, '-ac',1, '-aC',1); + '-ap',2, '-am',1, '-ac',1, '-aC',1, + '-cs',1, '-cw',2, '-pc',8, '-pRGB',0, '-pXYZ',0); # boolean rtrace options my @boolO = ('-w', '-bv', '-dv', '-i', '-u'); # view options and the associated number of arguments @@ -26,7 +27,7 @@ my %vwraysC = ('-vf',1, '-vtv',0, '-vtl',0, '-vth',0, my %ignoreC = ('-t',1, '-ps',1, '-pt',1, '-pm',1,); # Starting options for rtrace (rpict values) my @rtraceA = split(' ', 'rtrace -u- -dt .05 -dc .5 -ds .25 -dr 1 ' . - '-aa .2 -ar 64 -ad 512 -as 128 -lr 7 -lw 1e-03'); + '-aa .2 -ar 64 -ad 512 -as 128 -lr 7 -lw 1e-04'); my @vwraysA = ('vwrays', '-pj', '.67'); my @vwrightA = ('vwright', '-vtv'); my @rpictA = ('rpict', '-ps', '1'); @@ -153,9 +154,9 @@ my @res = split(/\s/, `@vwraysA -d`); ##### Resort pixels to reduce ambient cache collisions? if ($nprocs > 1 && $ambounce > 0 && $ambcache && defined($ambfile)) { if (!defined($outzbf) && !defined($outdir)) { - # Straight picture output, so just randomize sample order - system "cnt $res[1] $res[3] | sort -R > /tmp/ord$$.txt"; - die "sort error\n" if ( $? ); + # Straight picture output, so just shuffle sample order + system "cnt -s $res[1] $res[3] > /tmp/ord$$.txt"; + die "cnt error\n" if ( $? ); system "@vwraysA -ff -i < /tmp/ord$$.txt " . "| @rtraceA -ffa -ov '$oct' > /tmp/pix$$.txt"; die "Error running rtrace\n" if ( $? ); @@ -167,12 +168,11 @@ if ($nprocs > 1 && $ambounce > 0 && $ambcache && defin exit 0; } # Else randomize overture calculation to prime ambient cache - my $oxres = int($res[1]/6); - my $oyres = int($res[3]/6); - print STDERR "Running $oxres by $oyres overture calculation " . + my @ores = (int($res[1]/6), int($res[3]/6)); + print STDERR "Running $ores[0] by $ores[1] overture calculation " . "to populate '$ambfile'...\n"; - system "@vwraysA -x $oxres -y $oyres -pj 0 " . - "| sort -R | @rtraceA -faf -ov '$oct' > /dev/null"; + system "cnt -s @ores | @vwraysA -i -ff -x $ores[0] -y $ores[1] -pj 0 " . + "| @rtraceA -ff -ov '$oct' > /dev/null"; die "Failure running overture\n" if ( $? ); print STDERR "Finished overture.\n"; }