I’m currently attempting to display different objects per eye Camera via the Google Cardboard Package.
It seems the heirarchy contains:
Main Camera
Main Camera Left
Main Camera Right
It’s somehow set up to propagate all settings (including culling masks) from the Main Camera through to the left and right cameras, overriding anything you set there.
I’ve tried a bunch of things, but I’m hitting a wall. I’m wondering, does anyone have any idea how to pop the hood on this asset in order to bring culling masks/layers back to each eye? (I don’t mind if I lose the “Stereo Controller” Script and have to set my cameras manually)
The code that does the culling mask copying is in CardboardEye.cs, function CopyCameraAndMakeSideBySide(). It’s this line:
camera.CopyFrom(controller.GetComponent());
You could comment it out if you don’t really need to keep the settings sync’ed. Or just add your own culling mask bits to the eye after this line.
Actually, there’s a function in Cardboard.cs called canApplyDistortionCorrection(), which checks that all the prerequisites are available for doing the distortion. If you make this function return false, then the distortion will not be done. You can then do your own. If you do it as an Image Effect, make sure to clear the Direct Render checkbox on the StereoController – this seems to be necessary for Image Effects to work right with side-by-side stereo.
Just be careful with your distortion – the Cardboard lenses are not doing a simple fisheye. They actually cause a pincushion distortion effect. The SDK in turn does a barrel distortion to counteract that. If your own distortion doesn’t do effectively the same thing, it will look very weird.