1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Fixed Timestep Interpolation (2D)

Adds fixed timestep interpolation to the rendering server (2D only).
Switchable on and off with a project setting (default is off).

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
This commit is contained in:
Ricardo Buring
2024-02-17 00:57:32 +01:00
parent fe01776f05
commit 2ed2ccc2d8
39 changed files with 1040 additions and 75 deletions

View File

@@ -299,6 +299,17 @@ int64_t MainTimerSync::DeltaSmoother::smooth_delta(int64_t p_delta) {
// before advance_core considers changing the physics_steps return from
// the typical values as defined by typical_physics_steps
double MainTimerSync::get_physics_jitter_fix() {
// Turn off jitter fix when using fixed timestep interpolation.
// Note this shouldn't be on UNTIL 3d interpolation is implemented,
// otherwise we will get people making 3d games with the physics_interpolation
// set to on getting jitter fix disabled unexpectedly.
#if 0
if (Engine::get_singleton()->is_physics_interpolation_enabled()) {
// Would be better to write a simple bypass for jitter fix but this will do to get started.
return 0.0;
}
#endif
return Engine::get_singleton()->get_physics_jitter_fix();
}