Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: 3D sprites, textures sizes...

  1. #1
    Junior Member Newbie
    Join Date
    May 2001
    Location
    Worcester, Worcestershire, UK
    Posts
    1

    3D sprites, textures sizes...

    Does anyone know how I can use a texture that is not to the power of 2?

    I have written my first 3D sprite library in OpenGL, it supports for all the normal stuff, plus real-time anti-aliasing, but at the moment I'm restricted to 16x16, 32x32, 64x64, 128x128, 256x256, etc...

    Both 'the red book' and the relevant examples on the nehe site say there are ways around this, but don't say what they are or where to find them...

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: 3D sprites, textures sizes...

    BTW, your textures don't have to be square. Any combination of power-of-two works as long as GL_MAX_TEXTURE_SIZE is not exceeded.

    Check this out for non power-of-two textures. http://oss.sgi.com/projects/ogl-samp..._rectangle.txt

  3. #3
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Aix en Provence, France
    Posts
    182

    Re: 3D sprites, textures sizes...

    You can only use power of two sized textures, but you can store several sprites in one texture using subtextures and use them separately with appropriate texture coordinates ...
    Hope this helps
    -----
    Paddy
    Software Engineer
    I/O Labs

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: 3D sprites, textures sizes...

    Be careful, mip-mapping becomes a major hassle if you store multiple sub-textures in one image.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •