Depth Buffer Detection Modification

  • Posts: 30
3 months 3 weeks ago - 3 months 3 weeks ago #1221 by pyewacket

thalixte wrote: However, can you show me the "statistics" tab ?


Sure. Here u go: prntscr.com/pp83m2

This is when R is active: prntscr.com/pp84j7

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

  • Posts: 578
3 months 3 weeks ago - 3 months 3 weeks ago #1222 by thalixte
Can you please send me a save for this location ?

Just tested the SOTTR benchmark with and without Reshade in 1080p, exclusive fullscreen mode, Reshade performance mode, only adaptative sharpen enabled, with the latest build i made from the master branch (including the latest Crosire's commits), and i see no difference. The benchmark results are the same...

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

  • Posts: 80
3 months 3 weeks ago #1223 by sajittarius
Very strange, Reshade on or off, none of those screenshots show maxed out GPU or CPU. Odd that you are not solid 60fps, lol

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

  • Posts: 30
3 months 3 weeks ago - 3 months 3 weeks ago #1224 by pyewacket

thalixte wrote: Can you please send me a save for this location ?

Just tested the SOTTR benchmark with and without Reshade in 1080p, exclusive fullscreen mode, Reshade performance mode, only adaptative sharpen enabled, with the latest build i made from the master branch (including the latest Crosire's commits), and i see no difference. The benchmark results are the same...


Just in case you'll want it for whatever reason, but it's not needed for you to check this anymore, for the reasons below: mega.nz/#!jhsUjaYZ!pkQOq9gl_Pg-mLXBcLyZkAGGks3Xs0MOfqyNbqtXA2o

Map with location: prntscr.com/ppj0dr

So i did a lot of testing and i think i came to some kind of conclusion finally. The main culprit in case of SOTTR seems to be the Reshade's version.

SOTTR
prntscr.com/ppm37g - latest official Reshade.
prntscr.com/ppm7b4 - clean.
prntscr.com/ppmih0 - latest discord build.
prntscr.com/ppmklt - 4.3.1.139 build i got from this thread some time ago, mainly i was using this one in my games recently.

Unfortunately it's not that clear in ACO as in SOTTR.

Please pay attention to frametime graph.

prntscr.com/pplxst - clean.
prnt.sc/ppm8rm - latest official build.
prntscr.com/ppldyj - latest discord build Reshade.

Official build is noticeably better, it might not look that way in those screenshots, but in motion the difference is there, compared to community iterations from this thread or discord, but still not perfect. I mean, it's not working, but still noticeably taxing performance, doesn't really make sense, does it? I.e. Freestyle doesn't behave that way in ACO for me, as soon as you turn off the preset the performance goes back to normal. I hope this will be helpful in some way to ppl who make Reshade builds, but if not, at least i figured it out for myself.

@thalixte Could u please upload the dxgi.dll you used in your SOTTR benchmark?

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

  • Posts: 30
3 months 3 weeks ago - 3 months 3 weeks ago #1225 by pyewacket
NV jusr released new drivers with Reshade support: www.guru3d.com/files-details/geforce-441...driver-download.html

But on top that there's a stand alone sharpness filter controlled through CP now, i tested it and it doesn't induce any performance hit which is simply amazing, i can now play ACO at butter smooth 60fps locked without Reshade. :) imgur.com/PGA3y95

Plus gpu scaling sounds very interesting and promising.

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

  • Posts: 578
3 months 3 weeks ago - 3 months 2 weeks ago #1226 by thalixte

pyewacket wrote:
@thalixte Could u please upload the dxgi.dll you used in your SOTTR benchmark?


Thks ;) Here is the last build i tried:
mega.nz/#!ilITBaKY!Xn9NSpl_WpdvRl9_VIo9i17dY0uzYcN9xIFtvaCM5t4

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

  • Posts: 80
3 months 2 weeks ago - 3 months 2 weeks ago #1227 by sajittarius
BTW, i tested new Nvidia support of Reshade injected with Freestyle (Geforce Experience), it works pretty well (even with Vulkan)! Was able to use ReShade in Wolfenstein Youngblood and The Surge 2, both Vulkan games. Only supports a specific subset of shaders (looks like they do a hash check of the shaders), but it's much better than nothing.

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

  • Posts: 525
