[vtkusers] about opengl extensions

Francois Bertel francois.bertel at kitware.com
Thu Nov 2 15:51:00 EST 2006


Hi Vicente,

What do you want to achieve with that? Re-write some mapper? Write some mapper for your specific dataset?

For instance, if you look at VolumeRendering/vtkOpenGLVolumeTextureMapper3D.* that uses 3D textures, it is just a question of detecting if the extension is available and using it:

1. Try to load the extension:

vtkOpenGLExtensionManager * extensions = vtkOpenGLExtensionManager::New();
int supports_GL_EXT_texture3D          = extensions->ExtensionSupported( "GL_EXT_texture3D" );

if(supports_GL_EXT_texture3D)
  {
  extensions->LoadExtension("GL_EXT_texture3D");
  }

2. Use the extension:

glEnable( vtkgl::TEXTURE_3D_EXT );
glBindTexture(vtkgl::TEXTURE_3D_EXT, this->Volume1Index);
vtkgl::TexImage3DEXT( vtkgl::TEXTURE_3D_EXT, 0, GL_LUMINANCE8_ALPHA8, dim[0], dim[1], dim[2], 0,
                      GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, this->Volume1 );


vicente carro wrote:
> Hi Francois,
> 
> We are evaluating to add that kind of extensions in VTK (cause they will
> be quite usable in another project that we are working in). 
> How much time could be required to add those extensions in VTK taking
> into account that we are newbies in VTK?
> We are focus in the compiledvertexarray-like and 3d textures.
> 
> Thanks
> 
>> Hi Vicente,
>>
>> VTK uses OpenGL extensions for some programmable materials (VTK/Rendering/vtkGLSLShader*) and for some volume mappers (VolumeRendering/vtkOpenGLVolumeTextureMapper3D.* and VolumeRendering/vtkOpenGLHAVSVolumeMapper.*).
>> VTK/Rendering/vtkOpenGLExtensionManager.* is designed to query the available extensions on the current OpenGL context and to load them. I don't think VTK uses vertex buffer objects yet.
>>
>> Some documents are available here: http://www.vtk.org/Wiki/VTK_Shaders or browse the doxygen doc http://www.vtk.org/doc/nightly/html/
>>
>> vicente carro wrote:
>>> Hi:
>>> I'm a newbie here and i have one question. Vtk uses extensions for
>>> accelerated rendering (like vertexbufferobject, compiled vertex array
>>> and so) ?



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list