Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
aliss86's avatar
aliss86
Honored Guest
3 years ago
Solved

Rendering multiple cameras to each eye

Hey all, I'm trying to create an effect where there are hidden objects in the scene, which you only see if they're within a certain area of your vision.  I had gotten the effect to work with a single camera by setting hidden objects to a specific layer, adding a second camera as a child to the first with a Culling Mask set to that layer, setting Clear Flags to Depth only, setting the Depth to 1 (greater than the main camera) and then cropping the Viewport Rect to the area I was interested in.

 

However in porting this to the Quest, the effect breaks entirely.  If I create a child camera for each eye, I see the rectangular area I'm interested in, however it's all black, and only appears in one eye.  If I just create a child camera for the center eye, my entire vision is black.

 

Do any of you know why rendering multiple cameras would cause an issue like this?  Or can you think of a way to achieve this effect without multiple cameras?

  • I'd stick with a single OVRCameraRig.

     

    Then, for objects you want visible by range, attach a script to them to track their distance from the camera.  Use a transparent material and then base the alpha on the distance (lerp it from a specific distance away, it would fade in as the camera gets closer, clamp it to a certain close distance close to have full visibility for a range).

     

    That would look really cool actually, ghost objects.

     

     

2 Replies

Replies have been turned off for this discussion
  • I'd stick with a single OVRCameraRig.

     

    Then, for objects you want visible by range, attach a script to them to track their distance from the camera.  Use a transparent material and then base the alpha on the distance (lerp it from a specific distance away, it would fade in as the camera gets closer, clamp it to a certain close distance close to have full visibility for a range).

     

    That would look really cool actually, ghost objects.

     

     

  • aliss86's avatar
    aliss86
    Honored Guest

    Hey man, that was a great call.  I had hacked the solution by putting quads in front of your eyes that could act like portals, but I think I have it working using screen space coordinates and it's a lot more elegant.  Thanks!