3 months 2 weeks ago - 3 months 2 weeks ago #1228 by lowenz
Any suggestions for Thief Deadly Shadows and Deux Ex Invisible War?
With the Crosire D3D8to9 wrapper the normal maps are somehow visible:

File Attachment:


Those 2 games can benefit in a terrific way of the RTGI by Marty....but now it's impossible as they actually crash due to some issue enabling it (surely related to the partial DB reconstruction).

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

  • Posts: 3631
3 months 2 weeks ago #1229 by crosire
There is no such thing as partial DB reconstruction. Either you have one or you don't. If you see normals, but no depth it just means it is reversed, so set "RESHADE_DEPTH_INPUT_IS_REVERSED" to the opposite (the default is "1", so that would be "0").

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

  • Posts: 525
3 months 2 weeks ago - 3 months 2 weeks ago #1230 by lowenz
Depth buffer is shown correctly in the "start" level ("DX" classic logo screen in Invisible War / "THIEF" word in Deadly Shadows).
So the settings are already correct.

The problem is in-game: the Depth Buffer seems totally "flattened out"!
Same spot, far plane set to 10 (it's the only way to see the player arm/weapon)

File Attachment:


File Attachment:



As you can see the settings are already right but somehow the DB range is "compressed".
Without drawing the weapon to help "see" the depth the scene DB is there but almost "flat" !

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

  • Posts: 525
3 months 2 weeks ago - 3 months 2 weeks ago #1231 by lowenz
Deus Ex Invisible War:

File Attachment:


File Attachment:


You can see the weapon in the depth screen, and the rest is flattened....

MXAO and other depth-dependent shaders freeze the game.

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

  • Posts: 3631
3 months 2 weeks ago - 3 months 2 weeks ago #1232 by crosire
You can change the far plane (via RESHADE_DEPTH_LINEARIZATION_FAR_PLANE).

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

  • Posts: 525
3 months 2 weeks ago - 3 months 2 weeks ago #1233 by lowenz

crosire wrote: You can change the far plane (via RESHADE_DEPTH_LINEARIZATION_FAR_PLANE).

I know, actually it's the only way to obtain the image with the weapon visible as you see above :D (1000->10)

But it's not usable, shaders crash and as I said all the values are flattened (1000=black->10=grey but always flatten) no matter the far plane value.

DXIW and TDS are the only games showing these strange behaviours (Unreal 2 and UT 2004 work like a charm with the d3d9 wrapper).

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

  • Posts: 525
3 months 2 weeks ago - 3 months 2 weeks ago #1234 by lowenz
The "Best" result is with value: 5

File Attachment:


This is the problem.....it's something related to the value range and type of the buffer.

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

  • Posts: 578
3 months 2 weeks ago - 3 months 2 weeks ago #1235 by thalixte
@Lowenz,
I think that i know where the problem comes from :) . Have you ticked the option called "Fix for user weapon or cockpit" in the DX9 tab ? This option forces the viewport to have less depth, so the depth values aret flettened. I introduced this option in order to fix z-fighting issues in some games, especially UE4 UT3. It works if applied on a specific depth buffer (generally the last one, which is the depth buffer where the weapon or cockpit is drawn, for instance in UE4 UT3). But if it is applied to the depth buffer since the very first draw, all the depth buffer can be flattened.

Try to untick "Fix for user weapon or cockpit" in the DX9 tab. If it is un tick, remobe the DX9_buffer_detection section in the Resahde.ini file, and repply your settings.
The following user(s) said Thank You: JBeckman

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

  • Posts: 405
3 months 2 weeks ago #1236 by JBeckman
That's nifty, interesting to know what that setting does too for reference.
Would have assumed a D3D8 issue in older games or a wrapper problem if turned into D3D9/D3D11/Vulkan via various tools though z-flickering can be a problem and I suppose for depth and effects it's going to be even worse if applying a full-screen shader and it acts up.

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

  • Posts: 525
3 months 2 weeks ago #1237 by lowenz

thalixte wrote: @Lowenz,
I think that i know where the problem comes from :) . Have you ticked the option called "Fix for user weapon or cockpit" in the DX9 tab ? This option forces the viewport to have less depth, so the depth values aret flettened. I introduced this option in order to fix z-fighting issues in some games, especially UE4. It works if applied on a specific depth buffer (generally the last one, which is the depth buffer where the weapon or cockpit is drawn, for instance in UE4). But if it is applied to the depth buffer since the very first draw, all the depth buffer can be flattened.

Try to untick "Fix for user weapon or cockpit" in the DX9 tab. If it is un tick, remobe the DX9_buffer_detection section in the Resahde.ini file, and repply your settings.

Problem is, it's NOT activated in DXIW and TDS.

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

  • Posts: 578
3 months 2 weeks ago #1238 by thalixte

lowenz wrote:

thalixte wrote: @Lowenz,
I think that i know where the problem comes from :) . Have you ticked the option called "Fix for user weapon or cockpit" in the DX9 tab ? This option forces the viewport to have less depth, so the depth values aret flettened. I introduced this option in order to fix z-fighting issues in some games, especially UE4. It works if applied on a specific depth buffer (generally the last one, which is the depth buffer where the weapon or cockpit is drawn, for instance in UE4). But if it is applied to the depth buffer since the very first draw, all the depth buffer can be flattened.

Try to untick "Fix for user weapon or cockpit" in the DX9 tab. If it is un tick, remobe the DX9_buffer_detection section in the Resahde.ini file, and repply your settings.

Problem is, it's NOT activated in DXIW and TDS.


What is the content of your Reshade.ini ? For me it really sounds like a viewport pb...

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

  • Posts: 578
3 months 2 weeks ago - 3 months 2 weeks ago #1239 by thalixte

JBeckman wrote: That's nifty, interesting to know what that setting does too for reference.
Would have assumed a D3D8 issue in older games or a wrapper problem if turned into D3D9/D3D11/Vulkan via various tools though z-flickering can be a problem and I suppose for depth and effects it's going to be even worse if applying a full-screen shader and it acts up.


The option is not enabled by default, and normally, not in standard mode, and concerns only d3d9. The z-fighting issue i mentioned, for instance in UE4 UT3 is that the weapon depth buffer can go down the scene depth buffer (as if the depth vars of the scene and the weapon have the same value).So, to ensure that the depth buffer associated with the weapon is always at the top (aka, the nearest from the player), i modify the viewport before the rendering occurs.

EDIT: the title for which i added this option was UT3, not UE4 (as i said, it is only for d3d9).

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

  • Posts: 525
3 months 2 weeks ago - 3 months 2 weeks ago #1240 by lowenz

thalixte wrote: What is the content of your Reshade.ini ? For me it really sounds like a viewport pb...


TDS / DXIW reshade.ini ( It's a d3d8to9-wrapped game with Crosire wrapper )

[GENERAL]
CurrentPresetPath=E:\Thief - Deadly Shadows\System\RS4.ini
ScreenshotPath=E:\Thief - Deadly Shadows\System
PerformanceMode=0
NoFontScaling=1
TextureSearchPaths=C:\ReShade 4\Textures
ScreenshotIncludePreset=0
EffectSearchPaths=C:\ReShade 4\Shaders
ShowFrameTime=0
TutorialProgress=4
NoReloadOnInit=0
PreprocessorDefinitions=RESHADE_DEPTH_LINEARIZATION_FAR_PLANE=5,RESHADE_DEPTH_INPUT_IS_UPSIDE_DOWN=0,RESHADE_DEPTH_INPUT_IS_REVERSED=0,RESHADE_DEPTH_INPUT_IS_LOGARITHMIC=0
ScreenshotFormat=1
ShowClock=0
ShowFPS=0
ShowScreenshotMessage=1
ClockFormat=0
SaveWindowState=0
NewVariableUI=0
ScreenshotSaveBefore=0

[INPUT]
KeyReload=0,0,0,0
KeyEffects=35,0,0,0
InputProcessing=2
KeyScreenshot=44,0,0,0
KeyMenu=36,0,0,0

[STYLE]
GrabRounding=0.000000
Alpha=1.000000
FPSScale=1.000000
FrameRounding=0.000000
ChildRounding=0.000000
PopupRounding=0.000000
WindowRounding=0.000000
ScrollbarRounding=0.000000
TabRounding=4.000000
EditorStyleIndex=0
ColFPSText=1.000000,1.000000,0.784314,1.000000
Font=
FontSize=13
EditorFont=
EditorFontSize=13
StyleIndex=2

[DX9_BUFFER_DETECTION]
DisableINTZ=0
PreserveDepthBuffer=1
PreserveDepthBufferIndex=0
AutoPreserve=1
SourceEngineFix=0
FocusOnBestOriginalDepthstencilSource=0
BruteForceFix=0

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