2D Toolkit Forum
2D Toolkit => Support => Topic started by: Drips on May 22, 2013, 11:54:17 pm
-
Today I tried upgrading our project to the newest unity version, 4.12. Our frame rate now drops as low as 6 fps calculated on the Update() function.
Prior to the update the fps was ranging from 50 - 60.
I tried removing different assets from the scene and it turns out to be caused by the amount of pedestrians (animated sprites). With a few of these animated sprites being rendered, the frame rate drops dramatically. This wasnt present in unity 3.57. The sprites are reasonably sized, and are animated at 7 fps.
Any ideas? Thanks!
-
Can't say I've seen this before.
Have you run this through the profiler to see what the slowest bit is?
-
took a while but we are back to unity 4 as we need some of the new features. The issue remains the same.
96% of cpu usage is going to Camera.Render -> Drawing -> Render.TransparentGeometry -> RenderForwardAlpha.Render -> MeshRenderer.RenderDynamicBatch
96% of GPU usage is going to Camera.Render -> Drawing -> Render.TransparentGeometry -> RenderForwardAlpha.Render -> MeshRenderer.Render -> Mesh.DrawVBO
-
Its nearly impossible to say what is going on as I don't know what you're rendering, what platform you're running on, if there is any difference in the configuration between the Unity configurations, how many sprites / animated sprites / how many you're updating every frame.
Please provide as much information as you can so I can try to work out what is going wrong :)
-
This issue is present running in the unity editor on pc.
There are approx 30 of these animated sprites, each using approx 60 png sprites. The sprites are
small pngs, 35px by 40 px, and are scaled up 6x in the animated sprite. The sprites compose the
animations which at played at 7 frames per second.
The game's fps drop occurs even when there is a single of these animated sprites being rendered by
the camera. It is not affected when they are present in game but not being rendered. For each
additional animated sprite being rendered, the fps drops more. I've seen it as low as 7fps with about
6 of these animated sprites present. With none the fps is at 50-60.
Here are the settings on the sprite collections:
premultiplied alpha unchecked
normal generation: normals only
target height 768
filter mode point
The atlas settings:
Texture type advanced
no mipmaps
The animated sprites are using the tk2d/LitBlendVertexColor material.
Once again, this issue only surfaced after upgrading to unity 4. The sprite animation settings havent
been changed after the upgrade.
Also, we are using tk2d version 1.9F. Today I'll try migrating to tk2d version 2.
Thanks Unikron I've been impressed by your level of support!
-
Wait, you're getting performance problems running in the editor? With 30 animated sprites?
Do you have any error messages being spammed in your log window?
I am almost certain this has nothing to do with the sprite itself, you're unlikely to get this kind of performance drop on PC due to some sprite collection setting unless you're running on some prehistoric hardware, or if Unity has some serious issues with your hardware... Can you please post your specs? (assuming you dont' have the error messages above)
-
thanks, i think we're on to something here.
we had this trace in unity 3: Shader wants normals, but the mesh doesn't have them
in unity 4 it is being traced MUCH more often.
after investigating, this trace only occurs when there is one of these animated sprites being rendered.
as far as i can tell, the setup of the collection, atlas, animation, and material is the same as other animated sprites in our game which work fine and dont cause this trace.
any ideas fixing the trace?
-
Can you try switching to an unlit material and try that? Does it work better? If so, then that will identify the issue.