Skip to content

Incorrect FOV conversion (might not affect real programs) #1716

@Sgeo

Description

@Sgeo

Describe the bug

The FOV conversion at

vr::VRTextureBounds_t CompositorBase::FovPortToTextureBounds(ovrFovPort eyeFov, ovrFovPort fov)
can be incorrect when the game-provided bounds are neither the default FOV bounds nor symmetrical. I imagine that those two cases do cover the vast majority of games. The attached reproduction is intentionally bizarre.

I believe that the correct calculation is taking the headset-suggested tan bounds and multiplying them by the game's projection matrix. If left tans were negative, then uMin = vrTanAngleLeft * 2 / (gameTanAngleRight - gameTanAngleLeft) - (gameTanAngleRight + gameTanAngleLeft) / (gameTanAngleRight - gameTanAngleLeft)

Even if I'm wrong about what the correct conversion is, the attached demo shows incorrect behavior in Revive.

To Reproduce
Steps to reproduce the behavior:
OculusRoomTiny_GL_modified.zip

  1. Run program, in Revive and on real Oculus headset

Expected behavior
The 3D view should look almost good, except there's a black area on most of the left of the view

Actual behavior
Weird distortion. The view is pushed excessively to the right, and does not behave properly as the head moves

Environment (please complete the following information):

  • App: Modified version of OculusRoomTiny_GL
  • OS: Win10
  • Headset: Oculus Quest 2

Versions (please complete the following information):

  • Revive: 2.1.1
  • SteamVR: beta 1.19.7

Additional context
The attached program contains the below code, to force an asymmetric FOV:

	hmdDesc.DefaultEyeFov[0].LeftTan = 0.17f;
	hmdDesc.DefaultEyeFov[1].LeftTan = 0.17f;

Screenshot of Oculus headset:
image

Screenshot of Revive:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions