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 7 of 7

Thread: Texture mapping

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Israel
    Posts
    5

    Texture mapping

    Is there a limit to the number of textures you can use in one application ?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    503

    Re: Texture mapping

    In practice, no. Assuming you're using texture objects (and if you aren't, you should be) the OpenGL implementation will eventually run out of identifier names, but we're talking _billions_ here.

    That said...

    If you have a graphics card that accelerates OpenGL, it will store textures in the card's own memory whenever possible. This gives a big boost in performance. If you start using more textures than will fit into the onboard RAM, the driver has to upload textures from main system memory to card memory every frame, and this is usually very bad for performance.

    So: there's no hard limit to how many textures you can use, but too many will hurt performance. The exact number will depend on lots of things - how much memory your card has, how much of that memory s taken up by the framebuffer, and how big your individual textures are.

    Hope this helps,

    Mike

  3. #3
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Caracas/Venezuela
    Posts
    182

    Re: Texture mapping

    You can also put 64 32x32 textures in a single 256x256 OpenGL texture, with a simple adjust to your texcoords.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    503

    Re: Texture mapping

    Originally posted by coco:
    You can also put 64 32x32 textures in a single 256x256 OpenGL texture, with a simple adjust to your texcoords.
    True, but I don't know that I'd recommend that in a beginner thread. Once you start using sub-textures you get a whole bunch of messy issues with filtering around the edges - bits of adjacent subtextures getting mixed in with the edges of "your" subtexture - and you can't just clamp or wrap any more.

    MikeC

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    uk
    Posts
    3

    Re: Texture mapping

    big boost in performance. If you start using more textures than will fit into the onboard RAM, the driver has to upload textures from main system memory to card memory every frame, and this is usually very bad for performance.


    So how do I load my textures into the
    graphic board memory explicity? Or this
    an automatic process.

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    503

    Re: Texture mapping

    cc246 - no, you don't need to worry about this. The driver is responsible for loading textures into card memory, and if you have more textures than will fit it'll usually try to optimize by keeping the most recently used ones loaded. Some drivers (recent Permedia ones in particular) can get very advanced in this respect.

    With OpenGL texture objects you can also specify a priority as a hint to the driver, but there's been a fair bit of discussion lately (mostly from Tim Sweeney) as to whether this is adequate, and new functionality in this area may appear in a future release.

    Cheers,

    MikeC

  7. #7
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Rochester, NY, USA
    Posts
    9

    Re: Texture mapping

    Supposedly, the idiots that wrote 3dfx's drivers hard coded a max number of textures into the drivers (something like 256). It was one of the major graphics bugs in the game recently released game Asheron's Call. I'm not sure if they fixed it or not. Other than that unusual case, most drivers don't hyave a max number of allowed textures.

    -Daedalus

Posting Permissions

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