Hey guys, I’ve been working on my game for about 6 months now, using the 2DRenderer with 2D Lights.
A couple months ago I was getting around 250fps when playing the game. Testing it now, I’m getting 90-110 fps. I can’t think of anything I’ve added/changed that would be causing the low framerate. I’m trying to profile the game, but having difficulty figuring out what exactly I can do about the things that are taking high percentage of CPU/GPU.
I’m running a standalone Development Build of the game with the Profiler attached.
[Above] In-game screenshot - not too much going on. I’m using the 2D lights system with point-lights, and the Player has a normalmap. Theres some foreground images, and theres a rain particle effect. I’m only getting 103 fps.
[Above] Profiler showing CPU usage.
The top highlighted line says ParticleSystem.WaitForPreMapping, and it is taking 36.9% CPU time. I googled ParticleSystem.WaitForPreMapping as well as ParticleSystem.ScheduleGeometryJobs and coudln’t find any information. The only particles that are currently active is the Rain particle effect. Probably around 300 or 400 active particles. There must be something weird going on to cause this 36.9% CPU usage, but without knowing what WaitForPreMapping is, I have no idea what to do.
I also highlighted the Render 2D Lighting CPU-usage which is only taking 5.1%. I don’t have any other information/reference point to compare that to, but it seems pretty good.
[Above] Profiler showing GPU usage.
Couple things that I don’t understand here. For one, the GPU Usage graph is showing the entire thing as “Other”. And then there is the Render 2D Lighting → RenderTexture.SetActive entry that is using 88.8% of the GPU. So now I know what is taking the majority of the GPU usage, but I don’t know what I can do about it. Is this normal? Did I configure something wrong with my project? I try to google to figure it out but I can’t find any information.
[Above] Rendering Info
Wanted to include this info in case it matters. 295 batches/draw calls seems like an awful lot, especially considering I use Texture Atlases, and have a good rendering strategy that should minimize batching. The game I’m working on is a sequel to a game I made using LibGDX, and I’m using the same rendering strategy with Texture Atlases. In that game I had around 60 draw calls. I really wish there was more information on how the 2D lighting system works so I would know if I need to set things up differently.
Would really appreciate any advice on what I could check or change to improve my FPS. I feel sort of helpless in my situation since I can’t find any information on what the ParticleSystem.WaitForPreMapping is, or whats going on with the RenderTexture.SetActive for the 2D Lighting.
Thanks!! :]