TOPIC: Depth Buffer Question For Crosire!!

What does Reshade hook into in order to gain access to a game's depth buffer? Depth buffer support seems pretty inconsistent, and I was wondering how hard it would be to modify the way a depth buffer is gathered on a per-game basis. Certain games have no depth buffer support at all, some have partial support (ex: only captures gun's depth, only captures UI, etc.)

Considering you're pretty much the only one that knows what code is what: Could you point me in the right direction as to where the depth buffer hook is in the source code?

me too.I try to use Reshade 3.0.6 in Assassin's creed 2 ,call of duty 8,medal of honor airbone,but in Assassin's creed 2,the character doesn't have depth buffter , in medal of honor airbone only the gun has depth buffter,in ,call of duty 8 there is no depth buffer.I turn off all AA in game,but nothing chage,I don't know why？But call of duyt 2 and 5,they all have depth buffer only you turn off AA in game,they all have nice DOF.

Example D3D11: ReShade hooks all draw call methods (github.com/crosire/reshade/blob/master/s...d11_runtime.cpp#L586 "d3d11_runtime::on_draw_call") and the depth stencil state getter and setter (github.com/crosire/reshade/blob/master/s...d11_runtime.cpp#L615 "d3d11_runtime::on_set_depth_stencil") of ID3D11DeviceContext. Everytime those are called by the game, ReShade stores information about the amount of triangles that were drawn and which depth buffer is currently bound. Later in the frame it then uses that information to try and find the one buffer that is most likely containing scene depth information (github.com/crosire/reshade/blob/master/s...11_runtime.cpp#L1053 "d3d11_runtime::detect_depth_source").
Modifying the algorithm in the latter method will change the way ReShade detects the correct depth buffer. The values in there are currently chosen in a way that works well in most cases. But for some games they need to be different. For some games this way of detection will probably never work at all.