21:9 Depth issue
- Ceroes
- Topic Author
The issue when in full screen mode.
Seeing the issue
Please Log in or Create an account to join the conversation.
- Marty McFly
To fix most shaders, open the ReShade.fxh and find this function:
float GetLinearizedDepth(float2 texcoord)
{
#if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN
texcoord.y = 1.0 - texcoord.y;
#endif
float depth = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x;
#if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC
const float C = 0.01;
depth = (exp(depth * log(C + 1.0)) - 1.0) / C;
#endif
#if RESHADE_DEPTH_INPUT_IS_REVERSED
depth = 1.0 - depth;
#endif
const float N = 1.0;
depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N);
return depth;
}
Modify so it looks like this
float GetLinearizedDepth(float2 texcoord)
{
float aspect_fix = 21.0 / 16.0; //adjust source/destination ratio
texcoord.x = (texcoord.x - 0.5) * aspect_fix + 0.5 ;
#if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN
texcoord.y = 1.0 - texcoord.y;
#endif
float depth = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x;
#if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC
const float C = 0.01;
depth = (exp(depth * log(C + 1.0)) - 1.0) / C;
#endif
#if RESHADE_DEPTH_INPUT_IS_REVERSED
depth = 1.0 - depth;
#endif
const float N = 1.0;
depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N);
return depth;
}
That should work. To fix the qUINT shaders (if you use them), do the same inside the qUINT_common.fxh except I named texcoord uv there.
Please Log in or Create an account to join the conversation.
- Ceroes
- Topic Author
Please Log in or Create an account to join the conversation.
- Ceroes
- Topic Author
Normal screen
With the fix and depth enabled for comparison.
What part of the fix could I play with to adjust this?
Please Log in or Create an account to join the conversation.
- Marty McFly
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- OtisInf
Please Log in or Create an account to join the conversation.
- Ceroes
- Topic Author
Please Log in or Create an account to join the conversation.
- crosire
Marty McFly wrote: And to workaround this, each shader would need to be patched in order for this to work - which wouldn't be a problem if every shader used the ReShade.fxh (which unifies depth access) but shaders like Depth3D don't do that.
Please Log in or Create an account to join the conversation.
- Martigen
Yes, depth is broken in the SMAA.fx currently on github. Here is a fixed version: pastebin.com/KRjDzFgGCeroes wrote: The fix for this game is 21.3 / 16 for it to work with Marty McFly mxao and the depth view but it's still messed up for smaa depth edge detection it's has the Original issue it's treating the screen like it was displaying the game in 21:9 still
This is linked from this post here: reshade.me/forum/shader-discussion/5203-smaa#33192
Crosire will no doubt add this (or a similar version) to Github at a later date.
Please Log in or Create an account to join the conversation.
- Ceroes
- Topic Author
Please Log in or Create an account to join the conversation.
- peronmls
Marty McFly wrote: Hmm this is difficult to fix, since in theory, the padding on the outside should not be added by the game itself. And to workaround this, each shader would need to be patched in order for this to work - which wouldn't be a problem if every shader used the ReShade.fxh (which unifies depth access) but shaders like Depth3D don't do that.
To fix most shaders, open the ReShade.fxh and find this function:
float GetLinearizedDepth(float2 texcoord) { #if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN texcoord.y = 1.0 - texcoord.y; #endif float depth = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x; #if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC const float C = 0.01; depth = (exp(depth * log(C + 1.0)) - 1.0) / C; #endif #if RESHADE_DEPTH_INPUT_IS_REVERSED depth = 1.0 - depth; #endif const float N = 1.0; depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N); return depth; }
Modify so it looks like this
I'm trying to do this with QUINT. Without the ratio fix. I copied over what you posted. It breaks everything. I also tried renaming texcoord to uv because I didn't know if you were implying to us to do that. I can't ever use MXAO or DOF together because one is always flipped.float GetLinearizedDepth(float2 texcoord) { float aspect_fix = 21.0 / 16.0; //adjust source/destination ratio texcoord.x = (texcoord.x - 0.5) * aspect_fix + 0.5 ; #if RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN texcoord.y = 1.0 - texcoord.y; #endif float depth = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x; #if RESHADE_DEPTH_INPUT_IS_LOGARITHMIC const float C = 0.01; depth = (exp(depth * log(C + 1.0)) - 1.0) / C; #endif #if RESHADE_DEPTH_INPUT_IS_REVERSED depth = 1.0 - depth; #endif const float N = 1.0; depth /= RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - depth * (RESHADE_DEPTH_LINEARIZATION_FAR_PLANE - N); return depth; }
Please Log in or Create an account to join the conversation.