fholger / vrperfkit

VR Performance Toolkit
Other
1.3k stars 53 forks source link

Crashes with new Reshade 5.0 #36

Open vrnord opened 2 years ago

vrnord commented 2 years ago

Excited to try out the new Reshade 5.0 with supposed performance improvements and built-in SteamVR support, but SkyrimVR crashes every time (and froze the entire computer one time) when Vrperfkit is also enabled. This is whether Reshade 5.0's dll is renamed as d3d11 or dinput8: the normal load screen appears that says Reshade 5.0 is loading, then the game crashes. Switching back to your version of Reshade's dll renamed d3d11 works normally.

The logs are interesting - Reshade 5.0 (dinput8) says it is terminating due to DXGI, and the Vrperfkit log appears to be endlessly setting texture sizes.

Thanks!

DINPUT8.log vrperfkit.log

drowhunter commented 2 years ago

Doesn't Reshade and VRPerfkit both inject using dxgi.dll ?

I would think this would make them totally incompatible.

vrnord commented 2 years ago

No you can rename the 4.x Reshade dll to d3d11.dll and then both function, that is well known.

However 5.0 seems to be incompatible.

speed-of-heat commented 2 years ago

works OK for me but i rename the vrperfkit dll to d3d11.dll rather than the reshade dll.

vrnord commented 2 years ago

OK I tried that and it didn't crash this time, however now there are several errors in the Vrperfkit log like this: "(!) ERROR: Failed to install hook for CreateDXGIFactory" so not sure if it is working properly when renamed?

Vrperfkit log when renamed to d3d11.dll: vrperfkit.log

DJSlane commented 2 years ago

Glad to see @speed-of-heat to be interested in this. I think you've had some good tips in other forums! Did you see the DCS mod for FFR in the fork: https://github.com/cedriclmenard/vrperfkit This now appears to be ~8%FPS boost on my Pimax.

speed-of-heat commented 2 years ago

yes, i did and was "testing" it with just the frame rate counter last night before i went to bed, and I saw a "good" improvement, so thanks for that @DJSlane any chance that this will get pulled into the core build by @fholger ? or are the changes DCS specific only?

DJSlane commented 2 years ago

It should! It should! I can't believe it works not only for DCS but FFR even works for Elite Dangerous (it probably did before the fork). I've simply never seen better performance. This is a real game-changer. Regrettably I've noted that the focal centers don't line up with Pimax canted displays - not a big deal as with a setting of 0.9 radius - you still save about 5-10% frame time. Only a small portion is even within the frustrum anyway. I simply suspect that if we could in any way adjust the focal point left or right on each eye I feel it would enable even more performance. Currently at 0.9 radius I can start to see the resolution decrease in the inner portion of my FOV - that is: toward the nose. Sadly I then realized that the outer portion is almost entirely covered by the full rendering resolution. So in effect, I could probably double the performance boost or more by having the ability to change the location of the Fovea in each eye either manually or by some setting made for Pimax etc. Since when I'm using the Pimax, the first 100 degrees of FOV are core, the rest is merely for immersion. All I know is I hope @fholger and @cedriclmenard and others continue to develop this mod even further to include more games, headsets and settings. And that they know that what they are doing is nothing short of advancing VR at least by a year or two in terms of what VR games can do.

fholger commented 2 years ago

The mod does calculate the proper focal point for Pimax. The issue, however, is that in some games it is impossible to know when the game is rendering which eye. This is why in such instances I do not apply any foveation at all. Cedric's version in these instances instead applies foveation with a focal point in the center of the image, which is obviously not correct, but works without knowing which eye is rendered. So in short, there is no simple way to make this work properly in all games. It does work correctly in most Unity and Unreal games, but custom engines are a different matter.

DJSlane commented 2 years ago

Incredibly interesting. So for the upscaler radius we can assign which eye it's rendering, but not for the FFR? FFR must be at a different process in the pipeline. That is to say: FFR is at the pre-render level, CAS and sharpening is in post? Have I got that right?

