Hello,
When trying to volume render a data set that is 2300 x 2300 x 750 I am getting the following error:
ERROR: OpenGL MAX_3D_TEXTURE_SIZE is 2048
2026-02-12 12:39:14.555 ( 93.864s) [ 4F6000E] vtkVolumeTexture.cxx:954 ERR| vtkVolumeTexture (0x1323c73b0): Invalid texture dimensions [2350, 2350, 11]
UNSUPPORTED (log once): POSSIBLE ISSUE: unit 1 GLD_TEXTURE_INDEX_3D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
I completely understand the error. My question is what code path should I use in VTK to figure out ahead of time that the dataset will be too large for a clients hardware? Currently in our class we have access to the folowing:
vtkNew<vtkVolume> m_VolumeActor;
vtkNew<vtkSmartVolumeMapper> m_VolumeMapper;
vtkNew<vtkVolumeProperty> m_VolumeProperty;
vtkWeakPointer<vtkRenderWindowInteractor> m_ObservedInteractor;
I know I need to use vtkTextureObject? I also dug around in the Vtk source code to see the code that surrounds the error message and inside of vtkVolumeTexture there is a protected function:
bool vtkVolumeTexture::AreDimensionsValid(
vtkTextureObject* texture, int width, int height, int depth)
{
int const maxSize = texture->GetMaximumTextureSize3D();
if (width > maxSize || height > maxSize || depth > maxSize)
{
std::cout << "ERROR: OpenGL MAX_3D_TEXTURE_SIZE is " << maxSize << "\n";
return false;
}
return true;
}
Which seems promising but I’m not sure how to get to it.
Any help would be appreciated.
–
Mike Jackson