Reshade display depth не работает

Reshade display depth не работает

1,358 уникальных посетителей
18 добавили в избранное

I am making sourcemod in SDK 2013 branch and I want to improve Source graphic a bit so i installed ReShade but then i realised something is wrong with AO, so i started to tweak settings with another depth buffers, disabling HUD.
But, i found a way to fix it a bit, that why i wanted to create this tutorial 😀

So you want to have this?
|
No Problem! Follow my steps to fix messed DepthBuffer

Why i need DepthBuffer for ReShade?:

  • In easy words it has «informations» about depth on your ingame screen ( how far props/walls/sky is from player`s camera ) and ReShade needs these informations for SSAO, Depth Of Field and all depth related shaders

Why DepthBuffer in Source is «broken» for ReShade?:

  • VGUI ( HUD elements: health, ammo, crosshair ) makes it solid color so it has no depth information. You can fix it by typing r_drawvgui 0 in console ( but who wants to play without HUD ? ) or by choosing right Depth Buffer from DX9 Tab in ReShade but it still needs some fixes

    MSAA makes it solid color aswell so you need to disable Antialiasing in game options ( but you can enable Anti-Aliasing in ReShade so git gut )

    When 3D Skybox is enabled ( it usually is ) DepthBuffer will flicker ( switching between playable area and 3D Skybox`s architecture ) when player is moving and looking around ( from what i saw it switch when your crosshair is on hidden 3D Skybox area but not always ) so you need to disable 3D Skybox architecture by typing r_3dsky 0 in console or SSAO will turns ON and OFF on player`s movement

  • Color Correction can make it solid sometimes, so turn it OFF ( but in my case i can have it enabled and everything is fine )

NOTE: There are just some tricks to make it work. It is not a full DepthBuffer repair and they have also some cons! You need to disable 3D Skybox or DepthBuffer will flickers when you are moving! I have not found any solution for this yet. If you have a solution to keep 3D Skybox enabled, write a comment. Thank you 😀

I will show you how to make it work for Half-Life 2, but it should works for all Source Engine games/mods in most cases.

You can download it here: https://reshade.me/

> Open ReShade Setup

> Click Select game to install

> Find your game .exe ( hl2.exe in most cases ) it should be in C:\Program Files (x86)\Steam\steamapps\common\half-life 2 by default ( or in your Source SDK Base if you are working with source mod ) and click on it

> Check «Direct3D 9» API below in ReShade setup

> When window Do you want do download collection. shows up, click YES and Check All effects so you can tweak with some cool settings later

> Open your game folder ( folder where you installed ReShade and where hl2.exe is )

> Copy these files:

  • reshade-shaders folder
  • d3d9.dll
  • ReShade.ini

> Paste them in your game «bin» folder hl2/bin ( «bin» folder is in same place where hl2.exe is ) or in Source SDK Base/bin if you have a sourcemod

> You should see that ReShade is working if you see it on top

> First of all open Options —> Video —> Advanced: Turn Anti-Aliasing to None and Disable Color Correction

> Click «Home» key to open ReShade

> Tutorial will appear, you can read this or just Skip Tutorial

> In ReShade window go to Home tab ( it is on top )
Next
> Create your own Preset by clicking » + » on the right and write name for your Preset ( you should not use DefaultPreset )
Next
> In Home tab find DisplayDepth [DisplayDepth.fx] and active it
Next
> Go to DX9 tab and active Copy Depth Buffers Before Clear Operation
You can see something is going on

Left: Normal map ( is reversed )
Right: Depth map ( still broken, only view model is visible )

Next
> Go back to DisplayDepth in Home tab and change RESHADE_DEPTH_INPUT_IS_REVERSED from 1 to 0

Next
> Click Edit global preprocessor definitions you should have here RESHADE_DEPTH_INPUT_IS_REVERSED 0, but if there is nothing, in Current Preset ( or Global if you want to have many presets ) click on «+» and in first window write RESHADE_DEPTH_INPUT_IS_REVERSED and in second window 0 and then click Reload on bottom

> You can deactive DisplayDepth [DisplayDepth.fx] now

> We are almost done! Go back to Home tab, find MXAO [MXAO.fx] and active it
Next
> AO will flickers sometimes, so you need to disable 3D Skybox. Write r_3dsky 0 in console
Maybe someone will find solution for this 😀

And you have fixed DepthBuffer! You can tweak with MXAO settings or active another depth related shader like Depth Of Field —> DOF.fx shaders, active FXAA.fx to have Anti-Aliasing

In MXAO there is not a big difference between Medium AO quality and higher and my fps stay the same on my PC when its on Medium, but when on Maximum i lose 100fps and i barely see any visual quality in FullHD resolution, so not worth for me go higher than medium 😀

Источник

Depth buffer detection modifications

Ok, so let’s be orderly. Here are the last builds ok my dlls. Can you tell me wich one are the best (RE4HD, L4D2 and source engins games) ? By advance, thks.

Based on L4D2 testing, the above builds can be divided into two groups depending on the resulting behavior:

1) Correct depth map is retrieved when the Flashlight is OFF, «skybox» depth map is retrieved when the Flashlight is ON, silhouette issues are present, shadow issues are absent
— 90 (Reshade-4009a4b8633b41f8aa2546468e1daade297c3cf2)
— 104 (Reshade-3b13969c5519529642169f2fd339353e0bfd11e0)

2) These are worse than builds from the 1st group. «skybox» depth map is retrieved when the Flashlight is OFF, «rotated» depth map is retrieved when the Flashlight is ON (it can be seen on one of screenshots I’ve posted previously), silhouette issues are absent, shadow issues are absent too
— 93 (Reshade-851bb7b6e1371d66673481a5a46ffdc310a81075)
— 96 (Reshade-307a0f7cc754214ed92f3367633623fd9b7b15b9)
— 97 (Reshade-68c989e3cf1498b04eb04006272fe37d17ace52b)
— 100 (Reshade-41ec1bf24bc6120696e79cd7dff39dd13ba09b75)
— 101 (Reshade-5dc247f8020f7426952b10a682d87adadbc721db)

In the end, none of these builds are better than the build 85 which is able to retrieve the correct depth map when the Flashlight is both ON and OFF (but there are serious shadow issues when the Flashlight is ON).

More DX9 games have been tested with the build 85:

1) Aarklash: Legacy
The depth map can be successfully retrieved after selecting «DepthBufferClearingNumber = 0» and «DepthBufferClearingFlagNumber = 2». But there are «character model colorization» issues (seems like character models are being colorized by semi-transparent selection marker color).

2) Batman: Arkham Asylum
The depth map is retrieved and the game works pretty good in general after selecting «DepthBufferClearingNumber = 0» and «DepthBufferClearingFlagNumber = 6». But there are occasional depth test issues that can mostly be seen in foggy areas as black/white/green «reminder» flashes. I’ve even crashed one time (it might have been related to the game itself though).

3) Mirror’s Edge (the 1st one from series)
There is no way to retrieve the correct depth map so far. Different parts of depth map can be seen when changing «Before clearing» settings.

4) Styx: Master of Shadows (the 1st one from series)
The depth map is retrieved after selecting «DepthBufferClearingNumber = 0» and «DepthBufferClearingFlagNumber = 5» but there are evident depth test issues. For example, in the main menu (when you see Styx sitting on the castle wall), try switching between the «Post-processing» and «Before clearing» modes while looking at the fire above Styx (i.e. there is something like a burning torch above him).

5) Trine 2 — Complete Story
An interesting and unexpected finding in this game. The correct depth map can be retrieved even in the «Post-processing» mode when setting «RestrictDepthBufferDimensions = 0». But different shadow issues appear in this case (main character’s shadow is frozen and then disappears, etc.). There are no «Before clearing» settings that allow to retrieve the correct depth map if «RestrictDepthBufferDimensions = 1» (either different parts or shrunk depth map can be seen instead).

Thanks, thalixte! This will make it much easier to track changes. I’ll try to focus all of my testing on RE4.

UPDATE: I tried all 7 versions of the files you linked to. The one I’ve been using wasn’t among those and still works the best for me. I’ll post my full findings when I have more time but I did notice there were some common issues between a few of these versions. One big problem I encountered testing some of these was if I chose a setting that didn’t work NONE of the settings would work after that unless I quit and restarted the game. So if I had a preset with values for Depth Buffer Clearing Number and Depth Buffer Clearing Flag Number that didn’t work then no other settings would work no matter what I entered. So when I was testing a new .dll it would appear that version didn’t work at all. I had to try and guess which settings would most likely work. Through trial and error Depth Buffer Clearing Numbers between Third and Eighth are the most «compatible.»

The most common Depth Buffer Clearing Numbers that were empty were the First, Second, and Ninth. The Third Depth Buffer Clearing Number almost always had an issue once you raised your weapon to aim. One of two things would happen: either the screen would flicker while the laser beam on the weapon disappeared or the screen would go black causing the depth buffer to be lost no matter what settings you choose after that. I’d have to restart game to get it back.

The oddest thing I encountered was with Reshade-851bb7b6e1371d66673481a5a46ffdc310a81075 using
Depth Buffer Clearing Number = None
Depth Buffer Clearing Flag Number = 1
where only Leon’s hair and laser beam on his weapon would appear when I tried to aim.

NONE of these versions had depth buffer access in the area where you’re supposed to take the boat across the lake. I’ll try to upload my save files so you can take a look at that area to see what makes it different than the rest.

Hey! This thread took my attention, and was hoping for some fixes for Source engine based games. Didn’t test everything yet, but the results are interesting. Going to upload a video to share my experiments in Garry’s Mod.

Summary: the only best solution is still the r_drawvgui 0 which hides all GUI elements, including menus. Not a convenient solution, but works.
With Depth Buffer Clear Number settings, the effects are highly varied. At some settings, water reflections ruin it (disabling water reflections using console commands helped). Some settings do absolutely nothing. In some cases, flash light disables or inverts depth buffer. One of the settings works only on the background (Source engine does a weird job with background models with the «3d skybox» feature)

r_depthoverlay draws the depth texture of the engine itself, interesting to see, how low resolution it is, also the very gradient is very rough. And the 3D sky looks weird, the depth overlay shows the closer part of it as it was very close to the camera.

Going to try the 7 uploaded DLL versions on Source based games. Tried the latest d3d9 branch from github, but didn’t really work. No effect at all (needs further testing).

Note that the black borders on the screenshot are because of a shader I made to fix some border artifacts when running the game borderless, completely unrelated to your changes.

I’ve used these settings:

Other settings messed with the depth testing, this seems to work flawlessly.

Although for some reason, which could be completely unrelated, using this makes it impossible to go back to the game (on fullscreen) after alt-tabbing. If I try it, nothing happens (but the screen freezes) and I’m forced to stop the process. This sometimes happens when I use both this build and Flawless Widescreen at the same time and the game is full screen, it maybe be conflicting with that in some way, and sometimes it happens even if the game is windowed (it makes the window freeze). It might be just a fault on the poor port anyways.

Is this already on one of the branches in your repo? I wanted to merge into mine if possible (I like blending multiple cutting edge features into a single build).

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

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

So, from the beginning, yes, those settings work. However, I did observe that I could also select DepthBufferClearingNumber=2, and everything was fine.
Also, the DepthBufferTextureFormat setting apparently can be left at unknown, as it had no effect (between unknown and 44, other values weren’t tested) in these tests.

Then, I checked out sarif industries, which doesn’t appear to work at all with those settings, and works intermittently with others, notably DepthBufferClearingNumber must be set to «1». No other settings work.

Then, much the same in detroit, except DepthBufferClearingNumber must be set to «2», and there is intermittent breakage depending on where you are standing. In all videos, it isn’t shown, but I have found consistently that DepthBufferTextureFormat can be set to unknown or 44 and it has no discernable impact on the result.

With Depth Buffer Clear Number settings, the effects are highly varied. At some settings, water reflections ruin it (disabling water reflections using console commands helped). Some settings do absolutely nothing. In some cases, flash light disables or inverts depth buffer. One of the settings works only on the background (Source engine does a weird job with background models with the «3d skybox» feature)

I can confirm build «Reshade-4009a4b8633b41f8aa2546468e1daade297c3cf2.zip» works on Mass Effect 1:
.
Other settings messed with the depth testing, this seems to work flawlessly.
.
Although for some reason, which could be completely unrelated, using this makes it impossible to go back to the game (on fullscreen) after alt-tabbing. If I try it, nothing happens (but the screen freezes) and I’m forced to stop the process. This sometimes happens when I use both this build and Flawless Widescreen at the same time and the game is full screen, it maybe be conflicting with that in some way, and sometimes it happens even if the game is windowed (it makes the window freeze). It might be just a fault on the poor port anyways.

It’s normal that only specific combinations of «Before clearing» settings are working fine in some games and don’t work in others (poorly selected settings could even break the game rendering completely or cause occasional visual glitches). I.e. the lists with «Before clearing» settings are kind of universal and designed for you guys to go through and carefully select settings which are working fine in a specific game you play. Hope this explains things a bit.

BTW, Mass Effect 1-3 are indeed working fine starting from early builds with thalixte’s Depth Buffer-related changes.

luluco250, regarding freezes that you experience, do they happen when you use the original ReShade 3.1.2?

PS: thalixte, sorry for being your advocate

BTW, Mass Effect 1-3 are indeed working fine starting from early builds with thalixte’s Depth Buffer-related changes.

Right, I’ll look it up then.

luluco250, regarding freezes that you experience, do they happen when you use the original ReShade 3.1.2?

Pretty sure it’s completely unrelated, because I was just able to use the game for an extended period of time with thalixte’s build, even when working with the game in the background. I think it was just a random coincidence that I was getting freezes on it but not on vanilla ReShade.

Also, made a video to showcase the depth buffer working.

@OtisInf: i tested TitanFall2 with your great camera tools. Unfortunately, i cannot reproduce your issues. In my rig, the depth buffer displays correctly, even when i am in camera mod and i pause the time, then disable the pause. have you a specific sequence where the pb occurs ?

It happens when I pause the game with numpad 0, then enable camera, then enable display depth (so I see the depth buffer), and I move the camera with the camera tools (not the game!): the depth buffer stays the same. To get the depth buffer updated, I have to click reload on reshade. In fact, if I enable display depth I don’t see anything, I have to click reload to get things working in the reshade window.

This is also the same btw with the normal game I now notice: enable displaydepth: nothing changes when the camera is moved. Windowed or full screen, doesn’t matter. Perhaps it’s a weird setting of the game itself, no idea. I’ve everything maxed, vsync to triple buffered, adaptive resolution fps target to 60, adaptive supersampling switched off.

Testing the new .dll’s in dx9 mode (all 32 bit) on Deus Ex Human Revolution

41ec1bf24bc6120696e79cd7dff39dd13ba09b75 — All white — but when I press pause the depth buffer is present — even in places where the main dll (the latest dxgi32) wasn’t showing all depth buffer output (i.e. all white except for phonebooth letter stenciling), however unrestricting viewport and changing DepthBufferClearingFlagNumber to 7 shows this:

5dc247f8020f7426952b10a682d87adadbc721db — same as above.

68c989e3cf1498b04eb04006272fe37d17ace52b — This one i tinkered with and found that changing the following values provides seemingly better buffer access in more places, but it still flickers out and shows something like the screenshot above. Also, massive ghosting, and textures disappearing.

[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=9
DepthBufferTextureFormat=0
DepthBufferClearingFlagNumber=0
RestrictDepthBufferDimensions=1

307a0f7cc754214ed92f3367633623fd9b7b15b9 — same as first (41ec1bf24bc6120696e79cd7dff39dd13ba09b75 )

851bb7b6e1371d66673481a5a46ffdc310a81075 — No access (either all white or all black) — all white except fifth — and that only displays something similar to the screenshot if viewport restriction is disabled.

4009a4b8633b41f8aa2546468e1daade297c3cf2 — No access (either all white or all black)

If I was religious about this it’d be more beneficial to use a spreadsheet for each configuration, lol.

Also, before I forget:

Thalixte: great stuff

Isn’t it taxing though to copy the textures around at that stage (as in: loss in performance?)

  • thalixte
  • Topic Author
  • Offline

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

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

So, from the beginning, yes, those settings work. However, I did observe that I could also select DepthBufferClearingNumber=2, and everything was fine.
Also, the DepthBufferTextureFormat setting apparently can be left at unknown, as it had no effect (between unknown and 44, other values weren’t tested) in these tests.

Then, I checked out sarif industries, which doesn’t appear to work at all with those settings, and works intermittently with others, notably DepthBufferClearingNumber must be set to «1». No other settings work.

Then, much the same in detroit, except DepthBufferClearingNumber must be set to «2», and there is intermittent breakage depending on where you are standing. In all videos, it isn’t shown, but I have found consistently that DepthBufferTextureFormat can be set to unknown or 44 and it has no discernable impact on the result.

  • thalixte
  • Topic Author
  • Offline

@OtisInf: i tested TitanFall2 with your great camera tools. Unfortunately, i cannot reproduce your issues. In my rig, the depth buffer displays correctly, even when i am in camera mod and i pause the time, then disable the pause. have you a specific sequence where the pb occurs ?

It happens when I pause the game with numpad 0, then enable camera, then enable display depth (so I see the depth buffer), and I move the camera with the camera tools (not the game!): the depth buffer stays the same. To get the depth buffer updated, I have to click reload on reshade. In fact, if I enable display depth I don’t see anything, I have to click reload to get things working in the reshade window.

This is also the same btw with the normal game I now notice: enable displaydepth: nothing changes when the camera is moved. Windowed or full screen, doesn’t matter. Perhaps it’s a weird setting of the game itself, no idea. I’ve everything maxed, vsync to triple buffered, adaptive resolution fps target to 60, adaptive supersampling switched off.

  • thalixte
  • Topic Author
  • Offline

Thanks, thalixte! This will make it much easier to track changes. I’ll try to focus all of my testing on RE4.

UPDATE: I tried all 7 versions of the files you linked to. The one I’ve been using wasn’t among those and still works the best for me. I’ll post my full findings when I have more time but I did notice there were some common issues between a few of these versions. One big problem I encountered testing some of these was if I chose a setting that didn’t work NONE of the settings would work after that unless I quit and restarted the game. So if I had a preset with values for Depth Buffer Clearing Number and Depth Buffer Clearing Flag Number that didn’t work then no other settings would work no matter what I entered. So when I was testing a new .dll it would appear that version didn’t work at all. I had to try and guess which settings would most likely work. Through trial and error Depth Buffer Clearing Numbers between Third and Eighth are the most «compatible.»

The most common Depth Buffer Clearing Numbers that were empty were the First, Second, and Ninth. The Third Depth Buffer Clearing Number almost always had an issue once you raised your weapon to aim. One of two things would happen: either the screen would flicker while the laser beam on the weapon disappeared or the screen would go black causing the depth buffer to be lost no matter what settings you choose after that. I’d have to restart game to get it back.

The oddest thing I encountered was with Reshade-851bb7b6e1371d66673481a5a46ffdc310a81075 using
Depth Buffer Clearing Number = None
Depth Buffer Clearing Flag Number = 1
where only Leon’s hair and laser beam on his weapon would appear when I tried to aim.

NONE of these versions had depth buffer access in the area where you’re supposed to take the boat across the lake. I’ll try to upload my save files so you can take a look at that area to see what makes it different than the rest.

Источник

Читайте также:  Как настроить нужный канал
Оцените статью