Hi,
I’m in the final stages of my first game for iOS / Android and I’m having a problem with transparent images.
All the images (with the exception of the transparent ones) are set to Mobile/Diffuse.
Basically my game is a 2D sidescroller with three layers:
- The front one is the game layer, where the action happens
- The middle one is the transparent layer
- A back layer as a backdrop to the game
Here’s how the transparent game object is set.
Here’s the output of the profiler when the middle layer is set as Transparent/Diffuse
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 2.6 max: 97.5 avg: 41.1
cpu-ogles-drv> min: 0.5 max: 1.6 avg: 0.9
frametime> min: 20.4 max: 100.9 avg: 53.6
draw-call #> min: 13 max: 16 avg: 14 | batched: 0
tris #> min: 640 max: 646 avg: 642 | batched: 0
verts #> min: 443 max: 455 avg: 448 | batched: 0
player-detail> physx: 0.6 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.0 render: 38.2 fixed-update-count: 1 … 5
mono-scripts> update: 1.0 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 274432 allocated heap: 356352 max number of collections: 0 collection total duration: 0.0
----------------------------------------
And here’s the output of the profiler when the middle layer is set as Mobile/Diffuse (i.e.: Non-transparent)
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 2.1 max: 22.2 avg: 10.2
cpu-ogles-drv> min: 0.6 max: 2.1 avg: 0.8
frametime> min: 32.1 max: 34.5 avg: 33.3
draw-call #> min: 14 max: 14 avg: 14 | batched: 0
tris #> min: 840 max: 840 avg: 840 | batched: 0
verts #> min: 564 max: 564 avg: 564 | batched: 0
player-detail> physx: 0.4 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.0 render: 8.3 fixed-update-count: 1 … 2
mono-scripts> update: 0.8 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 237568 allocated heap: 356352 max number of collections: 0 collection total duration: 0.0
----------------------------------------
As you can see the numbers in general are reasonable (14 drawcalls/frame, 840 tris and 564 verts…)
But If I understood correctly, without transparency I’m running at approx. 30 fps, with transparency at 20 fps, is that correct?
Any suggestions on how I can user the transparent layer without having such an impact on performance?
Thanks in advance,
Jay_Santos
