Depth buffer detection modifications
- thalixte
- Topic Author
Just disable in game anti-aliasing and play with the Depth buffer clearing number (third works fine for me)...
d3d9_32bits.zip
d3d9_64bits.zip
Those new dlls should also fix the displaying UI problem in Dark messiah, Supreme Commander, Divinity II, and so on... Could you please check this.
I revert back to the old version of input.cpp and input.hpp of the 3.1.2 release reshade lib.
Seems that, for d3d9 games, modifications introduced in the last commits lead to some displaying pbs. Will probably add an issue in the github repo...
@Crosire: could you pls test this...
- AladinZ
Display_Depth ON:
Display_Depth OFF:
I can never thank you enough. This is one of my Life-long favorite Games! I wish I could donate.
- Nerrel
I should have followed up on this, is it possible for OpenGL games to receive the same type of mods? Or can this only be done for D3D?thalixte wrote: Sorry to say that my modifs do not impact OpenGL games for the moment.
EDIT: This part can be ignored, as I didn't have the "depth is reversed" preprocessor setting correct.
RE4 is working with AA disabled and the third clearing number, but it's hard to get MXAO to give a natural result. The AO generally isn't applied to the environment in the way it should based on what I've seen in other games, and turning the sample radius up at all results in Leon's back being blackening out regardless of position as well as odd shapes in the sky getting shaded:
Turning the radius down fixes those issues, but it still generally doesn't look so hot and doesn't shade a lot of objects that it should:
It's great that it's working at all, but it doesn't seem usable yet... unless I'm doing something way wrong.
- Uncle Crassius
Nerrel wrote: RE4 is working with AA disabled and the third clearing number, but it's hard to get MXAO to give a natural result. The AO generally isn't applied to the environment in the way it should based on what I've seen in other games, and turning the sample radius up at all results in Leon's back being blackening out regardless of position as well as odd shapes in the sky getting shaded:
Turning the radius down fixes those issues, but it still generally doesn't look so hot and doesn't shade a lot of objects that it should:
It's great that it's working at all, but it doesn't seem usable yet... unless I'm doing something way wrong.
Looks like depth buffer is inverted. Try switching the corresponding preprocessor setting off when it's on or vice versa.
- lowenz
Yes but still no DB.
- conan2k
thalixte wrote: Those new dlls should also fix the displaying UI problem in Dark messiah, Supreme Commander, Divinity II, and so on... Could you please check this.
Yes, all of UI issues previously reported by me are gone with these new DLLs (well, there is still a problem in Supreme Commander 1/2 but it's the same as in the original ReShade). Besides, the depth map can now be successfully retrieved for the following games:
1) Divinity II: Developer's Cut
Seems to work fine with "DepthBufferClearingNumber=7" even when the HDR option is enabled in the game now (there are various shading artifacts with other clearing numbers). Awesome!
2) King's Bounty: Warriors of the North
Works fine with "DepthBufferClearingNumber=3"!
3) X3: Terran War Pack
Works fine with "DepthBufferClearingNumber=3"!
- Nerrel
Uncle Crassius wrote: Looks like depth buffer is inverted. Try switching the corresponding preprocessor setting off when it's on or vice versa.
You're right! It looks great now, definitely adds a lot to the game. The only issue is that cutscenes don't seem to work:
- conan2k
1) The Witcher: Enhanced Edition Director's Cut
The depth map can now be retrieved with different clearing numbers but it's not "complete" (i.e. various objects and/or main character are missing in the retrieved depth map). Besides, selecting any clearing number other than None breaks the game rendering (there are partially transparent walls, missing shadows, etc.).
2) Fallout 3 GotY
The depth map can now be retrieved with "DepthBufferClearingNumber=5" but it's disappearing randomly and breaks the game rendering (for example, MXAO randomly becomes "frozen" and moves together with the camera view).
3) Far Cry 2
The depth map can now be retrieved with "DepthBufferClearingNumber=5" but it's flickering wildly. Besides, selecting any clearing number other than None breaks the game rendering (disappearing objects/walls, etc.).
I'll test more games as I have time.
- robgrab
thalixte wrote: Here are two new dlls. the 32 bits one should work with RE4 HD
Just disable in game anti-aliasing and play with the Depth buffer clearing number (third works fine for me)...
d3d9_32bits.zip
d3d9_64bits.zip
Those new dlls should also fix the displaying UI problem in Dark messiah, Supreme Commander, Divinity II, and so on... Could you please check this.
I revert back to the old version of input.cpp and input.hpp of the 3.1.2 release reshade lib.
Seems that, for d3d9 games, modifications introduced in the last commits lead to some displaying pbs. Will probably add an issue in the github repo...
@Crosire: could you pls test this...
You did it! I never thought I'd see the day we'd get depth buffer access in RE4. If you need help testing anything else or have a way to donate to you please let me know. Thank you so much! I can die happy now.
- thalixte
- Topic Author
Nerrel wrote:
I should have followed up on this, is it possible for OpenGL games to receive the same type of mods? Or can this only be done for D3D?thalixte wrote: Sorry to say that my modifs do not impact OpenGL games for the moment.
EDIT: This part can be ignored, as I didn't have the "depth is reversed" preprocessor setting correct.
RE4 is working with AA disabled and the third clearing number, but it's hard to get MXAO to give a natural result. The AO generally isn't applied to the environment in the way it should based on what I've seen in other games, and turning the sample radius up at all results in Leon's back being blackening out regardless of position as well as odd shapes in the sky getting shaded:
Turning the radius down fixes those issues, but it still generally doesn't look so hot and doesn't shade a lot of objects that it should:
It's great that it's working at all, but it doesn't seem usable yet... unless I'm doing something way wrong.
Sorry to hear that, but my modifs only concist in retrieving the existing depth buffer, not modifying it. Maybe you could ask Marty Mc Fly to help you in this way
- thalixte
- Topic Author
conan2k wrote: But, there are still problems with the depth buffer access in these games:
1) The Witcher: Enhanced Edition Director's Cut
The depth map can now be retrieved with different clearing numbers but it's not "complete" (i.e. various objects and/or main character are missing in the retrieved depth map). Besides, selecting any clearing number other than None breaks the game rendering (there are partially transparent walls, missing shadows, etc.).
2) Fallout 3 GotY
The depth map can now be retrieved with "DepthBufferClearingNumber=5" but it's disappearing randomly and breaks the game rendering (for example, MXAO randomly becomes "frozen" and moves together with the camera view).
3) Far Cry 2
The depth map can now be retrieved with "DepthBufferClearingNumber=5" but it's flickering wildly. Besides, selecting any clearing number other than None breaks the game rendering (disappearing objects/walls, etc.).
I'll test more games as I have time.
Thks for your feedback. When i have time, will test Witcher 1. The problem you describe is the same i had with Mass Effect 2. It seems too that some games use a different clearing flag than the others. So the best i could do is check if i cannot find a proper clearing flag for Witcher 1, otherwise, as you mentionned, it breaks the depth map, that's why you see "transparent" objects, because the depth test always succeed in this specific case
- Uncle Crassius
thalixte wrote: Sorry to hear that, but my modifs only concist in retrieving the existing depth buffer, not modifying it. Maybe you could ask Marty Mc Fly to help you in this way
All good, just a flipped depth buffer. Other than that, tested the latest one with Lord of the Rings: War in the North and couldn't get depth to work. There don't seem to be any anti aliasing settings, though, so maybe that's to blame.
- lowenz
Errata corrige!lowenz wrote: Yes but still no DB.
Dark Messiah and Sin Emergence CAN give their DB (clearing value 3-4-5) but it's "unstable" (some part of the scene with 3, some others with 4 or 5).
It's the same behaviour of Deus Ex Human Revolution DC (d3d11).....
- thalixte
- Topic Author
lowenz wrote:
Errata corrige!lowenz wrote: Yes but still no DB.
Dark Messiah and Sin Emergence CAN give their DB (clearing value 3-4-5) but it's "unstable" (some part of the scene with 3, some others with 4 or 5).
It's the same behaviour of Deus Ex Human Revolution DC (d3d11).....
Ah. bad news. And if you select Post processing ? Or maybe this is a specific clearing flag.
- OtisInf
- thalixte
- Topic Author
OtisInf wrote: I built reshade from source (master, latest) to see whether the depth buffer techniques added recently would find the depth buffer in Titanfall 2, but no dice, no matter what I pick (post process, in merger stage, before clearning etc.) the depth buffer stays empty (or filled with ones). Is there a particular combination I need to choose? TIA
Hi OtisInf In titanFall2, there is a working combination with the latest master build. Be sure not to be online for this to work. As soon as i am at home, i will give it to you
- lowenz
About SIN it seems the culprit is the overlay handling....when you show the demoplayer (SHIFT+F2 -> i use SHIFT+F3 for ReShade in Source Engine powered games) the DB is correctly retrieved and here's the MXAO applied:thalixte wrote:
lowenz wrote:
Errata corrige!lowenz wrote: Yes but still no DB.
Dark Messiah and Sin Emergence CAN give their DB (clearing value 3-4-5) but it's "unstable" (some part of the scene with 3, some others with 4 or 5).
It's the same behaviour of Deus Ex Human Revolution DC (d3d11).....
Ah. bad news. And if you select Post processing ? Or maybe this is a specific clearing flag.
- OtisInf
Thanks! Will try to be offline indeed, that's something I forgot to check.thalixte wrote:
OtisInf wrote: I built reshade from source (master, latest) to see whether the depth buffer techniques added recently would find the depth buffer in Titanfall 2, but no dice, no matter what I pick (post process, in merger stage, before clearning etc.) the depth buffer stays empty (or filled with ones). Is there a particular combination I need to choose? TIA
Hi OtisInf In titanFall2, there is a working combination with the latest master build. Be sure not to be online for this to work. As soon as i am at home, i will give it to you
- conan2k
thalixte wrote: Thks for your feedback. When i have time, will test Witcher 1. The problem you describe is the same i had with Mass Effect 2. It seems too that some games use a different clearing flag than the others. So the best i could do is check if i cannot find a proper clearing flag for Witcher 1, otherwise, as you mentionned, it breaks the depth map, that's why you see "transparent" objects, because the depth test always succeed in this specific case
How difficult is it to find a proper clearing flag? Maybe it would be reasonable to provide the community with instructions and ability to enter a Custom Clearing Flag (when pre-defined ones from the list don't work)? Since I don't know how these clearing flags work exactly, I apologize if I'm suggesting something stupid
- thalixte
- Topic Author
OtisInf wrote:
Thanks! Will try to be offline indeed, that's something I forgot to check.thalixte wrote:
OtisInf wrote: I built reshade from source (master, latest) to see whether the depth buffer techniques added recently would find the depth buffer in Titanfall 2, but no dice, no matter what I pick (post process, in merger stage, before clearning etc.) the depth buffer stays empty (or filled with ones). Is there a particular combination I need to choose? TIA
Hi OtisInf In titanFall2, there is a working combination with the latest master build. Be sure not to be online for this to work. As soon as i am at home, i will give it to you
Here are the settings in the dxgi.ini file:
PreprocessorDefinitions=RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=1000.0,RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0,RESHADE_DEPTH_INPUT_IS_REVERSED=0,RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0
[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=2
DepthBufferClearingNumber=0
DepthBufferTextureFormat=2