Home Technical Talk

About texture atlas (or supertexture)...

G3L
polycounter lvl 9
Offline / Send Message
G3L polycounter lvl 9
If you're not sure what I'm talking about - http://en.wikipedia.org/wiki/Texture_atlas

Was wondering if using this method is the best method for using textures in next gen games?

I was reading some stuff on the Unity forums today and they recommend you combine all your small textures into one big texture atlas or supertexture (as some people like to call it) instead of having them separate.

Currently I'm working in Unity for mobile devices at my studio, but before stumbling upon this information I was so used to importing and exporting small textures or whatever size instead of having most of them into one big texture page.

So just wondering if this same method is recommended for use in Unreal and for next-gen console rendering? I've never really had to do this method before in production, which is fine, but I did some more reading and found out that this mainly applies to engines that take the tile approach.

For example....I make a barrel, crate rock and backpack mesh...each uses a 512x512 texture. Typically I would use the textures separately instead of combining them into one big 1024 sheet. So in one scenario you have...

4 meshes + 4 512's
or
4 meshes + 1 1024

Does this all depend on the engine in the end?

Thoughts, comments, suggestions? O_O

Replies

  • SpeCter
    Options
    Offline / Send Message
    SpeCter polycounter lvl 14
    It mostly depends if this 4 meshes for example are to be seen together.
    You use that technique to save texture calls.

    If they are not seen together at all it´s not that good to combine them, because you need the whole texture space for only a small part of it.
  • commander_keen
    Options
    Offline / Send Message
    commander_keen polycounter lvl 18
    Usually whenever this is used in production its done behind the scenes by the engine. This is pretty easy to setup in Unity. Remember that you only get an advantage from doing this when the atlased textures are on the same object and material (or can auto-magically be combined into the same object and material).

    For example, if your entire level used 1 shader you can gather all the materials in the level and pack each materials texture(s) into an atlas(or multiple atlases if there are more than 1 texture on the materials). Then you can combine all the meshes together and modify their uv coords to point to the materials new atlased uv space. For per materials settings like specular brightness and color tint you would have to also make atlases for these because the final combined mesh would use a single material so it can be 1 draw call.
  • G3L
    Options
    Offline / Send Message
    G3L polycounter lvl 9
    Good stuff guys! That definitely makes sense by having them combined or not. Been really getting into this whole draw call business as of late >_<

    Anyone know what batching does exactly in an engine?
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    G3L wrote: »
    Good stuff guys! That definitely makes sense by having them combined or not. Been really getting into this whole draw call business as of late >_<

    Anyone know what batching does exactly in an engine?


    Texture atlasing is to get rid of the pause where the engine has to stop to change textures/shaders when rendering polygons. It's not always the texture fetch that causes this as it may just be that the engine always pauses between polygons with a different shader/texture on them.

    It's highly engine specific as different engines will pause at different times depending on what kind of scene graph they have. Some engines may have other limitations to do with physics and so on that may be more important.
  • commander_keen
    Options
    Offline / Send Message
    commander_keen polycounter lvl 18
    Batching can mean a few different things. Sometimes it refers to combining materials textures or meshes like my example, but it can also refer to ordering the draw calls to minimize the amount of state changes needed to render everything. The fastest way to render something will always be to have it in 1 vertex buffer and share 1 material. You also have to think about occlusion and memory usage though.
Sign In or Register to comment.