Mafia: Definitive Edition (full remake DX11)

Post Reply
Shift-E
Cross Eyed!
Posts: 199
Joined: Mon Sep 16, 2019 11:26 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV

Mafia: Definitive Edition (full remake DX11)

Post by Shift-E »

Mafia: Definitive Edition released today, and the visuals are pretty impressive...especially at night. I never played the original, but always heard how it was a masterpiece of writing and story telling so I decided to pick it up. It's DX11 and 3D kicks in, with some shaders broken (lights/etc). I tried out Superdepth3D reshade and it works well, BUT man this game would look amazing with real 3D. Figured I'd post to see if this game interests any of our shaderhackers. I would definitely put this game on ice if so, and donate of course...

https://www.youtube.com/watch?v=14O0xlJ4P0Q

User avatar
DJ-RK
Binocular Vision CONFIRMED!
Posts: 272
Joined: Thu Sep 19, 2019 8:13 pm

Re: Mafia: Definitive Edition (full remake DX11)

Post by DJ-RK »

I looked at both Mafia II: DE and Mafia III recently, couldn't manage to fix shadows in either and therefore didn't bother trying anything else because without correct shadows no point looking at anything else. I lost interest after spending at least a couple hours on each title without correct result, and likely won't bother to make further attempts, but I'll document a few notes that may be useful to others that might want to attempt (or make any suggestions that I might not have thought of).

-Unsurprisingly, both games shaders had similarities (with M3 being much more complex, of course, but still following the same initial handling of it's coordinates), so I'm pretty confident that a) Mafia 1: DE is going to be the same deal, and b) the same general approach to fixing will be the same for all 3 titles.

-M2:DE has shader headers, M3 does not (so would be adviseable to start on M2 and then hopefully adapt the fix to M3 with less information at the ready)

-The correct fix SHOULD be extremely easy. Here is the line of HLSL code from the M2 shader (which occurs before a shadow map matrix multiply) that other shaderhackers will likely recognize the significance of: r1.xyz = v2.xyz * r0.xxx + g_CameraOrigin.xyz; This means the coordinate is a world space coordinate, and should simply need a conversion to clip space, fix, convert back to world space.

-The shader even has the following two matrices available: g_WorldViewProj and g_InvWorldViewProj which should make the translation to clip space and back ez pz, but no dice (these probably are using model space as the start/end point, not world space). Even just translating the coordinate to clip and back to world using these (without doing anything else) will cause the shader to fail to render.

-Found a ViewProjMat in another shader, copied that into the shader, and using that (and using matrix.hlsl to inverse) does work for translating, but the stereo fix doesn't fix it... it does cause the shadows to stereoize, just not correctly (and yes, I've even split the above line of code up to separate the v2.xyz * r0.xxxx and + g_CameraOrigin.xyz, so the g_CameraOrigin is added after the fix).

-It feels like maybe it needs an FOV multiplier, or division by W during the translations or fix, or something like that since shadows would separate more or less depending on their distance from the camera... I think. My memory is a little bit hazy on this, but that's how I think I remember it. I don't think I could find any projection or inverse projection matrices to derive an FOV multiplier from. I don't think I specifically searched for them, but I definitely didn't come across any naturally.

