godot/servers
Arseny Kapoulkine b2c83b42f6
Relax motion vector updates to allow skipped frames for skeletons
Before this change, a skeleton that was not updated every frame would
result in a difference of 2+ between last_change and frame index every
frame, which would disable the buffer rotation and set motion vectors to
zero. This results in significant visual artifacts for FSR2 that are
especially prominent on the characters that move together with the view
such as the main character in third person mode.

This is a significant problem for high refresh rate displays: at 120 Hz,
we are effectively guaranteed to skip skeleton updates every other frame
with skeleton update happening during physics processing, and the lack
of physics interpolation for skeletons. This happens by default in TPS
demo when FSR2 is enabled.

In other places where motion vectors are disabled, such as multi-mesh
and mesh rendering (where previous transform is updated), the logic
effectively allows for a single-frame gap in updates, because it
compares the frame where the update happened (which is the current frame
if updates are consistent) with the current frame, so the latency of 0
means "update just happened", but both multi-mesh and mesh transform
updates permit a latency of 1 as well.

Here, however, last_change is updated *after* the frame processing has
concluded, so a zero-latency update has a distance of 1. Allowing a
distance of 2 (latency 1) reduces the severity of the problem and aligns
the logic with transform updates.

Note that the problem will still happen when refresh rate is noticeably
higher than physics rate times 2. For example, it still happens at 240
Hz. However, a longer latency allowance is inconsistent with other
transforms and could lead to issues, so ideally long term physical
interpolation of skeleton transforms would completely solve this.

(cherry picked from commit 92f2bc70dd)
2024-09-16 17:10:47 +02:00
..
audio Fix audio samples not being able to be "finished" 2024-07-17 10:45:38 -04:00
camera One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
debugger Reduce and prevent unnecessary random-access to List 2024-05-04 16:08:55 +02:00
display [macOS] Improve native menu open/close callbacks. 2024-06-05 20:22:41 +03:00
extensions Disable all 3D nodes, physics, and resources when compiling without 3D 2024-03-11 01:00:55 -07:00
movie_writer Add error checks for DirAccess creation. 2023-09-26 03:07:43 +01:00
navigation Add navigation path simplification 2024-04-11 12:32:21 +02:00
physics_2d fix rare physics crash 2024-06-18 02:18:11 -07:00
physics_3d fix rare physics crash 2024-06-18 02:18:11 -07:00
rendering Relax motion vector updates to allow skipped frames for skeletons 2024-09-16 17:10:47 +02:00
text [TextServer, GDExtension] Fix building text servers as GDExtension, expose new/changed low-level methods to GDExtension API. 2024-06-12 19:30:19 +03:00
xr XR: Check for bad input in make_vrs_texture 2024-06-24 17:45:27 +02:00
audio_server.cpp Fix AudioStreamPlayer get_playback_position() for web build 2024-09-16 16:41:06 +02:00
audio_server.h Fix AudioStreamPlayer get_playback_position() for web build 2024-09-16 16:41:06 +02:00
camera_server.cpp One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
camera_server.h Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
display_server_headless.h Pass window exclusive and transient properties for subwindow creation 2024-07-25 00:27:27 +08:00
display_server.cpp Pass window exclusive and transient properties for subwindow creation 2024-07-25 00:27:27 +08:00
display_server.h Pass window exclusive and transient properties for subwindow creation 2024-07-25 00:27:27 +08:00
navigation_server_2d_dummy.h Add navigation source geometry parser callbacks 2024-04-19 12:10:57 +02:00
navigation_server_2d.cpp Add navigation source geometry parser callbacks 2024-04-19 12:10:57 +02:00
navigation_server_2d.h Add navigation source geometry parser callbacks 2024-04-19 12:10:57 +02:00
navigation_server_3d_dummy.h Add navigation source geometry parser callbacks 2024-04-19 12:10:57 +02:00
navigation_server_3d.cpp Add navigation source geometry parser callbacks 2024-04-19 12:10:57 +02:00
navigation_server_3d.h Add navigation source geometry parser callbacks 2024-04-19 12:10:57 +02:00
physics_server_2d_wrap_mt.cpp Apply additional fixes to servers' threading 2024-05-08 17:41:40 +02:00
physics_server_2d_wrap_mt.h Only print physics sync warning on dev builds to avoid warning spam from using move_and_slide 2024-07-12 10:52:30 -07:00
physics_server_2d.cpp Bind PhysicsServer*D::body_set_state_sync_callback 2024-07-23 13:30:44 +02:00
physics_server_2d.h Update PinJoint2D API with angle limits and motor speed 2023-09-26 10:29:23 +02:00
physics_server_3d_wrap_mt.cpp Apply additional fixes to servers' threading 2024-05-08 17:41:40 +02:00
physics_server_3d_wrap_mt.h Only print physics sync warning on dev builds to avoid warning spam from using move_and_slide 2024-07-12 10:52:30 -07:00
physics_server_3d.cpp Bind PhysicsServer*D::body_set_state_sync_callback 2024-07-23 13:30:44 +02:00
physics_server_3d.h Disable all 3D nodes, physics, and resources when compiling without 3D 2024-03-11 01:00:55 -07:00
register_server_types.cpp Add samples playback support 2024-06-18 11:06:31 -04:00
register_server_types.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
rendering_server.compat.inc Add antialias support for CanvasItem draw primitives 2024-05-13 19:03:31 +08:00
rendering_server.cpp Fix AABB computation for position compression to not depend on vertex order 2024-07-03 23:53:24 -07:00
rendering_server.h Remove our ERR_ON_RENDER_THREAD guard, it is not reliable 2024-07-09 18:48:00 +10:00
SCsub [NativeMenu] Move files to the display subfolder. 2024-03-26 10:18:08 +02:00
server_wrap_mt_common.h Fix typo in preprocessor symbol 2024-06-19 22:04:29 +02:00
text_server.compat.inc Improve TextEdit/LineEdit word selection. 2024-04-22 14:02:07 +03:00
text_server.cpp Fix TextServer::shaped_text_*_character_pos for the first character of wrapped string. Allow starting/ending RTL selection before line start. 2024-09-16 16:38:23 +02:00
text_server.h [TextServer, GDExtension] Fix building text servers as GDExtension, expose new/changed low-level methods to GDExtension API. 2024-06-12 19:30:19 +03:00
xr_server.compat.inc Rework XR Trackers to have a common ancestor. Allow creation of XRNode3D to drive node positions and visibility. 2024-04-18 20:04:01 -04:00
xr_server.cpp Apply reference frame transform to OpenXRCompositionLayer nodes 2024-05-29 07:52:54 -05:00
xr_server.h OpenXR: Change timing of xrWaitFrame and add thread safety features to OpenXR 2024-05-01 14:24:41 +10:00