News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • May 21, 2018, 03:25:00 AM

Login with username, password and session length

Author Topic: High Draw calls with Explosion V1  (Read 2390 times)

Offline sgolby

  • Newbie
  • *
  • Posts: 2
    • Appbite
High Draw calls with Explosion V1
« on: July 11, 2013, 07:00:24 PM »
Hi Everyone,

Anyone else seeing this ?
- Game running, 20-30 draw calls
- Set off Explosion = 84 draw calls

Did some testing it feels like I am getting +1 draw call per Sprite in the prefab.

I assume I'm doing something stupid, wrong rendering settings or something.

Attached are some screenshots from the profiler. You can see the drawcalls going down just before the call, as the camera is zooming in making the screen less complex, then boom, +64 draw calls. The code is a pretty simple.  If I comment out that 1 line, 20 draw calls all the way.
Instantiate(nuclearExplosionPrefab, nukeVect, Quaternion.identity);

I have also done a test by dropping various prefabs from the pack just into the scene and starting the game.  When they are not enabled the game starts at 30 draw calls, when they are enable frame #1 = 30 draw calls, frame #2 = 140 to 170 draw calls.

I have deleted the pack fully, redownloaded from the asset store and reinstalled no change.

When I run the demo scene from the same project it has 55 draw calls in the menu & just 56 when I hit an explosion.

There is a some chance this problem started with Unity v4.1.  When using v4.0 I never noticed the slowdown on my Kindle Fire, when I recently did a new build under v4.1.3f3 the game stopped dead when the explosion went off.  Unfortunately I can't quite pin it down as my desktop doesn't blip even with 140 draw calls.

Can anyone figure what setting I put wrong to disable the nice 1 draw call explosions ?

Thanks,
Scott

Offline sgolby

  • Newbie
  • *
  • Posts: 2
    • Appbite
Re: High Draw calls with Explosion V1
« Reply #1 on: July 11, 2013, 07:04:35 PM »
Appears the Attachments aren't working in the forum, dir not writable.




Offline mtran003

  • Newbie
  • *
  • Posts: 1
Re: High Draw calls with Explosion V1
« Reply #2 on: October 29, 2014, 01:52:14 PM »
I made some modifications to the script HTSpriteSheet that helped reduce my draw calls for when I have > 20 explosions of the same type on screen at the same time to just 1 draw call; and also some code to facilitate object pooling.

Can I post it here do should email it to Hedgehog Team?

Manny