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.15 by greg, Wed May 25 19:24:11 2011 UTC vs.
Revision 2.18 by greg, Wed Jun 1 22:50:24 2011 UTC

# Line 139 | Line 139 | print
139   </WindowElement>
140   ';
141   # Clean up temporary files and exit
142 < if ( $persistfile ) {
143 <        open(PFI, "< $persistfile");
142 > if ( $persistfile && open(PFI, "< $persistfile") ) {
143          while (<PFI>) {
144                  s/^[^ ]* //;
145                  kill('ALRM', $_);
# Line 148 | Line 147 | if ( $persistfile ) {
147          }
148          close PFI;
149   }
150 < system "rm -rf $td";
151 < exit 0;
150 > exec("rm -rf $td");
151 >
152   #-------------- End of main program segment --------------#
153  
154   #++++++++++++++ Tensor tree BSDF generation ++++++++++++++#
# Line 204 | Line 203 | out_square_x = (out_square_a + 1)/2;
203   out_square_y = (out_square_b + 1)/2;
204   ';
205   # Announce ourselves in XML output
206 < print "         <DataDefinition>\n";
207 < print "                 <IncidentDataStructure>TensorTree$tensortree</IncidentDataStructure>\n";
208 < print "         </DataDefinition>\n";
206 > print "\t<DataDefinition>\n";
207 > print "\t\t<IncidentDataStructure>TensorTree$tensortree</IncidentDataStructure>\n";
208 > print "\t</DataDefinition>\n";
209   # Fork parallel rtcontrib processes to compute each side
210   if ( $doback ) {
211          for (my $proc = 0; $proc < $nproc; $proc++) {
# Line 249 | Line 248 | sub bg_tree_rtcontrib {
248                          "| rcalc -e 'r1=rand(($pn+.8681)*recno-.673892)' " .
249                          "-e 'r2=rand(($pn-5.37138)*recno+67.1737811)' " .
250                          "-e 'r3=rand(($pn+3.17603772)*recno+83.766771)' " .
251 <                        "-e 'Dx=1-($pbeg+\$1+r1)/$ns;Dy:0;Dz=sqrt(1-Dx*Dx)' " .
251 >                        "-e 'Dx=1-2*($pbeg+\$1+r1)/$ns;Dy:0;Dz=sqrt(1-Dx*Dx)' " .
252                          "-e 'xp=(\$3+r2)*(($dim[1]-$dim[0])/$nx)+$dim[0]' " .
253                          "-e 'yp=(\$2+r3)*(($dim[3]-$dim[2])/$ny)+$dim[2]' " .
254                          "-e 'zp=$dim[5-$forw]' -e 'myDz=Dz*($forw*2-1)' " .
# Line 316 | Line 315 | print
315                  <SourceSpectrum>CIE Illuminant D65 1nm.ssp</SourceSpectrum>
316                  <DetectorSpectrum>ASTM E308 1931 Y.dsp</DetectorSpectrum>
317                  <WavelengthDataBlock>
318 <                        <WavelengthDataDirection>Reflection $side</WavelengthDataDirection>
318 > ';
319 > print "\t\t\t<WavelengthDataDirection>Reflection $side</WavelengthDataDirection>\n";
320 > print '
321                          <AngleBasis>LBNL/Shirley-Chiu</AngleBasis>
322                          <ScatteringDataType>BRDF</ScatteringDataType>
323                          <ScatteringData>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines