Physics system update based on frame delta #968
-
So far I am using very dumb and straightforward way of performing physics system update, by passing 1 collision step and the frame delta time, and calling it every frame before rendering the scene, without using the multi-threading capabilites of Jolt: m_joltPhysicsSystem.Update(deltaTime, 1, m_tempAllocator, &m_jobThreadPool); And because my FPS is locked to 60 right now, I guess that the reason it works fine. However, I suspect, that when the frame rate will drop, it will affect the simulation respectively. My question is:
Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, the more complicated your scene is, the bigger the difference. In principle you don't want to go below 1/60 th of a second, but you also want the delta time to be as consistent as possible from frame to frame. If you vary delta time, you can clearly see the effect on e.g. a ragdoll as it 'sags' a bit when delta time is big and then becomes 'hard' again when delta time is smaller. Also you may miss collisions completely with bigger delta time as objects can tunnel through other objects.
So there's not a clear cut off point and it really depends on your scene. In my experience 60 Hz gives a good quality simulation, 50 Hz probably too. 30 Hz in my opinion is too low (but maybe for your scene it will look ok). |
Beta Was this translation helpful? Give feedback.
Yes, the more complicated your scene is, the bigger the difference. In principle you don't want to go below 1/60 th of a second, but you also want the delta time to be as consistent as possible from frame to frame. If you vary delta time, you can clearly see the effect on e.g. a ragdoll as it 'sags' a bit when delta time is big and then becomes 'hard' again when delta time is smaller…