From 8c7ee6dac4cebd56da692ebf42defc43b8eca8aa Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 9 May 2019 22:40:20 +0200 Subject: [PATCH] Tweak the default low-processor usage mode to be 144 Hz-friendly On high-refresh rate displays, the old default value (8000) effectively limited redrawing to 125 FPS, no matter whether V-Sync was enabled or not. The new value limits redrawing to a value slightly above 144 FPS, decreasing input lag and making the editor feel smoother when using freelook. 60 Hz displays aren't affected by this change when V-Sync is enabled, since V-Sync will take care of limiting redrawing to 60 FPS. --- main/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index fc9ec3b2d99..da77962c8a6 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1027,7 +1027,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } OS::get_singleton()->set_low_processor_usage_mode(GLOBAL_DEF("application/run/low_processor_mode", false)); - OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(GLOBAL_DEF("application/run/low_processor_mode_sleep_usec", 8000)); + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(GLOBAL_DEF("application/run/low_processor_mode_sleep_usec", 6900)); // Roughly 144 FPS ProjectSettings::get_singleton()->set_custom_property_info("application/run/low_processor_mode_sleep_usec", PropertyInfo(Variant::INT, "application/run/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "0,33200,1,or_greater")); // No negative numbers Engine::get_singleton()->set_frame_delay(frame_delay); @@ -1949,7 +1949,7 @@ bool Main::iteration() { return exit; if (OS::get_singleton()->is_in_low_processor_usage_mode() || !OS::get_singleton()->can_draw()) - OS::get_singleton()->delay_usec(OS::get_singleton()->get_low_processor_usage_mode_sleep_usec()); //apply some delay to force idle time (results in about 60 FPS max) + OS::get_singleton()->delay_usec(OS::get_singleton()->get_low_processor_usage_mode_sleep_usec()); //apply some delay to force idle time else { uint32_t frame_delay = Engine::get_singleton()->get_frame_delay(); if (frame_delay)