[vtkusers] performance of MIP mappers

Michael Knopke Michael.Knopke at gmx.de
Tue Apr 10 04:12:50 EDT 2007


Hi Mark,

I made some changes to vtkOpenGLTextureMapper that enables MIP. Actually
this is pretty easy to do, so I was always wondering why it was never
included.

You just have to change the appropriate lines so that :

 

1)

Line 311: (this is the position for 1 component, need to be adjusted for the
other parts that handle more than one component too)

  

// added MIP functionality

  if(this->Superclass::GetBlendMode() == 0){

    glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );

  }

  else if(this->Superclass::GetBlendMode() == MAXIMUM_INTENSITY_BLEND){

  glBlendFunc( GL_ONE, GL_ONE);

  vtkgl::BlendEquation(vtkgl::MAX_EXT);

  }

 

2)

At the end of vtkOpenGLTextureMapper:

 

To activate the BlendEquation extension you need to load it:

 

int supports_GL_EXT_blend_minmax       = extensions->ExtensionSupported(
"GL_EXT_blend_minmax" );

 

if(supports_GL_EXT_blend_minmax)

    {

     extensions->LoadExtension("GL_EXT_blend_minmax");

    }

 

3)

 

Extent the enum in vtkVolumeMapper.h

enum 

  {

    COMPOSITE_BLEND,

    MAXIMUM_INTENSITY_BLEND,

  };

 

And add a function that lets you choose this enum. (SetBlendModeTo
MaximumIntensityBlend)

 

That's it!

 

Regards,

 

Michael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070410/2ee5e2a3/attachment.htm>


More information about the vtkusers mailing list