About the Changes in DisplayDepth.fx

  • Daodan
  • Topic Author
More
5 years 4 months ago - 5 years 4 months ago #1 by Daodan About the Changes in DisplayDepth.fx was created by Daodan
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 years 4 months ago by Daodan.
The following user(s) said Thank You: OtisInf, Viper_Joe, Sinclair, brazzjazz, thalixte, seri14, Bred_W

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

  • Marty McFly
More
5 years 4 months ago #2 by Marty McFly Replied by Marty McFly on topic About the Changes in DisplayDepth.fx
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.

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

  • Martigen
More
5 years 4 months ago #3 by Martigen Replied by Martigen on topic About the Changes in DisplayDepth.fx
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 following user(s) said Thank You: Daodan

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

  • CecilyJisi
More
5 years 3 months ago #4 by CecilyJisi Replied by CecilyJisi on topic About the Changes in DisplayDepth.fx
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.

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

  • Sami 1999
More
5 years 3 months ago #5 by Sami 1999 Replied by Sami 1999 on topic About the Changes in DisplayDepth.fx
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.

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

  • Daodan
  • Topic Author
More
5 years 3 months ago #6 by Daodan Replied by Daodan on topic About the Changes in DisplayDepth.fx

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?

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

  • Sami 1999
More
5 years 3 months ago - 5 years 3 months ago #7 by Sami 1999 Replied by Sami 1999 on topic About the Changes in DisplayDepth.fx
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: 5 years 3 months ago by Sami 1999.

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

  • Daodan
  • Topic Author
More
5 years 3 months ago - 5 years 3 months ago #8 by Daodan Replied by Daodan on topic About the Changes in DisplayDepth.fx
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: 5 years 3 months ago by Daodan.
The following user(s) said Thank You: zhiruo

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

  • Sami 1999
More
5 years 3 months ago - 5 years 3 months ago #9 by Sami 1999 Replied by Sami 1999 on topic About the Changes in DisplayDepth.fx
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!
Last edit: 5 years 3 months ago by Sami 1999.
The following user(s) said Thank You: willedits, zhiruo

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

  • Daodan
  • Topic Author
More
5 years 3 months ago #10 by Daodan Replied by Daodan on topic About the Changes in DisplayDepth.fx

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!

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

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

  • brazzjazz
More
3 years 9 months ago #11 by brazzjazz Replied by brazzjazz on topic About the Changes in DisplayDepth.fx
Very nice indeed, Daodan, these in-depth explanations are always appreciated, and in fact just helped me help somebody else here on the forums! 👍

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

  • Medieval3D
More
8 months 2 weeks ago - 8 months 2 weeks ago #12 by Medieval3D Replied by Medieval3D on topic About the Changes in DisplayDepth.fx
Thanks for the information! :), i has helped to fix DisplayDepth

I have a question about reshade 5.5.0 addon version, what does mean the "draw cells"?
pasteboard.co/KYlAL0zSHXGT.png  , what does this mean? ☑|2048x2048|  D24x8 | draw cells (       ) ----> vertices
Last edit: 8 months 2 weeks ago by Medieval3D.

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.