Depth buffer detection modifications

More
2 years 5 months ago - 2 years 5 months ago #281 by matsilagi
Replied by matsilagi on topic Depth buffer detection modifications

conan2k wrote:

thalixte wrote: Again, big thk U. There's nothing more frustrating than facing a behaviour i do not understand... is it possible for you to send me a save in L4D2 ?


There is no need in a save in L4D2. Just select "Single Player" and you'll be able to choose from different campaigns and levels. L4D2 screenshots I'm attaching are from the very beginning of "Dead Center" campaign (1st level).

But, in general, I can of course send you logs, crash logs, saves, etc. from other games if will be needed. I.e. any help you might need, just name it :)

On the other note, I've tried to compare depth maps retrieved by the old build 64 (the one that seemed to work fine) and the new build 85. And, now I see that the depth map retrieved by the build 64 doesn't look as 100% correct (but it was "stable" and allowed to apply MXAO and DOF). The given behavior is consistent across different levels and campaigns.

Hope these screenshots will help to figure out what's going on in the game:

Warning: Spoiler!


Yeah, i had that confirmed a while before. It flickered a lot less, but wasn't correct.

As weird as it seems, every time it flickers, it always gets the depth buffer of the skybox (Like when you turned the flashlight, the highlighted area was the skybox), with it off, it would occasionaly break the Z part of the textures (Like the one Alyx pic shown earlier on HL2) or would work completely OK (Ignoring the FPS guns in HL2's case, apparently L4D2.

Would getting the game's Source Code help? There are versions of the Source Engine 2007 which may help on this quest. Since all of the SE versions (Besides Black Mesa) uses the same logic for depth buffers.

EDIT: Pasting it here anyways : github.com/csnxs/source-2007/tree/master/src_main

Look around the folders and you will eventually find the ones releated to rendering, pretty sure you might find awnsers there.
Last edit: 2 years 5 months ago by matsilagi.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #282 by robgrab
Replied by robgrab on topic Depth buffer detection modifications
Okay, I just tried the newest .dll files and now I can't get depth buffer with ANY settings in RE4. Things seem to be getting worse with each release (regarding RE4). I decided to make 2 quick videos to show what I'm talking about.

This first video shows RE4 running with the April 6th release. Notice the settings don't change as I leave and re-enter each area.
Warning: Spoiler!


This second video shows RE4 running with the version released on April 8th. Notice I have to change settings each time I leave the area. Also if the setting number is an odd number you need to select an even number once you leave that area. Besides that a setting that previously didn't work in that area will work as long as the value is changing to a different number. Hopefully the video will explain it better than I can with words.
Warning: Spoiler!
Last edit: 2 years 5 months ago by robgrab.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #283 by thalixte
Replied by thalixte on topic Depth buffer detection modifications
Thks for the info. So, the build from the 6th april is better for RE4HD.

I have to deal with different behaviours from one game to another, so i have to point out where is the difference . Unfortunately, i am very busy right now, so i cannot test as much as i would.

Thk U ;)

I confirm that a save would be great...
Last edit: 2 years 5 months ago by thalixte.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #284 by thalixte
Replied by thalixte on topic Depth buffer detection modifications

matsilagi wrote:

conan2k wrote: Look around the folders and you will eventually find the ones releated to rendering, pretty sure you might find awnsers there.


Can you test this specific dl for L4D2 (and maybe other source engine games) ?
d3d9_32bits_L4D2.zip

