[vtkusers] Hardware Volume Rendering Quality

AGPX agpxnet at yahoo.it
Fri Oct 31 03:00:21 EDT 2008


Hello,

I'm quite new to VTK, but looking at vtkOpenGLVolumeTextureMapper3D.cxx, it seem to me that (probably for memory reason), 16 bit volumes are always reduced to 8 bit. I'm very disappointed about this limit. A volume with 2560 different level, will be reduced to only 255! I wish to know: there are some planning to support 16 bit hardware volume rendering in future release? In addition, take a look at this code:

int vtkOpenGLVolumeTextureMapper3D::IsTextureSizeSupported( int size[3] )
{
  if ( this->GetInput()->GetNumberOfScalarComponents() < 4 )
    {
    if ( size[0]*size[1]*size[2] > 128*256*256 )
      {
      return 0;
      }
    vtkgl::TexImage3D(vtkgl::PROXY_TEXTURE_3D, 0, GL_RGBA8, size[0]*2, 
                      size[1]*2, size[2], 0, GL_RGBA, GL_UNSIGNED_BYTE,
                      this->Volume2 );
...
}

Why the width and height of the texture are doubled in the call to the TexImage3D? How muchvideo-memory a volume (with less than 4 scalar components) need?   (size[0] * 2) * (size[1] * 2) * size[2] * 4 ? That is, 16 bytes per voxel?
In addition, looking at UpdateVolumes. From the function vtkVolumeTextureMapper3D::UpdateVolumes, I see the following code:

...

int neededSize = powerOfTwoDim[0] * powerOfTwoDim[1] * powerOfTwoDim[2];

...

switch (components)
{
      case 1:
        this->Volume1 = new unsigned char [2*neededSize];
        this->Volume2 = new unsigned char [3*neededSize];
        this->Volume3 = NULL;
        break;
...
}
 
That is, for one component scalar, a volume need 5 times the neededSize (i.e. the dimesion of the volume, nearest to the power of two) bytes of system memory. Is this correct?
 

Thanks in advance,

- AGPX


      Unisciti alla community di Io fotografo e video, il nuovo corso di fotografia di Gazzetta dello sport:
http://www.flickr.com/groups/iofotografoevideo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081031/c20a7a9a/attachment.htm>


More information about the vtkusers mailing list