Depth buffer detection modifications

  • thalixte
  • Topic Author
More
6 years 3 weeks ago - 6 years 3 weeks ago #141 by thalixte Replied by thalixte on topic Depth buffer detection modifications
Ok, found the bug for Timeshift, i guess. Could you please try those ones ?
Last edit: 6 years 3 weeks ago by thalixte.
The following user(s) said Thank You: Androll
The topic has been locked.
  • Nerrel
More
6 years 3 weeks ago - 6 years 3 weeks ago #142 by Nerrel Replied by Nerrel on topic Depth buffer detection modifications
MXAO used to be capable of working in N64 games via GlideN64 plugin (openGL)... surprisingly well, in fact.
Warning: Spoiler!

Unfortunately, it no longer does as changes to the plugin have resulted in the AO being applied incorrectly. It's offset vertically and lags behind the camera:
Warning: Spoiler!

The developer of GlideN64 said this is because Reshade is drawing from frame buffer objects (where most draw calls are made) rather than the depth buffer, and FBO is scaling the image in ways that are breaking the MXAO effect. Do you think your modifications would help in this case? If I could get an openglx32.dll to experiment with I could see for myself if anything changes. Either way, thanks for working on this.

(I'm also hoping RE4 can be made to work with this, since it would go really well with Cris and Albert's RE4HD project)
Last edit: 6 years 3 weeks ago by Nerrel.
The topic has been locked.
  • lowenz
More
6 years 3 weeks ago #143 by lowenz Replied by lowenz on topic Depth buffer detection modifications
Timeshift working now!

Dark Messiah and Sin Emergence (Source 2006 games) still can't show the ReShade interface.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 3 weeks ago - 6 years 3 weeks ago #144 by thalixte Replied by thalixte on topic Depth buffer detection modifications

lowenz wrote: Timeshift working now!

Dark Messiah and Sin Emergence (Source 2006 games) still can't show the ReShade interface.


Good news for TimeShift :) But, when i tested it, i found that depth buffer worked perfectly with the 3.1.2 current release (which not embed any of my modifications for the moment).

Will test RE4 first, then will look at Source 2006 games, if i find some time.
Question: have you tested Source 2006 games with the current 3.1.2 Reshade release ? Does the Reshade interface appear correctly in this case ?
Last edit: 6 years 3 weeks ago by thalixte.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 3 weeks ago - 6 years 3 weeks ago #145 by thalixte Replied by thalixte on topic Depth buffer detection modifications

Nerrel wrote: MXAO used to be capable of working in N64 games via GlideN64 plugin (openGL)... surprisingly well, in fact.

Unfortunately, it no longer does as changes to the plugin have resulted in the AO being applied incorrectly. It's offset vertically and lags behind the camera:

The developer of GlideN64 said this is because Reshade is drawing from frame buffer objects (where most draw calls are made) rather than the depth buffer, and FBO is scaling the image in ways that are breaking the MXAO effect. Do you think your modifications would help in this case? If I could get an openglx32.dll to experiment with I could see for myself if anything changes. Either way, thanks for working on this.

(I'm also hoping RE4 can be made to work with this, since it would go really well with Cris and Albert's RE4HD project)


Sorry to say that my modifs do not impact OpenGL games for the moment. The best you can do here is to ask MartyMcFly (the author of the excellent MXAO shader) to see if he could help you.
Last edit: 6 years 3 weeks ago by thalixte.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 3 weeks ago #146 by thalixte Replied by thalixte on topic Depth buffer detection modifications
@Crosire: when i am finished with the DX9 modifs for depth buffer detection, may i make a pull request in the Reshade repo in order to publish it ?
The topic has been locked.
  • lowenz
More
6 years 3 weeks ago - 6 years 3 weeks ago #147 by lowenz Replied by lowenz on topic Depth buffer detection modifications

thalixte wrote: Good news for TimeShift :) But, when i tested it, i found that depth buffer worked pefectly with the 3.1.2 current release (which not embed any of my modifications for the moment).

I know, but I found strange the "regression". So you can confirm that your reshade implementation can fail where the original implementation can do good?

Question: have you tested Source 2006 games with the current 3.1.2 Reshade release ? Does the Reshade interface appear correctly in this case ?

Yes, Yes.
Last edit: 6 years 3 weeks ago by lowenz.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 3 weeks ago - 6 years 3 weeks ago #148 by thalixte Replied by thalixte on topic Depth buffer detection modifications

lowenz wrote:

thalixte wrote: Good news for TimeShift :) But, when i tested it, i found that depth buffer worked pefectly with the 3.1.2 current release (which not embed any of my modifications for the moment).

I know, but I found strange the "regression". So you can confirm that your reshade implementation can fail where the original implementation can do good?


