godot/servers/rendering
Arseny Kapoulkine 92f2bc70dd 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.
2024-08-17 11:10:41 -07:00
..
dummy Fix LightmapGI causes crash when using --headless 2024-08-07 11:38:05 +02:00
environment Reset SDFGI when changing editor scene tabs 2023-08-30 19:50:05 +03:00
renderer_rd Relax motion vector updates to allow skipped frames for skeletons 2024-08-17 11:10:41 -07:00
storage Track compositor effects that use motion vectors so we enable required logic 2024-06-12 12:37:18 +10:00
renderer_canvas_cull.cpp Add alternative pixel rounding 2024-06-29 10:33:39 -04:00
renderer_canvas_cull.h Add antialias support for CanvasItem draw primitives 2024-05-13 19:03:31 +08:00
renderer_canvas_render.cpp Avoid crashes when engine leaks canvas items and friends 2023-12-20 13:19:46 +01:00
renderer_canvas_render.h fix missing cleanup and null checks for various singletons 2024-06-18 01:05:30 -07:00
renderer_compositor.cpp fix missing cleanup and null checks for various singletons 2024-06-18 01:05:30 -07:00
renderer_compositor.h Fix regression around OpenGL swapchain optimisation for OpenXR 2024-07-29 12:46:58 +10:00
renderer_geometry_instance.cpp
renderer_geometry_instance.h Expose RD::texture_native_handle 2023-06-14 09:58:08 +10:00
renderer_scene_cull.cpp Merge pull request #95379 from SlashScreen/fix_dir_light_layers 2024-08-16 10:35:44 +02:00
renderer_scene_cull.h Fixed Timestep Interpolation (3D) 2024-07-07 22:15:23 +02:00
renderer_scene_occlusion_cull.cpp Jitter raster occlusion camera to reduce false positives. 2024-04-03 12:18:45 +01:00
renderer_scene_occlusion_cull.h [Core] Add scalar versions of Vector* min/max/clamp/snap(ped) 2024-05-02 10:31:13 +02:00
renderer_scene_render.cpp Implement hooks into renderer 2024-02-18 21:54:21 +11:00
renderer_scene_render.h Implement hooks into renderer 2024-02-18 21:54:21 +11:00
renderer_viewport.cpp Fix regression around OpenGL swapchain optimisation for OpenXR 2024-07-29 12:46:58 +10:00
renderer_viewport.h Apply additional fixes to servers' threading 2024-05-08 17:41:40 +02:00
rendering_context_driver.cpp Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver. 2024-02-12 10:02:18 -03:00
rendering_context_driver.h Add optional driver workaround to RenderingDevice for Adreno 6XX. 2024-05-13 10:20:31 -03:00
rendering_device_binds.cpp Remove useless instantiation in RDShaderFile::parse_versions_from_text 2024-06-27 08:57:06 +02:00
rendering_device_binds.h Implement hooks into renderer 2024-02-18 21:54:21 +11:00
rendering_device_commons.cpp Make shader binary alignment handling simpler and more robust 2024-03-06 11:48:23 +01:00
rendering_device_commons.h Improvements to VRS/Foveated rendering 2024-05-03 17:20:30 +10:00
rendering_device_driver.cpp Add support for enhanced barriers in D3D12. 2024-05-20 13:04:44 -03:00
rendering_device_driver.h Merge pull request #91769 from DarioSamo/d3d12_enhanced_barriers 2024-05-31 14:15:49 +02:00
rendering_device_graph.cpp Add support for enhanced barriers in D3D12. 2024-05-20 13:04:44 -03:00
rendering_device_graph.h Add support for enhanced barriers in D3D12. 2024-05-20 13:04:44 -03:00
rendering_device.compat.inc Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver. 2024-02-12 10:02:18 -03:00
rendering_device.cpp Fail when submit or sync called on main rendering device 2024-08-12 15:50:01 -07:00
rendering_device.h Fail when submit or sync called on main rendering device 2024-08-12 15:50:01 -07:00
rendering_light_culler.cpp Tighter light culling - fix directional lights colinear case 2024-05-10 09:13:05 +01:00
rendering_light_culler.h Tight shadow culling - increase epsilon to prevent flickering 2024-05-18 14:14:27 +01:00
rendering_method.cpp
rendering_method.h Fixed Timestep Interpolation (3D) 2024-07-07 22:15:23 +02:00
rendering_server_constants.h Fixed Timestep Interpolation (3D) 2024-07-07 22:15:23 +02:00
rendering_server_default.cpp Fixed Timestep Interpolation (3D) 2024-07-07 22:15:23 +02:00
rendering_server_default.h Fixed Timestep Interpolation (3D) 2024-07-07 22:15:23 +02:00
rendering_server_globals.cpp
rendering_server_globals.h
SCsub
shader_compiler.cpp Emit normal_roughness compatibility code in custom functions 2024-07-26 10:45:36 -07:00
shader_compiler.h Change shader compiler default setting to avoid doctool error 2024-02-29 11:01:56 +08:00
shader_language.cpp Merge pull request #95547 from Chaosus/shader_fix_for_middle_expression 2024-08-16 14:36:10 +02:00
shader_language.h Fix shader crash when the comma used in for loop as a trailing 2024-08-10 11:23:11 +03:00
shader_preprocessor.cpp Fix shader language preprocessor include marker handling 2023-09-06 16:57:40 +03:00
shader_preprocessor.h Extract ScriptInstance to simplify includes 2023-09-06 22:54:38 +02:00
shader_types.cpp Prevent changing some built-ins in spatial shaders 2024-06-17 19:18:14 +03:00
shader_types.h
shader_warnings.cpp Warn users when assigning VERTEX directly to POSITION due to compatibility breakage from reverse z changes 2024-04-12 10:38:35 -07:00
shader_warnings.h Warn users when assigning VERTEX directly to POSITION due to compatibility breakage from reverse z changes 2024-04-12 10:38:35 -07:00