About the Changes in DisplayDepth.fx
- Daodan
-
Topic Author
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.
- 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.
- 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
So, basically what you do is:
- Change the values for *_IS_REVERSED and *_IS_LOGARITHMIC until the output looks like in the first image.
- Click 'Edit global preprocessor definitions' and put the values in there
- Reload
Please Log in or Create an account to join the conversation.
- Marty McFly
-
Please Log in or Create an account to join the conversation.
- Martigen
-
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.
Please Log in or Create an account to join the conversation.
- CecilyJisi
-
Please Log in or Create an account to join the conversation.
- Sami 1999
-
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
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: Is it possible to use separate depth setting for each effect?
What DOF are you using?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.
Please Log in or Create an account to join the conversation.
- Sami 1999
-
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.
Please Log in or Create an account to join the conversation.
- Daodan
-
Topic Author
Here's a version of CinematicDOF with a custom depth input ('Depth Input' category in the settings): CinematicDOFCustomDepth.fx
Maybe it works for you

Please Log in or Create an account to join the conversation.
- Sami 1999
-
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?
{
// Uncomment line below for debug info / code / controls
// #define CD_DEBUG 1
#if __RESHADE__ < 30101
#define __DISPLAYDEPTH_UI_FAR_PLANE_DEFAULT__ 1000.0
#define __DISPLAYDEPTH_UI_UPSIDE_DOWN_DEFAULT__ 0
#define __DISPLAYDEPTH_UI_REVERSED_DEFAULT__ 0
#define __DISPLAYDEPTH_UI_LOGARITHMIC_DEFAULT__ 0
#else
#define __DISPLAYDEPTH_UI_FAR_PLANE_DEFAULT__ 1000.0
#define __DISPLAYDEPTH_UI_UPSIDE_DOWN_DEFAULT__ 0
#define __DISPLAYDEPTH_UI_REVERSED_DEFAULT__ 1
#define __DISPLAYDEPTH_UI_LOGARITHMIC_DEFAULT__ 0
#endif
Please Log in or Create an account to join the conversation.
- Daodan
-
Topic Author
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:
#if __RESHADE__ < 30101
#define __DISPLAYDEPTH_UI_FAR_PLANE_DEFAULT__ 1000.0
#define __DISPLAYDEPTH_UI_UPSIDE_DOWN_DEFAULT__ 0
#define __DISPLAYDEPTH_UI_REVERSED_DEFAULT__ 0
#define __DISPLAYDEPTH_UI_LOGARITHMIC_DEFAULT__ 0
#else
#define __DISPLAYDEPTH_UI_FAR_PLANE_DEFAULT__ 1000.0
#define __DISPLAYDEPTH_UI_UPSIDE_DOWN_DEFAULT__ 0
#define __DISPLAYDEPTH_UI_REVERSED_DEFAULT__ 1
#define __DISPLAYDEPTH_UI_LOGARITHMIC_DEFAULT__ 0
#endif
uniform float fUIFarPlane <
ui_category = "Depth Input";
ui_type = "drag";
ui_label = "Far Plane";
ui_tooltip = "RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=<value>\n"
"Changing this value is not necessary in most cases.";
ui_min = 0.0; ui_max = 1000.0;
ui_step = 0.1;
> = __DISPLAYDEPTH_UI_FAR_PLANE_DEFAULT__;
uniform int iUIUpsideDown <
ui_category = "Depth Input";
ui_type = "combo";
ui_label = "";
ui_items = "RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0\0RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=1\0";
> = __DISPLAYDEPTH_UI_UPSIDE_DOWN_DEFAULT__;
uniform int iUIReversed <
ui_category = "Depth Input";
ui_type = "combo";
ui_label = "";
ui_items = "RESHADE_DEPTH_INPUT_IS_REVERSED=0\0RESHADE_DEPTH_INPUT_IS_REVERSED=1\0";
> = __DISPLAYDEPTH_UI_REVERSED_DEFAULT__;
uniform int iUILogarithmic <
ui_category = "Depth Input";
ui_type = "combo";
ui_label = "";
ui_items = "RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0\0RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=1\0";
ui_tooltip = "Change this setting if the displayed surface normals have stripes in them";
> = __DISPLAYDEPTH_UI_LOGARITHMIC_DEFAULT__;
float GetDepth(float2 texcoord)
{
//Calculate the depth value as defined by the user
//RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN
if(iUIUpsideDown)
{
texcoord.y = 1.0 - texcoord.y;
}
float depth = tex2Dlod(ReShade::DepthBuffer, float4(texcoord, 0, 0)).x;
//RESHADE_DEPTH_INPUT_IS_LOGARITHMIC
if(iUILogarithmic)
{
const float C = 0.01;
depth = (exp(depth * log(C + 1.0)) - 1.0) / C;
}
//RESHADE_DEPTH_INPUT_IS_REVERSED
if(iUIReversed)
{
depth = 1.0 - depth;
}
const float N = 1.0;
return depth /= fUIFarPlane - depth * (fUIFarPlane - N);
}
And then you need to replace every call to ReShade::GetLinearizedDepth() with GetDepth().
Please Log in or Create an account to join the conversation.
- brazzjazz
-
Please Log in or Create an account to join the conversation.
- Medieval3D
-

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
Please Log in or Create an account to join the conversation.