Texture Atlas

Optimizations | Tuesday 8 December 2009 1:07 pm

Texture atlas [1][2] is a technique to group smaller textures into a larger texture. This decreases the number of state switches [3] a renderer needs to do and therefore often increases performance. Texture atlases have been used for a long time in the video game industry for sprite animations. When using texture atlases, the uv-coordinates of the models have to be changed so the original 0..1 map to the textures tile in the atlas. Grouping of textures can be done manually by texture artists or with tools. The texture coordinate system can be changed to map the new texture in a tool, or in the shader at run-time.

An example texture atlas
Image from article [2]

There are some limitations with using texture atlases compared to normal textures. First of all, all texture coordinates must initially be within 0..1 range. So for example, no “free” tiling can be used. The other problem is bleeding between tiles in the atlas when doing filtering, for example when using mipmaps.

Some additional information from Ivan-Assen Ivanov, author of article [2].

” – separate textures hurts not only batching (in facts, it hurts batching less than years ago), but also memory – as there is a certain per-texture overhead. This is especially painful on consoles – on PCs, the overhead is still there, I guess, but the driver hides it from you. The exact numbers are under NDA, of course, but on an old, unreleased project, we saved about 9 MB by atlas-sing a category of textures we didn’t atlas before.

- vertex interpolators are expensive! make sure you measure the remapping from 0..1 to the actual UVs in the atlas both in the vertex and in the pixel shader. Sounds counterintuitive, but on modern GPUs and with dense geometry, pixel shader is actually faster.” 

[1] “Improve Batching Using Texture Atlases” http://http.download.nvidia.com/developer/NVTextureSuite/Atlas_Tools/Texture_Atlas_Whitepaper.pdf

[2] “Practical Texture Atlases” (borrowed image from this page)
http://www.gamasutra.com/features/20060126/ivanov_01.shtml

[3] “Batch, Batch, Batch: What Does It Really Mean?”
http://developer.nvidia.com/docs/io/8230/batchbatchbatch.pdf

Please share:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Current
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • StumbleUpon
  • Twitter
  • Reddit
  • Technorati
  • Yahoo! Bookmarks

5 Comments »

  1. Comment by Ivan-Assen Ivanov — December 8, 2009 @ 8:22 pm

    Hey, that’s an image I recognized in my Google Reader stream :-)

    A couple things to add that I learned since writing that Gamasutra article:

    - separate textures hurts not only batching (in facts, it hurts batching less than years ago), but also memory – as there is a certain per-texture overhead. This is especially painful on consoles – on PCs, the overhead is still there, I guess, but the driver hides it from you. The exact numbers are under NDA, of course, but on an old, unreleased project, we saved about 9 MB by atlas-sing a category of textures we didn’t atlas before.

    - vertex interpolators are expensive! make sure you measure the remapping from 0..1 to the actual UVs in the atlas both in the vertex and in the pixel shader. Sounds counterintuitive, but on modern GPUs and with dense geometry, pixel shader is actually faster.

  2. Comment by admin — December 9, 2009 @ 9:34 am

    Thanks for the comment and additional info. :) I hope you don’t mind me borrowing the image from the article. I thought it showed the idea great.

    /admin

  3. Comment by rip — December 9, 2009 @ 4:02 pm

    I created a Texture Atlas Generator script for 3dsmax, you can find it here: http://www.scriptspot.com/3ds-max/texture-atlas-generator

  4. Comment by admin — December 9, 2009 @ 5:12 pm

    That looks like a very useful tool! I will test it as soon as I get some time. Thanks for telling me about it.

    /admin

  5. Pingback by Real-Time Rendering · 7 things for December 23 — December 24, 2009 @ 11:43 am

    [...] a short little article on texture atlassing. If you want a bit more information, read Ivanov’s article on this topic on Gamasutra, [...]

RSS feed for comments on this post. TrackBack URI

Leave a comment