Console rendered wrong on

Steps to reproduce:

Play in VR, press ‘`’ to pull up the console. Your eye’s won’t be able to properly converge on it as it is rendered with the wrong offset and depth.

I’ve tracked this down to FSteamVRHMD not implementing GetOrthoProjection. So instead it falls back on the base class’s version (FStereoRendering, in StereoRendering.h).

The fix should be to add:

virtual void GetOrthoProjection(int32 RTWidth, int32 RTHeight, float OrthoDistance, FMatrix OrthoProjection[2]) const override;

to the SteamVRHMD.h header under FSteamVRHMD. And then implement it in the cpp file.

The Oculus plugin does it correctly, and I tried looking at it to fix it on but I don’t understand orthographic view matrices enough to do it.

Hello muchcharles,

I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have also provided a link to the public tracker. Please feel free to visit the provided link for future updates.

Link: Unreal Engine Issues and Bug Tracker (UE-34597)

Make it a great day

Thanks.

This is a hack fix if anyone is interested. It isn’t properly calculated and if you ran SteamVR from a headset other than it might look off, because it isn’t actually based on the lens center offset from screen center, etc., it is just some values I found that work okish:

add this to SteamVRHMD.h:

 virtual void GetOrthoProjection(int32 RTWidth, int32 RTHeight, float OrthoDistance, FMatrix OrthoProjection[2]) const override;

and add this to SteamVRHMD.cpp:

 void FSteamVRHMD::GetOrthoProjection(int32 RTWidth, int32 RTHeight, float OrthoDistance, FMatrix OrthoProjection[2]) const
 {

     OrthoProjection[0] = OrthoProjection[1] = FMatrix::Identity;
     OrthoProjection[0] = FTranslationMatrix(FVector(RTWidth * -.0125, 0, 0));
     OrthoProjection[0].M[0][0] = .9;

     OrthoProjection[1] = FTranslationMatrix(FVector(OrthoProjection[1].M[0][3] * RTWidth * .25 + RTWidth * (.5 - .10), 0, 0));
     OrthoProjection[1].M[0][0] = .9;
 }

Hey Rudy,

I just saw this was fixed in 4.13, referencing UE-21424. You can probably close the UE-34597 you created for this as a duplicate of UE-21424.