Search Unity

Question Is there a need to manually turn off particle systems that are not on screen?

Discussion in 'General Graphics' started by FrickinSilly, Mar 22, 2023.

  1. FrickinSilly

    FrickinSilly

    Joined:
    Feb 19, 2020
    Posts:
    53
    So let's say I have a tree in a scene and the tree sheds leaves. The falling leaves are achieved using a traditional particle system.

    For performance reasons, is it helpful if I set up a collider and script that turns off the particle system when off screen? Or will Unity automatically optimize off-screen particle systems?
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    The particle system isn't a 2D feature so I'll move your post to the General Graphics forum for you and add a "particles" tag.
     
    FrickinSilly likes this.
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
  4. FrickinSilly

    FrickinSilly

    Joined:
    Feb 19, 2020
    Posts:
    53
    Thank you!
     
  5. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    675
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
  7. Torbach78

    Torbach78

    Joined:
    Aug 10, 2013
    Posts:
    296
    without 100% trust of my profiling skills i assume masked Shuriken objects (still within cam FOV) utilize 100% CPU usage .. but not necessarily GPU?
     
  8. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    what does “masked” mean here? covered by other objects? (occluded)
     
  9. Torbach78

    Torbach78

    Joined:
    Aug 10, 2013
    Posts:
    296
    Last edited: Mar 25, 2023
    richardkettlewell likes this.
  10. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    In general, these kinds of masking techniques don't eliminate the entire GPU cost.
    As you speculated, the CPU cost is always there.
    The GPU *vertex shader* cost is also always there.
    The only performance saving is that occluded pixels will be skipped.