[vtk-developers] Speeding up raycasting on x86

Volpe, Christopher R (Research) volpecr at crd.ge.com
Fri Jul 12 12:33:04 EDT 2002


Whoops. Thanks, I'll look into this further...

> -----Original Message-----
> From: David Gobbi [mailto:dgobbi at imaging.robarts.ca]
> Sent: Friday, July 12, 2002 12:27 PM
> To: Volpe, Christopher R (Research)
> Subject: RE: [vtk-developers] Speeding up raycasting on x86
> 
> 
> Hi Chris,
> 
> Your float->int conversion seems to have a major flaw:
> 
> The FPU does 'round-to-nearest,even' meaning that
>   1.5 rounds to 2.0
>   3.5 rounds to 4.0
> but
>   2.5 rounds to 2.0
>   4.5 rounds to 4.0
> 
> This is IEEE standard, but isn't quite what we want.
> Using your QuickTrunc() I get
> 
> floor of 1  ->  0
> floor of 2  ->  2
> floor of 3  ->  3
> floor of 4  ->  3
> 
> The truth is that for most places where floor() is used (calculating
> integer + fraction for the purpose of interpolation) this result
> is fine, the fractional portion is just returned as 1.0.  But it
> seems just a bit too subtle to be safe.
> 
>  - David
> 
> 
> On Fri, 12 Jul 2002, David Gobbi wrote:
> 
> > Hi Lisa,
> >
> > I've converted the vtkFloorFuncMacro() to Chris' version.
> > His version is indeed safe, there is no 1/65536 error in it,
> > and it is more efficient than my version.
> >
> > There are still plenty of (int) casts left in the ray casting
> > code i.e. all the conversions of float scalar values to int,
> > and if these were converted to use vtkRoundFuncMacro() there
> > is probably a few more % of efficiency to be gained.
> >
> > I don't really like the fact that VTK always converts float scalars
> > to int scalars using 'cast' operations.  It seems to me 
> that it really
> > should be rounding instead.
> >
> >  - David
> >
> >
> > On Thu, 11 Jul 2002, Volpe, Christopher R (Research) wrote:
> >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Lisa Avila [mailto:lisa.avila at kitware.com]
> > > > Sent: Thursday, July 11, 2002 5:06 PM
> > > > To: Volpe, Christopher R (Research); 'David Gobbi'; Lisa Avila
> > > > Cc: vtk-developers at public.kitware.com
> > > > Subject: RE: [vtk-developers] Speeding up raycasting on x86
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > >2) It's not completely correct. Tests I ran not too long ago
> > > > show that the
> > > > >process causes the value
> > > > >to be *rounded*, but this is not readily apparent because
> > > > the rounding is,
> > > > >in this case, not to the
> > > > >nearest int but to the nearest fraction of 1/2**16. So, for
> > > > example, a
> > > > >value greater than (3.0 -
> > > > >1/2**16), but less than 3.0,  will be rounded up to 3. 
> This problem
> > > > >becomes very readily apparent if
> > > > >you tweak the values so that you use the full 32 bits for
> > > > the integer
> > > > >portion and don't reserve any
> > > > >bits for fixed point fractional values, thus causing 
> rounding to the
> > > > >nearest integer.
> > > >
> > > > Being "not completely correct" may cause big problems in the
> > > > ray caster.
> > >
> > > Yes, butit's easily fixable. My version, for example, 
> doesn't have the problem.
> > >
> > > -Chris
> > > _______________________________________________
> > > vtk-developers mailing list
> > > vtk-developers at public.kitware.com
> > > http://public.kitware.com/mailman/listinfo/vtk-developers
> > >
> >
> >
> 
> 

