I’m making a 2D game, a kind of fast moving Tetris.
Below what my Profiler looks like. It always shows about 0.2 ms for the GPU and 3 ms for the CPU!
Why is all the work done by the CPU? Is there a way to transfer some of the tasks to the GPU?
My scripts only take 10% of that CPU usage, so should I assume my coding is not to blame?
Here are a few details about how my project works:
- I use a sprite packer and I only have
about 25 draw calls. - My entire
graphics files are about 1 Mb in size
in total. - The sprites are drawn on
about 10 layers (but drawing them on
1 layer didn’t solve the problem) - I
never use Instantiate() or Destroy().
All my prefab instances are pooled
off screen. - 95% of my rendering is
shown as “Transparent” in Profiler
(only 5% is Opaque) - I use the
Shader “Sprites/Default” for my whole
project - My audio clips are all
cached upon Start() as public static
variables (and they play with an
annoying delay) - I use NGUI
