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.82 by greg, Sun Jun 9 20:52:13 2019 UTC vs.
Revision 2.89 by greg, Wed Mar 2 21:15:18 2022 UTC

# Line 213 | Line 213 | if ( !defined $recovery ) {
213                  printf MGFSCN "xf -t %.6f %.6f 0\n", -($dim[0]+$dim[1])/2, -($dim[2]+$dim[3])/2;
214                  close MGFSCN;
215                  if ( $mgfin ) {
216 +                        die "+mgf requires input file with +geom\n" if ($#ARGV < 0);
217                          system qq{mgfilt "#,o,xf,c,cxy,cspec,cmix,m,sides,rd,td,rs,ts,ir,v,p,n,f,fh,sph,cyl,cone,prism,ring,torus" @ARGV >> $mgfscn};
218                  } else {
219                          system "rad2mgf $radscn >> $mgfscn";
# Line 324 | Line 325 | sub do_ttree_dir {
325                                  qq{-e "r2=rand(-5.37138*recno+67.1737811)" } .
326                                  qq{-e "r3=rand(+3.17603772*recno+83.766771)" } .
327                                  qq{-e "r4=rand(-1.5839226*recno-59.82712)" } .
328 <                                qq{-e "Dx=1-2*(\$1+r1)/$ns" } .
329 <                                qq{-e "Dy=if(\$1-.5,1/$ns,sqrt(1-Dx*Dx))*(2*r2-1)" } .
328 >                                qq{-e "odds(n):if(.5*n-floor(.5*n)-.25,-1,1)"} .
329 >                                qq{-e "Dx=1-(\$1+r1)/$ns2" } .
330 >                                qq{-e "Dy=min(1/$ns,sqrt(1-Dx*Dx))*odds(\$1)*r2" } .
331                                  qq{-e "Dz=sqrt(1-Dx*Dx-Dy*Dy)" } .
332                                  qq{-e "xp=(\$3+r2)*(($dim[1]-$dim[0])/$nx)+$dim[0]" } .
333                                  qq{-e "yp=(\$2+r3)*(($dim[3]-$dim[2])/$ny)+$dim[2]" } .
# Line 339 | Line 341 | sub do_ttree_dir {
341                                  qq{-e 'r2=rand(-5.37138*recno+67.1737811)' } .
342                                  qq{-e 'r3=rand(+3.17603772*recno+83.766771)' } .
343                                  qq{-e 'r4=rand(-1.5839226*recno-59.82712)' } .
344 <                                qq{-e 'Dx=1-2*(\$1+r1)/$ns' } .
345 <                                qq{-e 'Dy=if(\$1-.5,1/$ns,sqrt(1-Dx*Dx))*(2*r2-1)' } .
344 >                                qq{-e 'odds(n):if(.5*n-floor(.5*n)-.25,-1,1)' } .
345 >                                qq{-e 'Dx=1-(\$1+r1)/$ns2' } .
346 >                                qq{-e 'Dy=min(1/$ns,sqrt(1-Dx*Dx))*odds(\$1)*r2' } .
347                                  qq{-e 'Dz=sqrt(1-Dx*Dx-Dy*Dy)' } .
348                                  qq{-e 'xp=(\$3+r3)*(($dim[1]-$dim[0])/$nx)+$dim[0]' } .
349                                  qq{-e 'yp=(\$2+r4)*(($dim[3]-$dim[2])/$ny)+$dim[2]' } .
# Line 434 | Line 437 | sub ttree_comp {
437                  }
438          }
439          if ($pctcull >= 0) {
440 <                my $avg = ( $dorecip && "$typ" =~ /^r[fb]/ ) ? " -a" : "";
440 >                my $avg = ( $dorecip && ( $tensortree == 3 || "$typ" =~ /^r[fb]/ ) ) ? " -a" : "";
441                  my $pcull = ("$spec" eq "Visible") ? $pctcull :
442                                                       (100 - (100-$pctcull)*.25) ;
443                  if ($windoz) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines