[vtkusers] vtkVolumeTextureMapper3D memory consumption since 5.6

Simon ESNEAULT sesneault at gmail.com
Fri Oct 29 10:43:14 EDT 2010


Hi All,

Since vtk 5.6 is out, we have some trouble using vtkVolumeTextureMapper3D.

With VTK 5.4 rendering a volume of 512x512x366 consumes around 500 Mo and
needs one or two seconds to load. The interactivity is good (20 fps)
With VTK 5.6, rendering the same volume consumes 1700 Mo and needs more than
30 seconds to load. And the interactivity is unusable. (~1 fps)
Test done on an intel i7 870 cpu, with an nvidia gtx 260, Ubuntu Linux 64
bits (same result on windows 7).

After some investigation, it appears that the pb, is the use of
MAX_3D_TEXTURE_SIZE in the file vtkOpenGLVolumeTextureMapper3D.cxx instead
of an harcoded max texture size (128*256*256) as it used to be in vtk 5.4.
In the documentation it is
said<http://www.vtk.org/doc/nightly/html/classvtkVolumeTextureMapper3D.html#_details>
that
all the volume will be resampled to a 128*256*256 volume, but it's no longer
true in > 5.4.

As a rough hack, if we changed the code around line 1970 of the
file vtkOpenGLVolumeTextureMapper3D.cxx :

*int vtkOpenGLVolumeTextureMapper3D::IsTextureSizeSupported(int
size[3], components)*
*{*
*  GLint maxSize;*
*  glGetIntegerv(vtkgl::MAX_3D_TEXTURE_SIZE,&maxSize);*
*
*
*  if(size[0]>maxSize || size[1]>maxSize || size[2]>maxSize)*
*    {*
*    return 0;*
*    }*

... into ...

*int vtkOpenGLVolumeTextureMapper3D::IsTextureSizeSupported(int
size[3], components)*
*{*
*  GLint maxSize;*
*  glGetIntegerv(vtkgl::MAX_3D_TEXTURE_SIZE,&maxSize);*
*  maxSize = 256;*
*
*
*  if(size[0]>maxSize || size[1]>maxSize || size[2]>maxSize)*
*    {*
*    return 0;*
*    }*

... we get back the good old behavior of this 3D volume mapper.

Maybe this can be set as an option, something like
mapper->Max3DTextureSizeOn(), to prevent that problem.


Thanks for listening, and thanks a lot for VTK.

-Simon


-- 
------------------------------------------------------------------
Simon Esneault - Therenva
Centre d'Innovation Technologique
Centre Cardio-Pneumologique
CHU Pontchaillou
Rennes, France
Tel : +33 (0)6 64 61 30 94
Mail : simon.esneault at therenva.com
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101029/1ac20258/attachment.htm>


More information about the vtkusers mailing list