Skip to content

Holoplay.cs

This script drives the Holoplay Capture prefab.

Fields

The following public fields are meant to mimic Unity's builtin camera:

clearFlags
background
cullingMask
depth
renderingPath
occlusionCulling
allowHDR
allowMSAA
allowDynamicResolution

For more information about those fields, please consult the Unity docs.

Instance

Type: Holoplay

The most recently enabled Holoplay in the scene. Given that in most cases there will be only one Holoplay, this field is a quick way to get that one.

size

Type: float

Distance in Unity units from center of Holoplay to top of Holoplay. As in, a size of 7 will make a holoplay whose total height at the zero-parallax plane to be 14

preview2D

Type: bool

Allows you to preview your content in 2D instead of 3D. Useful for debugging

fov

Type: float

Sets fov of camera like normal, but this ends up changing how far the camera is from center (GetCamDistance() will return larger values for smaller FOVs)

nearClipFactor

Type: float

Sets the near clipping plane for the camera as measured from the center of the Holoplay GameObject, multiplied by scale.

For example, a Holoplay with a nearClipFactor of 1.5 and a size of 10 means that the camera will set the near clipping plane to be 15 units in front of the Holoplay's location.

farClipFactor

Type: float

Sets the far clipping plane for the camera as measured from the center of the Holoplay GameObject, multiplied by scale.

For example, a Holoplay with a farClipFactor of 1.5 and a size of 10 means that the camera will set the far clipping plane to be 15 units in behind of the Holoplay's location.

scaleFollowsSize

Type: bool

If set to true, the scale of the Game Object's transform is set to the size of this Holoplay.

quiltPreset

Type: Quilt.Preset

The quilt configuration you'd like to choose. Quilts are the underlying textures that drive Looking Glass. Higher quality quilts lead to better visual fidelity, but are more graphics intensive.

screenshot2DKey

Type: KeyCode

Which key will take a 2d screenshot. This screenshot will save to the root directory of your project.

screenshotQuiltKey

Type: KeyCode

Which key will take a 3D screenshot in the form of a quilt. This quilt will save to the root directory of your project.

overrideQuilt

Type: Texture2D

If you have a pre-made quilt texture, set the Override Quilt to that texture to render it as a light field image. If this is set, the Quilt component will not do any rendering from the captures and will instead only process the Override Quilt.

renderOverrideBehind

Type: bool

If this is set to true, the Override Quilt will be used as a backdrop, and the Captures will render on top of it.

quiltRT

Type: RenderTexture

The live quilt that this Holoplay is producing.

frustumColor

Type: Color

Color of frustum (Holoplay's capture boundaries) gizmo in the Scene editor

middlePlaneColor

Type: Color

Color of Zero-Parallax-Plane identifier gizmo in the Scene editor

handleColor

Type: Color

Color of gizmo handles in the Scene editor

drawHandles

Type: bool

Whether or not to display handles, which allow the user to manipulate the Holoplay's shape with their mouse in the Scene editor

onHoloplayReady

Type: LoadEvent

Functions associated with this event will fire just after the Holoplay is ready, which involves reading calibration and accounting for screen size adjustments.

onViewRender

Type: ViewRenderEvent

Functions

ResetCamera()

Returns: float

Applies the Holoplay attributes to the internal Holoplay camera. Holoplay calls this every frame, so you won't need to unless you're doing advanced things with timing.

ReloadCalibration()

Returns: void

Occasionally Holoplay.cs will lose track of the Looking Glass' calibration. If this happens, press the "Reload Calibration" button to refresh.

GetCamDistance()

Returns: float

Returns the camera's distance from the center. This will be a positive number.