I am creating a stereo setup for an application using two separate cameras - and I was hoping to use a single stereo camera. I also have two flats in the middle of my scene - each one only displays to a single eye by using camera masks - to complete a stereo image. I’d like to move to a single stereo camera for performance reasons (one cull pass), but I am unable to set different ‘camera masks’ on each display region - only on the single stereo camera. Is there a way to get these two to play together currently, and if there is no current way, what would I have to do to get them to work together?
Hmm, that’s a bit tricky, for the precise reason that the key thing the cull pass does is to build up the list of objects to be rendered. Thus, if your left and right channels share a cull pass, it follows that they must be rendering exactly the same set of objects. So it’s not possible to have one card visible only on the right, and a different card visible only on the left, with a single stereo camera.
I suppose it would be theoretically possible to define a concept like a “stereo texture”. This texture would have two images internally; it would display one image when it is rendered in the left channel of a stereo camera, and the other image when it is rendered in the right channel. Then you could apply this magic texture to a single card that would be visible by both the left and right channels, and the same cull pass could then serve both channels; the distinction between them would be made at draw time instead of at cull time.
But we don’t have any concept of a stereo texture right now.
I wasn’t quite sure how the camera masks worked - if it happened in the cull pass or if it happened in the render pass. A stereo texture would work, and I could just do that in a shader - just branch off of which modelview matrix I have v. which one I want.