Depth buffer detection modifications
- lowenz
- thalixte
- Topic Author
lowenz wrote: Already tested the log option, but how it works with the far plane?
The way Reshade calculate the depth value rendered by the shade is the following:
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;
}
So, it applies a logarithmic transformation to the initial depth value, then the depth is divided by a value calculated from the far plane and the logarithmmmic depth.
I am not a math specialist, but it seems to me that, the more tha far plan is, the more the depth values range is wide. So, lowering the far plane depth value should be a solution.
- thalixte
- Topic Author
+ Fable III - Depth Buffer doesn't work properly it has major with problems.
Without "multiple depthstencil replacement buffer," it flickers really bad. But when enabled this problem shows up.
Strange, indeed. Does it really run offline ?
- BlueSkyKnight
thalixte wrote:
+ Fable III - Depth Buffer doesn't work properly it has major with problems.
Without "multiple depthstencil replacement buffer," it flickers really bad. But when enabled this problem shows up.
Strange, indeed. Does it really run offline ?
That part is done in offline mode.
- CZauX
If you're interested in Dolphin at all I've got an interesting case.
I've compiled rev 45d318b and tested with Dolphin 5.0-9479 under DirectX11. Been trying to get The Legend of Zelda: Collector's Edition to work with the Majoras Mask game in it. In the menu before selecting the game there is a depth buffer that shows up with DisplayDepth. When the game is selected and actually begins playing there doesn't appear to be any further detail, though there is still a depth buffer being showed by the DX11 menu. Just blank white and blue depth and normal map. RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0, reversed nor logarithmic in any combination show any detail in the depth buffer. If "Copy depth before clearing" is selected the buffer dissapears from the list until unselected. "Extended depth buffer detection" reveals no depth buffers at all.
Maybe this is just an issue where Dolphin needs to be compatible with Reshade, but thought I'd ask. The end goal would be to get a depth buffer that can atleast differentiate between the game UI and the actual 3D world. That way shaders like bloom won't effect the UI.
- MonarchX
- lowenz
Yes.MonarchX wrote: Is this a D3D9-only thing?
- thalixte
- Topic Author
- Uncle Crassius
- thalixte
- Topic Author
Uncle Crassius wrote: Just had a go with Vanquish again with several of the latest dlls. While they provide access to the depth buffer they mess up the shadow map in levels with directional shadows from sunlight, i.e. the shadows map's moving with the viewport. Tried several variations of ingame settings and resolutions together with with multistencil et al but it's always wonky. Might not be noticeable in indoor areas. Anyone encountered similar issues?
Interesting... Would it be possible for you to send me the game saves ?
- Uncle Crassius
thalixte wrote: Interesting... Would it be possible for you to send me the game saves ?
Sure. This should be the correct file. drive.google.com/file/d/1c2k57j_VSbn9JpZ...5Pd/view?usp=sharing
Goes into <Steam-folder>\userdata\<user-id>\460810\remote\ according to pcgamingwiki .
- lowenz
Can you check thalixte?
- thalixte
- Topic Author
Uncle Crassius wrote:
thalixte wrote: Interesting... Would it be possible for you to send me the game saves ?
Sure. This should be the correct file. drive.google.com/file/d/1c2k57j_VSbn9JpZ...5Pd/view?usp=sharing
Goes into <Steam-folder>\userdata\<user-id>\460810\remote\ according to pcgamingwiki .
This one should fix artefacts in Vanquish, BUT it removes the shadows....
d3d9_32bits.zip
- Uncle Crassius
- lowenz
Uplowenz wrote: It seems that RS 4.1.1 (official / compiled) can't retrieve the DB in D3D11 in DXHRDC, no matter the chosen options.
Can you check thalixte?
(MXAO is SO important in Human Revolution or you get that totally flat-shading feeling, even using the original - imho really bad - SSAO!)
- thalixte
- Topic Author
lowenz wrote:
Uplowenz wrote: It seems that RS 4.1.1 (official / compiled) can't retrieve the DB in D3D11 in DXHRDC, no matter the chosen options.
Can you check thalixte?
(MXAO is SO important in Human Revolution or you get that totally flat-shading feeling, even using the original - imho really bad - SSAO!)
Yes, i totally agree, but i am very busy nowadays, sorry. I did not have the time to test on Dolphin (@CZauX's request). I already have Vanquish, so it was easy to test, but i removed Deus Ex since a long time.
- GrijzePilion
Could this have something to do with your modification?
EDIT: upon further investigation I was running Reshade version 3.1.2.72 when I had this tab and my Buffer Detection settings were at Before Clearing / First / 2. I was still seeing glitching and various the various other viewport issues I've been having with the depth buffer but these were subtle enough for my game to be playable. It does seem like the game is decidedly NOT playable using Reshade's default depth buffer clearing settings, since the depth buffer will consistently alternate between failing to be retrieved entirely, and rendering all game geometry inside out and upside down inside the aforementioned 1024x512 window.
I don't know if you've modified your detection methods since you first linked me to this thread but the modified DLL I got out of this thread (before all the links died) was by far the least broken way of doing things I've seen under either Reshade 3 or 4.
I'm currently looking into when exactly I first started having any depth issues under Reshade 2.0.3 and whether it coincides with a GPU driver update, a DX9 update, a major change in game data.....anything, really. Amazing how such a little thing can thoroughly ruin your day-to-day enjoyment of a game you've played weekly for 8 years.
- thalixte
- Topic Author
GrijzePilion wrote: Hey, I did a reinstall of my Reshade after I updated to version 4.1.1 to solve some issues I was having with 3.1.1. Unfortunately the new version only made them worse and there were no longer any buffer detection options under the settings menu. I've now reverted to the old version, but the tab entitled Buffer Detection is still nowhere to be found. I'm also missing a large number of options under the MXAO.fx configuration.
Could this have something to do with your modification?
EDIT: upon further investigation I was running Reshade version 3.1.2.72 when I had this tab and my Buffer Detection settings were at Before Clearing / First / 2. I was still seeing glitching and various the various other viewport issues I've been having with the depth buffer but these were subtle enough for my game to be playable. It does seem like the game is decidedly NOT playable using Reshade's default depth buffer clearing settings, since the depth buffer will consistently alternate between failing to be retrieved entirely, and rendering all game geometry inside out and upside down inside the aforementioned 1024x512 window.
I don't know if you've modified your detection methods since you first linked me to this thread but the modified DLL I got out of this thread (before all the links died) was by far the least broken way of doing things I've seen under either Reshade 3 or 4.
I'm currently looking into when exactly I first started having any depth issues under Reshade 2.0.3 and whether it coincides with a GPU driver update, a DX9 update, a major change in game data.....anything, really. Amazing how such a little thing can thoroughly ruin your day-to-day enjoyment of a game you've played weekly for 8 years.
No, i did not make any modification that was commited for the 4.1.1 Reshade release. Normally, the Reshade official release does not embed any of my modifications for d3d9. It just have the dx10 and dx11 modifications.
- GrijzePilion
- BOTLester
Depth buffer is just empty.
ENB does have an access to depth buffer in those games, so i guess it's a problem with ReShade