texture atlas!

Hi guys!

I know this is not 100% Unity related, but I thought some of you guys in here may have the answer to my question anyway!..

Basically I just learned that using texture atlases is a great way to optimize, specifically in relation to render states and draw calls I presume… However, I am a bit uncertain of the actual procedure that is actually creating one of these!.

I guess, well I think at least, one way is to just create the UVs within the 0…1 and then only use a small part of a larger map… Essentially giving each UV set a restricted part of a map thus each of them should be able to read from the same map?!..

I’m fairly convinced this method will work, but the question is, whether or not this actually is the way to do it, or if there is another, better and more efficient way out there?!

thanks for your time!
Regads,
Alex

It’s not a new thing, it goes back to when you had a limited number of pages of VRAM on a graphics card.

They’re a good way to edit/keep track of memory used, than a directory of small textures. Lot more efficient for memory, draw calls, etc.

It’s not perfect though.
You can’t tile textures as easily (have to model them to tile), UVs need to be pulled in so you don’t get lines from bilinear or MIPS blurring the edges, and it can be a pita remapping all your objects to fit pages.(auto atlas packers are nice)

Some of it depends on the 3D app your using. Recent 3ds max versions allow you to UV map multiple seperate objects simultaniously on a single texture page so it’s fairly trivial to UVmap and move stuff around, bake normal maps on a texture atlas. Tiling is still going to be a pain and usually wastes a ton of tris trying to get something working.

I’m working on a texture atlas generator right now (almost finished). All I need to do is figure out how to assign the object uv’s to their place on the atlas sheet. Anyone want to give me some tips (I have it almost figured out)?

I might post the atlas generator in the showcase later.

Hey Guys!

Thank you all very much for your replies!, During my search on this topic on the web I just stumbled upon this little thread…
http://forum.unity3d.com/threads/7619-Texture-atlas
which I can’t figure out why I didn’t find when I used the search function here in the forum… but nevermind that…!

There are some good info here on the topic and especially the mention of Unitys own Texture2D.PackTextures seems very intriguing to me! I haven’t goten the time to check it out yet, but I will be sure to do it soon!..

Also Nvidia seems to have released a tool for windows seemingly for this exact purpose…
http://developer.nvidia.com/object/texture_atlas_tools.html
Haven’t checked this out yet either…!

@theinfomercial: Be sure to give a heads-up when you generator is done!.. :slight_smile:

Don’t know which tool you use, but the animatated gifs at least show in a couple of seconds the most important infos on a texture atlas script doing its work :slight_smile:
http://www.scriptspot.com/3ds-max/scripts/texture-atlas-generator

But since Unity seems to have it already included in some sort, that’s great already :slight_smile:

Another ressource link:
http://www.polycount.com/forum/showthread.php?t=78192

There are several really nice texture atlas creation tools available, but they don’t currently work with Unity. Brady’s SM2 allows for the packing of textures into texture atlases, but due to limitations inside Unity does not allow for rotating of sprite textures to really get maximum packing of a sprite sheet.

Hopefully this will be addressed in an upcoming iteration of Unity.

B.