-M2 doesn't use compute shaders, so pretty sure StereoFlagsDX10 driver flag has no impact. Didn't try testing anything other than StereoTextureEnable = 23 (I don't have the patience for testing driver profile stuff. Never have, never will!).

I think that's all I got. Sadly I didn't nail the fix myself, but I hope that helps someone (especially since I'd like to play M3 someday).

maddcatt
One Eyed Hopeful
Posts: 5
Joined: Sun Dec 15, 2019 11:57 am

Re: Mafia: Definitive Edition (full remake DX11)

Post by maddcatt »

Please great masters, fix the game for us 3D noobs and novices.

thebigdogma
Binocular Vision CONFIRMED!
Posts: 208
Joined: Mon Sep 16, 2019 8:29 am

Re: Mafia: Definitive Edition (full remake DX11)

Post by thebigdogma »

Here are a few CMU shots... not too bad (Mafia 3 profile.)
You do not have the required permissions to view the files attached to this post.
Last edited by thebigdogma on Thu Sep 24, 2020 11:18 pm, edited 1 time in total.

thebigdogma
Binocular Vision CONFIRMED!
Posts: 208
Joined: Mon Sep 16, 2019 8:29 am

Re: Mafia: Definitive Edition (full remake DX11)

Post by thebigdogma »

And a few geometry shots with low separation/high convergence.
You do not have the required permissions to view the files attached to this post.

maddcatt
One Eyed Hopeful
Posts: 5
Joined: Sun Dec 15, 2019 11:57 am

Re: Mafia: Definitive Edition (full remake DX11)

Post by maddcatt »

The game does not look bad but the broken shaders if fixed will make this an amazing 3D game. I hope some of the awesome experts can fix them soon. Thank you, sirs!!

User avatar
Chtiblue
Sharp Eyed Eagle!
Posts: 366
Joined: Mon Sep 16, 2019 4:52 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV

Re: Mafia: Definitive Edition (full remake DX11)

Post by Chtiblue »

DJ-RK wrote: Thu Sep 24, 2020 8:44 pm I looked at both Mafia II: DE and Mafia III recently, couldn't manage to fix shadows in either and therefore didn't bother trying anything else because without correct shadows no point looking at anything else. I lost interest after spending at least a couple hours on each title without correct result, and likely won't bother to make further attempts, but I'll document a few notes that may be useful to others that might want to attempt (or make any suggestions that I might not have thought of).
Thanks for the info DJRK but yep sadly, the engine used till MAFIA 3 seems to be a Big PITA as none of the 2 greats shaderhackers, DHR & DJRK were able to fix it...

Masterotaku said once he will looking at it so it would be nice to have his opinion with this engine before buring definitly it with the non fixable engines...

It would awesome to replay the Legend MAFIA I in proper 3D 8)

User avatar
masterotaku
Cross Eyed!
Posts: 119
Joined: Sun Sep 22, 2019 4:43 am
Which stereoscopic 3D solution do you primarily use?: S-3D desktop monitor

Re: Mafia: Definitive Edition (full remake DX11)

Post by masterotaku »

DJ-RK wrote: Thu Sep 24, 2020 8:44 pm -The correct fix SHOULD be extremely easy. Here is the line of HLSL code from the M2 shader (which occurs before a shadow map matrix multiply) that other shaderhackers will likely recognize the significance of: r1.xyz = v2.xyz * r0.xxx + g_CameraOrigin.xyz; This means the coordinate is a world space coordinate, and should simply need a conversion to clip space, fix, convert back to world space.
Sounds like fun :). I always try to fix things without using conversions, and most of the time I can, but there are some games (or engines) where I just can't find an alternative (like some shaders you fixed in FFXV).
DJ-RK wrote: Thu Sep 24, 2020 8:44 pmI don't think I could find any projection or inverse projection matrices to derive an FOV multiplier from. I don't think I specifically searched for them, but I definitely didn't come across any naturally.
Now that sucks. Some of my most annoying and time wasting experiences were from when I couldn't find the FOV value.
DJ-RK wrote: Thu Sep 24, 2020 8:44 pm-M2 doesn't use compute shaders, so pretty sure StereoFlagsDX10 driver flag has no impact.
Not talking about these Mafia games, but the value 0x00001000 has helped me in games without compute shaders where some depth targets weren't stereoized. Two examples: one side haloing on water in Yakuza 0, bloom in Star Ocean 4. When there are games that have compute shaders, that's how I get the typical 0x00005008 combination.

