What the title says. The profiler says that it’s moving an expensive static object but when i check that object, it’s not set as static. It doesn’t have a rigidbody attacked, but as far as i remember, it stopped beeing expensive since U5 because of the newer physX used. Or at least that’s what i got from the physics presentation back then.
Is it just a warning that didn’t get removed, or does is it really expensive?
yes, we should relax the warning ![]()
MortenSkaanin, I’m aware you fixed that issue in Unity 5 but can you confirm if creating rather than moving a static collider at runtime is still slow?
Yes, and Morten, please say what is the cheapest method to move my colliders, I don’t need them to detect collisions or overlap, just repositioning complex mesh collider very often. And I understand that moving static colliders isn’t expensive anymore, but is that mean it is equally expensive to move static collider and kinematic rigidbody with the same collider?
Moving static Colliders should now be as fast as moving Rigidbodies. Remember that if you teleport them around constantly you will pay a cost proportional to the length you move them. It will not be high, but it might be a surprise if you though it was entirely free.
Kier had a good reply regarding what we updated on the static Colliders:
"Hi guys
Just a little follow-up on the debate over this modification to static actors. In fact, the static actors are still static actors (PxRigidStatic) and both memory footprint and simulation performance will not be affected by this change. What has changed is the use of a dynamic pruner instead of a static pruner for the static scene in the scene queries instead of using a static pruner.
Whenever any static actor in the SQ scene is updated, inserted or removed, the static pruner is rebuilt from scratch. This can be very expensive if you either move a static actor (clearly not recommended) or simply have a streamed environment when your static scene consists of lots of shapes. The dynamic pruner, on the other hand, is incrementally updated so inserting, removing or teleporting actors causes less of a spike because the cost is spread over several frames.
You still have 2 separate scene query pruners – one for the static actors and one for the dynamic actors – so if you don’t insert/remove or update any of your static actors, it is not expected that you will observe any performance regressions. It is just that they are both now using the same type of pruner instead of using 2 different pruner types. The performance of scene queries in general in PhysX 3.3 are significantly faster than PhysX 2.8.3 so you should see nothing but performance gains when you upgrade.
I hope this helps to clear this up
Many thanks
Kier (NVIDIA PhysX engineer, in case you were wondering)"
Thanks, that answers my question 100%.