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
68 stars 14 forks source link

Is it possible to the full size when in side-by-side mode? #13

Open tsume709 opened 11 months ago

tsume709 commented 11 months ago

The width is halved when in side-by-side mode, is there any way to avoid halving the width? Under normal circumstances, side-by-side half is fine, but when displaying on a projector, etc., it would be preferable if it could be displayed in full size.

Vital-Volkov commented 11 months ago

If you want for example 1920x1080 per eye resolution in SbS then just set 3840x1080 resolution with "SbS HMD" output method and your projector should understand this format and split it to 1920 per eye.

Vital-Volkov commented 11 months ago

The width is halved when in side-by-side mode, is there any way to avoid halving the width? Under normal circumstances, side-by-side half is fine, but when displaying on a projector, etc., it would be preferable if it could be displayed in full size.

Or do you mean two cables output - one cable per eye

tsume709 commented 11 months ago

Thank you for your response. I am using two cables and have set up two projectors to 3840x1080 using NVIDIA Surround. In "SbS", the screen size becomes 3840x1080, but the 3D objects are halved in size. With "SbS HMD", the 3D objects don't fit on the screen at all. From what you're saying, it seems that using "SbS HMD" is the correct approach, so I'll experiment with it a bit more. Indeed, my objective is to display an image of 1920x1080 on each, so I'm fine with using the "one cable per eye" method. Is there a way to do that? Also, does it come with sample scenes that are compatible with the latest version?

tsume709 commented 11 months ago

image image It turns out like the image attached. There might be something wrong with the camera settings. Could you possibly show me a sample Unity project that works correctly?

Vital-Volkov commented 11 months ago

I guess you set 3840x1080 for one projector(but how you using a second projector and which image go by second cable?) and both left-right images go by one cable as on screenshots above but with "SBS" you have correct S3D vision but the cube is squeezed and with "SBS HMD" you have correct proportions of cube in S3D vision but not correct position for eyes.

1) "SBS" is common for monitors where left and right images squeezed in half and then stretched back by monitor with loss horizontal resolution of image in half so I can get "Interlaced S3D" with SbS input on my LG D2342P monitor. 2) "SBS HMD" is for HMD VR with image proportions as is where each image stay on their side of screen as is in front of user eyes so when you have screen size = user IPD * 2 then(with correct PPI setting) you have vanish points(camera optical axes) in center of each image(more like on first screenshot). 3) So as I understand for projectors I need to add "SbS Projector" output method with unchanged proportions like on second screenshot and S3D settings logic like on first screenshot due projector get left and right part of 3840x1080 image as is and project one over another as 1920x1080 without changing resolution and proportions of original image received by cable. 4) It is possible to also make an output method with left camera output to Display1 and right camera output to Display2 so you get left and right images separated by their own cable as is directly from left and right cameras instead of getting a combined image by S3D shader from main camera as standard Display1 output.

Ok I'll add these output methods soon.

Vital-Volkov commented 11 months ago

I added "SideBySide Full" so you can try it. And don't forget to enable "Optimize" checkmark for performance due in 3840x1080 screen resolution left and right camera also will render to target texture with 3840x1080 resolution each but with "Optimize" target texture resolution will be 1920x1080 each left and right.

Vital-Volkov commented 11 months ago

I added also "Two Cables" so you can try it.

tsume709 commented 10 months ago

Thank you. The 'SideBySide Full' feature worked well. As for the 'Two Cables' function, it is something I am looking for, but the app window only appears on one monitor and it doesn't work properly. I think it's because I'm not very familiar with Unity, but I'll do some more research on it.

Vital-Volkov commented 10 months ago

Second display should show image only when you select "Two Cables" output method as only in this mode main camera is disabled and left camera become output to Display1 and right camera to Display2 so if you setup two displays in Windows video driver then this should work. If not working in Unity editor then build a project and try it in Unity Player.

ebadier commented 10 months ago

Hi @Vital-Volkov,

For the "Two Cables" mode to work in build mode, you should activate the required displays manually: https://docs.unity3d.com/Manual/MultiDisplay.html

Vital-Volkov commented 10 months ago

Hi @Vital-Volkov,

For the "Two Cables" mode to work in build mode, you should activate the required displays manually: https://docs.unity3d.com/Manual/MultiDisplay.html

Hi @ebadier, Thanks) Already added two lines of code)) and who have two displays try it and let me know if "Two Cables" works.

tsume709 commented 10 months ago

I have confirmed that 'Two Cables' is also working properly. Is it possible to select the display on which it will be projected?

Vital-Volkov commented 10 months ago

I have confirmed that 'Two Cables' is also working properly. Is it possible to select the display on which it will be projected?

Sure it's possible just find in Stereo3D.cs the lines:

                canvasCam_left.targetDisplay = 0;
                canvasCam_right.targetDisplay = 1;

            if (Display.displays.Length > 1)
                Display.displays[1].Activate();

and change the numbers as you need for example:

                canvasCam_left.targetDisplay = 1;
                canvasCam_right.targetDisplay = 2;

            if (Display.displays.Length > 2)
            {
                Display.displays[1].Activate();
                Display.displays[2].Activate();
            }

But why do you need this? Do you have more than 2 displays connected? But if you have only 2 connections, don't forget about the "Swap Left-Right View" option to change which one is Left-Right.

tsume709 commented 10 months ago

Thank you. There are times during an event presentation when this software is used in parallel with another software (such as StereoMovie Player FF) for playing 3D videos, where a laptop for operation is connected to two projectors. The laptop for the operator becomes Display 1, so I wanted to output to the other two displays.

Vital-Volkov commented 10 months ago

Ok I added display selection staticTooltip for Method.Two_Displays and GUIAsOverlay support(except for HDRP till) for Method.Two_Displays. Select displays by pressing numeric keys and also to change selection at any time just press Ctrl + Shift + *.