My settings:
[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=0
DepthBufferClearingFlagNumber=2
DepthBufferTextureFormat=0
RestrictDepthBufferDimensions=1
Last edit: 2 years 5 months ago by thalixte.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #285 by thalixte
Replied by thalixte on topic Depth buffer detection modifications

jminternelia wrote:

thalixte wrote: DXHR works on my rig. But i have to disable anti-aliasing in the game settings...
As soon as i can, i send to you my conf.


That would be fantastic. I did get some progress at getting dof to work, but def send me that config info, as with how I have it now, it does like Arkham Knight and periodically the depth buffer is blank and the effect vanishes.

imgur.com/RaG8slj
imgur.com/SJfTCFZ
imgur.com/FOlMx2o
imgur.com/ck10IC3

Thalixte this is absolutely amazing work. This should absolutely be merged into the main branch (my opinion only). The only other game I really wish this would work for is Ghostbusters, but the game flat out crashes on startup. It's an old dx8 game and something something engine .cpp. Anyway, again, thanks so much for this. Fantastic stuff!


Sorry, i made a mistake: my settings were for Deux Ex Mankind, not Deux Ex Human Revolution, but as soon as i can, will test DXHR :)

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #286 by thalixte
Replied by thalixte on topic Depth buffer detection modifications

lowenz wrote:

thalixte wrote: DXHR works on my rig. But i have to disable anti-aliasing in the game settings...
As soon as i can, i send to you my conf.

Can we have the lastest D3D11/DXGI implementations (32/64) to test?


It is as easy as renaming the d3d9.dll in dxgi.dll (as it embeds the last dx11 changes for depth buffer detection).
Last edit: 2 years 5 months ago by thalixte.
The following user(s) said Thank You: jminternelia

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #287 by lowenz
Replied by lowenz on topic Depth buffer detection modifications
Source Engine keeps showing the same behaviour: some parts of the scene are susceptible to "third" and other ones to "fourth" (the remaining part got artifacts).

Video: www25.zippyshare.com/v/aHxSco0g/file.html

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #288 by jminternelia
Replied by jminternelia on topic Depth buffer detection modifications

thalixte wrote:

lowenz wrote:

thalixte wrote: DXHR works on my rig. But i have to disable anti-aliasing in the game settings...
As soon as i can, i send to you my conf.

Can we have the lastest D3D11/DXGI implementations (32/64) to test?


It is as easy as renaming the d3d9.dll in dxgi.dll (as it embeds the last dx11 changes for depth buffer detection).


I am just confirming...

So use your d3d9.dll and rename it dxgi.dll? Do we run the game in DX9 or DX11? I was using your d3d11 32 bit dll, with the following settings:

