praydog / UEVR

Universal Unreal Engine VR Mod (4.8 - 5.4)
http://uevr.io
3.08k stars 158 forks source link

Add the option to force symmetric projections in games with shader issues. #163

Closed kuby29 closed 7 months ago

kuby29 commented 9 months ago

certain shaders don't support the off-axis rendering that is necessary to display on certain VR headsets. this causes many weird visual issues on affected headsets (notably the clouds in ace combat 7, but there must be others.)

This could be addressed by forcing the renderer to render symmetrical projections, and adjusting the finished image after to compensate. This would have the drawback of cropping parts of the screens, a potential workaround for that would be to render beyond the visible area with a wider FOV, and zoom in the image to compensate. This would make it possible to work around the shader issues at the cost of some performance from the extra resolution.

praydog commented 9 months ago

@fholger has given some advice on this subject in the past, and some of his mods make use of this. So I'll probably look into that

mrbelowski commented 8 months ago

this is quite easy to do with OpenVR - you can override the projection matrix with a symmetrical one that uses the greater of each eye's left / right / top / bottom values then populate the existing VRTextureBounds_t left & right objects with the appropriate values to tell the compositor to use only a section of the eye texture.

This 'works' in so far as the projection looks correct and when toggling this on and off, you can see a slight difference in resolution (because it's submitting only part of the rendered scene).

There are 2 major issues. In the game I tried (Vampyr) it doesn't appear to make any difference - the fog is still only rendered in the left eye so I guess there's some other issue with that shader. It's also much less straightforward to do this with OpenXR. I don't think the submit process gives the same level of control but I'm no expert

mrbelowski commented 8 months ago

https://github.com/praydog/UEVR/pull/196

praydog commented 7 months ago

Added in 9074c01b9a1e819e5652af74d4931d714861402b

under Compatibility options.