Search Unity

Collider Debug Draw Performance

Discussion in 'Physics for ECS' started by MNNoxMortem, Oct 25, 2020.

  1. MNNoxMortem

    MNNoxMortem

    Joined:
    Sep 11, 2016
    Posts:
    723
    Code (CSharp):
    1. Debug Draw rendering is now significantly faster and should be able to handle much more complicated scenes with ease.
    What is a "much more complicated scene"? I have a scene with MeshColliders that should display ~500k tris and is completly unuseable for me as it locks the whole editor up.

    While the scene renders with 100fps without the debug display
    upload_2020-10-25_18-36-17.png
    and enabling it causes unity to almost freeze
    upload_2020-10-25_18-35-49.png
    where
    upload_2020-10-25_18-37-17.png
    I clearlyget less than the displayed 22 FPS, as it feels like it takkes 500ms to render a single frame, which would be more like 2FPS.
     
  2. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Try a terrain collider. I actually have to force quit Unity if I forget to disable our terrain collider before debugging that's how slow it is.
     
  3. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Hey all! Unfortunately Debug display is not finished yet, we've made some progress and it's still slower than we'd like it to be, but it's also not correct in all cases. We'll definitely be looking into it more in the future releases.

    One alternative I can suggest for now is to temporarily switch to Havok and use Havok Visual Debugger to review your colliders and stuff.
     
    MNNoxMortem likes this.
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Add in the ability to select which collider types to display. Not only provides a work around for the worst cases right now that can bring down Unity, but it's just generally useful. I hacked it in at one time but got tired of updating it on every release, so now I just do a one line hack to disable terrains.
     
    Lukas_Kastern and petarmHavok like this.