I've been using sprite atlas to great effect, keeping my draw calls to a minimum, but I can't seem to find a way to add my characters which I imported using the PSD importer tool to an atlas. The result is when lots are on the screen I have upwards of 450+ draw calls as each limb must be it's own call and gives horrid performance on mobile. Surely there's a way to do it, right?
Please try adding the sprites individually to the SpriteAtlas Packable Objects. Also if you are referring to this package : com.unity.2d.psdimporter@1.0 you should be able to add the texture object or the folder that contains the psd texture to the Sprite Atlas packables. Please use the latest version of 2019.1 Beta (Unity 2019.1.0b6) Let us know if this works.
Trying now, but the PSD Importer does not actually work with 2019.1.0b6. Reproduce: Create fresh 2019.1.0b6 project Import com.unity.2d.psdimporter@1.0 from package manager
In a new project using 2018.3.5f1, it batches it all together, but in my main project in the same unity version it doesn't... I'm trying to find the delta, but the only thing I can think of is that the main project is rigged with bones and the unity 2d IK. Would that do it?
In 2018.3 versions animated sprites are not batched. However we have added support for batching of animated sprites (SpriteSkin) in 2019.1 (please test latest beta). More info here : https://forum.unity.com/threads/2d-animation-v2-preview-packages.599356/ Will take a look asap.
I'm an idiot. It just required 2d.animation. I'm suffering a new problem now.. The PSD imports work with their rigs, but my actual prefabs have lost all linking to their bones, see the video below: https://www.dropbox.com/s/ga7gjaaiupi1j2f/Z87Iy6puaw.mp4?dl=0
@Tarodev: Did you figure out a way to put Sprites from a PSD into a Sprite Atlas so that draw calls for the sprites are batched? I put them into the sprite atlas directly (not through a directory), but there are still a lot of draw calls... BTW: Great videos on your Youtube channel!
I finally figured this out. Sprite atlases work with 2D Animation as expected! The issue in my case was, that I highlighted some instances by changing shader properties, which resulted in every sprite getting its own material. Since batching only works with shared materials, I had to reset the materials back to the original one, after highlighting was over. Using the FrameDebugger was really helpful btw!
Before I change the material, I store a reference to the material. But I'd recommend to look into https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html, that's much better than changing the material directly and you don't need to reset the material.
I attempted switching the materials to a new mat, but still having batching issues. It didn't change my draw call count. My "Sprite Skin" section in the inspector doesn't have the "Enable Batching" checkbox or even the warning to have burst or collections installed. (which I do have have). Any thoughts or other things check?
The Sprites get generated into a Sprite sheet through the PSD importer from a PSD/PSB File.The issue were having is that all the pieces of the rig get called in (drawn) separately. also, appreciate your time and responses!
Hey, we were able to move some of these layers around and adjust some lighting interactions and it seemed to fix the problem!