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

targetDisplay

Type: int

(v1.2 or later)

Makes the Holoplay render to a specified display. This is automatically managed in most cases, including when working with ExtendedUI, Multiplex, a Pro Workstation Manager, or a conventional setup.

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.

Note: This is a private variable starting v1.2. To modify via script, use SetQuiltPreset() and GetQuiltPreset() instead.

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 associated with this event will fire before each individual view is rendered as well as one last time before the entire quilt is rendered.

viewInterpolation

Type: ViewInterpolationType

(v1.2 or later)

Instead of rendering all views (controllable by quiltPreset setting), view interpolation options allow you to render only a subset of views, relying on a depthmap-based view interpolation to fill in other views. This significantly enhances performance, though depending on what is in the scene, it may result in visual noise.

reduceFlicker

Type: bool

(v1.2 or later)

View interpolation sometimes result in a visual artifact where pixels flicker between different color values. This setting reduceFlicker to true helps mitigate that. Apply only when needed as it significantly reduces performance.

fillGaps

Type: bool

(v1.2 or later)

View interpolation sometimes result in a visual artifact surfaces have missing pixels, or gaps. Setting fillGaps to true helps mitigate that. Apply only when needed as it reduces performance.

blendViews

Type: bool

(v1.2 or later)

View interpolation sometimes results in stark and unblended color differences on surfaces of objects. Setting blendViews to true helps mitigate that. blendViews increases the amount of flicker, so it may be wise to use this with reduceFlicker.

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.

SetQuiltPreset(Quilt.Preset preset)

Returns: void

(v1.2 or later)

Changes quiltPreset via script

GetQuiltPreset()

Returns: Quilt.Preset

(v1.2 or later)

Retrieves quiltPreset