3
\$\begingroup\$

I am trying to build a game for my son for the Oculus Rift DK2 to help treat his lazy eye using Unity.

I need objects that:

  • Appear only to his left eye
  • Appear only to his right eye
  • Appear for both eyes.
    (this helps force the brain to use both eyes together to form the complete scene)

How can I pull this off?

Thanks!

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I'm not sure about oculus rift but can you implement two cameras, one for each eye? And when you want to hide an object from one camera(eye) you can utilize the camera view layers? \$\endgroup\$
    – Savlon
    Commented Apr 8, 2015 at 12:34
  • \$\begingroup\$ @Savlon there are two cameras, but they're created by the Oculus plugin at runtime. Working with them at design-time is difficult. \$\endgroup\$
    – 3Dave
    Commented Jan 25, 2017 at 14:37

2 Answers 2

1
\$\begingroup\$

Use culling mask for each camera & use corresponding layer for intended object that supposed to disguise for that specific camera.

\$\endgroup\$
0
\$\begingroup\$

The most direct way, unfortunately, is to group the objects that you want to hide - layer, culling mask, custom property or whatever - and enable/disable them before rendering. You'd need to add a component to the Oculus cameras that, in a pre-render event handler, enable or disable the layers.

Note that, for each frame, you'll get at least two renders per update (assuming that your game isn't dropping frames) - one for each eye. In Update(), set a flag indicating that the current eye is left. At the end of the first render, change that flag - probably just an integer - to right, and enable / disable whatever you need to.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .