Depth buffer detection modifications
- lowenz
- robgrab
- OtisInf
Hopefully this is enough for you to see what's going on and what might be the problem
- thalixte
- Topic Author
lowenz wrote: Tested Styx 1 (Unreal Engine 3.x, - game own Ambient Occlusion, Motion Blur and Depth of Field all disabled) and the result is always the same: DB is correctly retrieved (see Display Depth) with "Third" or "Fourth" but MXAO gives this result:
(and the player character shadow is erratic - in the screenshot there's no shadow at all)
Ok, i need to retrieve this game to see what's wrong. It is the same behaviour as Mass effect 2. In ME2, i fixed it by setting the flag number to 6. Have you tried to set a different flag number ? I suggest you to retrieve the very last version too.
- thalixte
- Topic Author
OtisInf wrote: There's still a problem with the system you implemented, but perhaps it's titanfall2 specific: when I enable DisplayDepth and the settings you suggested, I get a view of a filled depth buffer. However when I move the camera, I keep that frame, the depth buffer captured isn't updated. So it might be TF2 uses a series of buffers and we're just looking at one which isn't in use anymore (and therefore not updated by the game) OR your code doesn't update the texture from the depth buffer each frame, hence we keep old data in the one we're working with inside reshade.
Hopefully this is enough for you to see what's going on and what might be the problem
Oddly enough, i don't have this behaviour. When i move the camera, the depth buffer is correctly updated. I update it on each frame, but as i kept the online protection of the official release, if Reshade detects network traffic, the depth buffer is not updated, which can lead to depth texture freezing or flickering. I personally always play offline.
Do you use specific settings for TitanFall 2 ? As you have the skills, maybe the best would be for you to make a step by step debug in the depth buffer detection process, retrieving the last version of the master branch in the Crosire repo. The modifications i made for dx11 impact runtime.cpp, impacted d3d11_runtime.cpp and d3d11_devicecontext.cpp, and draw_call_tracker.cpp.
- thalixte
- Topic Author
robgrab wrote: HERE is a quick little video I made of RE4 using the RE4HD texture pack with an earlier version of your .dll. I tried your latest version but couldn't find the right combination of settings to get the depth buffer back. Anyway, you'll notice the depth buffer seems to work perfectly except it flickers when Leon is aiming weapons with a laser sight. Also MXAO seems to struggle with this game. Not sure if it's because of the low poly models or what. Anyway, thanks again for all your hard work. It's very much appreciated!
Have you tried the last version ? Also, i do not have this flickering on my conf.
- thalixte
- Topic Author
Uncle Crassius wrote:
Played for over an hour and works like a charm. Didn't even change any settings, just changed the dll. You are now officially my hero.
After Crosire, of course
Cool to see it works
- Uncle Crassius
thalixte wrote:
Uncle Crassius wrote:
Played for over an hour and works like a charm. Didn't even change any settings, just changed the dll. You are now officially my hero.
After Crosire, of course
Cool to see it works
Well, true, him and Marty McFly^^. Anyhow, giving Styx a try, too. Will update this post, still downloading.
Edit: Couldn't get it to work. Hooks, but no DB access so I'm apparently doing something wrong. Will give it another more in depth try later.
- DeMondo
I quickly tried one, Mirror's Edge (2009) but this one is going without any luck regarding the depth-buffer.
Could you shine a new light onto it?
Thanks in advance !!
- thalixte
- Topic Author
Uncle Crassius wrote:
thalixte wrote:
Uncle Crassius wrote:
Played for over an hour and works like a charm. Didn't even change any settings, just changed the dll. You are now officially my hero.
After Crosire, of course
Cool to see it works
Well, true, him and Marty McFly^^.
...and OtisInf, and BlueSkyDefender, and so ... in fact, the community
Thks to test Styx. let me know if playing with the flag number setting has an impact
- thalixte
- Topic Author
DeMondo wrote: First thank you very Thalixte for bringing new life into (old) depthbuffer-less games !!!
I quickly tried one, Mirror's Edge (2009) but this one is going without any luck regarding the depth-buffer.
Could you shine a new light onto it?
Thanks in advance !!
Oh, yes, good idea Mirror's Edge. Will try it...
- Uncle Crassius
thalixte wrote:
Uncle Crassius wrote:
thalixte wrote:
Uncle Crassius wrote:
Played for over an hour and works like a charm. Didn't even change any settings, just changed the dll. You are now officially my hero.
After Crosire, of course
Cool to see it works
Well, true, him and Marty McFly^^.
...and OtisInf, and BlueSkyDefender, and so ... in fact, the community
Thks to test Styx. let me know if playing with the flag number setting has an impact
Group hug!
Anyway, gave it another try. Weird: Without changing any settings it behaved differently. Depth seems to be messed up in the normal view, even with Reshade effects disabled and no matter the flag or any other settings. Looks like this, the glowing objects shouldn't be visible:
On the other hand, MXAO itself is working fine, so that's a start. At least the depth buffer shows correctly and the shader behaves as if there were no wonky issues like in the screenshot.
Edit: Must be some effect. Turned settings to low and everything seemed fine. Game froze after setting it to high again, though.
What configs did you use in Dark Messiah of Might and Magic? It may be a global config for all Source-Engine Based games.
- robgrab
thalixte wrote:
robgrab wrote: HERE is a quick little video I made of RE4 using the RE4HD texture pack with an earlier version of your .dll. I tried your latest version but couldn't find the right combination of settings to get the depth buffer back. Anyway, you'll notice the depth buffer seems to work perfectly except it flickers when Leon is aiming weapons with a laser sight. Also MXAO seems to struggle with this game. Not sure if it's because of the low poly models or what. Anyway, thanks again for all your hard work. It's very much appreciated!
Have you tried the last version ? Also, i do not have this flickering on my conf.
I've been playing with your newest version this morning but it has a problem. The depth buffer works fine until I raise my weapon to aim. At that point the depth buffer goes full black and doesn't come back. Hitting Reload in Reshade doesn't fix it. The only way to get it back is to restart the game. The older d3d9.dll I was using flickered when I raised my weapon but went back to normal when I lowered my weapon. Here are the settings I'm using with the newest version:
[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=3
DepthBufferTextureFormat=0
DepthBufferClearingFlagNumber=6
RestrictDepthBufferDimensions=1
I've tried using different values for DepthBufferClearingFlagNumber but the same thing happens: raise your weapon and depth buffer goes away. The earlier version of your d3d9.dll I was using had these settings, which gave the flickering while aiming but went back to normal once the weapon lowered:
[DEPTH_BUFFER_DETECTION]
DepthBufferRetrievalMode=1
DepthBufferClearingNumber=3
DepthBufferTextureFormat=0
What config settings are you using?
- conan2k
thalixte wrote:
conan2k wrote: Is the new "DepthBufferClearingFlagNumber" setting expected to affect the original "Post-processing" retrieval method? It seems to cause visual glitches where they were absent before. I'll do more detailed testing in the evening today.
No, the DepthBufferClearingFlagNumber setting only affects the "Before clearing stage" retrieval mode. If you select "Post process", it does not use this setting.
More extensive testing has shown that it's actually the "Restrict depth buffer dimensions to viewport" checkbox that was causing weird visual issues in games for me. For example, when I've accidentally disabled it in Far Cry 2 (with the original "Post-processing" retrieval method selected), I've got partially transparent walls and various "glowing" artifacts. When I've noticed it and re-enabled the checkbox, everything returned back to "normal". This is definitely not a problem but rather an interesting thing to note.
Regarding the "DepthBufferClearingFlagNumber" setting, it indeed helps to avoid artifacts or even retrieve a correct depth map in some cases where it was not possible before:
1) Left 4 Dead 2 (Single Player mode)
The depth map can now be successfully retrieved after selecting "DepthBufferClearingNumber = None" and "DepthBufferClearingFlagNumber = 2". It had not been possible to retrieve a correct depth map in this game before the "DepthBufferClearingFlagNumber" setting has been introduced.
2) Divinity II: Developer's Cut
The "DepthBufferClearingFlagNumber" setting has helped to "trace and get rid of" remaining visual artifacts. The retrieved depth map is perfectly correct and there are no visual glitches after selecting DepthBufferClearingNumber = 6" and "DepthBufferClearingFlagNumber = 6". Now there is no need to disable the HDR Rendering option in order to get the correct depth map in this game.
3) King's Bounty: Warriors of the North - Complete Edition
Similar to Divinity II, the "DepthBufferClearingFlagNumber" setting has helped to "trace and get rid of" remaining visual artifacts. Now the retrieved depth map is perfectly correct and there are no visual glitches after selecting DepthBufferClearingNumber = 4" and "DepthBufferClearingFlagNumber = 6".
At the same time, there are games that have completely "lost" the depth buffer access after the introduction of "DepthBufferClearingFlagNumber" setting (like The Witcher: Enhanced Edition which has a "partial / broken" depth buffer access when using the previous version of DLL). I'll report those games along with newly tested DX9 games in a separate post.
- Uncle Crassius
conan2k wrote: More extensive testing has shown that it's actually the "Restrict depth buffer dimensions to viewport" checkbox that was causing weird visual issues in games for me. For example, when I've accidentally disabled it in Far Cry 2 (with the original "Post-processing" retrieval method selected), I've got partially transparent walls and various "glowing" artifacts. When I've noticed it and re-enabled the checkbox, everything returned back to "normal". This is definitely not a problem but rather an interesting thing to note.
That sounds exactly like what's happening for me in Styx, even though the restriction wasn't unchecked. Might try that, thanks.
This is the to-go settings for any Source-Engine based game, SiN, DMoMM, and other Source Engine games won't flicker if you have that one switched.
Ok, it doesn't fix the flicker 100% BUUUT it fixes it to the point it rarely flickers.
Side effect is no DB with Flashlight (It only takes the skybox) but its better than nothing.
- thalixte
- Topic Author
Here are new one that work better:
d3d9_32bits.zip
d3d9_64bits.zip
- thalixte
- Topic Author
conan2k wrote:
thalixte wrote:
conan2k wrote: Is the new "DepthBufferClearingFlagNumber" setting expected to affect the original "Post-processing" retrieval method? It seems to cause visual glitches where they were absent before. I'll do more detailed testing in the evening today.
No, the DepthBufferClearingFlagNumber setting only affects the "Before clearing stage" retrieval mode. If you select "Post process", it does not use this setting.
More extensive testing has shown that it's actually the "Restrict depth buffer dimensions to viewport" checkbox that was causing weird visual issues in games for me. For example, when I've accidentally disabled it in Far Cry 2 (with the original "Post-processing" retrieval method selected), I've got partially transparent walls and various "glowing" artifacts. When I've noticed it and re-enabled the checkbox, everything returned back to "normal". This is definitely not a problem but rather an interesting thing to note.
Regarding the "DepthBufferClearingFlagNumber" setting, it indeed helps to avoid artifacts or even retrieve a correct depth map in some cases where it was not possible before:
1) Left 4 Dead 2 (Single Player mode)
The depth map can now be successfully retrieved after selecting "DepthBufferClearingNumber = None" and "DepthBufferClearingFlagNumber = 2". It had not been possible to retrieve a correct depth map in this game before the "DepthBufferClearingFlagNumber" setting has been introduced.
2) Divinity II: Developer's Cut
The "DepthBufferClearingFlagNumber" setting has helped to "trace and get rid of" remaining visual artifacts. The retrieved depth map is perfectly correct and there are no visual glitches after selecting DepthBufferClearingNumber = 6" and "DepthBufferClearingFlagNumber = 6". Now there is no need to disable the HDR Rendering option in order to get the correct depth map in this game.
3) King's Bounty: Warriors of the North - Complete Edition
Similar to Divinity II, the "DepthBufferClearingFlagNumber" setting has helped to "trace and get rid of" remaining visual artifacts. Now the retrieved depth map is perfectly correct and there are no visual glitches after selecting DepthBufferClearingNumber = 4" and "DepthBufferClearingFlagNumber = 6".
At the same time, there are games that have completely "lost" the depth buffer access after the introduction of "DepthBufferClearingFlagNumber" setting (like The Witcher: Enhanced Edition which has a "partial / broken" depth buffer access when using the previous version of DLL). I'll report those games along with newly tested DX9 games in a separate post.
Really cool For the games that lost the depth buffer with my previous release, it should now be fixed. Could you please retest...
It is broken now, the prevalent depth buffer is the skybox one, when i turn on the flashlight, the depth buffer from the room i am in appears, but in a small square.