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

Comparing ray/src/util/genBSDF.pl (file contents):
Revision 2.80 by greg, Thu Apr 19 17:02:13 2018 UTC vs.
Revision 2.87 by greg, Sun Dec 12 20:32:21 2021 UTC

# Line 205 | Line 205 | if ( !defined $recovery ) {
205          }
206          close MYAVH;
207          # Generate octree
208 <        system "oconv -w -f $radscn > $octree";
208 >        system "oconv -w $radscn > $octree";
209          die "Could not compile scene\n" if ( $? );
210          # Add MGF description if requested
211          if ( $geout ) {
# Line 323 | Line 323 | sub do_ttree_dir {
323                                  qq{| rcalc -e "r1=rand(.8681*recno-.673892)" } .
324                                  qq{-e "r2=rand(-5.37138*recno+67.1737811)" } .
325                                  qq{-e "r3=rand(+3.17603772*recno+83.766771)" } .
326 <                                qq{-e "Dx=1-2*(\$1+r1)/$ns;Dy:0;Dz=sqrt(1-Dx*Dx)" } .
326 >                                qq{-e "r4=rand(-1.5839226*recno-59.82712)" } .
327 >                                qq{-e "odds(n):if(.5*n-floor(.5*n)-.25,-1,1)"} .
328 >                                qq{-e "Dx=1-(\$1+r1)/$ns2" } .
329 >                                qq{-e "Dy=min(1/$ns,sqrt(1-Dx*Dx))*odds(\$1)*r2" } .
330 >                                qq{-e "Dz=sqrt(1-Dx*Dx-Dy*Dy)" } .
331                                  qq{-e "xp=(\$3+r2)*(($dim[1]-$dim[0])/$nx)+$dim[0]" } .
332                                  qq{-e "yp=(\$2+r3)*(($dim[3]-$dim[2])/$ny)+$dim[2]" } .
333                                  qq{-e "zp=$dim[5-$forw]" -e "myDz=Dz*($forw*2-1)" } .
# Line 335 | Line 339 | sub do_ttree_dir {
339                                  qq{| rcalc -e 'r1=rand(.8681*recno-.673892)' } .
340                                  qq{-e 'r2=rand(-5.37138*recno+67.1737811)' } .
341                                  qq{-e 'r3=rand(+3.17603772*recno+83.766771)' } .
342 <                                qq{-e 'Dx=1-2*(\$1+r1)/$ns;Dy:0;Dz=sqrt(1-Dx*Dx)' } .
343 <                                qq{-e 'xp=(\$3+r2)*(($dim[1]-$dim[0])/$nx)+$dim[0]' } .
344 <                                qq{-e 'yp=(\$2+r3)*(($dim[3]-$dim[2])/$ny)+$dim[2]' } .
342 >                                qq{-e 'r4=rand(-1.5839226*recno-59.82712)' } .
343 >                                qq{-e 'odds(n):if(.5*n-floor(.5*n)-.25,-1,1)' } .
344 >                                qq{-e 'Dx=1-(\$1+r1)/$ns2' } .
345 >                                qq{-e 'Dy=min(1/$ns,sqrt(1-Dx*Dx))*odds(\$1)*r2' } .
346 >                                qq{-e 'Dz=sqrt(1-Dx*Dx-Dy*Dy)' } .
347 >                                qq{-e 'xp=(\$3+r3)*(($dim[1]-$dim[0])/$nx)+$dim[0]' } .
348 >                                qq{-e 'yp=(\$2+r4)*(($dim[3]-$dim[2])/$ny)+$dim[2]' } .
349                                  qq{-e 'zp=$dim[5-$forw]' -e 'myDz=Dz*($forw*2-1)' } .
350                                  qq{-e '\$1=xp-Dx;\$2=yp-Dy;\$3=zp-myDz' } .
351                                  qq{-e '\$4=Dx;\$5=Dy;\$6=myDz' -of } .
# Line 428 | Line 436 | sub ttree_comp {
436                  }
437          }
438          if ($pctcull >= 0) {
439 <                my $avg = ( $dorecip && "$typ" =~ /^r[fb]/ ) ? " -a" : "";
439 >                my $avg = ( $dorecip && ( $ttree == 3 || "$typ" =~ /^r[fb]/ ) ) ? " -a" : "";
440                  my $pcull = ("$spec" eq "Visible") ? $pctcull :
441                                                       (100 - (100-$pctcull)*.25) ;
442                  if ($windoz) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines