The question is answered, right answer was accepted
Can atlasing also decrease performance?
Hi!
I currently develope an asset where I need to render many quads at the same time. They are dynamically batched together and modified by vertex shader. To increase performance i decided to create atlases so that all quads share the same material. I recognize, that the setpass calls lowered 50 percent but my scene containing around 10000 quads (not all rendered one time) started to lag and the frames dropped from 60-100 to 30-50. Can atlasing be the reason?
Best, Andre
It could be the reason if Unity is trying to render all of the quads at the same time as one object just because they share the same material...
You didn't atlas transparent objects with opaque objects, right? That's a really bad idea ;)
$$anonymous$$y atlas has an alpha channel and my own shader for the material renders transparent alpha blended only, not opaque and the atlas is only used by this material not another material and opaque shader. Does unity renders all together although? And is this a problem? I thought it increases performance due to less cpu drawcalls. $$anonymous$$y render thread is not the problem (always lower 5ms), but cpu (12-25 ms).
The profiler lists this peaks: Physics.processing renderforwardalpha - batch.drawdynamic shadows.rendershadowmap culling/scene culling - cull scene dynamic objects
Without atlasin the cpu was stable at around 12ms
Ah okay, you mean that it could force other threads to wait for the big mesh to finish rendering whereas smaller mesh chunks enable other threads to continue? I saw many time is wasted upon wait functions. Sounds sensfull, or? thank you again ;)
Sorry, I don't have a very technical explanation for you, but if you do something and performance drops I would switch back to what you had before.
Answer by SkandYxyz · Mar 04, 2016 at 11:17 PM
Okay, I think I will let the user decide wether to use atlasing or not and maybe there will be improvements in this case. In other scenarios with many different materials and maybe less quads atlasing really helps. Thanks!
Giving the end-user more flexibility is normally best. $$anonymous$$ake sure you close your questions by clicking the gear by your question ;)
If you can, try to get the Answer to match the title of the Question.
This answer is really a non-answer, saying you'll do things in a way where it won't matter. I'm glad it solved things for you. But think about someone else Searching, finding a Q with your title, and seeing this green answer.
Good point, Owen Reynolds!
Fore those whoe finde thise threade in yeares to cume... ;)
While atlasing is generally good practice, there are times when it actually decreases performance. One example is found here when transparent and opaque textures are combined in the same atlas. This forces all objects to be rendered with a more intensive shader.
http://docs.unity3d.com/$$anonymous$$anual/HOWTO-ArtAssetBestPracticeGuide.html