Search Unity

Static Collider: 1ms of Processing & FetchResults

Discussion in 'Physics' started by LightStriker, Jul 6, 2019.

  1. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Our scenes are made of about 25-30k colliders (mostly primitives).

    Having a rather high physic cost (2+ ms) while nothing is happening, we found out that when turning off every RigidBody, and only have our static colliders, the physic would still take 1.2ms of processing.

    0.37ms : SyncColliderTransform (why? Nothing moves!)
    0.41ms : Processing
    0.49ms : FetchResults

    Is there a way to "lock up" those colliders so the Physic wouldn't try to sync them or "process" them every frames? It's a ton of CPU cycles for something that does nothing.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  3. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    AutoSync Enabled make it sync all the transform when you use any physics function, like Raycast.
    When it's disabled, the sync occurs when the physic is updated.

    In the end, same CPU cost.
     
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    There is something missing here. 50k randomly placed static box colliders no rigidbody puts the physics update at 0.2 ms average per frame for me on 2019.1. Replacing with mesh collider same result.
     
  5. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    Hmm... 2018.4.2 here.
     
  6. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,717
    For the fun of it, I went and download 2019.1.9.

    Same issue.

    As a side note, we call the physic update manually in code. (Auto-Simulation is off)
    Using auto-simulation, the CPU impact is even worse.
    And for some reason in 2019.1.9, the player can wall through walls. Clearly something is wrong in 2019.