3D Depth Map Based Stereoscopic Shader
- BlueSkyKnight
-
Topic Author
mr_spongeworthy wrote: Just a quick note to say that I finally did a performance comparison between this and TriDef running my P3D profile. Performance with your shader is far better. I easily average +10fps (sometimes even better than that) using your shader as opposed to TriDef and the exact same scene. And that's not even a completely fair comparison since I'm using Shadow Boost, which is reducing the shadow draw distance when utilizing TriDef but not have to kick in at all using your shader. So without ShadowBoost it's possible you might be looking at a 15 or even 20fps performance increase over TriDef in exactly the same scene. Excellent performance. Your shader is ever so slightly "softer" than TriDef,, but increasing Lumasharpen corrects that as far as I can tell (I've turned your "blur" setting to 0 already).
Blur does not blur the image output. It blurs the Depth map. This is one of the things that reduces halos. I added this option to turn it off because some people got used to halos and it not bother to them.
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
HSV color conversion is very important it also has to be reinserted twice on at different points of the process. Took the clue from Sharps 2D to 3D conversion PowerPoint presentation.
Needs dominate Color detection so that color inversion happens automaticly, Also Presudo Depth-maps to assists needed aswell this would have to be based on the dominate shape in the scene. If some one can figure that out then maybe we can have a ok 2D to 3D converter.
I think we have Ok 2D to 3D coversion for movies.
Here a scene from Netflix show Stranger Things. Hallway
The DepthMap
//With a Presudo Depth overlay would help with that bright spot on the left and give the scene more even color.
The 3D image it Produces.
//Your Brain will correct for abnormality. Like the Black orbs in the middle of this image.
This Kind Of shader needs a lot of work.
I will upload it soon. This shader needs some one dedicated to this kind of work to get it going. If some one want to work on this as a project please do.
Please Log in or Create an account to join the conversation.
- otherman
-
I think you need it, to some extend, to make a depth mask that makes any sense.
An exemple is what I said in my first post about speed: 2d tracking movements of main features in the picture between frames, give reasonable information on what is near and what is far the pov.
Sorry, my code skills stop to very basic HTML, I can't help you.
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
otherman wrote: In theory, a picture (or a single frame) has not true 3d information. The best methods, also used in high professional 2Dto3D conversion for movies, use differences between frames to get it.
I think you need it, to some extend, to make a depth mask that makes any sense.
An exemple is what I said in my first post about speed: 2d tracking movements of main features in the picture between frames, give reasonable information on what is near and what is far the pov.
Sorry, my code skills stop to very basic HTML, I can't help you.
The thing is to do this with out delay is a lot harder. So I have to go by DOF effects and Color information from RGBtoHSV conversion. Ya that way your saying may not be possible to do as shader.
Depth from from motion can be done, but will break down once things stop moving.
If you have a video you can buffer it then play it. But, for a game......... well it can't be done the same way.
Also the depth maps I have here are inverted.
also the biggest problem is removing noise.... This is a very intensive process.
Please Log in or Create an account to join the conversation.
- mr_spongeworthy
-
Maybe you should just edit the initial post to include the common questions and answers you've been seeing throughout this thread, rather than having to answer them individually.
I'll be trying your shader in a few more games soon, things like The Witcher 3 where the TriDef profile doesn't work well (TONS of issues with lighting sources). I'll let you know how things look when I get a chance. I've also posted a few stereoscopic images on the Nexus forums (some done with TriDef, some with your SuperDepth3D). Here are a couple I am fairly sure were taken with your Shader (you can find more if you search for content from mr_spongeworthy on the nexus I expect):
staticdelivery.nexusmods.com/images/1151/979461-1472194493.jpg
staticdelivery.nexusmods.com/images/1151/979461-1472507759.jpg
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
mr_spongeworthy wrote: OK, I see what you mean about the Blur function. I'll play with it a bit and see how it changes things. (As you can see I have not read all 14 pages of posts or I would have known that...)
Maybe you should just edit the initial post to include the common questions and answers you've been seeing throughout this thread, rather than having to answer them individually.
I'll be trying your shader in a few more games soon, things like The Witcher 3 where the TriDef profile doesn't work well (TONS of issues with lighting sources). I'll let you know how things look when I get a chance. I've also posted a few stereoscopic images on the Nexus forums (some done with TriDef, some with your SuperDepth3D). Here are a couple I am fairly sure were taken with your Shader (you can find more if you search for content from mr_spongeworthy on the nexus I expect):
staticdelivery.nexusmods.com/images/1151/979461-1472194493.jpg
staticdelivery.nexusmods.com/images/1151/979461-1472507759.jpg
I am happy you are enjoying it. Keep in mind I am still working on this and looking for ways to make it look better. The Next step is to fix weapon depth.
Finding the weapon in the Depth buffer is one thing.
Adjusting for the depth map in this location is a other thing.
But, once found weapons can have there own depth maps.
Please Log in or Create an account to join the conversation.
- Aelius Maximus
-
I really should have left notes. As you can see it was a rushed job.
I'm sorry about that.
maybe if you change rgb to just r since the rest of the colors are not necessary.
Also most of the problems come not using passes when passing information from one to the other.
convert them to void and create a pass to a texture. Then Pass that texture over. This way you may get a performance boost. maybe not. also reshade will stop yelling at you..
you can also remove
DepthL = min(DepthL,1 - (tex2D(PseudoDofSamplerC,float2(texcoord.x+uv.x*pix.x, texcoord.y)).r)-tex2D(SamplerCC,float2(texcoord.x, texcoord.y)).rgb);
DepthR = min(DepthR,1 - (tex2D(PseudoDofSamplerC,float2(texcoord.x-uv.x*pix.x, texcoord.y)).r)-tex2D(SamplerCC,float2(texcoord.x, texcoord.y)).rgb);
PseudoDofSamplerC is not that good.
This worked like a charm, thanks, even managed to get it to compile in ReShade 1.1
Injected into various 2d applications, Media Players, Google Earth, Street View, Various 2D emulators, and it works as the WIP shader that it is. Could be very awesome once you figure out a good 2D to 3D algorithm,

