Vital-Volkov / Stereoscopic-3D-system-for-Unity-2019-

Stereoscopic 3D system for Unity 2019 and 2020 with default render + Post Processing Stack v2, URP, and HDRP + Direct3D 11.1 native S3D
72 stars 14 forks source link

Stranger sequential behavior #16

Open HugoDevExe opened 6 days ago

HugoDevExe commented 6 days ago

Hello,

First of all, Thank you for your work it helped us a lot !

We are using your package on a 5 faced cave with the sequential setting but the frequency seems to be off, is there any parameter we can use to adapt it ? Or maybe the problem comes form somewhere else ?

Vital-Volkov commented 5 days ago

Hello,

Sequential for active shutter glasses will only work correctly if frames per second matches screen refresh rate so if your GPU FPS guarantee exceeds screen Hz then Sequential will work OK with vSync enabled otherwise desynchronisation will occur. 

This is the reason why I made native quad buffer D3D11 S3D output method using DLL for active glasses that can work with FPS lower than screen refresh, so you can use this method if you have supported hardware/software for native D3D11 S3D like Nvidia 3D Vision.

Read this

HugoDevExe commented 5 days ago

Thank you for your answers !

Actually, we do use 2 quadros RTX coupled with NVIDIA Mosaic and to harmonize refresh rate of the 5 screens, but we the get some desynchronisation, it is very slight but occurs often enough.

Our Unity project is DX11 and version 2021.3.23.

Vital-Volkov commented 4 days ago

My Sequential is just an implementation of simple, independent from any Hardware/Software method for Shutter glasses, it just switches Left/Right image every Update cycle(or Frame) so if you have potential FPS higher than screen refresh in your app without drops then Sequential should work fine. But if even one frame loss occurs then you see it like swapped Left/Right S3D and use key shortcut "Left Shift + S3D On/Off" for fast Left/Right swap same as toggle checkmark on S3D Control Panel. You can also toggle "Optimize" checkmark because if it On then Sequential renders Left/Right image only in odd frame and shows left then in even frame it only shows Right without rendering anything. This is required for Left/Right eyes not separated over time like in real life where Both Left/Right images come to brain from one time moment in normal condition otherwise you'll see broken depth of S3D while turning fast in one direction you feel it become shallower and deeper in another direction. So try to toggle the "Optimize" setting and give me feedback on how it changes sync behavior when Off and On.

I think the sync problem goes from dropped frames even on stable FPS matched to screen refresh and soon I'll make Left/Right switch based on time instead of next frame and we check how it goes. Ideally I need low level access to monitor buffer control and then I can make FPS independent self made quad buffer realization and Left/Right switch based on the next frame of screen hardware instead of not stable software and sync will be 100% in time. I am still researching how to control this directly without using Nvidia S3D drivers 452.06 or other high level native API's like D3D11 S3D or ATI HD3D and maybe I found answers in open source like Linux how driver controls monitor.

I personally do not like the shutter method because of light blinking and Left/Right separation over time which is unnatural(both eyes should see Left/Right at the same time like IRL) and as result all of this desync complicated problems which just do not exist in other methods. But Shutter is a solution for watching S3D on a common hi Hz capable OLED TV or monitor. So I want to solve this method also in my S3D system and have all general output methods.

I also bought a month ago Nvidia 3D Vision glasses v1(brand new with dead LiPo batteries which I replaced by soldering) and able to get good S3D(by default was several unwatchable ghosting but after tune timings with NvTimingsEd I get best result with light ghosting only 10% of screen top and bottom) on my common LG 4K OLED which can do 120hz in 2K mode.