begin 600 winmail.dat
M>)\^(@80`0:0"``$```````!``$``0>0!@`(````Y`0```````#H``$(@`<`
M&````$E032Y-:6-R;W-O9G0 at 36%I;"Y.;W1E`#$(`06``P`.````T@<'``P`
M#``A``0`!0`B`0$@@`,`#@```-('!P`,``P`(0`$``4`(@$!"8`!`"$````T
M1CDU-SDQ0CE!-4-!,C1%.#8R1C9$03`Y,D8S13<Q00!,!P$$@`$`,P```%)%
M.B!;=G1K+61E=F5L;W!E<G-=(%-P965D:6YG('5P(')A>6-A<W1I;F<@;VX@
M>#@V`!`2`0V`!``"`````@`"``$#D`8`Q`T``#`````#``%N(`````,`/8`(
M(`8``````,````````!&`````%*%``!];@$`'@`^@`@@!@``````P```````
M`$8`````5(4```$````$````.2XP``L`ZH$((`8``````,````````!&````
M``:%`````````P`_@`@@!@``````P````````$8``````84````````+`#N`
M""`&``````#`````````1@`````#A0````````L`0(`((`8``````,``````
M``!&``````Z%`````````P`\@`@@!@``````P````````$8`````$(4`````
M```#`$&`""`&``````#`````````1@`````1A0````````,`0H`((`8`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#2%))4U1/4$A%4BY63TQ010````,`&4```````P#]/^0$```#`"8`````
M``,`-@```````P"`$/____\"`4<``0```#8```!C/553.V$]34%22S0P,#MP
M/4=%.VP]6$U",#)#4D1'12TP,C`W,3(Q-C,S,#1:+38S-34U-0````(!^3\!
M````=0````````#<IT#(P$(0&K2Y"``K+^&"`0`````````O3SU'12]/53U#
M4D1.25-+05E53D$O0TX]4D5#25!)14Y44R]#3CU%6$-(04Y'12!#3$E%3E0@
M*$580S`Q0U)$1T4I+T-./4-(4DE35$]02$52+E9/3%!%`````!X`^#\!````
M&P```%9O;'!E+"!#:')I<W1O<&AE<B!2("A#4D0I```>`#A``0```!(```!#
M2%))4U1/4$A%4BY63TQ010````(!^S\!````=0````````#<IT#(P$(0&K2Y
M"``K+^&"`0`````````O3SU'12]/53U#4D1.25-+05E53D$O0TX]4D5#25!)
M14Y44R]#3CU%6$-(04Y'12!#3$E%3E0@*$580S`Q0U)$1T4I+T-./4-(4DE3
M5$]02$52+E9/3%!%`````!X`^C\!````&P```%9O;'!E+"!#:')I<W1O<&AE
M<B!2("A#4D0I```>`#E``0```!(```!#2%))4U1/4$A%4BY63TQ010```$``
M!S#9LE>\P2G"`4``"#!P+JK+P2G"`1X`/0`!````!0```%)%.B``````'@`=
M#@$````O````6W9T:RUD979E;&]P97)S72!3<&5E9&EN9R!U<"!R87EC87-T
M:6YG(&]N('@X-@``'@`U$`$````V````/$9"13DP1$9#,C0P0D$U-#%",SA!
M-#-&,SDY,3-!,39$,#)%03,P04)`>&UB,#)C<F1G93X````+`"D```````L`
M(P```````P`&$`CF<*<#``<0;`@```,`$!```````P`1$`D````>``@0`0``
M`&4```!72$]/4%-42$%.2U,L24Q,3$]/2TE.5$]42$E31E525$A%4BTM+2TM
M3U))1TE.04Q-15-304=%+2TM+2U&4D]-.D1!5DE$1T]"0DE-04E,5$\Z1$=/
M0D))0$E-04=)3D=23T)!``````(!?P`!````-@```#Q&0D4Y,$1&0S(T,$)!
L-30Q0C,X030S1C,Y.3$S03$V1#`R14$S,$%"0'AM8C`R8W)D9V4^````%`X=
`
end



More information about the vtk-developers mailing list