In many of the posts I’ve read, certain things keep being mentioned with trying to optimize performance for the iPhone. With everything I’ve been reading, I’m still not 100% on understanding exactly how to do what I’m doing differently.
An example being, I’m currently using one 128x128 texture on a plane per character passing by on the screen. Based on what I’ve been reading, I should use instead one big texture and somehow still chop up the plane per character??? I don’t really understand UV mapping, and since it’s just a 2D game I’m making I was hoping to avoid it…
I wouldn’t worry too much, it simple sounds like you’ve misread something.
You’ll draw your characters on indvidual planes as you’re doing (or quads, say…don’t use Unity planes).
What you’ve read is that you should try and cram as many of your textures (or frames of 2D character animation say) into a single image, often called a Texture Atlas, which will look similar to old school Sprite Sheets.
Oops hit submit too early.
You can apply the texture area of each character’s animation frame to your quad by setting the UV’s, which are analogous to X and Y co-ordinates. The major difference being that they are a range of between 0.0 and 1.0 (so 512 pixels across on a 1024 wide image is 0.5).
Best bet is to read up in the docs and search the forums, they’re a widely documented aspect of Unity and 3D in general.
currently, my 2d characters aren’t animated… (I was hoping to play with this at a later date) so, if im not animating them, am I’m ok with what i’m doing?.. with the exception of using unity’s planes…
I would recommend giving something like SpriteManager a go. You’ll still need to understand a bit about uv mapping, but almost everything is handled for you.
Sure, although the logic involved is that the more graphics you can fit into a single texture image (they could be anim frames, different characters, UI elements, etc) will improve performance on the iPhone.
Smag’s suggestion to look up SpriteMagager is a good one - it will further increase your performance as it groups all sprites linked to it into a single draw call (there are lots of threads on the importance of this here).
Be aware that an important requirement of SpriteManager is that all of your sprites must reference the same texture image. (You can of course have multiple SpriteManaged gameobjects for different textured sprites).
I spent the day yesterday optimizing everything and squeezing all the characters into the same texture; however i’m still mapping them into their own respective quad. Everything is performing great, thanks for the push.
Also, @Smag@Phil W I looked into the SpriteManager before I started development, but I thought it was a bit much for what I’m creating. At the most I’ll only have about ~5 characters on the screen at the same time and I wanted it to be as high res as possible.
Thanks again everyone, I’m looking forward to reciprocating the help via the forums when I’m proficient.