I really hope this shader comes along
I'm guessing the new 2dto3dconv shader is for dev's only as it shows a blank left and right when i activate it.
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
Aelius Maximus wrote:
I really should have left notes. As you can see it was a rushed job.
I'm sorry about that.
maybe if you change rgb to just r since the rest of the colors are not necessary.
Also most of the problems come not using passes when passing information from one to the other.
convert them to void and create a pass to a texture. Then Pass that texture over. This way you may get a performance boost. maybe not. also reshade will stop yelling at you..
you can also remove
DepthL = min(DepthL,1 - (tex2D(PseudoDofSamplerC,float2(texcoord.x+uv.x*pix.x, texcoord.y)).r)-tex2D(SamplerCC,float2(texcoord.x, texcoord.y)).rgb);
DepthR = min(DepthR,1 - (tex2D(PseudoDofSamplerC,float2(texcoord.x-uv.x*pix.x, texcoord.y)).r)-tex2D(SamplerCC,float2(texcoord.x, texcoord.y)).rgb);
PseudoDofSamplerC is not that good.
This worked like a charm, thanks, even managed to get it to compile in ReShade 1.1
Injected into various 2d applications, Media Players, Google Earth, Street View, Various 2D emulators, and it works as the WIP shader that it is. Could be very awesome once you figure out a good 2D to 3D algorithm,
I really hope this shader comes along
I'm guessing the new 2dto3dconv shader is for dev's only as it shows a blank left and right when i activate it.
Ya it's really Hard to do It also takes up a lot of time.
I have also found this.
www.flickr.com/groups/gmic/discuss/72157626154386744/
This Gimp programmer made 2D to 3D converter
The code for it is here.
pastebin.com/82LKJvGp
The problem here is that I don't understand the Gimp scripting structure.
Also looking at the video conversions he has they are a lot better. Then what I have. Watching the out put with my old red and blue glasses. It works a lot better then mine
.
The video has a lot of wiggling. But, I think It's works really really well....
Now if we have any one here that understand gimp programming.

Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
Small update to the blur code. Don't think it made the shader any slower or any faster. But, The reason I am still working on the blur code is to combat the harsh separation effect that makes it look like you have break in the picture.
Blurring The depth map lowers that harsh separation make it more pleasing to the eye and the brain. To my understanding subtle warping. Here are images Referencing the differences.
Shader Blur 1.8.3 Blur setting at Default 7.5
Shader Blur 1.8.4 Blur setting at Default 0.050
You can always lower the Blur if it's eating too much of the Depth Information.
In GTA 5 I notice a setting of 0.025 on the new shader is ok.
You can still turn off the Blur effect by just setting it to Zero. This will give a sharper Image. But, will bring back that strong Halo effect.
I am still working on weapon depth This turned out to be harder then expected for some games.
Please Log in or Create an account to join the conversation.
- Aelius Maximus
-
Ya it's really Hard to do It also takes up a lot of time.
I have also found this.
www.flickr.com/groups/gmic/discuss/72157626154386744/
This Gimp programmer made 2D to 3D converter
The code for it is here.
pastebin.com/82LKJvGp
The problem here is that I don't understand the Gimp scripting structure.
Also looking at the video conversions he has they are a lot better. Then what I have. Watching the out put with my old red and blue glasses. It works a lot better then mine
.
The video has a lot of wiggling. But, I think It's works really really well....
Now if we have any one here that understand gimp programming.then we can have OK 2d to 3D conversions.
Damn, theres gotta be someone on here who can translate it to HLSL
Not to mention, you would then have to remove the anaglyph and make it compatible with SBS

