fholger / openvr_fsr

Add Image Upscaling via AMD FidelityFX SuperResolution or NVIDIA Image Scaling to SteamVR games
Other
1.71k stars 63 forks source link

Not Working as Expected in HellBlade Senua' Sacrifice VR #12

Closed VWP92 closed 3 years ago

VWP92 commented 3 years ago

I've applied this mod to Hellblade VR and the resolution scaling doesn't seem to work. The sharpening seems to do something because image looks to be a little sharper but performance is slightly worse than it would be without the mod by about 10FPS on my system.

fholger commented 3 years ago

If there is a difference in behaviour, then it sounds like the mod is working, in principle. You can check the log file openvr_mod.log that should be created where the openvr_api.dll resides, or post it here and I can tell you if the mod is doing things.

As for performance: FSR is not free. It comes with a fixed performance cost that depends on your graphics card and the target resolution. To see a performance benefit from FSR, the game must profit enough from rendering to a lower resolution to offset the cost of FSR. But that only works if the game is primarily GPU-bound. If the bottleneck is on the CPU side, then it is entirely possible that FSR shows no benefits or might even make it worse.

VWP92 commented 3 years ago

The game is not CPU bound at all. I actually normally play this game at 75% resolution scale to reach my 90FPS target but I wanted to use this mod to get some image quality back. So I installed the mod and set set my headset resolution scale back to 1 and FSR mod to 77% ("Ultra mode"), left the Sharpening at 75% and I got the results results I mentioned above. Performance is worse then it normally is when I have resolution scale set to 1 on my headset without the mod.

I'll post the log you mentioned here in a little while.

VWP92 commented 3 years ago

Below is what I got from the openvr_mod.txt file.

Initializing hooks... Requested interface IVRSystem_012 Injecting GetRecommendedRenderTargetSize into IVRSystem_012 Requested interface IVRSystem_012 Requested interface IVRCompositor_016 Injecting Submit into IVRCompositor_016 Requested interface IVROverlay_013 Requested interface IVRExtendedDisplay_001 Requested interface IVRChaperone_003 Creating post-processing resources Creating upscaled texture of size 11207x4785 Creating sharpened texture of size 11207x4785 Creating shader resource view for input texture 000001F240132378 Texture has size 8630x3685 Mapping format 5a Texture size changed, recreating resources... Creating post-processing resources Creating upscaled texture of size 8005x3418 Creating sharpened texture of size 8005x3418 Creating shader resource view for input texture 000001F24021FC38 Texture has size 6164x2632 Mapping format 5a Texture size changed, recreating resources... Creating post-processing resources Creating upscaled texture of size 11207x4785 Creating sharpened texture of size 11207x4785 Creating shader resource view for input texture 000001F240302338 Texture has size 8630x3685 Mapping format 5a Shutting down hooks...

fholger commented 3 years ago

So, the mod is working, but it looks like your render resolution is pretty high. FSR's cost depends on the target resolution, which in your case is pretty large. That's why it's costing you performance. You'd probably have to lower the renderScale parameter of the mod until you begin seeing a benefit.

VWP92 commented 3 years ago

I will try to lower it lower and see what happens but nothing changes when I put the resolution scale higher at 1.25 either, performance is still the same and it even looked the same. That log I posted was with FSR scale set to 0.77. My resolution per eye in Steam VR is 3080x2632

fholger commented 3 years ago

Then it looks like the game is not recognizing the mod's request to render at a lower resolution, because from the logs it is still rendering to 3080x2632, and then FSR is upscaling it to a higher resolution, which is expensive.

As a workaround, you might have to actually lower the resolution in SteamVR and instead set a renderScale > 1 to match your original resolution. E.g. for FSR ultra quality, set your SteamVR resolution to something close to 2372x2027 and set renderScale in the mod config to 1.3.

VWP92 commented 3 years ago

OK so just fyi I have a Pimax 5K Super HMD. So I left the resolution scale in PiTools for the HMD at 1.00, which is what I normally do when I have the mod active anyway so that's not effecting anything. In Steam VR I set the resolution to 60% which ends up around 2384x2036, that's as close to the resolution you mentioned as I can get. Then I set the resolution scale in FSR mod to 1.3 and that works out! I'm getting pretty close to the flat 90FPS I would normally get when I use to just set the resolution scale in PiTools to 0.75 while getting near the image quality of setting the resolution to the full 1.00. It's really crazy how well FSR works in VR.

