Skip to content

Conversation

DuFF14
Copy link
Member

@DuFF14 DuFF14 commented Aug 24, 2015

Setting up rendering from new ClientKit functionality. No longer parsing display config in Unity. This implementation assumes exactly one viewer and one surface per eye. Latency feels a little high. This isn't ready for a merge, but would like a review/comments.

The example scene is displayController.unity

DuFF14 added 30 commits August 18, 2015 00:16
…SetupDisplay() from Start(), although it probably won't succeed in Start.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the guts of the new implementation. Would like a review here. Do we also need to do anything in VRSurface::OnPreRender(), or will this suffice?

@DuFF14
Copy link
Member Author

DuFF14 commented Sep 1, 2015

Still need to update demo scenes, prefabs, and maybe some cleanup. Can VRDisplayTracked prefabs go away?

…layController" but it's the same prefab.

Removed test scene displayController.unity and DisplayController prefab.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to let the developer set IPD through the inspector here? Usually would be part of a user profile, but a developer might want to modify this temporarily for artistic effect. If not here, where?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nowhere - this is part of the problem with the existing solution. Simulator sickness is not an artistic effect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and actually, isn't there already a control in the camera component for the near and far plane? No need to duplicate, just use those - they're the only settings from the camera we'll not override.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no longer a camera component in the scene, it gets created at runtime and initialized with these variables.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked about IPD because Cardboard allows FOV to be changed for special effect: https://github.com/googlesamples/cardboard-unity/blob/91bdb1c00ac35e14f0f403bc4ede49670dad8008/Cardboard/Scripts/StereoController.cs#L76

Could be used in a game if the player could change size (would a smaller IPD make everything look bigger?). Agreed that it shouldn't really be tampered with in most cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You change size by adjusting the room-to-world matrix and doing a scale change there. Everything in room space needs to stay the same for consistent viewing.

@DuFF14
Copy link
Member Author

DuFF14 commented Sep 2, 2015

Added a lot of comments and made some structural changes towards supporting multiple viewers and surfaces, but still ensuring there is only 1 of each right now. This involved moving our main "stereo rendering update loop" (OnPreCull and EndOfFrame coroutine) to DisplayController rather than having these in VRViewer. DisplayController now owns the dummy camera. The properties of this camera are copied to each VRSurface camera. I made a todo for copying any other effects that may be attached to the dummy camera that a developer might want attached to each surface camera.

The client is currently being updated before each GetViewerPose() and before each GetViewerEyePose(), as well as in ClientKit::Update() and ClientKit::LateUpdate().

@DuFF14
Copy link
Member Author

DuFF14 commented Sep 9, 2015

Exception being thrown when getting viewer or eye pose but no HMD is connected. Put this in a try/catch? Error message:

InvalidOperationException: [OSVR] DisplayConfig.GetViewerEyePose(): native osvrClientGetViewerPose call failed.
OSVR.ClientKit.DisplayConfig.CheckSuccess (Byte returnCode, System.String message) (at z:/jenkins-node/workspace/Managed-OSVR/ClientKit/Display.cs:187)
OSVR.ClientKit.DisplayConfig.GetViewerEyePose (UInt32 viewer, Byte eye) (at z:/jenkins-node/workspace/Managed-OSVR/ClientKit/Display.cs:276)
OSVR.Unity.VRViewer.UpdateEyes () (at Assets/OSVRUnity/src/VRViewer.cs:98)
OSVR.Unity.DisplayController.OnPreCull () (at Assets/OSVRUnity/src/DisplayController.cs:240)

… has received its first pose. This fixes the error when no HMD is connected.
@DuFF14
Copy link
Member Author

DuFF14 commented Sep 10, 2015

The error above has been fixed with latest commit. Just need confirmation that this doesn't introduce ghosting/lag before merging. Unable to test with HDK.

Conflicts:
	OSVR-Unity/Assets/OSVRUnity/src/VREye.cs
	OSVR-Unity/Assets/OSVRUnity/src/VRHead.cs
DuFF14 added a commit that referenced this pull request Sep 13, 2015
Unity now retrieves the output of the computational display model from the OSVR-Core API
@DuFF14 DuFF14 merged commit 34fd6f1 into master Sep 13, 2015
@DuFF14 DuFF14 deleted the clientKitRenderParams branch December 9, 2015 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants