Depth buffer detection modifications

  • thalixte
  • Topic Author
More
6 years 2 weeks ago - 6 years 2 weeks ago #181 by thalixte Replied by thalixte on topic Depth buffer detection modifications
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...
Last edit: 6 years 2 weeks ago by thalixte.
The following user(s) said Thank You: Uncle Crassius, AladinZ, Nerrel, AssassinsDecree
The topic has been locked.
  • AladinZ
More
6 years 2 weeks ago - 6 years 2 weeks ago #182 by AladinZ Replied by AladinZ on topic Depth buffer detection modifications
I confirm that Depth Buffer detection is working properly with FUEL (Made by Asobo Studio)

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.
Last edit: 6 years 2 weeks ago by AladinZ.
The topic has been locked.
  • Nerrel
More
6 years 2 weeks ago - 6 years 2 weeks ago #183 by Nerrel Replied by Nerrel on topic Depth buffer detection modifications

thalixte wrote: Sorry to say that my modifs do not impact OpenGL games for the moment.

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?


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:
Warning: Spoiler!

Warning: Spoiler!


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:
Warning: Spoiler!


It's great that it's working at all, but it doesn't seem usable yet... unless I'm doing something way wrong.
Last edit: 6 years 2 weeks ago by Nerrel.
The topic has been locked.
  • Uncle Crassius
More
6 years 2 weeks ago - 6 years 2 weeks ago #184 by Uncle Crassius Replied by Uncle Crassius on topic Depth buffer detection modifications

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.
Last edit: 6 years 2 weeks ago by Uncle Crassius.
The topic has been locked.
  • lowenz
More
6 years 2 weeks ago - 6 years 2 weeks ago #185 by lowenz Replied by lowenz on topic Depth buffer detection modifications
Those new dlls should also fix the displaying UI problem in Dark messiah.

Yes but still no DB.
Last edit: 6 years 2 weeks ago by lowenz.
The topic has been locked.
  • conan2k
More
6 years 2 weeks ago #186 by conan2k Replied by conan2k on topic Depth buffer detection modifications

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"!
The topic has been locked.
  • Nerrel
More
6 years 2 weeks ago #187 by Nerrel Replied by Nerrel on topic Depth buffer detection modifications

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:

The topic has been locked.
  • conan2k
More
6 years 2 weeks ago #188 by conan2k Replied by conan2k on topic Depth buffer detection modifications
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.
The topic has been locked.
  • robgrab
More
6 years 2 weeks ago #189 by robgrab Replied by robgrab on topic Depth buffer detection modifications

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. :) :) :)
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 2 weeks ago - 6 years 2 weeks ago #190 by thalixte Replied by thalixte on topic Depth buffer detection modifications

Nerrel wrote:

thalixte wrote: Sorry to say that my modifs do not impact OpenGL games for the moment.

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?


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 :)
Last edit: 6 years 2 weeks ago by thalixte.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 2 weeks ago - 6 years 2 weeks ago #191 by thalixte Replied by thalixte on topic Depth buffer detection modifications

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 :cheer:
Last edit: 6 years 2 weeks ago by thalixte.
The topic has been locked.
  • Uncle Crassius
More
6 years 2 weeks ago #192 by Uncle Crassius Replied by Uncle Crassius on topic Depth buffer detection modifications

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.
The topic has been locked.
  • lowenz
More
6 years 2 weeks ago - 6 years 2 weeks ago #193 by lowenz Replied by lowenz on topic Depth buffer detection modifications

lowenz wrote: Yes but still no DB.

Errata corrige!

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).....
Last edit: 6 years 2 weeks ago by lowenz.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 2 weeks ago - 6 years 2 weeks ago #194 by thalixte Replied by thalixte on topic Depth buffer detection modifications

lowenz wrote:

lowenz wrote: Yes but still no DB.

Errata corrige!

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.
Last edit: 6 years 2 weeks ago by thalixte.
The topic has been locked.
  • OtisInf
More
6 years 2 weeks ago - 6 years 2 weeks ago #195 by OtisInf Replied by OtisInf on topic Depth buffer detection modifications
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
Last edit: 6 years 2 weeks ago by OtisInf.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 2 weeks ago - 6 years 2 weeks ago #196 by thalixte Replied by thalixte on topic Depth buffer detection modifications

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 :cheer:
Last edit: 6 years 2 weeks ago by thalixte.
The topic has been locked.
  • lowenz
More
6 years 2 weeks ago - 6 years 2 weeks ago #197 by lowenz Replied by lowenz on topic Depth buffer detection modifications

thalixte wrote:

lowenz wrote:

lowenz wrote: Yes but still no DB.

Errata corrige!

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.

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:

[img


[img
Last edit: 6 years 2 weeks ago by lowenz.
The topic has been locked.
  • OtisInf
More
6 years 2 weeks ago #198 by OtisInf Replied by OtisInf on topic Depth buffer detection modifications

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 :cheer:

Thanks! Will try to be offline indeed, that's something I forgot to check.
The topic has been locked.
  • conan2k
More
6 years 2 weeks ago #199 by conan2k Replied by conan2k on topic Depth buffer detection modifications

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 :cheer:


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 :)
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 2 weeks ago #200 by thalixte Replied by thalixte on topic Depth buffer detection modifications

OtisInf wrote:

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 :cheer:

Thanks! Will try to be offline indeed, that's something I forgot to check.


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

:cheer:
The following user(s) said Thank You: OtisInf
The topic has been locked.
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.