Welcome, Guest.
Username: Password: Remember me

TOPIC: About the Changes in DisplayDepth.fx

About the Changes in DisplayDepth.fx 5 months 2 days ago #1

DisplayDepth.fx was recently updated and here's a little explanation why that is and how to use these new features.

The way the values for the depth input were checked was a bit cumbersome with all the reloading, value changing and only having the depth values as a visual representation for the correct (or wrong) settings.

Making this procedure of finding the right values easier is the point of the new DisplayDepth.fx features. The depth buffer settings can now be checked in real-time and therefore changing the global preprocessor defines & reloading needs to be dealt with only once.

Shader settings:
  • Use Preprocessor Definitions: enabling this overrides the RESHADE_DEPTH_INPUT_IS_* settings from the shader with the global preprocessor definitions. This is to check if the global preprocessor definitions are correct.
The following settings are only applied within the shader and are a means to help in finding the correct preprocessor values. If the correct values are found they still need to be applied globally (-> click 'Edit global preprocessor definitions' and put them in there)
  • Far Plane: sets the value for RESHADE_DEPTH_LINEARIZATION_FAR_PLANE (no need to change this)
  • RESHADE_DEPTH_INPUT_IS_*: these are the values for a upside-down, reversed and logaritmic depth buffer.
Options:
  • Present type: change between displaying normal map and depth map

Reference images about what it should (and shouldn't) look like:

All values are set up correctly:
  • Normal map: the surfaces look smooth and the background is colored
  • Depth map: close objects are black, distant objects are white


Here the surface normals have stripes in them so the *_IS_LOGARITHMIC setting is wrong - despite the right image looking alright.



A wrong setting for *_IS_REVERSED is quite obvious as the normals are flipped (upwards pointing normals should be a greenish color), the background is black and the depth values are also all black.
Also a nice feature: instead of being shown a mysterious black screen you can still see what's going on :-)





If there is no depth buffer access the depth map is either black or white and the normal map shows only a solid color.

But you're not out of luck just yet, if it doesn't work. In some games specific settings can prevent depth buffer access:
  • Try changing the type of antialiasing (specificly MSAA, see DX11 tab in d3d11 games)
  • Try changing settings that alter the resolution at which the game is rendered (for example: Remember Me needs supersampling turned on, Mass Effect Andromeda needs resolution scaling turned off)
  • Don't forget to take a look at the Compatibility List
One other thing: ReShade disables access to the depth buffer in online games!

So, basically what you do is:
  1. Change the values for *_IS_REVERSED and *_IS_LOGARITHMIC until the output looks like in the first image.
  2. Click 'Edit global preprocessor definitions' and put the values in there
  3. Reload
Last Edit: 5 months 2 days ago by Daodan.
The administrator has disabled public write access.
The following user(s) said Thank You: OtisInf, Viper_Joe, Sinclair, thalixte, seri14

About the Changes in DisplayDepth.fx 5 months 2 days ago #2

Those of you who might wonder why MXAO normals output colors look different: different coordinate handedness so some components are flipped. When I fixed the normal map output of the displaydepth I kept the original handedness.
The administrator has disabled public write access.

About the Changes in DisplayDepth.fx 5 months 2 days ago #3

Thank you Daodan this is a fantastic guide, and the first one that explained what to do with Logarithmic!

One suggestion: Reshade's 'MSAA is on/off' display is presumably to check if MSAA is enabled in-game, as this prevents depth buffer detection. Maybe add this to the guide saying if you can't get depth working, check what Reshade says and disable MSAA if necessary.
The administrator has disabled public write access.
The following user(s) said Thank You: Daodan

About the Changes in DisplayDepth.fx 4 months 6 days ago #4

I'm going to be perfectly honest; this makes absolutely zero sense to me. It use to work just fine before but now I can't get any DOF preset to work, not even my green screen. I need a literal dumbed down step by step guide on how to get it working again because I'm dumber than a sack of dead rocks.
The administrator has disabled public write access.

About the Changes in DisplayDepth.fx 3 months 3 weeks ago #5

Is it possible to use separate depth setting for each effect?

Like in FiFA 10, I need to keep the depth buffer reversed [which is actually wrong] to get proper depth of field. But then MXAO looks bad. I have to set Depth buffer is reversed to "0" for MXAO to work properly but then depth of field effects dont work properly.

So having the ability to set separate DB setting for each effects/shader would be great.
The administrator has disabled public write access.

About the Changes in DisplayDepth.fx 3 months 3 weeks ago #6

Sami 1999 wrote:
Is it possible to use separate depth setting for each effect?
In principle, yes. But for that to happen each shader needs to be altered so it calculates the depth value by itself. But doing that is kind of pointless as it would just add clutter to the code - a shader should work fine with the proper depth input settings.

Sami 1999 wrote:
Like in FiFA 10, I need to keep the depth buffer reversed [which is actually wrong] to get proper depth of field. But then MXAO looks bad. I have to set Depth buffer is reversed to "0" for MXAO to work properly but then depth of field effects dont work properly.
What DOF are you using?
The administrator has disabled public write access.

About the Changes in DisplayDepth.fx 3 months 3 weeks ago #7

Cinematic DOF.

Technically the shaders should work fine with proper depth settings. But FiFA 2002~2010 has weird depth settings. The grass aka the field is set to infinity for some reason. So DOF either focuses on the grass and blurring the players on the field or focuses on the players and blurs the distant objects, and the grass.

But if I set the wrong settings for depth, then I can manage to keep the grass and players blur free while only blurring the distant objects like crowds during cutscenes.

Edit: Here are some screenshots:



You can pretty much see the problem here. The wrong setting makes the whole screen black while enabling "Display depth" but then I can set a manual Focus range on DOF and then only the far objects [Other than the grass which is supposedly at infinite] get only blurred. Normally I think that's fine so long as it works.

But then Ambient occlusion becomes negative and that's a problem. Also, if the grass's depth was in correct position, then I could have just used Auto focus and everything would work as intended. But I guess that can't be changed due to the way this game was designed.
Last Edit: 3 months 3 weeks ago by Sami 1999.
The administrator has disabled public write access.

About the Changes in DisplayDepth.fx 3 months 3 weeks ago #8

Ok. Then that's an issue with FiFA.
Here's a version of CinematicDOF with a custom depth input ('Depth Input' category in the settings): CinematicDOFCustomDepth.fx
Maybe it works for you :)
Last Edit: 3 months 3 weeks ago by Daodan.
The administrator has disabled public write access.

About the Changes in DisplayDepth.fx 3 months 3 weeks ago #9

Thanks, I'll give it a try and see if it works.

Edit: Thanks a lot. It actually works. Custom depth input really solves the issues with Fifa 09 and Fifa 10. And now partially works well with fifa 2002~2008.

By the way, I guess if I paste this code [as seen on your edited dof shader] on the shaders I want, then I can set custom depth input for any shaders I want right?
Warning: Spoiler! [ Click to expand ]
Last Edit: 3 months 3 weeks ago by Sami 1999.
The administrator has disabled public write access.
The following user(s) said Thank You: willedits

About the Changes in DisplayDepth.fx 3 months 3 weeks ago #10

Sami 1999 wrote:
By the way, I guess if I paste this code [as seen on your edited dof shader] on the shaders I want, then I can set custom depth input for any shaders I want right?

Not quite, there's more to it.
That needs to be added:
Warning: Spoiler! [ Click to expand ]

And then you need to replace every call to ReShade::GetLinearizedDepth() with GetDepth().
The administrator has disabled public write access.
The following user(s) said Thank You: Sami 1999