Configuring Per-Camera Visibility

When your 3D scene is being rendered from multiple cameras, the need sometimes arises to display some elements to only one type of camera and not others. MixCast offers a number of methods to ensure that only the desired objects end up being seen by the VR user and MixCast cameras.

Layer Culling Mask

A method of filtering visibility of objects that most developers are familiar with is using the Culling Mask field on a Camera component to exclude objects on certain layers from rendering. By default, MixCast cameras are set to copy the Culling Mask from the Main Camera (the headset view), but if you need finer control over the mask, here’s how to configure it.

Instructions
  1. Override the Layer Cam Prefab as described on this page
  2. Uncheck the Culling Mask field on the SetCameraParametersFromMainCamera component from the previous instructions.
  3. Set the Culling Mask field on the Camera component to whichever layers you want rendered to the MixCast camera’s view.

Per-Renderer Masking

The other main method of displaying or hiding objects from the MixCast camera is by using a provided script called SetRenderingForMixCast. This component handles ensuring that the specified Renderer components (MeshRenderer, ParticleRenderer, etc) are only drawn for the configured camera.

Instructions
  1. Attach SetRenderingForMixCast to the GameObject you want to hide.
  2. (Optional) Manually specify the Renderer components to control by adding them to the Targets list. If this list is empty, it will be filled on enable by all the Renderer components in the GameObject or its children.
Additional Notes

VR Controllers: Since the user in mixed reality footage is already displayed holding their controllers with their real camera, the virtual controller models are at best redundant, at worst distracting. To rectify this issue, you should employ the visibility techniques mentioned above to exclude the virtual controller models from rendering. If you’re using the SteamVR-provided SteamVR_RenderModel component to render your user’s controllers, MixCast provides the more tailored component SetRenderingControllerForMixCast to be attached to the same GameObject as the aforementioned script, otherwise the existing SetRenderingForMixCast component should work.

Tilt Five Wand(s): Unlike in VR, Tilt Five wands are often obscured by the virtual content when held over the board. To increase readability, MixCast provides an optional prefab that additionally renders the Tilt Five wands to the MixCast cameras, but not to the user’s glasses. You can find the prefab at MixCast/Extras/Prefabs/MixCast – TiltFive – Wands; just add this prefab to the first scene of your project to enable this functionality.

Suggest Edit