It's a conundrum
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
Aelius Maximus wrote:
Ya it's really Hard to do It also takes up a lot of time.
I have also found this.
www.flickr.com/groups/gmic/discuss/72157626154386744/
This Gimp programmer made 2D to 3D converter
The code for it is here.
pastebin.com/82LKJvGp
The problem here is that I don't understand the Gimp scripting structure.
Also looking at the video conversions he has they are a lot better. Then what I have. Watching the out put with my old red and blue glasses. It works a lot better then mine
.
The video has a lot of wiggling. But, I think It's works really really well....
Now if we have any one here that understand gimp programming.then we can have OK 2d to 3D conversions.
Damn, theres gotta be someone on here who can translate it to HLSL
Not to mention, you would then have to remove the anaglyph and make it compatible with SBS
It's a conundrum
The easy part would be adding side by side.
The hard part is translating it in the first place. Hey want to learn Gimp script programing?

But, really some could ask him if he can translate it to HLSL or GLSL.
That or make a request here on the request forum here.
Please Log in or Create an account to join the conversation.
- Aelius Maximus
-
The easy part would be adding side by side.
The hard part is translating it in the first place. Hey want to learn Gimp script programing?
But, really some could ask him if he can translate it to HLSL or GLSL.
That or make a request here on the request forum here.
Do you know any fellow coders that know gimp programming language
We should ask around on here?

What about the laplachian HLSL code that i found, is that still of some use?
Is the current 2dto3d converter shader still development only?
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
Aelius Maximus wrote:
The easy part would be adding side by side.
The hard part is translating it in the first place. Hey want to learn Gimp script programing?
But, really some could ask him if he can translate it to HLSL or GLSL.
That or make a request here on the request forum here.
Do you know any fellow coders that know gimp programming language
We should ask around on here?
What about the laplachian HLSL code that i found, is that still of some use?
Is the current 2dto3d converter shader still development only?
I tried it out and it works. But, produces holes that the median filter is finding hard to fill.
But, I found use for the radial blur. I rewrote it to work not as Radial but as a single axis filter.
Thank you. with this I was able to make the shader we have now look a little bit sharper.
I don't know any one that programs for gimp. My not hurt to ask Thomas Keil himself. He the one that wrote it.
Also, I think we should be able to ask around gmic.eu/ community for some help with the converting the code over to HLSL or GLSL.
*G'MIC* plug in is really really nice for Gimp. It became a must have for photo editing. I recommend it.
Please Log in or Create an account to join the conversation.
- Aelius Maximus
-
I tried it out and it works. But, produces holes that the median filter is finding hard to fill.
But, I found use for the radial blur. I rewrote it to work not as Radial but as a single axis filter.
Thank you. with this I was able to make the shader we have now look a little bit sharper.
I don't know any one that programs for gimp. My not hurt to ask Thomas Keil himself. He the one that wrote it.
Also, I think we should be able to ask around gmic.eu/ community for some help with the converting the code over to HLSL or GLSL.
*G'MIC* plug in is really really nice for Gimp. It became a must have for photo editing. I recommend it.
So the Laplace code worked?

