3D Depth Map Based Stereoscopic Shader

  • BlueSkyKnight
  • Topic Author
More
6 years 5 months ago #1221 by BlueSkyKnight Replied by BlueSkyKnight on topic 3D Depth Map Based Stereoscopic Shader

BJensie wrote: I switched to Performance mode and it worked, so BlueSkyKnight, tell me when I can test again. Thanks crosire! :)

BJ

Edit: I already tested your 1.9.9 version and IT IS WORKING splendidly!!!! ;)
And thank you for adding the parameters for ETS2 to the Game_Settings.txt!!!!
I'll try out this later, I have to get some sleep here now! Once again, THANKS!

BJ

Edit 2:
@BlueSkyKnight

Is this a correct interpretation of the following in Game_Settings.txt for ETS2?

[Auto T / ZDP Range]
No Off / 0.450-0.550

Auto T = Auto Zero Parallax Distance Power / with alternatives Normal and Off
ZDP Range = Zero Parallax Distance / with a range setting of something in the interval 0.450 - 0.550

BTW, shouldn't it be ZPD Range?

One more thing, at GitHub it still says 1.9.5 at the top, ought to be 1.9.8 now.

BJ


Ya I readjusted the setting for your Game. with 1.9.9 Should look better now.

[Auto T / ZDP Range] - Auto give you a Yes or No Use case. T is Type. N is Normal, I is Inverted, NH is Normal Half, and IH is Inverted Half.
ZDP Range is the range where you should set Zero Parallax Distance.

[Auto T / ZDP Range]
No Off / 0.150-0.200

No Off - Would be Don't use any Auto setting.
0.150-0.200 -Would be The range you can set it.

Please Log in or Create an account to join the conversation.

  • ksotar
More
6 years 5 months ago - 6 years 4 months ago #1222 by ksotar Replied by ksotar on topic 3D Depth Map Based Stereoscopic Shader
Well, I had some modest advancement.

Having thought it through again, I decided that we better go 960x1080->1920x1080 way. And so we obviously need to adjust window size. Hence we need to meddle with WinAPI. I read a little here and there and decided to spy on those two functions: SetWindowPos() and CreateWindowExA().

Here what I found running Freespace2:



I set breakpoints on all of them and tried to inject some other values (see Pre-Call and Post-Call Values). Notice that while in game options there was 960x1080, the call is with 966x1113 - obviously it takes into account window header and borders. So I just set x to 0 and nWidth to 1926 (instead of 1920). Injecting in SetWindowPos had no efect, but if I inject into CreateWindowExA, those values fall through to SetWindowsPos and voila - I have my window. Two other calls with some strange values doesn't seem to influence anything - IDK why are they exist.

So here is what I got. Exactly half of the screen is active, even mouse cursor can't get any further:



Then I activate Depth3D:



Second image is quite to the right from the middle that was clipped out before. I think it proves that Reshade\Depth3D can go outside the default Viewport (I guess by creating their own).

PBD then somehow strange turns both images:




Anyway, it seems to me that we need one little tweak with Depth3D and all be good. BlueSkyKnight, what do you think?
Last edit: 6 years 4 months ago by ksotar.

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
6 years 5 months ago - 6 years 5 months ago #1223 by kingeric1992 Replied by kingeric1992 on topic 3D Depth Map Based Stereoscopic Shader
It is not a universal patch I'm afraid.
in my test engine, I have set the viewport to fit window size by retrieving the buffer size, instead of fixed value, (just for the ability to match in event of window resize), meaning your hacks of forcing window size will not work on similar setup.

window size, backbuffer size, viewport size,
these 3 can be tied together, or individually set.
in your case, backbuffer size is tied to window size, while viewport size is set separately.
in my case, all 3 are tied together.
while in some of the modern games, there's a scaling option to have different backbuffer size to the window.
so it really depends on the game implementation.

openVR only need sbs texture, which doesn't has to be framebuffer, that's how render to x2 texture then sent it to openVR would be so much reliable.
Last edit: 6 years 5 months ago by kingeric1992.

