- Home /
[Unity 4.6 uGUI] Using uGUI and unity built in sprite packer does not reduce draw calls.
Hi all,
I'm trying to do some performance enhancements to my UI heavy Augmented Reality app. I'm using Unity 4.6 new uGUI. But the draw call amount is not in an acceptable range. Somewhere near 100 draw calls on some screens. My target platform is mobile (iOS and Android) so this is not good at all.
UI setup
UI texture import settings
Texture type : Sprite (2d and UI)
Sprte mode : single
Packing tag : atlas
Canvas settings
Render mode : Screen space overlay
Other settings
I have multiple Canvases in one 'Screen'
No Camera apart from the AR camera that does not render UI (Since it's Screen space overlay, UI looks and behaves fine without a Camera)
All the UI elements are packed into one 'atlas' essentially
System configuration
Mac OSX 10.9.5
Unity 4.6.0 Patch 1 (tested on 4.6.0 as well. Same result)
I'm generating sprite atlas using Unity built in 'Sprite Packer' tool and as I've read on the documentation it should use the atlas in the background without me having to doing anything else. So my individual UI elements refer to the sprite not the atlas. But as I've understood it, Unity should use the created atlas in the background. Right? or do I have to do something else here?
But I still get a lot of draw calls where I should get only one. I've attached this screen capture to illustrate the issue.
This screen should only have one draw call as all the assets used in here are in one atlas.
Does anyone know what's going on or what I'm doing wrong.
Sorry for the long winded explanation BTW. Thanks
I have the exact same problem, could you find a solutions for it?
The solution I found is to manually create a texture atlas either by photoshop or using a 3rd part texture packer tool and then refer to those in Unity by importing the atlas 'sprite mode' as multiple. This is an annoying workaround but works until I can find a proper workflow using unity built in sprite packer
Answer by intacto · Dec 23, 2014 at 07:13 AM
Change the texture import setting to advanced and set the mesh type to full rect. Your problem will be fixed when you repack the atlas.
But you loose the "sprite" property of the asset in that way, hence, you can't use it as sprite on new UI controls.
Am I right ?
Hey, I have the same problem, and changing to advanced and then set mesh type too full rect didnt change anything.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
using new UGUI for network game 0 Answers
Unity uGui change source image on event 1 Answer
Is there a bug in Unity 4.6.0? 0 Answers