[vtk-developers] Texture handling: display subtexture vs. resample to power of two

David Gobbi dgobbi at imaging.robarts.ca
Mon Sep 8 13:32:38 EDT 2003


Hi Michael,

The SetLoadRegion() would be a lot easier to implement, that would be the
main reason for taking that route.

Automatically changing the texture coords means making a few changes to
vtkOpenGLActor (since that's where the texture coords are dealt with)
and will make that code a little less pretty.

However, it is still my preferred way to go because it emulates
non-power-of-two textures transparently, and in a manner that is more
efficient than resampling to a power of two, which is the current
behaviour.


David, the main reason for not using OpenGL extensions are that
- they complicate maintenance, since they usually start as
  vendor-specific, get approved as ARB extensions, then finally become
  part of the OpenGL spec, and their use generally requires lots of
  ugly #ifdefs to ensure they work properly on different systems,
  plus there is no guarantee that the person who first contributes the
  change will be willing to provide the needed maintaince
- with all those #ifdefs it is harder to provide full code coverage in
  the testing

 - David


On Mon, 8 Sep 2003, Michael Halle wrote:

> There are many legacy systems that won't support the new
> non-power-of-two extensions in the latest version of OpenGL.
>
> I would say that the vtk solution shouldn't *preclude* the use
> of one of these extensions as a platform specific optimization.
>
> David, is there an overriding reason not to make the non-p-o-two
> handling automatic?  Is it because SetLoadRegion() would be
> useful outside of non-p-o-two handling?
>
> Thanks, David!
>
> Michael Halle
> mhalle at bwh.harvard.edu
>
> On Monday, September 8, 2003, at 11:33 AM, David Thompson wrote:
>
> >> ...
> >> Over the weekend I patched vtkOpenGLImageActor to use glTexSubImage2D,
> >> so that the second time around only the image-size region of the
> >> texture
> >> is loading, eliminating the need to pad to a power of two.  This
> >> improves
> >> the performance enormously for non-power-of-two images.
> >> ...
> >> What do people think?
> > What about adding support for OpenGL texture extensions like
> > ARB_texture_non_power_of_two
> > (http://oss.sgi.com/projects/ogl-sample/registry/ARB/
> > texture_non_power_of_two.txt)
> > or NV_texture_rectangle
> > (http://oss.sgi.com/projects/ogl-sample/registry/NV/
> > texture_rectangle.txt)?
> >
> >
> > _______________________________________________
> > vtk-developers mailing list
> > vtk-developers at vtk.org
> > http://www.vtk.org/mailman/listinfo/vtk-developers
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>




More information about the vtk-developers mailing list