Please Log in or Create an account to join the conversation.

  • ksotar
More
6 years 4 months ago #1224 by ksotar Replied by ksotar on topic 3D Depth Map Based Stereoscopic Shader
You bring up more general theme than Depth3D itself, so I suggest we continue discussion in my "suggestions" thread?

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
6 years 4 months ago #1225 by kingeric1992 Replied by kingeric1992 on topic 3D Depth Map Based Stereoscopic Shader
sure

Please Log in or Create an account to join the conversation.

  • GabenHood
More
6 years 4 months ago #1226 by GabenHood Replied by GabenHood on topic 3D Depth Map Based Stereoscopic Shader
Thankyou BlueSkyKnight for the ETS2 fix and everything you do.
I hate having to choose between single screen 3D and eyefinity.
(I only have 1 3D screen and Tridef fails in eyefinity 99% of the time)
With your shader I can haz both!
:woohoo:
The following user(s) said Thank You: ksotar

Please Log in or Create an account to join the conversation.

  • REDCODE
More
6 years 4 months ago #1227 by REDCODE Replied by REDCODE on topic 3D Depth Map Based Stereoscopic Shader
I guess I'm getting really unlucky with your shader. I tested: Racedriver:GRID, rFactor and Call of duty 2. Out of the 3 only rFactor managed to had actual depth (and still needs fine tuning) Call of Duty 2 and GRID instead I can't find their depth maps. Do you have any ideas?

Please Log in or Create an account to join the conversation.

  • BlueSkyKnight
  • Topic Author
More
6 years 4 months ago - 6 years 4 months ago #1228 by BlueSkyKnight Replied by BlueSkyKnight on topic 3D Depth Map Based Stereoscopic Shader

REDCODE wrote: I guess I'm getting really unlucky with your shader. I tested: Racedriver:GRID, rFactor and Call of duty 2. Out of the 3 only rFactor managed to had actual depth (and still needs fine tuning) Call of Duty 2 and GRID instead I can't find their depth maps. Do you have any ideas?


Ya, you need to look at ReShade compatibility list.

To see if the Game Listed. Also, top of that the setting does change depending on the game used/screen type you have.

I will check on Call of Duty 2.

*Update*
Disable MSAA in games so that ReShade can grab the Depth buffer like in Call of Duty 2.
Last edit: 6 years 4 months ago by BlueSkyKnight.

Please Log in or Create an account to join the conversation.

  • Sinthetix
More
6 years 4 months ago #1229 by Sinthetix Replied by Sinthetix on topic 3D Depth Map Based Stereoscopic Shader
Hi guys. Could you help me with distortion settings for a specific VR headset?
I'm using Bobovr Z4 with a 5.1" phone and people created several profiles for it using this site: vr.google.com/cardboard/viewerprofilegenerator .
A google cardboard profile looks like this:
Screen to lens: 31-32
Inter-lens: 67
Screen vert. alignment: bottom
Tray to lens center: 38
Distortion 1: 0.20
Distortion 2: 0.05
FOV angles: 50

Could I set up Polynomial_Barrel_Distortion.fx shader using above settings? Especially distortion coefficients.
More than that Polynomial_Barrel_Distortion shader is better than cardboard profile as it allows you also to fix the chromatic aberration.
Can you tell me what Polynomial_Barrel_Distortion attributes are equivalent to cardboard distortion 1,2 coefficients?

Please Log in or Create an account to join the conversation.

  • BlueSkyKnight
  • Topic Author
More
6 years 4 months ago - 6 years 4 months ago #1230 by BlueSkyKnight Replied by BlueSkyKnight on topic 3D Depth Map Based Stereoscopic Shader

Sinthetix wrote: Hi guys. Could you help me with distortion settings for a specific VR headset?
I'm using Bobovr Z4 with a 5.1" phone and people created several profiles for it using this site: vr.google.com/cardboard/viewerprofilegenerator .
A google cardboard profile looks like this:
Screen to lens: 31-32
Inter-lens: 67
Screen vert. alignment: bottom
Tray to lens center: 38
Distortion 1: 0.20
Distortion 2: 0.05
FOV angles: 50

