I'd like to be able to see the output for both eyes in Unity 5. Using the latest OVR plugin, unity only shows a single eye. Also, it appears to be rendering monoscopic even to the headset.
I'd love an example that would let me show a blue rect on the left eye, red on the right and see both (blue and red) on the primary monitor.
Suggestions?
答案 0 :(得分:2)
回过头来解决了这个问题。基本上,每帧可以获得2次渲染和1次更新。
(伪代码)
int Eye=0;
Update()
{
// reset to left eye for this frame
Eye=0;
}
Render()
{
// generate different content based on which view
// (eye, editor game view) is being rendering
switch(Eye){
case 0: renderLeft(); break;
case 1: renderRight(); break;
default: renderSomethingInEditor();
}
// increment to next view, will be used by next render in this frame.
++Eye;
}
立体渲染要求每只眼睛的视图/投影矩阵不同。眼睛被有效地视为单独的相机,稍微偏移以反映用户的IPD。所以,游戏循环运行如下:
在VR中,每次更新总是至少两次呈现
。