Again, thks for your tests and feedbacks :cheer:. Normally , it is not the case anymore, cause i fixed it. That's the reason of the debug step ;) . I do not own all the games, so the more games to test, the better it is. I firstly tested my implementation in one game (ME2), where the error did not occur because the game engine did not reset the device during the game session, as U3 engines do. My reshade implementation of dx9 is a fork of the last master branch of Reshade.

lowenz wrote: Question: have you tested Source 2006 games with the current 3.1.2 Reshade release ? Does the Reshade interface appear correctly in this case ?
Yes, Yes.


OK, so i need to investigate. Crosire made a modif in his last commit regarding the UI in d3d9 ( github.com/crosire/reshade/commit/477dda...5a0e258cf0b7ad401aaa ). I need to test if this behaviour comes from my changes or his changes. You can check my modifs here: github.com/Thalixte/Reshade/commits/d3d9 .

One last thing to know: the 3.1.2 reshade release is not up-to-date, considering the github master branch.
Last edit: 6 years 3 weeks ago by thalixte.
The topic has been locked.
  • AladinZ
More
6 years 3 weeks ago - 6 years 3 weeks ago #149 by AladinZ Replied by AladinZ on topic Depth buffer detection modifications
Hello, could you please investigate this game named 'FUEL' by Codemasters? The bepthbuffer never worked properly.

Here are screenshots of what's happening:

Depth view on


Depth view off


I dream of the day depthbuffer will work properly in this game.
Last edit: 6 years 3 weeks ago by AladinZ.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 3 weeks ago - 6 years 3 weeks ago #150 by thalixte Replied by thalixte on topic Depth buffer detection modifications

AladinZ wrote: Hello, could you please investigate this game named 'FUEL' by Codemasters? The bepthbuffer never worked properly.

Here are screenshots of what's happening:

I dream of the day depthbuffer will work properly in this game.


Hello,

It reminds me the same pb as in Elex (dx11). In Elex, some depth buffers are related to the UI elements. That's why, in my modifs, I introduced a setting to select the appropriate depthstencil instance, i.e., a number which indicates to Reshade when it should retrieve the depth buffer (the first time the game clears a depth buffer, the second time, the third time, and so on...), so i can filter the appropriate one.
In Elex, this allows to display the depth buffer related to the rendering scene, not the ones related to the UI elements.

Do you know which version of DirectX is used in Fuel ? If it is DX11, my current modifs should help. If it is for DirectX10, you will need to wait for me to implement my modifs for this version of DirectX.

If it is for DX9, i should find a similar method for this version of the dll (but dx9 works differently from DX10 and DX11)...
Last edit: 6 years 3 weeks ago by thalixte.
The topic has been locked.
  • conan2k
More
6 years 3 weeks ago #151 by conan2k Replied by conan2k on topic Depth buffer detection modifications
Tested the latest DLLs in the following DX9 games so far (will test more as I have time):
1) The Witcher - Enhanced Edition (the 1st one from series)
Only UI and subtitles are present in the retrieved depth map (i.e. no changes from the original ReShade). Most likely the same problem as with FUEL, which you've described above.

2) King's Bounty Warriors of the North - Complete Edition
The retrieved depth map is empty (white).

3) Mass Effect (the 1st one from series)
Works just fine!

4) Dishonored (the 1st one from series)
Works just fine!

If you need The Witcher and King's Bounty games for testing, they are available for cheap on GOG (The Witcher is dirt-cheap actually). I can donate some funds to you via PayPal for such purchases if you have a compatible e-Wallet.

In any event, thanks a lot for your effort and continuous support!
The topic has been locked.
  • AladinZ
More
6 years 3 weeks ago #152 by AladinZ Replied by AladinZ on topic Depth buffer detection modifications

thalixte wrote:

AladinZ wrote: Hello, could you please investigate this game named 'FUEL' by Codemasters? The bepthbuffer never worked properly.

Here are screenshots of what's happening:

I dream of the day depthbuffer will work properly in this game.


Hello,

It reminds me the same pb as in Elex (dx11). In Elex, some depth buffers are related to the UI elements. That's why, in my modifs, I introduced a setting to select the appropriate depthstencil instance, i.e., a number which indicates to Reshade when it should retrieve the depth buffer (the first time the game clears a depth buffer, the second time, the third time, and so on...), so i can filter the appropriate one.
In Elex, this allows to display the depth buffer related to the rendering scene, not the ones related to the UI elements.

Do you know which version of DirectX is used in Fuel ? If it is DX11, my current modifs should help. If it is for DirectX10, you will need to wait for me to implement my modifs for this version of DirectX.