[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=2
DepthBufferTextureFormat=44

I didn't get to play very extensively with it, and I hadn't disabled MSAA.

Thanks!
Last edit: 2 years 5 months ago by jminternelia.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #289 by thalixte
Replied by thalixte on topic Depth buffer detection modifications

lowenz wrote: Source Engine keeps showing the same behaviour: some parts of the scene are susceptible to "third" and other ones to "fourth" (the remaining part got artifacts).

Video: www25.zippyshare.com/v/aHxSco0g/file.html


Is it sin emergence ? If it is possible, do you have a save ? Thks...
Last edit: 2 years 5 months ago by thalixte.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #290 by thalixte
Replied by thalixte on topic Depth buffer detection modifications

jminternelia wrote:

thalixte wrote:

lowenz wrote:

thalixte wrote: DXHR works on my rig. But i have to disable anti-aliasing in the game settings...
As soon as i can, i send to you my conf.

Can we have the lastest D3D11/DXGI implementations (32/64) to test?


It is as easy as renaming the d3d9.dll in dxgi.dll (as it embeds the last dx11 changes for depth buffer detection).


I am just confirming...

So use your d3d9.dll and rename it dxgi.dll? Do we run the game in DX9 or DX11? I was using your d3d11 32 bit dll, with the following settings:

[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=2
DepthBufferTextureFormat=44

I didn't get to play very extensively with it, and I hadn't disabled MSAA.

Thanks!


Ingame MSAA must be disabled (use another anti-aliasing technique, provided by the driver, for instance). Also, do you know which version of DirectX the game uses ?

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #291 by jminternelia
Replied by jminternelia on topic Depth buffer detection modifications

thalixte wrote:

jminternelia wrote:

thalixte wrote:

lowenz wrote:

thalixte wrote: DXHR works on my rig. But i have to disable anti-aliasing in the game settings...
As soon as i can, i send to you my conf.

Can we have the lastest D3D11/DXGI implementations (32/64) to test?


It is as easy as renaming the d3d9.dll in dxgi.dll (as it embeds the last dx11 changes for depth buffer detection).


I am just confirming...

So use your d3d9.dll and rename it dxgi.dll? Do we run the game in DX9 or DX11? I was using your d3d11 32 bit dll, with the following settings:

[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=2
DepthBufferTextureFormat=44

I didn't get to play very extensively with it, and I hadn't disabled MSAA.

Thanks!


Ingame MSAA must be disabled (use another anti-aliasing technique, provided by the driver, for instance). Also, do you know which version of DirectX the game uses ?


You can switch between DX9 and DX11. I am using DX11 for the added eye candy. I've discovered that the occasionally when enabling MXAO and DoF, while DoF will sometimes cut out, MXAO will still be visible. (Edit: RestrictDepthBufferDimensions was set to 0. Changing to 1 fixed that particular issue.)
Showing display depth reveals an all white screen, with some decals of a nearby phonebooth. Then, also, there are times that both MXAO and DoF aren't visible. I am using your latest dxgi 32 bit. MSAA appears to have no effect on depth buffer being read correctly, I get the same results with it enabled as I do disabled. I'll upload a video to explain better. Done.

(All AA is disabled)


This demonstrates that AA has zero effect on anything. Also, perhaps not related to your fix, may be something I'll send to Marty, when the gun is drawn, the entire screen except for the gun is blurred. This happens regardless of the depth linearization setting (100 or 1000) This was my fault. I had fADOF_HyperFocus set WAY too low.
Last edit: 2 years 5 months ago by jminternelia.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #292 by lowenz
Replied by lowenz on topic Depth buffer detection modifications

thalixte wrote:

lowenz wrote: Source Engine keeps showing the same behaviour: some parts of the scene are susceptible to "third" and other ones to "fourth" (the remaining part got artifacts).

Video: www25.zippyshare.com/v/aHxSco0g/file.html


Is it sin emergence ? If it is possible, do you have a save ? Thks...

You can see the issue in the starting screen too! (and the interaction with the Afterburner overlay)

File Attachment:

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #293 by matsilagi
Replied by matsilagi on topic Depth buffer detection modifications
Indeed, source is still broken.
It works on the HL2 menu, but in the rest of the game its all broken.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #294 by conan2k
Replied by conan2k on topic Depth buffer detection modifications

thalixte wrote:

matsilagi wrote:

conan2k wrote: Look around the folders and you will eventually find the ones releated to rendering, pretty sure you might find awnsers there.


Can you test this specific dl for L4D2 (and maybe other source engine games) ?
d3d9_32bits_L4D2.zip

My settings:
[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=0
DepthBufferClearingFlagNumber=2
DepthBufferTextureFormat=0
RestrictDepthBufferDimensions=1


Tested DLL in L4D2. Well, it's close but there are still depth-test issues which break the game rendering:
1) Good
- The depth buffer access seems to be stable. I haven't noticed any flickering in tested areas
- The depth map seems to be retrieved correctly even when the Flashlight is turned ON (this was never the case before)

2) Bad
- The light beam coming from the Flashlight looks dull (it's much brighter normally). However, switching to the "Post-processing" mode and back fixes the issue
- The light beam coming from the Flashlight tends to "catch" shadows that are then "carried" together with the beam
- Bluish glowing outline around "invisible" companions occasionally turns into glowing filled silhouette even if companions are still completely obscured (normally, this glowing silhouette effect can only be seen when a companion is about to appear in the field of view)
Last edit: 2 years 5 months ago by conan2k.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #295 by thalixte
Replied by thalixte on topic Depth buffer detection modifications

conan2k wrote:

thalixte wrote:

matsilagi wrote:

conan2k wrote: Look around the folders and you will eventually find the ones releated to rendering, pretty sure you might find awnsers there.


Can you test this specific dl for L4D2 (and maybe other source engine games) ?
d3d9_32bits_L4D2.zip

My settings:
[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=0
DepthBufferClearingFlagNumber=2
DepthBufferTextureFormat=0
RestrictDepthBufferDimensions=1


Tested DLL in L4D2. Well, it's close but there are still depth-test issues which break the game rendering:
1) Good
- The depth buffer access seems to be stable. I haven't noticed any flickering in tested areas
- The depth map seems to be retrieved correctly even when the Flashlight is turned ON (this was never the case before)

2) Bad
- The light beam coming from the Flashlight looks dull (it's much brighter normally). However, switching to the "Post-processing" mode and back fixes the issue
- The light beam coming from the Flashlight tends to "catch" shadows that are then "carried" together with the beam
- Bluish glowing outline around "invisible" companions occasionally turns into glowing filled silhouette even if companions are still completely obscured (normally, this glowing silhouette effect can only be seen when a companion is about to appear in the field of view)


Oups. It becomes complicated :blush: I wish i find a way to make it work whatever the situation :P

I think i will send to you all my latest releases, so you can tell me where the dll became instable (both for RE4HD than the source engine games)...
Last edit: 2 years 5 months ago by thalixte.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #296 by thalixte
Replied by thalixte on topic Depth buffer detection modifications

jminternelia wrote:
This demonstrates that AA has zero effect on anything. Also, perhaps not related to your fix, may be something I'll send to Marty, when the gun is drawn, the entire screen except for the gun is blurred. This happens regardless of the depth linearization setting (100 or 1000) This was my fault. I had fADOF_HyperFocus set WAY too low.


Just tested the game (at the very beginning). No problem in my case. Could you test those settings:

PreprocessorDefinitions=RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=75,RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0,RESHADE_DEPTH_INPUT_IS_REVERSED=0,RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=1

[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=0
DepthBufferTextureFormat=44
Last edit: 2 years 5 months ago by thalixte.
The following user(s) said Thank You: jminternelia

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #297 by conan2k
Replied by conan2k on topic Depth buffer detection modifications

thalixte wrote: Oups. It becomes complicated :blush: I wish i find a way to make it work whatever the situation :P

I think i will send to you all my latest releases, so you can tell me where the dll became instable (both for RE4HD than the source engine games)...


Sure, will be glad to help. I believe that debugging and fixing these issues will have a beneficial impact on many other games (not just Source Engine-based ones) :P

Speaking of which, I'm about to report a number of DX9 titles that have different depth-test issues (some are minor while others are severe).
Last edit: 2 years 5 months ago by conan2k.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #298 by Nerrel
Replied by Nerrel on topic Depth buffer detection modifications

robgrab wrote: Okay, I just tried the newest .dll files and now I can't get depth buffer with ANY settings in RE4. Things seem to be getting worse with each release (regarding RE4).


I'm having a much different problem using the latest .dll. The image is extremely washed out, and occurs everywhere, even on the title menus. I tried turning the effects off and changing the settings around, but nothing made a difference...

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #299 by robgrab
Replied by robgrab on topic Depth buffer detection modifications
It might be a good idea to start giving each release a version number so we can track differences between each build. That way when something breaks we can document it. For me, the April 6th release still works the best with RE4. Plus it got rid of the problem where the screen would flicker while aiming your weapon.
Last edit: 2 years 5 months ago by robgrab.

Please Log in or Create an account to join the conversation.

More
2 years 5 months ago #300 by thalixte
The following user(s) said Thank You: robgrab, JoeJoe90

Please Log in or Create an account to join the conversation.