Questions about some tests I did(drawcalls,lights and Verts)

Hi,

I spent yesterday some hours doing some tests on the iphone. And I’ve got some nice conclusions but there are things just a bit difficult to understand.

This are some questions I would be really greateful if someone could answer:

  1. When setting a light in the scene (a simple directional light) drawcalls increase to double (one by material it seems. Ex if there was 10 drawcalls now with the light we will get 20). Is there anyway to do not use any light in the scene but still being nice about the graphics?.

  2. What’s a good number of drawcalls?

  3. What’s a good size for texture atlas? I have been thinking about 1024x1024?.

Well, that’s all, thanks in advance,
HexDump.

Most of these question can be answered by looking at the FAQ thread at the top of this section.

  1. Pixel lights double the draw count… iPhone doesn’t support pixel lighting and instead uses vertex lighting which does not double the draw calls.

2)Depends on your game. For an action game try and stay below 30. For a puzzle game that is relatively static you could double that.

3)1024 sounds fine. So does 512 or 256… it really doesn’t matter. Just try and fit as many textures onto one sheet without leaving a lot of empty space.

Keep drawcalls under 20, or the frame rate dies on the 3G.

As for textures, 1024x1024 with no compression is -crippling-, if you’re going for a grungy look you can get away with 4bit compression which literally knocks about 1mb off the textures :slight_smile:

As to lighting, if you use lightmapping you can usually get away with using no lights at all on scene/level geometry.

For example, when I made Affirmation Garden I used no lights at all.

In Amoebaz, only the Amoebaz themselves use a vertex light. The background is entirely baked and only a single draw call. Not a single poly is wasted.

HI!,

Excuse me JTBentley, what did you want to mean by “1024x1024 with no compression is -crippling-”?. Do you think it is too big? I thought this was a nice size for atlas textures. In the other hand I´m using compresion, the default one unity applies.

Thanks in advance,
HexDump.

1024x1024 is with mipmap 1/4 of the whole graphics memory.
But if it holds the majority of the textures required, there isn’t a reason not to use it. if you are able to get that all into 1 material, then Unity 1.1 will offer you a single drawcall to draw all those things actually.

Thanks for the answers.

HexDump.

im using 5 different 1024x1024 textures per level (scene). So i guess my app will crash on the iphone?

I think this totally depends on whether or not you are compressing. Touch KO, at any given time, has up to 6 1024 textures with mip-maps (not to mention several other smaller textures and one 512x64 uncompressed/no mip-maps for the HUD). We don’t get memory warnings and don’t usually exceed 20 draw calls, and the game holds a fairly consistent 20fps.

Adam is naturally right, 1024x1024 is 1/4 of the memory (6mb) in uncompressed. If you have it compressed its size is 1/4 of the uncompressed to 1/8th of the uncompressed depending on the compression type (I would go with 4bbp as it leaves the quality largely intact)