David Glenn wrote:
Sounds interesting! I assume that using TextureRectangle does not auto-resize the image file like Texture2D does?

Both Texture2D and TextureRectangle can work with non-power of two textures, if your graphics hardware supports it. Every OpenGL 2.0-compatible graphics card should handle this without a problem.

The main difference with TextureRectangle is that it uses non-normalized texture coordinates, so if you have a 640x480 image, your texture coordinates on your geometry must range from 0-639 and 0-479 to show the whole image.

The simplest thing to do is to call setResizeNonPowerOfTwoHint(false) on your Texture2D object, and all should be well.


If so, that would solve one of my pet peeves in my life! Not to mention a consequence of letting users add graphic map images in my project – since I don’t expect them to understand the powers of two problem. That would save me some future grief!

Yeah, the power of two restriction was removed with the release of OpenGL 2.0.

--"J"

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to