浏览代码

Merge pull request #95705 from zeux/fsr-skin-relax

Relax motion vector updates to allow skipped frames for skeletons
Rémi Verschelde 1 年之前
父节点
当前提交
10b91ee950
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp

+ 3 - 2
servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp

@@ -1056,8 +1056,9 @@ void MeshStorage::update_mesh_instances() {
 
 			mi->surfaces[i].previous_buffer = mi->surfaces[i].current_buffer;
 
-			if (uses_motion_vectors && (frame - mi->surfaces[i].last_change) == 1) {
-				// Previous buffer's data can only be one frame old to be able to use motion vectors.
+			if (uses_motion_vectors && mi->surfaces[i].last_change && (frame - mi->surfaces[i].last_change) <= 2) {
+				// Use a 2-frame tolerance so that stepped skeletal animations have correct motion vectors
+				// (stepped animation is common for distant NPCs).
 				uint32_t new_buffer_index = mi->surfaces[i].current_buffer ^ 1;
 
 				if (mi->surfaces[i].uniform_set[new_buffer_index].is_null()) {