vtkVolumeTextureMapper3D memory consumption since 5.6
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
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 (128256256) as it used to be in vtk 5.4. In the documentation it is said that all the volume will be resampled to a 128256256 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