Skip to main content
Up and Coming
May 3, 2013

How to apply the Rift specific skybox?

Hi,

I've made the unity car-tutorial rift-ready (see here).

I want to switch to using the special Rift skybox but don't know how to go about it.

Could someone provide the steps to take the skybox from the rift-unity integration packages and apply them to another scene/project?

Thanks, Adam
    This topic has been closed for replies.

    76 replies

    Participant
    February 11, 2014
    Thank you very much Nora for this script!!
    it 's very useful to me :)
    I uses your code to display panoramas in OVR!

    Is there a way to zoom in the sky box?
    with my usual code the field of view changes only for CameraRight but do not display any change wearing the oculus

    #pragma strict

    var minFov: float = 1f;
    var maxFov: float = 150f;
    var sensitivity: float = 20f;

    function Update () {
    var fov: float = Camera.main.fieldOfView;
    fov -= Input.GetAxis("Mouse ScrollWheel") * sensitivity;
    fov = Mathf.Clamp(fov, minFov, maxFov);
    Camera.main.fieldOfView = fov;
    }


    Is there something to change in the code?
    sh0v0r
    Up and Coming
    February 11, 2014
    "fanchois" wrote:

    Is there a way to zoom in the sky box?
    Is there something to change in the code?


    You need to modify the FOV of the Rift Cameras in the OVRController.
    Up and Coming
    February 12, 2014
    "fanchois" wrote:
    Thank you very much Nora for this script!!
    it 's very useful to me :)
    I uses your code to display panoramas in OVR!

    Is there a way to zoom in the sky box?
    with my usual code the field of view changes only for CameraRight but do not display any change wearing the oculus

    #pragma strict

    var minFov: float = 1f;
    var maxFov: float = 150f;
    var sensitivity: float = 20f;

    function Update () {
    var fov: float = Camera.main.fieldOfView;
    fov -= Input.GetAxis("Mouse ScrollWheel") * sensitivity;
    fov = Mathf.Clamp(fov, minFov, maxFov);
    Camera.main.fieldOfView = fov;
    }


    Is there something to change in the code?


    Change 'Camera.main' to just 'camera' and attach to both right and left Oculus cameras. Although it might be better to have just one script which access both right/left cameras....
    Participant
    February 13, 2014
    "sh0v0r" wrote:
    You need to modify the FOV of the Rift Cameras in the OVRController.

    That's what I do in the given code

    "DaveA" wrote:

    Change 'Camera.main' to just 'camera' and attach to both right and left Oculus cameras. Although it might be better to have just one script which access both right/left cameras....


    Thank you DaveA, the field of view changes for both cameras. The only problem is that the zoom still does not work...
    In the inspector I see the FOV changing while rolling the wheel, but without any display change in my panorama.

    If someone have an other idea it would be very helpful because the zoom is the last useful thing to add to this scene! :)
    Participant
    February 19, 2014
    I've found something about my problem
    it seems that the FOV is defined at starting game, but cannot be updated during the game
    Up and Coming
    February 19, 2014
    "fanchois" wrote:
    "sh0v0r" wrote:
    You need to modify the FOV of the Rift Cameras in the OVRController.

    That's what I do in the given code

    "DaveA" wrote:

    Change 'Camera.main' to just 'camera' and attach to both right and left Oculus cameras. Although it might be better to have just one script which access both right/left cameras....


    Thank you DaveA, the field of view changes for both cameras. The only problem is that the zoom still does not work...
    In the inspector I see the FOV changing while rolling the wheel, but without any display change in my panorama.

    If someone have an other idea it would be very helpful because the zoom is the last useful thing to add to this scene! :)


    'Solar System Explorer' has a good zoom function. Try out the demo if you haven't already. Not sure how it's done though sorry.

    https://developer.oculusvr.com/forums/viewtopic.php?f=29&t=6321

    Maybe you can contact the dev for some advice?

    Hope this helps anyway.
    Up and Coming
    March 20, 2014
    "Nora" wrote:
    I have prepared a script that can be used to generate a mesh of Skybox.



    Hi Nora,

    Many thanks for the great script, I am using it but would like to ask a question, if I rotate the game object how can I prevent the skybox from rotating with the gameobject rotation? I recall seeing an option for this but in the newer script version I don't see this anymore.
    Could ask for your advise on how I could make it not to rotate?

    Many thanks,
    Kim
    Up and Coming
    March 20, 2014
    "khos85" wrote:
    "Nora" wrote:
    I have prepared a script that can be used to generate a mesh of Skybox.



    Hi Nora,

    Many thanks for the great script, I am using it but would like to ask a question, if I rotate the game object how can I prevent the skybox from rotating with the gameobject rotation? I recall seeing an option for this but in the newer script version I don't see this anymore.
    Could ask for your advise on how I could make it not to rotate?

    Many thanks,
    Kim


    Nevermind I figured it out :) I have to attach it to a non moving object, simple.
    Participant
    March 20, 2014
    Hi all,
    I finally found the solution for zooming:
    adding a small update function in OVRCameraController.cs
    // Update 
    new void Update()
    {
    float minFov = 1f;
    float maxFov = 150f;
    float sensitivity = 20f;
    base.Update();
    UpdateCameras();
    VerticalFOV = verticalFOV- Input.GetAxis("Mouse ScrollWheel") * sensitivity;
    VerticalFOV = Mathf.Clamp(VerticalFOV, minFov, maxFov);
    }

    and bingo! I can zoom in oculus
    hope this will help someone
    without this function, the FOV is set one for all at start and cannot been updated
    cheers

    EDIT: sorry for my previous post in French...
    Longue vie a l'OVR!!
    Up and Coming
    April 3, 2014
    Is this still the common way to get skyboxes to work?