Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Little annoyances with the OVRController prefab

multimedialmultimedial Posts: 32
Brain Burst
edited September 2013 in Unity Development
Hi there,

as I am currently working in Unity a lot, I am using the OVRController as the main camera view in the world.

However, due to its structure, it is somewhat painful to use...

The main (empty?) gameobject at the top of the hierarchy which holds the two cameras does not provide a small preview window as a normal camera node does.

This makes setting up the scene correctly somewhat difficult.

With a normal camera node, I can select the node, then position the camera in the scene according to my needs when using just one big editing window. Unity will provide me a small preview window with the view of the camera which usually is enough for a first approximation of the camera position.

The prefab however does not do this. You must open the node, then select either camera node (or both) to get the same result.

Since I am doing this a lot with my other Unity projects, I have tendency to relocate the two camera nodes relative to their parent node (the regrouping empty game object)...

It would be nice if the main parent node could already provide the two small previews from the attached cameras, so that one could position the group without inadvertently moving the cameras...


There is also a background color selector for the parent node - but whatever color I choose there, the background color of the cameras is not being changed. Am I doing something wrong?

And finally, it would be nice if one could use normal prefabs like the skydoxes by assiging them to the parent node, as skybox prefabs individually assigned to the cameras are offset (has already been discussed here).

Thanks,

multimedial

Comments

  • CaliberMengskCaliberMengsk Posts: 312
    Hiro Protagonist
    Well, it wouldn't display both cameras, but instead of using an empty game object, you could use a camera that is disabled on start. That way you would get the preview (pretty close to the two cameras. If you have the ovr camera centered on the camera, then it'd be between the two eyes, and would be really close to the final product wanted).

    That said, you can just have your scene editor window and your game window displayed at the same time. Personally, with a 1080 resolution, there is plenty of room with a six panel environment (scene, game, inspector in the top, hierarchy, project, debug on bottom) that way I can always see the game view and still edit the scene.
  • brendenfrankbrendenfrank Posts: 32
    NerveGear
    If you have a second monitor, you can just put your game window fullscreen and share that monitor with your rift.
  • I'm having my settings discarded all the time too, I change the background colour, use all the save functions I know, and still it changes back to the dark blue... What am I doing wrong?

    Same goes for FOV settings.
  • CaliberMengskCaliberMengsk Posts: 312
    Hiro Protagonist
    envaal wrote:
    I'm having my settings discarded all the time too, I change the background colour, use all the save functions I know, and still it changes back to the dark blue... What am I doing wrong?

    Same goes for FOV settings.
    That's a bug. Find the "OVRCameraController.cs" script, and find the function where it sets the background color. Should look like this:
    public  Color       BackgroundColor
    	{
    		get{return backgroundColor;}
    		set{backgroundColor = value; UpdateCamerasDirtyFlag = true;}
    	}
    

    The line above that is where it defines the variable. Make it public, save it, and now setting the color on the main OVRCameraController object should now change it for both cameras (at least when the play button is hit)

    I set mine to black by default but all total that section should look like this:
    	// UNITY CAMERA FIELDS
    	// Set the background color for both cameras
    	public Color 		backgroundColor = Color.black;//new Color(0.192f, 0.302f, 0.475f, 1.0f);
    	public  Color       BackgroundColor
    	{
    		get{return backgroundColor;}
    		set{backgroundColor = value; UpdateCamerasDirtyFlag = true;}
    	}
    

    I'm fairly certain that if you did the same to the clipping planes below that section, it would also fix the issue with the clipping planes not updating. It would probably also fix the FOV not being able to be changed by many as well.
Sign In or Register to comment.