Vital-Volkov / Remake-of-Direct3D11-native-stereoscopic-sample

Other
2 stars 0 forks source link

This project is really awesome along with your other two projects! #1

Open 46cv8 opened 1 month ago

46cv8 commented 1 month ago

Hey Man! I have been following some of your projects for over afew years :) I haven't had a chance to use it yet, but you recently followed my project I am working on open-3d-oled. Am I correct to understand that Direct3D11 native stereo API will generate page flipped output in the hardware, using a special D3D11 API? I remember when I first saw it a number of years ago, I thought I can't believe NVidia will allow this, someone is going to make an opengl wrapper that takes the frame buffer and passes it to D3D11 for quad buffer output, then all the premium price they charge for Quadro's for QuadBuffer OpenGL would be meaningless because you could do some work around copying opengl frame buffers into D3D11 for hardware pageflipping output. Am I missunderstanding the functionality provided by the D3D11 API. If this does expose hardware pageflipping via D3D11, do you have any plan to integrate it into your Unity and Unreal plugins for pageflipping support? Then finally if you are planning to do that one day, I might be interested to fork it to add the trigger boxes so I could use it with my open-3d-oled project :) Thanks for your great work and sharing everything and I wish you all the best!

46cv8 commented 1 month ago

By the way if you have an Oled or LCD TV with 120hz and are interested in testing a beta unit I would love to have your feedback and can give you a discount so please let me know :)

Vital-Volkov commented 1 month ago

Hi! Thanks!

D3D11 has built-in S3D support but it requires a NVIDIA 3D Vision driver to work and specific monitor for output method(you can make it by EDID override) and S3D also will work in windowed mode instead of 3D Vision. So you set stereo buffers in D3D11 and it communicates with NV 3D Vision driver to show frame flipping at monitor refresh rate independent of GPU load and FPS. I tried to make a custom quad buffer without 3D Vision dependency but it looks like it is not possible to update the monitor image each refresh(FPS independent) from D3D11 code without low level access to the video driver.

I get D3D11 S3D working on RTX2060 12GB with last NVIDIA driver working with D3D11 3D Vision 452.06(unpack and replace hardware ID(1E89) from old RTX2060 to new one(1F03 in my case) in nv_dispi.inf and disable signature in boot menu to driver can be install with red popup attention and click continue to confirmation during process) + 3D Vision driver install using 3DFixManager. With my LG D2342P I get Passive S3D in Direct3D stereoscopic 3D sample over HDMI S3D mode 1920x1080 if set 24hz and Active flipping(what you need) S3D when I change refresh back to 60hz and this working only if I change HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\NVIDIA Corporation\Global\Stereo3D StereoViewerType key to 1 from default 9000 while in NV Control Panel S3D settings monitor recognized as HDMI Blue Ray on default windows drivers or native works same. On DVI monitor connection even with Zalman ZM-M240W EDID and monitor recognized as passive 3D Vision Optimized for GeForce D3D11 S3D not working correct but on my old GTX660 with latest 3D Vision 425.31 driver it works fine at 60hz and also 3D Display Mode switch appear in Windows display settings.

So as you can see it is a total mess when D3D11 S3D works or not with different drivers and hardware combinations so ideally make a custom quad buffer and find a way to direct control which image to show on monitor each refresh. Anyway I'll add D3D11 S3D to output methods as C++ native plugin for my S3D system.

You can test if D3D11 S3D works on your hardware+software using Direct3D stereoscopic 3D sample prebuilt package install or build it yourself. I upgrade it to VS2019 and will upgrade to VS2022 also soon.

Vital-Volkov commented 1 month ago

By the way if you have an Oled or LCD TV with 120hz and are interested in testing a beta unit I would love to have your feedback and can give you a discount so please let me know :)

Ok thanks! I have an LG OLED TV but it is 60HZ. Sure I want to try an active S3D on an OLED as I searched for my favorite passive S3D but damn it was no more in stores and I bought a common TV. S3D with OLED image quality is a must have :)

46cv8 commented 4 weeks ago

Thanks so much for such an information dense reply! You basically summarized exactly what I feared the situation would be. The only thing I wonder is that I'm pretty sure back when 3d movies were taking off, intel (discontinued after alder lake https://www.intel.com/content/www/us/en/support/articles/000093215/graphics.html) and amd (maybe discontinued amd hd3d https://en.wikipedia.org/wiki/AMD_HD3D) also supported 3d output under the D3D11 driver. But they may have relied on drivers by those third party applications like tridef. So I doubt there is anyway to get it working easily on all platforms and it's going to require trying different vendor drivers and third party tool drivers to get it working. This was precisely why for my open3doled stuff, I threw all that stuff out the window and focused on a fast software page flipping implementation. Then I rewrote the firmware for the shutter glasses to make it resync instantly on a dropped frame / eye flip, so normally worst case it only flickers black for 1 frame every 50 seconds or so. The best is when a TV supports framepacked 3d input natively that way you don't need to rely on video drivers for quad buffer or try to do software pageflipping. I wish there was a really reliable way to do software pageflipping, I bet one could manage it efficiently if one had two gpus. The discrete one could render SBS, and then the integrated one could just stuff those frame buffers onto the display laternating left/right at 120hz. Anyways yeah I'm sorry it won't work on your TV as you already know because it's 60 hz :( If you ever want one in the future just let me know and I can send one your way. I don't think my AMD card supports HD3D so D3D11 frame flipping is probably out, also my nvidia laptop has a crappy integrated prime mux so it can't do 3d vision.

46cv8 commented 4 weeks ago

I don't know if framepacked output is covered by "D3D11 S3D", but I wonder if it would be possible if it isn't to add framepacked stereoscopic output support. PotPlayer media player under windows 11, has an option for 3d output called "Stereoscopic 3D (Windows 8 Native 3D)". PotPlayer isn't open source so I don't know what they are doing but I suspect it is using this API.

https://learn.microsoft.com/en-us/windows-hardware/drivers/display/stereoscopic-3d

If for whatever reason this API is restricted to video or something, then I've also seen online that if you make a custom resolution profile for 1920x2205 24Hz you can force your computer to output video in top and bottom so that the projector will think it's framepacked hdmi.

https://www.reddit.com/r/htpc/comments/115ap94/how_to_get_full_hd_3d_frame_packing_from_a_pc_or/

So perhaps supporting that custom resolution with some option like "top-and-bottom style frame packed output" then adding a row of black pixels that is 45 rows high between the left and right eyes would also work. Anyways I look forward to trying out your unreal engine plugin out some time on my projector which supports frame packing if it will work :)