21
12/2011

Tool - Texture atlas maker

Written by arthur

I told you that I started iPhone development. After testing Unity3D and cocos2d, I decided that I will better write my own 2d engine with opengl-es. Maybe it's more extra-work, but I prefer truely understand what I am working with. Moreover I did a similar engine on Windows. But the downside was the performance, how to manage a lot of graphics on such limited hardware? (Yes, iPhone 3G, I am speaking of you.)
On windows I was loading one texture for one sprite. If I had 300 images in my application I would load 300 textures. Not very efficient, but it worked on nowadays computer. Of course it couldn’t work on iPhone. Plus, on iOS we can’t load texture that have not a power-of-two size. For example a 257x300 pixel wide image would require a space of 512x512 pixels in ram. That means a lot of wasted space.
One common approach is to pack all images in a big one, and then at the rendering compute the convenient UV mapping for each image. In doing that we get rid of glBindTexture and other opengl calls which can slow down the rendering.

texture packer atlas example

You are going to ask me why I develop windows tool for iPhone development, the answer is simple: I like the .Net Framework and C#, and tools are made to save time! And this tool helps for two things:
  • Textures packing
  • Animations maker
It works for animations too because the problem is the same(a lot of different graphics, but with limited space in ram).
If you are brave enough, you can try it by yourself in downloading the application here (it requires .Net Framework 4.0 though).

Classified in : Tools - Tags : iphone, opengl, C#, windows, atlas, packer

1 comment

monday 22 april 2013 @ 13:36 see this said : #1

I am glad that i found amazing posts on this website and and this one is also an extra ordinary one. Now I have become a regular visitor of your website.

Write a comment

What is the third letter of the word foaf? :