★ TouchArcade needs your help. Click here to support us on Patreon.

Good estimate for texture sizes for Unity?

08-18-2009, 07:36 AM
#1
Joined: Jan 2009
Posts: 1,553
Good estimate for texture sizes for Unity?

I ask because I am yet to find an answer for what a good guess is for how many textures at X size work well with the editor, I read around that you should work to about 10mb of ram but I am rather clueless to how much is taken up with alpha images of 512x512 for example.

Not after a solid number but any Unity users here limit themselves to a set size and amount for their games?

3D modelling, design and sequential artist / GameCenter ID: Diab
08-18-2009, 11:19 AM
#2
Joined: Dec 2008
Location: Venice, CA
Posts: 790
Quote:
Originally Posted by Diablohead View Post
I ask because I am yet to find an answer for what a good guess is for how many textures at X size work well with the editor, I read around that you should work to about 10mb of ram but I am rather clueless to how much is taken up with alpha images of 512x512 for example.

Not after a solid number but any Unity users here limit themselves to a set size and amount for their games?
Texture sizes/limitations are not actually your biggest concern on the platform. Spend some time looking into 'draw calls'.. combining textures into one material is the key.

08-18-2009, 01:04 PM
#3
Joined: Feb 2009
Posts: 132
You can use 24 Mb of RAM for textures at a time.
I don't know if unity supports compressed textures, though.
It takes 4 bytes per pixel for uncompressed texture and 4 or 2 bits for compressed (2bpp is ugly, so I wouldn't use it anyway).
08-18-2009, 02:03 PM
#4
Quote:
Originally Posted by jaguard View Post
I don't know if unity supports compressed textures, though.
Indeed it does.

Quote:
It takes 4 bytes per pixel for uncompressed texture and 4 or 2 bits for compressed (2bpp is ugly, so I wouldn't use it anyway).
It depends on the textures. All the maze graphics in Realmaze3D are 2 bit PVRTC (primarily one 1024x1024 and two 512x512 texture atlases for each theme) and it's gotten a lot of comments about having good graphics. The UI stuff is mostly 4 bit PVRTC, plus uncompressed 16 bit for the font.

Quote:
Originally Posted by Diablohead View Post
I am rather clueless to how much is taken up with alpha images of 512x512 for example.
The Unity editor tells you how much RAM each texture uses.

--Eric

Realmaze3D on the App Store
Realmaze3Free: 3 free mazes (a taste of Realmaze3D)
08-18-2009, 02:15 PM
#5
Joined: Feb 2009
Posts: 603
There's no hard limit on how many textures at X size the editor will take, nor is their a precise amount of RAM dedicated to textures on an iPhone. You just need to make sure your overall memory budget is reasonable, and that you test extensively for crashes if you're finding yourself pushing the envelope. Do not wait until you're "done" to start paying attention to your memory usage. Anywhere under 30mb of total RAM usage is pretty safe territory (that's music, sound effects, textures, scripts, the whole bit). My new game uses a small truckload of 256x256 4-bit PVRTC alpha'd textures (several dozen of them) which are a mere 32kb each, and quite a lot of sound effects too, but I'm still using in the low 20's at peak.

Draw calls are a concern too, but I would argue less so than memory consumption. A game with a lot of draw calls run slow. A game with too many uncompressed textures doesn't run at all.
08-18-2009, 04:10 PM
#6
If you haven't already you should start a thread over in the Unity forums... there are a bunch of developers over there making iPhone stuff (me included) and that forum is going to be able to give you a lot more Unity-specific info.
08-19-2009, 02:55 PM
#7
Joined: Jan 2009
Posts: 1,553
All good info thanks everyone. It would be much better for me to ask at the unity forums but I not visited there for a long time lately, draw call wise I been thinking about that and triangle count all the time so no worries there. I'm trying to use only 4 lots of 256 and so far I have plenty of texture space for everything so I should be alright.

3D modelling, design and sequential artist / GameCenter ID: Diab
08-19-2009, 04:58 PM
#8
I believe Unity supports streaming too so you can use more than the actual total amount of memory assuming it's not all on-screen at once, right?

24-bit with alpha is 32-bit which means 4-bytes per pixel. So a single 512 x 512 x 32-bit texture will take up around 1 meg of RAM.

Make sure you are paying attention to fill rate as well as the # of draw calls. The iPhone has some great 3D hardware but the fill-rate on the 1st gen phones can cause a snag if you aren't careful. Unity may do a good job of handling that though.

Xenovoid - FREE 4X Galactic Conquest MMO for iOS, PC, OSX, and Linux
JOIN THE FREE BETA @ Xenovoid.com