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

@ -73,6 +73,7 @@ void ParallaxLayer::_update_mirroring() {
RID ci = get_canvas_item();
Point2 mirrorScale = mirroring * get_scale();
RenderingServer::get_singleton()->canvas_set_item_mirroring(c, ci, mirrorScale);
RenderingServer::get_singleton()->canvas_item_set_interpolated(ci, false);
}
}
@ -162,4 +163,6 @@ void ParallaxLayer::_bind_methods() {
}
ParallaxLayer::ParallaxLayer() {
// ParallaxLayer is always updated every frame so there is no need to interpolate.
set_physics_interpolation_mode(Node::PHYSICS_INTERPOLATION_MODE_OFF);
}