Details
-
Epic
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.11
-
None
-
Investigate and improve input latency in Qt3D
Description
The current implementation of the Qt3D.Input aspect uses a backend job to gather all events and passes the processed data to the respective frontend objects. The frontend objects in turn react to the changes and modifies backend objects. In problematic cases, these frontend objects trigger more backend processing (such as ray casting) before the new results are sent back to the frontend, which again modifies backend objects.
This roundtrip means that it takes from 2 to many frames from user input results in changes on screen. This results in very noticable lag, which is critical to certain applications (such as in games, AR and VR) and reduces user experience in all applications.
The following change compares input latency with the current implementation of the input aspect with a simple implementation that listens to keyPressEvents on the window level:
https://codereview.qt-project.org/#/c/224872/
The latency is measured from we detect the keyboard even until we update the camera transform. For the current implementation, we end up with 30 to 50 ms latency. By using the simple keyboard event, we end up with 1 to 20 ms latency.