Could I set up Polynomial_Barrel_Distortion.fx shader using above settings? Especially distortion coefficients.
More than that Polynomial_Barrel_Distortion shader is better than cardboard profile as it allows you also to fix the chromatic aberration.
Can you tell me what Polynomial_Barrel_Distortion attributes are equivalent to cardboard distortion 1,2 coefficients?


K2 Lens Distortion should be controllable. In the shader. I will Add K1 back in the newest shader 1.3. To bring it in line with Google site.

The update should be up in the next few hours since I need to fix an other shader.
Last edit: 6 years 4 months ago by BlueSkyKnight.
The following user(s) said Thank You: Sinthetix

Please Log in or Create an account to join the conversation.

  • Sinthetix
More
6 years 4 months ago - 6 years 4 months ago #1231 by Sinthetix Replied by Sinthetix on topic 3D Depth Map Based Stereoscopic Shader
Thank you BlueSkyKnight for adding the 2nd distortion coefficients.
Now I want to mention about another problem and why some people cannot fix distortion and chromatic aberration.
That problem occurs mostly on custom 3d headsets with different size of phones.
Sometimes its impossible to fix distortion and chromatic aberration because the horizontal center of lenses don't match horizontal center of the phone, that means that the Polynomial_Barrel_Distortion distortion will be shifted up or down in dependence of the phone size, when you have a smaller phone you can place something at the bottom to lift it up a little bit, but even doing so is not very precise, and with a bigger phone you sadly can't do anything with this.
The fix is actually very easy to apply. With an additional top or bottom padding parameter we could move the whole image up or down till we match the display center with the headset center.
It would be perfect to draw a centered horizontal line directly in shader to be able to match the centers with a high precision.
I will probably try to modify the shader for myself, with padding I don't see any problems, but I'm not sure about how to draw a centered horizontal line.
Last edit: 6 years 4 months ago by Sinthetix.

Please Log in or Create an account to join the conversation.

  • BlueSkyKnight
  • Topic Author
More
6 years 4 months ago #1232 by BlueSkyKnight Replied by BlueSkyKnight on topic 3D Depth Map Based Stereoscopic Shader
Draw me a quick Diagram so I can see what you want me to do. It sound like you want to be able to shift the entire image up and down is this right?

Please Log in or Create an account to join the conversation.

  • Sinthetix
More
6 years 4 months ago - 6 years 4 months ago #1233 by Sinthetix Replied by Sinthetix on topic 3D Depth Map Based Stereoscopic Shader
Exactly,
Here I'm trying to explain the problem: imgur.com/kovWbDU
The red line is the center of lenses, and the green line is the center of the phone display, so if we'll trying to fix distortion in this specific case form the above image we will fail every time as the center of phone is shifted down, and shader distortion is applied wrong.
So if we could add a padding parameter to the whole image, in the case form the above image we must shift the whole image a little bit up till the green line will be in place with red one.
And also if we could draw some lines directly in shader like in this image: imgur.com/6CRIQIr (not black but white lines)
The most important is the centered horizontal line, so when we'll play with padding that line should come exactly in the center of our lenses view and additional small lines I suppose should generate good chromatic aberration so that later in shader we can fix it applying the distortion and the color shift.
Last edit: 6 years 4 months ago by Sinthetix.

Please Log in or Create an account to join the conversation.

  • StuDentBR
More
6 years 4 months ago #1234 by StuDentBR Replied by StuDentBR on topic 3D Depth Map Based Stereoscopic Shader
Hi BlueSkyKnight first of all congratulations on your great work, it is very hard to find softwares to help us to make use of our 3D TV's these days.
Have anyone tested Depth3D with old video game emulators like Project64 or epsxe ? Does it work ?

Please Log in or Create an account to join the conversation.

  • BlueSkyKnight
  • Topic Author
More
6 years 4 months ago #1235 by BlueSkyKnight Replied by BlueSkyKnight on topic 3D Depth Map Based Stereoscopic Shader