And the Radial Blur has been reworked and used as a replacement for the Median Filter if i am not mistaken?
You say the current shader we have, meaning 2dto3dconv.fx?
Currently still messing around with the WIP version from 1 week ago, and noticing an awesome side effect of the light based depth, seen here in this texture from cave in Unreal Tournament 2004, a 12 year old game with very flat textures. yet light based 2d to-3d brings it to life and gives surface of cave wall awesome 3d effect dark areas look deep and light areas stand out. focus on image below in SBS mode(kind of look similar to parrallax mapping) en.wikipedia.org/wiki/Parallax_mapping
i.imgur.com/Sg51aSC.jpg
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
Aelius Maximus wrote:
So the Laplace code worked?
And the Radial Blur has been reworked and used as a replacement for the Median Filter if i am not mistaken?
You say the current shader we have, meaning 2dto3dconv.fx?
Currently still messing around with the WIP version from 1 week ago, and noticing an awesome side effect of the light based depth, seen here in this texture from cave in Unreal Tournament 2004, a 12 year old game with very flat textures. yet light based 2d to-3d brings it to life and gives surface of cave wall awesome 3d effect dark areas look deep and light areas stand out. focus on image below in SBS mode(kind of look similar to parrallax mapping) en.wikipedia.org/wiki/Parallax_mapping
i.imgur.com/Sg51aSC.jpg
The radial blur was used to replace my blur I had before.
Median Filter is used for hole filling.
Parrallax mapping was one of my ideas of working on once I am comfortable with the shader I have now.
Please Log in or Create an account to join the conversation.
- Aelius Maximus
-
BlueSkyKnight wrote:
Aelius Maximus wrote:
So the Laplace code worked?
And the Radial Blur has been reworked and used as a replacement for the Median Filter if i am not mistaken?
You say the current shader we have, meaning 2dto3dconv.fx?
Currently still messing around with the WIP version from 1 week ago, and noticing an awesome side effect of the light based depth, seen here in this texture from cave in Unreal Tournament 2004, a 12 year old game with very flat textures. yet light based 2d to-3d brings it to life and gives surface of cave wall awesome 3d effect dark areas look deep and light areas stand out. focus on image below in SBS mode(kind of look similar to parrallax mapping) en.wikipedia.org/wiki/Parallax_mapping
i.imgur.com/Sg51aSC.jpg
The radial blur was used to replace my blur I had before.
Median Filter is used for hole filling.
Parrallax mapping was one of my ideas of working on once I am comfortable with the shader I have now.
In a way, you have already kind of have something similar to it with light based 2d-3d
If the 2d-3d shader also had a good full scene 3d effect, rather than just looking good on textures, it would be one hell of shader.
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
So I added a Cross cusor based on the code listed here.
github.com/crosire/reshade-shaders/blob/...ders/MouseOverlay.fx
Changed it to a Cross pointer from the square one in this code.
I did keep the settings for Cursor Color and Cursor Size
This is to solve the problem of hard to use/click in game menus.
To use it press ` The same key as ~
Here a example game where in game menu navigation was a pain.
Borderlands 2
Green cusor not too big
Deus Ex: Mankind Divided.
Gold color a bit bigger.
Yes I know Deus Ex: Mankind Divided has a built in Side By Side 3D. But, My head Hurts when I play that game with there built in 3D. It's to hard on me

The reason you can't see my windows cusor is because I use a very small one as a pointer. I made a Game profile in windows to make my cusor small.
you can get mini cusors here.
www.rw-designer.com/cursor-set/mini-mousepointer
Please Log in or Create an account to join the conversation.
- Sh1nRa358
-
Please Log in or Create an account to join the conversation.
- BlueSkyKnight
-
Topic Author
Sh1nRa358 wrote: @BlueSkyKnight: Do you have a version of these that work with reshade 1.1.0f1? I don't want to switch from that yet because I have a couple of other shaders I like that doesn't work correctly with anything above it. I haven't tried yet but would I need to change anything to make this work or will it work right out the box for that reshade version?
I will port the new one to 2.0 then you can port it over to 1.1. I do this when I get back from the eye doctor to day.
Please Log in or Create an account to join the conversation.
- Aelius Maximus
-

The current one still show blank SBS image

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