- Home /
Texture render performance - one 1024px, vs two 512px - for modular models?
Better to render one bigger texture, or broken up textures? I mean, for example a modular model, with several mesh pieces, and occlusion culling. Wouldnt it be better to break up textures, to have one per mesh piece, since with occlusion culling, some meshes, may not be rendered? And since only a part of the texture would be for that part, you would be waistfully rendering a large texture over and over? But then again, it would be the same texture over and over if it was just one large texture.
I hope that didnt sound too all over the place...
Answer by Tarlius · Jun 20, 2013 at 11:34 AM
There is a hidden benefit to using one texture for all of them that is batching, which will result in fewer draw calls (and better performance/fps) when they all need to be rendered at the same time. However, if some of the objects will be completely culled a large amount of the time, the gain may not be so noticeable.
I would imagine that for a car, for example, breaking up the tires from the main object would not be worthwhile, since although from some angles they won't be seen, they will come into view very frequently.
However, for a large building, you would usually split the exterior from the interior.
If you have a case that is less obvious, you will probably be better off testing it with the profiler.
Thanks for reply. In my case it is buildings, but player will usually not see a lot of the pieces. I wonder if it would be worth breaking the floors into side pieces.
Thats the thing- if the all share the same material, they will be batched and thus only take one drawcall, which is why there will be a balance somewhere.
You could make your ui with 100 different prefabs, but if they all share the same material, one draw call.
However, if you have two objects that will never be drawn at the same time, it won't matter if they use the same material, so you could reduce the texture size and save graphics memory by uploading it to the card (done behind the scenes) when it comes into view.
I think in an ideal world, you would have everything using one material. However, in the real world, you can only fit so much onto one texture, so you'll have to use nastier-looking compression/etc, so you'll have a quality trade-off somewhere. Also, theres no point having that high-detail boss that only appears in the game once on the same texture as that barrel that is in every level (etc)
Edit: Note that by UI I mean if you use a library like EZGUI/NGUI/etc, which combines ui textures into an atlas for you, not the built in one which is terribly inefficient, particularly on mobile devices.
Just to note that batching is subject to the 65k vertex limit - it is not guaranteed that automatic batching will batch everything with the same material to 1 draw call, also this process does take processing resource.
The prefab itself doesn't have "its own" drawcall. Its decided by the material. 100 prefabs, one material -> one drawcall total.
I didn't know about the vertex limit! Learning odd little things is why I do this, tyvm :D
Different prefabs using the same material. I meant the second way; sorry if it wasn't clear!
Your answer
Follow this Question
Related Questions
Tiled GPU perf warning? 1 Answer
How to apply a texture to a prefab? 2 Answers
Eyes animation texture problem 0 Answers
Crash from texture memory? 2 Answers