It's strange that this game specifically is giving this issue. I've tried this mod in Assetto Corsa Competizione and Project Wingman, both use UE4 and all I have to so it set Pitools and SteamVR resolution scaled to 100% and this just change the resolution in the FSR Mod and it works great. I guess Hellblade is doing something different when it comes to the resolution?

Below is what the mod's log shows after I made the changes you mentioned.

Initializing hooks... Requested interface IVRSystem_012 Injecting GetRecommendedRenderTargetSize into IVRSystem_012 Requested interface IVRSystem_012 Requested interface IVRCompositor_016 Injecting Submit into IVRCompositor_016 Requested interface IVROverlay_013 Requested interface IVRExtendedDisplay_001 Requested interface IVRChaperone_003 Creating post-processing resources Creating upscaled texture of size 11219x4790 Creating sharpened texture of size 11219x4790 Creating shader resource view for input texture 00000217C35800F8 Texture has size 8630x3685 Mapping format 5a Texture size changed, recreating resources... Creating post-processing resources Creating upscaled texture of size 5609x2395 Creating sharpened texture of size 5609x2395 Creating shader resource view for input texture 00000217C35803B8 Texture has size 4315x1843 Mapping format 5a Texture size changed, recreating resources... Creating post-processing resources Creating upscaled texture of size 11219x4790 Creating sharpened texture of size 11219x4790 Creating shader resource view for input texture 000002178D293578 Texture has size 8630x3685 Mapping format 5a Shutting down hooks...

fholger commented 3 years ago

Yeah, it's doing something strange for sure. Will have to investigate closer.

VWP92 commented 3 years ago

I'm sorry I completely forget that I lowered the in game resolution last time I was experimenting with FSR and forgot to turn that back to 100% as well, man all these resolution scaled are getting confusing. But in this mistake I found this out...it seems Hellblade is completely ignoring SteamVR and the FSR Mod (when below 1.00?) resolution scale and only following the ingame resolution scale.

I new have SteamVR resolution set to 50% and FSR mod set to 1.42 while the ingame resolution scale is at 100% this time and below is what the Log shows now. The game seems to just ignore SteamVR and renders at the headset's full 3080x2632 from what is looks like.

Initializing hooks... Requested interface IVRSystem_012 Injecting GetRecommendedRenderTargetSize into IVRSystem_012 Requested interface IVRSystem_012 Requested interface IVRCompositor_016 Injecting Submit into IVRCompositor_016 Requested interface IVROverlay_013 Requested interface IVRExtendedDisplay_001 Requested interface IVRChaperone_003 Creating post-processing resources Creating upscaled texture of size 12254x5232 Creating sharpened texture of size 12254x5232 Creating shader resource view for input texture 000001F18EAA1578 Texture has size 8630x3685 Mapping format 5a Texture size changed, recreating resources... Creating post-processing resources Creating upscaled texture of size 8752x3737 Creating sharpened texture of size 8752x3737 Creating shader resource view for input texture 000001F18EAA12B8 Texture has size 6164x2632 Mapping format 5a Texture size changed, recreating resources... Creating post-processing resources Creating upscaled texture of size 12254x5232 Creating sharpened texture of size 12254x5232 Creating shader resource view for input texture 000001F2FE3712F8 Texture has size 8630x3685 Mapping format 5a

So now after figuring this out I've set the ingame resolution scale to 60% which puts my close to the 2372x2027 that you mentioned before, Pitools and SteamVR at 100% and FSR mod at the 1.3 you mentioned and that's giving me a great experience. Performance is at my target 90FPS and picture quality looks much better than using the ingame resolution scale by it self, the mod is definitely doing something lol.

fholger commented 3 years ago

Looks like it, yeah. But it still has to get the HMD resolution from somewhere. If I can figure out what it's doing, I might still be able to inject the downscale.

fholger commented 3 years ago

I had a look at it, and I think it actually works fine. However, the game has its own internal resolution scaling, and that can mess up the results. There is a render scale setting in the graphics options that, similar to SteamVR, will increase or decrease the render resolution. More importantly, there is also the "Performance Mode" setting in the main options that apparently triggers a dynamic resolution scale, so that, too, can get the game to render at a higher resolution. When I disable both of these options, everything appears to work as expected, so I'm going to close this issue.