fholger commented 2 years ago

Yes, that's correct.

drowhunter commented 2 years ago

So the chances of this getting pulled in is slim in its current state.

However since it can work I wonder if it would be possible to allow FFR in these scenarios via an option? (Just include a comment saying Use at your own risk , and your Milage may Vary"

Knowing that it can work but wont be perfect can be better than not having it at all. Even better as was mentioned above can we have an option to tweak it manually?

drowhunter commented 2 years ago

Oh and 1 more thing @fholger ,

now that reshade 5 is out and has VR support would it be possible since they both seem to hook the same way.

For you to develop your perfkit as an official reshade plugin, with all options tweakabke within its UI?

That would be so much cooler than having to use the Ctrl-F Keys?

cedriclmenard commented 2 years ago

IMO I don’t think it should be part of @fholger excellent tool kit. It is a hacky workaround.

And at the end of the day, this kit still requires per-game installation.

I’ll keep my fork updated with this repo’s master for as long as I can.

drowhunter commented 2 years ago

Well if it was a hidden option it might be cool, because we need to install it per game anyway. 😉

DJSlane commented 2 years ago

Too humble perhaps! The problem also comes from the lack of support for non-parallel projection in many games. For example DCS does have the correct Foveated center on each eye. So the problem isn't necessarily @cedriclmenard's implementation. Rather, the games have to allow for non-parallel projection. After using the mod for a while I think it should be merged because it seems to work as a fall-back method. So although you meant for this to work only for DCS. I've successfully used it now in Elite Dangerous and Subnautica SubZero. -- In each case providing 5-10% benefit without being at all noticeable. Before, they didn't work at all as I recall.

In short, I think a fall-back method of using the center of the frame (regardless of eye) is an excellent addition to the mod.

fholger commented 2 years ago

Oh and 1 more thing @fholger ,

now that reshade 5 is out and has VR support would it be possible since they both seem to hook the same way.

For you to develop your perfkit as an official reshade plugin, with all options tweakabke within its UI?

That would be so much cooler than having to use the Ctrl-F Keys?

The fixed foveation could absolutely work as a Reshade plugin, and I'm seriously considering it as it would be much easier to make it work with APIs other than D3D11. The upscaling part, however, is trickier, because Reshade currently has absolutely no concepts to enable that and would require some ground work to be done in Reshade, first.

drowhunter commented 2 years ago

The fixed foveation could absolutely work as a Reshade plugin, and I'm seriously considering it as it would be much easier to make it work with APIs other than D3D11. The upscaling part, however, is trickier, because Reshade currently has absolutely no concepts to enable that and would require some ground work to be done in Reshade, first

I just imagined adjusting the fov radius and sharpening strength via reshade sliders and it made me giddy. 😁

As for the ground work in reshade, it's a good thing they accept PR's 😉

fholger commented 2 years ago

Yeah, but this wouldn't be just an afternoon's amount of work, and I am rather busy with other projects ;)

speed-of-heat commented 2 years ago

Okay it sounds like that's a committed plan ;)

drowhunter commented 2 years ago

No doubt, take your time.

There already is an AMD CAS plugin in reshade 5 right now. So I see no reason why FFR couldn't be there as well.

r4Th-dev commented 2 years ago

@cedriclmenard I tried the FFR with DCS with an Oculus Quest 2 and it worked BUT only when I don't modify the "FOV-Tangent Multiplier". I usually set it to 0.8;0.8 and with this DCS will crash once you enter a Map (Main Menu works perfectly)

drowhunter commented 2 years ago

I just noticed over on the OpenXR Toolkit, they have implemented what we want. Its also kind of cool they have an overlay. Apparently they are using the same code as this project, I wonder if that overlay they are using could make it's way over here?

https://github.com/mbucchia/OpenXR-Toolkit/issues/115#issuecomment-1047371481