diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-29 12:42:16 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-29 12:42:16 +0200 |
| commit | 1ffc24e19e64f2cf72ea253618eae991ed6db8f5 (patch) | |
| tree | 79e0614cc4936491f9d09e74ec4e6ee0624afe79 | |
| parent | 5b5471e30a8885b309625529a10941613fefc48f (diff) | |
| parent | 15b31f0891fde06da4fa617276705b1d6404b2dd (diff) | |
| download | redot-engine-1ffc24e19e64f2cf72ea253618eae991ed6db8f5.tar.gz | |
Merge pull request #80124 from Calinou/3d-editor-frame-time-initialize-fps
Initialize View Frame Time estimates to match 120 FPS
| -rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index d38890eb36..4284fd8ae2 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -2887,8 +2887,9 @@ void Node3DEditorViewport::_notification(int p_what) { fps_label->set_visible(show_fps); RS::get_singleton()->viewport_set_measure_render_time(viewport->get_viewport_rid(), show_fps); for (int i = 0; i < FRAME_TIME_HISTORY; i++) { - cpu_time_history[i] = 0; - gpu_time_history[i] = 0; + // Initialize to 120 FPS, so that the initial estimation until we get enough data is always reasonable. + cpu_time_history[i] = 8.333333; + gpu_time_history[i] = 8.333333; } cpu_time_history_index = 0; gpu_time_history_index = 0; |
