monarch icon indicating copy to clipboard operation
monarch copied to clipboard

Asynchronous window sliding

Open Morgerion opened this issue 2 years ago • 5 comments

Thanks to the upgraded monarch, I was able to make sliding windows.

https://user-images.githubusercontent.com/7888071/230682291-110c84e1-4e7c-4326-ba30-35fd7efe2bab.mp4

... But the following problem has come to light - the windows slide unevenly. You can see it in the video if you look closely. This can also be seen in the screenshots: Скриншот 2023-04-08 00 21 13 Скриншот 2023-04-08 00 21 26

Apparently, for some windows, the transition is triggered a couple of frames later. This could be remedied by passing some sort of start time to all transitions, and compensating the delay via a negative delay in the gui.animation().

Morgerion avatar Apr 07 '23 21:04 Morgerion

This effect is very noticeable on the mobile: https://www.dropbox.com/s/poa3dee3kpvclm8/20230408_022714.mp4?dl=0

Morgerion avatar Apr 08 '23 12:04 Morgerion

I was able to get rid of the background shift when sliding. I had to do some trickery with skipping frames before animation, but now it's stable. :) However, when it comes to the GUI specifically, it still lags:

https://user-images.githubusercontent.com/7888071/230740177-48e3268b-5503-48c0-b69c-32e9ee04d9fa.mp4

The fact is that the middle window consists of two entities - the 3D scene and the GUI itself. I slide the 3D scene into the background on its own, and there is no problem here. But there is still a delay with the GUI sliding, and it is clearly within Monarch.

Morgerion avatar Apr 08 '23 19:04 Morgerion

I'm not sure if/how to solve this with the current design in Monarch. I can take one final look if you can prepare a minimal project where this problem can be seen. The other solution is to not use Monarch for the problematic screens or for those kinds of transitions.

britzl avatar Aug 03 '23 06:08 britzl

here's the project: __test_slide_GUI.zip

and here's a video (from this project) that shows where the lag in synchronization is noticeable:

https://github.com/britzl/monarch/assets/7888071/a50e2758-7308-4ab9-bc00-ddc1f3e37d17

Morgerion avatar Aug 14 '23 22:08 Morgerion

Let's say we always have two windows when sliding:

  • IN_Window (the window we arrive at)
  • OUT_Window (the window we're leaving from) For some reason i don't understand, IN_Window starts its animation 1 frame earlier than OUT_Window.

This problem can be solved without using the standard transitions from monarch. But even in this case you will have to manage the delay of 1 frame on PC and 2 frames on mobile devices (i don't know why this happens).

Morgerion avatar Aug 14 '23 22:08 Morgerion