Chtiblue wrote: Fri Sep 25, 2020 7:52 am Masterotaku said once he will looking at it so it would be nice to have his opinion with this engine before buring definitly it with the non fixable engines...
I know I said that (and it's still in my plans), but I always get caught into something more interesting (for my tastes). Anyway, the game may be hard to fix as DJ-RK said, so the more training I get, the lower the chances of me getting stuck, like I was with FFXV for almost two years. Right now I'm focused on The Surge 2 and I temporarily ditched the Dead Rising update I was planning before the Vulkan wrapper/driver release. After those two. I'm not sure what I'll do. I have to check my backlog.

User avatar
Chtiblue
Sharp Eyed Eagle!
Posts: 366
Joined: Mon Sep 16, 2019 4:52 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV

Re: Mafia: Definitive Edition (full remake DX11)

Post by Chtiblue »

Thanks for the news Masterotaku!

maddcatt
One Eyed Hopeful
Posts: 5
Joined: Sun Dec 15, 2019 11:57 am

Re: Mafia: Definitive Edition (full remake DX11)

Post by maddcatt »

masterotaku wrote: Fri Sep 25, 2020 8:17 am
DJ-RK wrote: Thu Sep 24, 2020 8:44 pm -The correct fix SHOULD be extremely easy. Here is the line of HLSL code from the M2 shader (which occurs before a shadow map matrix multiply) that other shaderhackers will likely recognize the significance of: r1.xyz = v2.xyz * r0.xxx + g_CameraOrigin.xyz; This means the coordinate is a world space coordinate, and should simply need a conversion to clip space, fix, convert back to world space.
Sounds like fun :). I always try to fix things without using conversions, and most of the time I can, but there are some games (or engines) where I just can't find an alternative (like some shaders you fixed in FFXV).
DJ-RK wrote: Thu Sep 24, 2020 8:44 pmI don't think I could find any projection or inverse projection matrices to derive an FOV multiplier from. I don't think I specifically searched for them, but I definitely didn't come across any naturally.
Now that sucks. Some of my most annoying and time wasting experiences were from when I couldn't find the FOV value.
DJ-RK wrote: Thu Sep 24, 2020 8:44 pm-M2 doesn't use compute shaders, so pretty sure StereoFlagsDX10 driver flag has no impact.
Not talking about these Mafia games, but the value 0x00001000 has helped me in games without compute shaders where some depth targets weren't stereoized. Two examples: one side haloing on water in Yakuza 0, bloom in Star Ocean 4. When there are games that have compute shaders, that's how I get the typical 0x00005008 combination.

Chtiblue wrote: Fri Sep 25, 2020 7:52 am Masterotaku said once he will looking at it so it would be nice to have his opinion with this engine before buring definitly it with the non fixable engines...
I know I said that (and it's still in my plans), but I always get caught into something more interesting (for my tastes). Anyway, the game may be hard to fix as DJ-RK said, so the more training I get, the lower the chances of me getting stuck, like I was with FFXV for almost two years. Right now I'm focused on The Surge 2 and I temporarily ditched the Dead Rising update I was planning before the Vulkan wrapper/driver release. After those two. I'm not sure what I'll do. I have to check my backlog.
Thank you very much, sir. I look forward to playing this game once awesome people like yourself get around to fixing it.

Kermitou
One Eyed Hopeful
Posts: 14
Joined: Sat Oct 12, 2019 7:28 am

Re: Mafia: Definitive Edition (full remake DX11)

Post by Kermitou »

Cross the fingers to play the trilogy in 3D vision, the remake of the 1st one is very good quoted, a new top game, thanks Masterotaku if you could do the job ;-)

a31632
One Eyed Hopeful
Posts: 22
Joined: Sun Jan 05, 2020 11:25 pm

Re: Mafia: Definitive Edition (full remake DX11)

Post by a31632 »

maddcatt wrote: Fri Sep 25, 2020 9:52 am
masterotaku wrote: Fri Sep 25, 2020 8:17 am
DJ-RK wrote: Thu Sep 24, 2020 8:44 pm -The correct fix SHOULD be extremely easy. Here is the line of HLSL code from the M2 shader (which occurs before a shadow map matrix multiply) that other shaderhackers will likely recognize the significance of: r1.xyz = v2.xyz * r0.xxx + g_CameraOrigin.xyz; This means the coordinate is a world space coordinate, and should simply need a conversion to clip space, fix, convert back to world space.
Sounds like fun :). I always try to fix things without using conversions, and most of the time I can, but there are some games (or engines) where I just can't find an alternative (like some shaders you fixed in FFXV).
DJ-RK wrote: Thu Sep 24, 2020 8:44 pmI don't think I could find any projection or inverse projection matrices to derive an FOV multiplier from. I don't think I specifically searched for them, but I definitely didn't come across any naturally.
Now that sucks. Some of my most annoying and time wasting experiences were from when I couldn't find the FOV value.
DJ-RK wrote: Thu Sep 24, 2020 8:44 pm-M2 doesn't use compute shaders, so pretty sure StereoFlagsDX10 driver flag has no impact.
Not talking about these Mafia games, but the value 0x00001000 has helped me in games without compute shaders where some depth targets weren't stereoized. Two examples: one side haloing on water in Yakuza 0, bloom in Star Ocean 4. When there are games that have compute shaders, that's how I get the typical 0x00005008 combination.

