Hello Guest

Author Topic: Occlusion Culling  (Read 6874 times)

raygozajc

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Occlusion Culling
« on: June 21, 2013, 02:25:47 am »
Hi, in a 2d horizontally scrolling game using only sprites and animated sprites, do i have a benefit applying occlusion culling?, or only the default frustum culling?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Occlusion Culling
« Reply #1 on: June 21, 2013, 11:03:49 am »
It depends. You don't need to use the Unity occlusion culling system, that works best for 3d occlusion - in 2D, if you run into gameobject overheads (and you'll need a LOT of gameobjects for this to happen...) you can group some sprites together using the static sprite batcher, or group some sprites under a parent and disable that when it goes out of view manually - that could save you a bit of performance.

With animated sprites, you should disable the animator when its not in view, especially if you have a lot of them. Group them together as above, and disable a set at a time to avoid performance hitches.