StuDentBR wrote: Hi BlueSkyKnight first of all congratulations on your great work, it is very hard to find softwares to help us to make use of our 3D TV's these days.
Have anyone tested Depth3D with old video game emulators like Project64 or epsxe ? Does it work ?


Give me some time I will look into Project64 or epsxe. I know someone had me test Old Dreamcast emulator and it worked.
The following user(s) said Thank You: StuDentBR

Please Log in or Create an account to join the conversation.

  • BlueSkyKnight
  • Topic Author
More
6 years 4 months ago #1236 by BlueSkyKnight Replied by BlueSkyKnight on topic 3D Depth Map Based Stereoscopic Shader

Sinthetix wrote: Exactly,
Here I'm trying to explain the problem: imgur.com/kovWbDU
The red line is the center of lenses, and the green line is the center of the phone display, so if we'll trying to fix distortion in this specific case form the above image we will fail every time as the center of phone is shifted down, and shader distortion is applied wrong.
So if we could add a padding parameter to the whole image, in the case form the above image we must shift the whole image a little bit up till the green line will be in place with red one.
And also if we could draw some lines directly in shader like in this image: imgur.com/6CRIQIr (not black but white lines)
The most important is the centered horizontal line, so when we'll play with padding that line should come exactly in the center of our lenses view and additional small lines I suppose should generate good chromatic aberration so that later in shader we can fix it applying the distortion and the color shift.


I can add this and the markers. Just Give me some time.
The following user(s) said Thank You: Sinthetix

Please Log in or Create an account to join the conversation.

  • StuDentBR
More
6 years 4 months ago - 6 years 4 months ago #1237 by StuDentBR Replied by StuDentBR on topic 3D Depth Map Based Stereoscopic Shader
I Saw that You included a TXT archive on the depth3d ZIP with the recomended settings for each game, reshader lets You save this settings for the shader on a .ini file right ? Would be posible for You to include these presets (.ini) on depth3d ZIP release ?
Last edit: 6 years 4 months ago by StuDentBR.

Please Log in or Create an account to join the conversation.

  • Sinthetix
More
6 years 4 months ago #1238 by Sinthetix Replied by Sinthetix on topic 3D Depth Map Based Stereoscopic Shader
Thank you BlueSkyKnight!
I've tested the distortion with the vertical shift and markers and want to say that this is cool, now the image is exactly in the center of my lenses, it looks more clear especially on the lens edges, and finally I was able to completely remove the chromatic aberration. That is really amazing, thank you.

Please Log in or Create an account to join the conversation.

  • BlueSkyKnight
  • Topic Author
More
6 years 4 months ago #1239 by BlueSkyKnight Replied by BlueSkyKnight on topic 3D Depth Map Based Stereoscopic Shader

StuDentBR wrote: I Saw that You included a TXT archive on the depth3d ZIP with the recomended settings for each game, reshader lets You save this settings for the shader on a .ini file right ? Would be posible for You to include these presets (.ini) on depth3d ZIP release ?



I am running into so many errors/crashes/problems in Project64. This will take me longer than expected.

Also not sure what you are asking for.
The following user(s) said Thank You: StuDentBR

Please Log in or Create an account to join the conversation.

  • StuDentBR
More
6 years 4 months ago - 6 years 4 months ago #1240 by StuDentBR Replied by StuDentBR on topic 3D Depth Map Based Stereoscopic Shader
I will show pics of what i mean, so you can see.
This .ini file generated when we add the shader and save the configuration file, so when you open the game again you don't have make all the configuration again.
i don't copy well the suggested configuration you included on depth3D release from TXT file to the program , i just thought it would be easier for the user if there was included the .ini files as pre-made game profiles. :)



Here the file i mean itself (it is with radom configurations as i could not understand very well how to use the suggested setting on the shader): www.4shared.com/file/yegtNgJdca/3D_witcher_3.html

About Project64 i used this video plugin: mudlord's Rice Video Build 6.1.3 - DX9 , it did not crash but i also could not see much depth or pop out effect, with the settings i've tried...
Last edit: 6 years 4 months ago by StuDentBR.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.