Welcome, Guest.
Username: Password: Remember me

TOPIC: Max Payne 2 - Mirrors break depth buffer

Max Payne 2 - Mirrors break depth buffer 4 months 2 weeks ago #1

I'm trying to use effects that require depth buffer access in Max Payne 2, and while the depth buffer is accessible by reshade, it appears that mirrors in game break the depth buffer, showing (presumably) the depth buffer used for the mirror image, which is reversed and out of place.

Here is what the depth buffer looks like when a mirror is not in view: my.mixtape.moe/vhalrr.png

and here is what it looks like with a mirror in view: my.mixtape.moe/tiifhd.png

I should note that I am using the widescreen fix mod in these screenshots, and it does affect the behavior of the depth buffer (although it is still broken for the same reason)

unmodded depth buffer without mirror: my.mixtape.moe/zggnzh.png

unmodded depth buffer with mirror: my.mixtape.moe/dmlsvi.png

I have tried using older dlls to see if an update had broken it, to no avail.
The administrator has disabled public write access.

Max Payne 2 - Mirrors break depth buffer 4 months 2 weeks ago #2

Hello,

What are your depth buffer detection settings ? In the last release, some new settings were introduced. For instance, you can now retrieve the depth buffer textures before they are cleaned in the rendering pipeline. It is now also possible to extend the number of depth buffer textures retrieved.

Can you remind me what is the directX version of Max Payne 2 ?
The administrator has disabled public write access.

Max Payne 2 - Mirrors break depth buffer 4 months 2 weeks ago #3

DirectX 8 I believe. But that might have been the first game.

EDIT: No it seems to be both.

EDIT: Though there might be unofficial patches or using dgVoodoo2 could perhaps wrap it into D3D11
dege.freeweb.hu/dgVoodoo2/dgVoodoo2.html
( dege.freeweb.hu/ Documentation and such, useful for how to set it up and what you can configure.)


EDIT: As for the mirrors older games copied or reversed geometry didn't they? So would the depth buffer need to be reversed then but that's kinda clunky for whenever the player looks into a mirror.
(It's not quite as today with screen space reflection and using a shader effect to approximate the reflective surface.)
Last Edit: 4 months 2 weeks ago by JBeckman.
The administrator has disabled public write access.

Max Payne 2 - Mirrors break depth buffer 4 months 2 weeks ago #4

JBeckman wrote:
DirectX 8 I believe. But that might have been the first game.

EDIT: No it seems to be both.

EDIT: Though there might be unofficial patches or using dgVoodoo2 could perhaps wrap it into D3D11
dege.freeweb.hu/dgVoodoo2/dgVoodoo2.html
( dege.freeweb.hu/ Documentation and such, useful for how to set it up and what you can configure.)

EDIT: As for the mirrors older games copied or reversed geometry didn't they? So would the depth buffer need to be reversed then but that's kinda clunky for whenever the player looks into a mirror.
(It's not quite as today with screen space reflection and using a shader effect to approximate the reflective surface.)

Yes, it is possible. I saw this kind of depth buffers in some other games (Bioshock 2 remastered or Agents of Mayhem, for example) when reflection was enabled.
Last Edit: 4 months 2 weeks ago by thalixte.
The administrator has disabled public write access.

Max Payne 2 - Mirrors break depth buffer 4 months 2 weeks ago #5

And about MP1?

DB seems empty (set to 255 / white)
Last Edit: 4 months 2 weeks ago by lowenz.
The administrator has disabled public write access.

Max Payne 2 - Mirrors break depth buffer 4 months 2 weeks ago #6

thalixte wrote:
Can you remind me what is the directX version of Max Payne 2 ?
D3D 8/8.1 (you must modify some binaries of MP/MP2 to get dgVoodoo2 working with them -> www.vogons.org/viewtopic.php?f=8&t=51579 )
The administrator has disabled public write access.

Max Payne 2 - Mirrors break depth buffer 4 months 2 weeks ago #7

thalixte wrote:
Hello,

What are your depth buffer detection settings ? In the last release, some new settings were introduced. For instance, you can now retrieve the depth buffer textures before they are cleaned in the rendering pipeline. It is now also possible to extend the number of depth buffer textures retrieved.

Can you remind me what is the directX version of Max Payne 2 ?

I'm using the standard Depth Buffer detection settings, as those new options are only available in DX11. Max Payne 2 uses DX8, and I'm using d3d8to9 to use it with reshade. I tried enabling DisableINTZ, but that just gets rid of the depth buffer altogether.
The administrator has disabled public write access.

Max Payne 2 - Mirrors break depth buffer 4 months 2 weeks ago #8

Ah, if it is DX9, i did not find the time to adapt the new code to this directX version. I don't think i will next month, but in August, i will see what i can do. DX9 functionalities make it more difficult to retrieve the depth buffer before the cleaning step, and i faced some kind of z-test conflict when i first tried.
The administrator has disabled public write access.
The following user(s) said Thank You: brazzjazz

Max Payne 2 - Mirrors break depth buffer 3 months 3 weeks ago #9

thalixte wrote:
Ah, if it is DX9, i did not find the time to adapt the new code to this directX version. I don't think i will next month, but in August, i will see what i can do. DX9 functionalities make it more difficult to retrieve the depth buffer before the cleaning step, and i faced some kind of z-test conflict when i first tried.
Sounds promising though, keep it up! I just got Max Payne 1 running with ReShade, but no working depth buffer detection at the moment.
Xeon E3-1231 v3, MSI GTX 970 @1446/3903 MHz, 16 GB DDR3-1600
The administrator has disabled public write access.