Skip to main content
New Participant
February 2, 2015

Need to disable movement completely

Here's what we're trying to do:

We've mounted a physical camera device on the oculus, and we just want to show the output of the camera on a texture on the scene, and overlay various indicators/whatever on the scene. So we've got that working nicely, but the camera rig keeps changing its position when the user moves their head -- which is definitely not what we want (since it's showing the outside camera output... don't need it).

Basically, we don't want it to be a VR headset right now, just want the oculus to be a nice passthrough display.

Using unity pro and the latest sdk... 0.4.3 I think?

I've seen previous suggestions to disable the UpdateAnchors() function, but that just makes the game view shake a LOT. Using the various options on the rig doesn't seem to make any difference either (disable position tracking, etc). Any thoughts on how to do this?
    This topic has been closed for replies.

    83 replies

    Participant
    February 11, 2017
    @JianZ, thanks for the hints. The story with OVROverlay started to avoid wobbling when OVRCameraRig's children are manually repositioned by scripts with custom VR camera position/rotation logic based on current actual HMD pose in real world (see example video with this logic here - I'm talking about the variation with external gamepad on 0:09 where the camera flies around a shape pivot point when a player rotates HMD). So there is no any single GameObject which should be rendered with default HMD tracking logic - that's why CullingMask on LeftEyeAnchor / RightEyeAnchor cameras is set to Nothing. CullingMask for RightEye/LeftEye camera just filters hidden service layers with helper objects. If I got your point correctly, then there is no way to get proper eye images for RightEye/LeftEye camera with Render to Textures mode on. If this is the case, then the whole point in using OVROverlay is missing in my scenario.
    So I'm asking once again - is there a technical possibility to implement in Unity 5.5.1 my head tracking scenario which avoids interference with TimeWarp? Maybe disabling of VR supported checkbox will help? And what camera setup should I use in this case? Any hint is highly appreciated, because I don't want to downgrade my project to Unity 4 (the same codebase is used for released project on Unity 5).
    Inspiring
    February 12, 2017
    @AnRaEl. Sorry I read through the whole thread, still not quite get what you want to do, let me guess.

    so you have your own image rendered  from somewhere( separated rendertotexture camera?), and you want to pass it through to the hmd, but you find the image you passed in isn't stay the same screen position when you were turning your head? And you think it is caused by time warp? Is my understanding right?
    Participant
    February 12, 2017
    @JianZ, yes and no  :)
    Rendertotexture camera came out of @imperativity advice for my scenario to use OVROverlay for rendering to avoid TimeWarp (if I understood him correctly). Originally, I need to be able to display a scene with a VR camera that has a custom HMD rotation representation. Imagine that there is a pivot point on a scene and an ellipse around this point. Each quaternion of HMD rotation in real world is translated into a point on this ellipse. VR camera should be placed to this point every frame (this is how position is calculated) and a pivot point look adjustment for camera rotation then applied (this is how rotation is calculated). When I try to trick Unity and apply this custom pose to my VR camera (OVRCameraRig is parented to a correct point on ellipse in the object hierarchy), TimeWarp interferes in this process (I guess from another thread) and discards my custom pose in an unpredictable manner. So this is the issue I'm fighting with.
    Inspiring
    February 12, 2017
    @AnRaEl ok, I think I understand now, somehow you want to control the vr camera's pose by ignoring the hmd tracking data? 
    Participant
    February 12, 2017
    @JianZ exactly! However, I need also to capture HMD pose for my calculations. 
    Inspiring
    February 13, 2017
    Ok,  a few clarifications here
    1. Turn off the VR Support checkbox won't work, since you will lost the ability to send any image to the HMD
    2. Disable Time warp isn't supported, we don't open it to developer any more.
    For your case,  we generally give developers suggestion " Don't do that" since it will make player sick if he can't control his own HMD's pose,  However, you probably have your own reasons, so I'm not going to judge it,  here I'm trying to give suggestions I can

    The possible solution I can think of :
    1.  Setup your own render to texture cameras ManualCameraLeft/ManualCameraRight ( pure unity cameras, not ovrCameraRig ), however you need manually setup the camera parameters to make it same as stereo camera ( correct FOV and IPD ) ,  render your scene into to 2 texture RTLeftEye and RTRightEye,  those texture's size should equal to standard eyeTexture size ( different on Gear and Rift ), then you have completely control what can be rendered into the 2 textures

    2.  Create another set of Stereo cameras ( no renderToTexture ), HMDLeftCamera ( Target Eye = Left ) and HMDRightCamera( Target Eye = Right), these 2 camera's pose is controlled by HMD tracking,  put 1 quad game object as a child of HMDLeftCamera, use RTLeftEye as the material texture of the quad and set culling mask to make the the quad only visible to HMDLeftCamera, adjusting the quad size to make it exactly cover your HMDLeftCamera's view.  Do the same to HMDRightCamera with another quad and source texture is RTRightEye.

    3. Change HMDLeftCamera/HMDRightCamera's depth to make it render after ManualCameraleft/ManualCameraRight.


    By this way,  you HMD camera are seeing screen(eye) faced Quad rendered from your ManualCamera no matter what the HMD pose is, and you have completely control of your ManualCameras
    I think this should work good enough.

    Good luck

    Again, I don't recommend anyone doing this setup unless you have absolute good reason.
    Participant
    February 13, 2017
    @JianZ, thanks a lot for this advice - I'll give it a try and come back with the conclusion. Currently I have a clarifying question about this setup: how to determine a proper eye texture size and IPD at runtime?
    Inspiring
    February 13, 2017
    for eyetexture size, check the unity manual
    https://docs.unity3d.com/ScriptReference/VR.VRSettings.html

    for ipd:
    if you searched the OvrUtils package, you can find OVRPlugin.ipd ,

    Participant
    February 13, 2017
    I'm back with the results. It took a while to try different combinations around the solution proposed by @JianZ, but unfortunately non of them worked on the device (in the Editor all of them worked as expected).
    In theory the solution looks pretty solid, but in practice I see a still quad with dynamic textures for the initial HMD orientation at the time of app launch (looks like the quad is located outside of HMDLeftCamera/HMDRightCamera while it's not true). Distortion is not applied to the render textures. Depth for ManualCameraLeft/ManualCameraRight is set to -1, depth for HMDLeftCamera/HMDRightCamera is set to 1. 
    I tried to place quads under LeftEyeAnchor/RightEyeAnchor with UsePerEyeCameras=true, CenterEyeAnchor with UsePerEyeCameras=false, created new game objects HMDLeftCamera/HMDRightCamera under OVRCameraRig/TrackingSpace with UsePerEyeCameras=true and false (LeftEyeAnchor/RightEyeAnchor cameras culling mask was set to Nothing in this and further cases), moved HMDLeftCamera/HMDRightCamera outside of OVRCameraRig hierarchy with the same result in all cases. Also I'd like to note that the quad is not quite still - it seems like pulsing from time to time as if TimeWarp interferes in some fancy way.
    Additional note is about "pure unity cameras, not ovrCameraRig" - once the VR checkbox is checked in Unity, all cameras become stereo. But if you mean to create ManualCameraLeft/ManualCameraRight outside of OVRCameraRig hierarchy then yes, they were created that way.
    Participant
    February 21, 2017
    I'm back with the results. It took a while to try different combinations around the solution proposed by @JianZ, but unfortunately non of them worked on the device (in the Editor all of them worked as expected).

    In theory the solution looks pretty solid, but in practice I see a still quad with dynamic textures for the initial HMD orientation at the time of app launch (looks like the quad is located outside of HMDLeftCamera/HMDRightCamera while it's not true). Distortion is not applied to the render textures. Depth for ManualCameraLeft/ManualCameraRight is set to -1, depth for HMDLeftCamera/HMDRightCamera is set to 1. 
    I tried to place quads under LeftEyeAnchor/RightEyeAnchor with UsePerEyeCameras=true, CenterEyeAnchor with UsePerEyeCameras=false, created new game objects HMDLeftCamera/HMDRightCamera under OVRCameraRig/TrackingSpace with UsePerEyeCameras=true and false (LeftEyeAnchor/RightEyeAnchor cameras culling mask was set to Nothing in this and further cases), moved HMDLeftCamera/HMDRightCamera outside of OVRCameraRig hierarchy with the same result in all cases. Also I'd like to note that the quad is not quite still - it seems like pulsing from time to time as if TimeWarp interferes in some fancy way.
    Additional note is about "pure unity cameras, not ovrCameraRig" - once the VR checkbox is checked in Unity, all cameras become stereo. But if you mean to create ManualCameraLeft/ManualCameraRight outside of OVRCameraRig hierarchy then yes, they were created that way. Does it mean a deadend or there are more ideas how to overcome my issues?