Chtiblue wrote: Fri Sep 25, 2020 7:52 am Masterotaku said once he will looking at it so it would be nice to have his opinion with this engine before buring definitly it with the non fixable engines...
I know I said that (and it's still in my plans), but I always get caught into something more interesting (for my tastes). Anyway, the game may be hard to fix as DJ-RK said, so the more training I get, the lower the chances of me getting stuck, like I was with FFXV for almost two years. Right now I'm focused on The Surge 2 and I temporarily ditched the Dead Rising update I was planning before the Vulkan wrapper/driver release. After those two. I'm not sure what I'll do. I have to check my backlog.
Thank you very much, sir. I look forward to playing this game once awesome people like yourself get around to fixing it.

Have you tried running the game with the Mafia 3 profile (regular, not “definitive edition”)?
If you run the game with that profile (as it uses the same graphics engine) it will look a lot better. Not sure if it’s perfect but I have played it in 3D with this profile selected and looks great!

floph
Two Eyed Hopeful
Posts: 83
Joined: Sat May 30, 2020 4:52 pm

Re: Mafia: Definitive Edition (full remake DX11)

Post by floph »

a31632 wrote: Sun Oct 18, 2020 11:08 pm Have you tried running the game with the Mafia 3 profile (regular, not “definitive edition”)?
If you run the game with that profile (as it uses the same graphics engine) it will look a lot better. Not sure if it’s perfect but I have played it in 3D with this profile selected and looks great!
Sorry for asking a noob question, but what exactly are these profiles and how can they be changed ?
Thank you !

Lysander
Cross Eyed!
Posts: 180
Joined: Fri May 29, 2020 3:28 pm

Re: Mafia: Definitive Edition (full remake DX11)

Post by Lysander »

floph wrote: Tue Oct 20, 2020 7:44 am
a31632 wrote: Sun Oct 18, 2020 11:08 pm Have you tried running the game with the Mafia 3 profile (regular, not “definitive edition”)?
If you run the game with that profile (as it uses the same graphics engine) it will look a lot better. Not sure if it’s perfect but I have played it in 3D with this profile selected and looks great!
Sorry for asking a noob question, but what exactly are these profiles and how can they be changed ?
Thank you !
From a semi-noob to a noob: Download a thing called NVIDIA Profile Inspector (also comes with 3D Fix Manager under the Tools folder). When you open it up, select "Mafia III" from the long list and in there add the Mafia executable file to the list by clicking the "Add application to current profile" button. I don't know if you have to remove the exe from the original (Mafia) profile - try it if it doesn't work.

At least I think that's what they mean by using different profiles :D I had to do that for one of my games, I think it was a demo where I added the demo exe to the game's profile and it kicked the 3D in. Just trying to help. Hope it works, cheers.
Ryzen 5 3600X, RTX2060, 16GB ram, Windows 1909, nVidia 452.06, SSD.

a31632
One Eyed Hopeful
Posts: 22
Joined: Sun Jan 05, 2020 11:25 pm

Re: Mafia: Definitive Edition (full remake DX11)

Post by a31632 »

Lysander wrote: Tue Oct 20, 2020 8:24 am
floph wrote: Tue Oct 20, 2020 7:44 am
a31632 wrote: Sun Oct 18, 2020 11:08 pm Have you tried running the game with the Mafia 3 profile (regular, not “definitive edition”)?
If you run the game with that profile (as it uses the same graphics engine) it will look a lot better. Not sure if it’s perfect but I have played it in 3D with this profile selected and looks great!
Sorry for asking a noob question, but what exactly are these profiles and how can they be changed ?
Thank you !
From a semi-noob to a noob: Download a thing called NVIDIA Profile Inspector (also comes with 3D Fix Manager under the Tools folder). When you open it up, select "Mafia III" from the long list and in there add the Mafia executable file to the list by clicking the "Add application to current profile" button. I don't know if you have to remove the exe from the original (Mafia) profile - try it if it doesn't work.

At least I think that's what they mean by using different profiles :D I had to do that for one of my games, I think it was a demo where I added the demo exe to the game's profile and it kicked the 3D in. Just trying to help. Hope it works, cheers.

Yes, correct, this is how to do it.
Just make sure you don’t add the “launcher.exe” to it but the actual exe file.
You don’t have to delete anything as the “launcher.exe” is attached to the profile for the “definitive edition”.

Works great for me, been playing a lot and looks pretty good to me

Post Reply

Return to “NVIDIA GeForce 3D Vision Driver Forums”