If it is for DX9, i should find a similar method for this version of the dll (but dx9 works differently from DX10 and DX11)...



The game uses DX9 unfortunately, but I can wait. Been playing the game for years, and likely to keep playing it for a long time to come.
The topic has been locked.
  • klotim
More
6 years 3 weeks ago #153 by klotim Replied by klotim on topic Depth buffer detection modifications
Shogun 2 total war has blank depth buffer as well, dx 11
The topic has been locked.
  • Uncle Crassius
More
6 years 3 weeks ago #154 by Uncle Crassius Replied by Uncle Crassius on topic Depth buffer detection modifications
Getting an "untrusted system file" with the latest dxgi.dll in Far Cry 5. The unmodified dll works but yields no depth buffer access, at least for me (with AA turned off).
The topic has been locked.
  • crosire
More
6 years 2 weeks ago #155 by crosire Replied by crosire on topic Depth buffer detection modifications
Official ReShade is whitelisted. Custom builds are not.
The topic has been locked.
  • conan2k
More
6 years 2 weeks ago #156 by conan2k Replied by conan2k on topic Depth buffer detection modifications
Tested more DX9 games (for which there is no depth buffer access with the original ReShade):
1) XCOM: Enemy Unknown - Complete Edition
Works just fine!

2) Resident Evil 6
Works just fine!

3) Fallout 3 GotY
The depth map is empty (white). However, when the game is in the 3rd-person view mode, the depth map is retrieved successfully (the same behavior as with the original ReShade).
The topic has been locked.
  • Uncle Crassius
More
6 years 2 weeks ago #157 by Uncle Crassius Replied by Uncle Crassius on topic Depth buffer detection modifications

crosire wrote: Official ReShade is whitelisted. Custom builds are not.


I see. Waiting for an official implementation of the detection improvements then. Thanks for clearing that up.
The topic has been locked.
  • Nerrel
More
6 years 2 weeks ago - 6 years 2 weeks ago #158 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. The best you can do here is to ask MartyMcFly (the author of the excellent MXAO shader) to see if he could help you.


Nuts. I asked MartyMcFly about this a while ago and there wasn't much he could do, as it's a ReShade issue. Instead of using the FBO, which is automatically chosen, ReShade would have to be manually set to use the depth buffer instead in order for GlideN64 to work, but manually selecting a source isn't possible at the moment. Crosire seemed to say that it probably never will be, but I'm holding out hope that some kind of workaround will eventually materialize... After all, it did work at one point. Thanks for your answer!

conan2k wrote: 2) Resident Evil 6
Works just fine!


I remember forcing AO through Inspector, which mainly gave the choice of AO from RE5 or Hawken. RE5 looked more natural but was subtle and didn't apply to distant objects. MXAO should blow those options out of the water.
Last edit: 6 years 2 weeks ago by Nerrel.
The topic has been locked.
  • thalixte
  • Topic Author
More
6 years 2 weeks ago - 6 years 2 weeks ago #159 by thalixte Replied by thalixte on topic Depth buffer detection modifications

conan2k wrote: Tested more DX9 games (for which there is no depth buffer access with the original ReShade):
1) XCOM: Enemy Unknown - Complete Edition
Works just fine!

2) Resident Evil 6
Works just fine!

3) Fallout 3 GotY
The depth map is empty (white). However, when the game is in the 3rd-person view mode, the depth map is retrieved successfully (the same behavior as with the original ReShade).


Cool! Thks for your feedback ;)

I have good news and bad news for Vanquish:
Good news is that i am able to retrieve the depth buffer (in fact, the actual build is able to retrieve it, if i disable an early rejection that checks the aspect ratio of the depthstencil surface in the code, in the on_set_depthstencil_surface method of the d3d9_runtime class).
The bad news is that the depthstencil texture is embedded in a 4096X4096 square, so when it is displayed by the shader, it is shrinked :( ...

I don't know if it is possible to crop a depth buffer texture in d3d9, so i wonder if it would be possible inside the shader itself (or in the Reshade.fxh that embed the method to retrieve the depth infos)...

@Crosire, what do you think about that ?
Last edit: 6 years 2 weeks ago by thalixte.
The following user(s) said Thank You: Uncle Crassius
The topic has been locked.
  • conan2k
More
6 years 2 weeks ago #160 by conan2k Replied by conan2k on topic Depth buffer detection modifications
Two more DX9 games have been tested:
1) F.E.A.R. 2: Project Origin
Works just fine!

2) Far Cry 2
Only main character's hands and weapon are present in the retrieved depth map. At the same time, the depth map is completely empty with the original ReShade. Also, DX10 renderer is available in this game but I haven't tested it since your changes are not ported to DX10 yet.
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.