Skip to main content
February 27, 2016

Getting Oculus Screen Size

Hello,

I create a render texture that uses the screen width and height at the start of runtime.

var renderTex = new RenderTexture(Screen.width, Screen.height, 24);


This works great in the editor, in both 2D and VR mode.

However, when I build and run using the standalone player it doesn't work in VR any longer.

I think it is because
Screen.width
is referring to the windowed standalone player and not what is displaying on the Oculus.

Is there a method to retrieve the Oculus screen width and height directly?

Thanks.
    This topic has been closed for replies.

    2 replies

    February 27, 2016
    I have just figured out the solution

    For some reason in the standalone player I have to use:

    Screen.width/2


    I'm not entirely sure why, but it seems to fix my problem.
    Inspiring
    February 27, 2016
    See https://developer.oculus.com/doc/0.1.0. ... splay.html. You need the eye bugfer size, which is part of the EyeRenderDesc in our Utilities.