Max Payne 2 - Mirrors break depth buffer

  • Niko of Death
  • Topic Author
More
5 years 9 months ago #1 by Niko of Death Max Payne 2 - Mirrors break depth buffer was created by Niko of Death
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.

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

  • thalixte
More
5 years 9 months ago #2 by thalixte Replied by thalixte on topic Max Payne 2 - Mirrors break depth buffer
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 ?

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

  • JBeckman
More
5 years 9 months ago - 5 years 9 months ago #3 by JBeckman Replied by JBeckman on topic Max Payne 2 - Mirrors break depth buffer
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: 5 years 9 months ago by JBeckman.

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

  • thalixte
More
5 years 9 months ago - 5 years 9 months ago #4 by thalixte Replied by thalixte on topic Max Payne 2 - Mirrors break depth buffer

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: 5 years 9 months ago by thalixte.

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

  • lowenz
More
5 years 9 months ago - 5 years 9 months ago #5 by lowenz Replied by lowenz on topic Max Payne 2 - Mirrors break depth buffer
And about MP1?

DB seems empty (set to 255 / white)
Last edit: 5 years 9 months ago by lowenz.

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

  • lowenz
More
5 years 9 months ago #6 by lowenz Replied by lowenz on topic Max Payne 2 - Mirrors break depth buffer

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 )

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

  • Niko of Death
  • Topic Author
More
5 years 9 months ago #7 by Niko of Death Replied by Niko of Death on topic Max Payne 2 - Mirrors break depth buffer

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.

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

  • thalixte
More
5 years 9 months ago #8 by thalixte Replied by thalixte on topic Max Payne 2 - Mirrors break depth buffer
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 following user(s) said Thank You: brazzjazz

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

  • brazzjazz
More
5 years 8 months ago #9 by brazzjazz Replied by brazzjazz on topic Max Payne 2 - Mirrors break depth buffer

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.

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

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.