Looking Glass Documentation
Buy Looking GlassDiscord
  • Looking Glass User Guide
  • NEW! ✨Looking Glass Go✨
  • Displays
    • 🔮Looking Glass Go
      • ⚡Get Started with Looking Glass Go
      • 📱Using the Go Mobile App
      • 🔆Liteforms™
      • 🖥️Standalone and Desktop Modes
      • 🔌Power and LED States
      • 🪄Default Playlist
      • ⏭️What's Next?
      • 👜Accessories
      • ⚙️Advanced Playlist Creation
      • ⚙️Manual Firmware Update
      • ❓Common Troubleshooting Issues
    • 🔮Looking Glass 16" Light Field Displays
      • 🪄Looking Glass 16" Light Field Display (Landscape)
      • 🪄Looking Glass 16" Light Field Display (Portrait)
      • ❓Common Troubleshooting Issues
    • 🔮Looking Glass 32" Light Field Displays
      • 🪄Looking Glass 32" Light Field Display (Landscape)
      • 🪄Looking Glass 32" Light Field Display (Portrait)
      • ❓Common Troubleshooting Issues
    • 🔮Looking Glass 65" Light Field Display
    • 🔮Looking Glass Portrait
      • ⚡Get Started with Looking Glass Portrait
      • 🎇Demo Holograms
      • ❓Common Troubleshooting Issues
  • Software
    • 📚Overview
    • 🌉Looking Glass Bridge
      • ✨Using Looking Glass Bridge
      • 🪟Display Settings on Windows
      • 🍎Display Settings on macOS
      • 🐧Display Settings on Linux
      • 👷Troubleshooting
    • ⚙️Looking Glass Bridge SDK
      • 🪛Web Application Integration
      • 🔌Integrating Native Applications
      • 📓Native Function Reference
      • 🐦Looking Glass Core Migration Guide
    • 🔌Unity
      • ⚡Using Unity with Looking Glass
      • Setting up your Development Environment
      • Example Scenes
      • Prefabs
        • Hologram Camera
        • 3D Cursor
        • Dual Monitor Application
      • Script Reference
        • HologramCamera.cs
        • LKGDisplaySystem.cs
        • QuiltCapture.cs
        • Cursor3D.cs
        • OrbitControls.cs
        • BlockUploader.cs
        • MobileDMAController.cs
        • iOS Sample Scene Scripts
          • ChangeInteractionModality.cs
          • XYSlider.cs
          • XYSpotlight.cs
          • AudioRotateControl.cs
          • ModelController.cs
          • DemoIOSUIController.cs
          • PageHandler.cs
          • PageConnectHandler.cs
          • PageCalibrateHandler.cs
          • PageTestHandler.cs
          • DynamicAlcove.cs
      • Package Integrations
        • Built-in Render Pipeline Post-Processing
      • Developing for iOS
      • Depth of Field and Other Post-Processing Effects
      • Quilt Video Audio and Playback
      • Developing for Ultraleap Hand Tracking on Looking Glass
      • Looking Glass Pro (Legacy)
      • Additional Support
      • Change Log
    • 📽️Looking Glass Studio
      • 📚Using Looking Glass Studio
      • 🎬Hologram Video iOS App
      • RGB-D Photo / Video
      • Quilt Images / Video
      • iPhone Portrait Photos
      • Android Depth Photos
        • Samsung Portrait Mode
      • Light Field Photosets
      • Exporting Holograms
      • Troubleshooting
    • 👀Looking Glass Model Viewer
    • 🧊Looking Glass Blocks
      • ✨Convert any image into a hologram
      • ⬆️Uploading, editing and sharing Quilts
      • 🥽Viewing your holograms on different platforms
    • 🎨Other Creator Tools
      • 🍹Blender
      • 🔌Unreal Engine
        • 🗒️Change Log and Old Versions
        • 💽Installing the Unreal Engine plugin
        • 🎥Using the Unreal Engine Plugin
          • Using the HoloPlay Capture
          • Exporting Quilt Images and Video with Sequencer
        • Accessing HoloPlay Data with Blueprint Scripting
        • Packaging the Project
        • Unreal Engine 4 (Legacy Support)
          • Unreal Engine 4 Quick Start
            • Using the HoloPlay Capture
            • Exporting Quilt Images and Video with Sequencer
      • 🌐WebXR
        • 🔶PlayCanvas
        • 3️⃣3️⃣ Three.JS
        • ⚛️React-Three-Fiber
        • 🌈Spline
    • 🧪Experiments
      • 🔆Liteforms™
        • 🪟Get Started on Windows
        • 🍎Get Started on MacOS
        • 🧙Making Custom Liteforms
        • 🏪Configure Liteforms for Kiosk Setup
      • 📽️Media Encoder
        • ⏩Looking Glass Media Encoder
    • 🧑‍🤝‍🧑Third Party Apps and Tools
      • 🗺️ParaView
      • 🔬VTK (Visualization Toolkit)
      • 🗡️3D Slicer
      • 🔩Community Made Tools & Projects
  • Key Concepts
    • 🔑Hologram 101
      • 🎉Making great holograms
      • 🌎Holograms in the real world
      • 👾Holograms, but virtual
    • 🔍How does Looking Glass Work?
    • 📸Virtual Camera
    • 🧊3D Design Guidelines
      • Lighting
      • Post-Processing
      • Scene Composition
      • Materials & Textures
      • Performance
    • 💡Quilts
      • 🎬Quilt Video Encoding
    • 💡Light Fields
      • ⚡Linear Light Field Capture
    • 📽️Filming a Looking Glass
  • Tutorials
    • 📱Running Looking Glass Displays with iOS Devices
    • Ⓜ️Capturing Light Fields in Maya
    • 🧑‍🔬Using ShaderToy with Looking Glass
    • 🎨Sculpting with Adobe Medium and Looking Glass
    • 🔍Turn Videogames Holographic with Refract
    • 🖐️Building with Leap Motion
  • Legacy
    • Legacy Hardware
      • 🔻Looking Glass 8.9"
      • 🔻Looking Glass 15.6"
      • 🔻Looking Glass 8K
      • 🔻Looking Glass 16"
      • 🔻Looking Glass 32"
      • 🔻Looking Glass Pro
    • Legacy Software
      • 📡3D Model Importer
        • 3D Model Importer App Guide
        • 3D Model Importer App Reference
      • 🎭Diorama
        • Change Log
      • 🎞️Depth Recorder
      • 📸Lightfield Photo App
      • 🍍Looking Glass Core Overview
      • 🍽️Looking Glass Core SDK
        • C API Overview
          • HoloPlayCore.h
            • State Functions
            • General-Query-Functions
            • Device-Query-Functions
          • libHoloPlayCore.h
          • HoloPlayShaders.h
      • 🔰Looking Glass Core JS
        • API
          • HoloPlayCore.Client
          • HoloPlayCore.Message
          • HoloPlay Service Related
          • examples
  • 💬Contact Us
  • 🛠️FAQ & Troubleshooting
Powered by GitBook

Follow us

  • Twitter
  • Instagram
  • LinkedIn
On this page
  • Fields & Properties
  • bool ForceDisplayIndex
  • DisplayTarget TargetDisplay
  • LookingGlass.Toolkit.LKGDeviceType EmulatedDevice
  • LookingGlass.Toolkit.LKGDeviceType DeviceType
  • LookingGlass.Toolkit.Calibration Calibration
  • float Calibration.ScreenAspect
  • LookingGlass.Toolkit.Display DisplayInfo
  • bool Preview2D
  • bool ShowHologramPreview
  • RenderTexture QuiltTexture
  • bool UseQuiltAsset
  • bool AutomaticQuiltPreset
  • QuiltPreset QuiltPreset
  • LookingGlass.Toolkit.QuiltSettings
  • int QuiltSettings.quiltWidth
  • int QuiltSettings.quiltHeight
  • int QuiltSettings.columns
  • int QuiltSettings.rows
  • int QuiltSettings.tileCount
  • float QuiltSettings.renderAspect
  • RenderStack RenderStack
  • TransformMode CameraProperties.TransformMode
  • float CameraProperties.NearClipFactor
  • float CameraProperties.FarClipFactor
  • float CameraProperties.size
  • SizeMode CameraProperties.sizeMode
  • CameraClearFlags CameraProperties.ClearFlags
  • Color CameraProperties.BackgroundColor
  • LayerMask CameraProperties.CullingMask
  • float CameraProperties.FieldOfView
  • float CameraProperties.Depth
  • RenderingPath CameraProperties.RenderingPath
  • bool CameraProperties.UseOcclusionCulling
  • bool CameraProperties.AllowHDR
  • bool CameraProperties.AllowMSAA
  • bool CameraProperties.AllowDynamicResolution
  • bool CameraProperties.UseFrustumTarget
  • Transform CameraProperties.FrustumTarget
  • float CameraProperties.CenterOffset
  • float CameraProperties.HorizontalFrustumOffset
  • float CameraProperties.VerticalFrustumOffset
  • float CameraProperties.Depthiness
  • bool Gizmos.DrawHandles
  • Color Gizmos.FrustumColor
  • Color Gizmos.MiddlePlaneColor
  • Color Gizmos.HandleColor
  • ViewRenderEvent Events.OnViewRendered
  • HologramViewInterpolation Optimization.ViewInterpolation
  • bool Optimization.ReduceFlicker
  • bool Optimization.FillGaps
  • bool Optimization.BlendViews
  • bool Debugging.ShowAllObjects
  • int Debugging.OnlyShowView
  • bool Debugging.OnlyRenderOneView
  • string TargetLKGName
  • int TargetLKGIndex
  • static HologramCamera Instance
  • HologramCameraProperties CameraProperties
  • HologramCameraGizmos Gizmos
  • HologramCameraEvents Events
  • OptimizationProperties Optimization
  • HologramCameraDebugging Debugging
  • QuiltSettings CustomQuiltSettings
  • Camera SingleViewCamera
  • Camera PostProcessCamera

Was this helpful?

  1. Software
  2. Unity
  3. Script Reference

HologramCamera.cs

The Hologram Camera captures scenes for Looking Glass displays. It is intended to replace Unity’s default camera for Looking Glass applications.

The Hologram Camera object’s main interface is the HologramCamera.cs script. It exposes variables and functions to control how your scene is captured.

Fields & Properties

bool ForceDisplayIndex

Force the Hologram Camera to render to the first display, and use Unity's SetParams method to move the window to the Looking Glass display.

This is useful for single-window applications that only want the visuals to appear on the Looking Glass or setups with more than one 2D monitor. For 2-window applications that require window-context-specific raycasting or UI events, and that have a single 2D monitor with the Looking Glass, this should be toggled off.

DisplayTarget TargetDisplay

The Unity display that this camera will render to. This will be overwritten to always be display 1 if "Force Display Index" is toggled on.

LookingGlass.Toolkit.LKGDeviceType EmulatedDevice

The type of device that is being emulated. Only appears in the inspector if there are no Looking Glass displays plugged in or recognized, otherwise the Hologram Camera will target device settings from one of the connected LKG devices.

LookingGlass.Toolkit.LKGDeviceType DeviceType

The type of Looking Glass display that is being emulated or targeted (currently identified based on its Calibration serial field).

LookingGlass.Toolkit.Calibration Calibration

Contains Looking Glass display-specific data required for accurately rendering to a given display.

If you are emulating a display, a default template calibration is returned.

float Calibration.ScreenAspect

The display's native aspect ratio, calculated using Calibration.screenW / Calibration.screenH.

Because quilts may not always be able to achieve this exact aspect ratio for each of the quilt tiles, QuiltSettings store this value at the time of capturing the quilt into the QuiltSettings.renderAspect variable, so that the quilt may be re-rendered later with the correct squishing or stretching to match the display's aspect ratio again when rendering the quilt.

This value is always greater than zero.

LookingGlass.Toolkit.Display DisplayInfo

Returns a copy of the Display info of the currently connected and targeted Looking Glass display, if any, or null if the Hologram Camera is not targeting a connected display and is emulating a display instead.

bool Preview2D

Allows you to preview your content in 2D instead of 3D. This can be useful for debugging.

bool ShowHologramPreview

Toggles on and off a hologram preview in the inspector and scene view. Note that this only has an effect in the Unity editor, not in builds.

RenderTexture QuiltTexture

The realtime quilt rendered by this Hologram Camera.

bool UseQuiltAsset

If set to true, QuiltTexture will save to an asset in your project (useful for debugging).

bool AutomaticQuiltPreset

Determines whether or not to use automatic/default quilt settings for the current targeted Looking Glass display or use custom arbitrary quilt settings instead.

To change this programmatically, use one the following:

  • void UseAutomaticQuiltSettings()

  • void UseCustomQuiltSettings(QuiltSettings settings)

  • void SetQuiltPreset(bool automaticQuiltPreset, QuiltPreset quiltPreset)

QuiltPreset QuiltPreset

Same as QuiltSettings, but has extra fields to determine if the quilt settings are the default for the targeted or emulated device, or if they are arbitrary, custom settings.

LookingGlass.Toolkit.QuiltSettings

Defines the resolution and layout of the quilt texture that this camera is rendering to as output.

int QuiltSettings.quiltWidth

The width (in pixels) of the entire quilt.

int QuiltSettings.quiltHeight

The height (in pixels) of the entire quilt.

int QuiltSettings.columns

The number of columns in the quilt.

int QuiltSettings.rows

The number of rows in the quilt.

int QuiltSettings.tileCount

The number of total tiles in the quilt. Each tile in the quilt corresponds to a single view rendered by the singleViewCamera.

Usually this is columns * rows, but it doesn't get set automatically to allow for customization. If it’s fewer, empty views in the top right corner of quilt will be black. The quilt tiles used start from the bottom-left, as shown in Quilts:

float QuiltSettings.renderAspect

The aspect ratio of the camera or source image, when this quilt was originally rendered.

If you are rendering new quilts from a 3D scene, full-screen to a Looking Glass display, this should be set to the aspect ratio of your Looking Glass display's native screen resolution (Calibration.screenW / Calibration.screenH).

This aspect ratio is NOT necessarily equal to the aspect ratio of each tile's (width / height).

For your reference:

  • LKG Go, 16" Portrait, and 32" Portrait: 0.5625

  • LKG Portrait: 0.75

  • LKG 16" Landscape, 32" Landscape and 65”: 1.77778

RenderStack RenderStack

Defines a sequence of rendering commands that can be mixed together in the form of quilt textures. This can be useful, for example, if you wish to mix 2D cameras, pre-rendered quilts, or quilt videos with the Looking Glass’s realtime renderer.

TransformMode CameraProperties.TransformMode

Defines how the transform controls the shape of the viewing volume.

  • In Volume mode, the transform position defines the focal plane.

  • In Camera mode, the transform position defines the central camera position.

float CameraProperties.NearClipFactor

Scales the nearClipPlane away from the focal plane.

The relationship can be mathematically written as the following: nearClipPlane = max(0.01, focalPlane - size * nearClipFactor * depthiness)

float CameraProperties.FarClipFactor

Scales the farClipPlane away from the focal plane.

The relationship can be mathematically written as the following: farClipPlane = max(0.01, focalPlane + size * farClipFactor * depthiness)

float CameraProperties.size

Defines half of the height of the camera frustum at the focal plane.

When using nearClipFactor and farClipFactor, this value also scales the nearClipPlane and farClipPlane away from the focal plane. NOTE: This is not the same as Unity's Camera.orthographicSize property.

Only appears when "Transform Mode" is set to TransformMode.Volume.

SizeMode CameraProperties.sizeMode

Sets the relationship between HologramCamera’s Size value and the Transform’s localScale value.

  • Manual - HologramCamera’s Size and Transform’s localScale values do not update automatically based on one another.

  • Size Sets Scale — Updating HologramCamera's Size automatically updates the Transform localScale's xyz values to match.

  • Scale Sets Size — Updating Transform localScale automatically updates HologramCamera's Size to match the largest value of the localScale xyz values.

Only appears when "Transform Mode" is set to TransformMode.Volume.

CameraClearFlags CameraProperties.ClearFlags

Determines how the camera clears the render target's background each frame.

Color CameraProperties.BackgroundColor

The background color of the render target when using Solid Color clear flags. NOTE: Unlike Unity's camera background color, the alpha channel is used to blend with any render steps in the stack that come before the current Looking Glass step.

LayerMask CameraProperties.CullingMask

Determines which layers the camera renders.

float CameraProperties.FieldOfView

The vertical field of view of the camera in degrees.

float CameraProperties.Depth

Sets the finalScreenCamera's depth, which determines the rendering order (relative to all other cameras in the scene) of the final HologramCamera rendering result.

RenderingPath CameraProperties.RenderingPath

The rendering path to use for rendering each of the single views. You may choose to use the player settings, or explicitly use deferred or forward rendering.

bool CameraProperties.UseOcclusionCulling

Whether or not the Hologram Camera will use occlusion culling during rendering.

bool CameraProperties.AllowHDR

When true, enables high dynamic range.

bool CameraProperties.AllowMSAA

When true, enables multi-sample anti-aliasing.

bool CameraProperties.AllowDynamicResolution

When true, enables dynamic resolution.

bool CameraProperties.UseFrustumTarget

Determines whether or not the frustum target will be used.

Transform CameraProperties.FrustumTarget

Automatically modifies Hologram Camera's settings to center capture volume on an object placed at this transform’s position.

float CameraProperties.CenterOffset

Offsets the cycle of horizontal views based on the observer's viewing angle, represented as a percentage on a scale of [-0.5, 0.5]. Only applies in the Unity editor as it is typically used to correct for center distortion from the taskbar being visible, ignored in builds. The default value is 0.

float CameraProperties.HorizontalFrustumOffset

Degrees of hologram camera’s horizontal offset.

float CameraProperties.VerticalFrustumOffset

Degrees of hologram camera’s vertical offset.

float CameraProperties.Depthiness

Scales the z-axis between the view and projection matrices. This is useful when the scene has too much depth, creating an apparent blur due to large discrepancies in the interlaced images. Scaling Z down maintains parallax and relational depth, but adds visual clarity to near and far objects at the cost of geometric accuracy. Default value is 1.

bool Gizmos.DrawHandles

Toggles whether to show draggable handles on the gizmo.

Color Gizmos.FrustumColor

Color of the Hologram Camera's frustum gizmos in the Scene view.

Color Gizmos.MiddlePlaneColor

Color of Focal Plane identifier gizmo in the Scene view.

Color Gizmos.HandleColor

Color of handles in the Scene view.

ViewRenderEvent Events.OnViewRendered

A callback that gets called before each individual view is rendered. This is called with viewIndex values ranging within [0, numViews]. Note that the upper bound is inclusive, for an extra callback in case cleanup is needed.

HologramViewInterpolation Optimization.ViewInterpolation

View interpolation allows you to render only a subset of views instead of rendering all views (controllable by quiltPreset setting), by relying on a depthmap-based algorithm to fill in intermediate views. This significantly enhances performance, but may result in visual artifacts, depending on the scene being rendered.

bool Optimization.ReduceFlicker

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.

bool Optimization.FillGaps

View interpolation sometimes result in a visual artifact where surfaces have missing pixels, or gaps. Setting fillGaps to true helps mitigate that.

Apply only when needed as it reduces performance.

bool Optimization.BlendViews

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

bool Debugging.ShowAllObjects

When set to true, this reveals hidden objects used by this Hologram Camera component, such as the cameras used for rendering.

int Debugging.OnlyShowView

Forces the rendering of only one view in the quilt, where this value represents the single-view's view index.

bool Debugging.OnlyRenderOneView

When onlyShowView is set to a valid index, this does the following:

  • When set to true, this causes the single view to only render to its tile in the quilt; the rest of the quilt will remain empty.

  • When set to false, the single view will be copied into every tile in the quilt. This does nothing when onlyShowView is -1.

string TargetLKGName

The name of the Looking Glass (LKG) device that this component is connected with.

int TargetLKGIndex

The index of the Looking Glass (LKG) device that this component is connected with.

static HologramCamera Instance

The most-recently enabled HologramCamera component, or null if there is none.


HologramCameraProperties CameraProperties

Contains a set of fields that correspond to fields on a Unity Camera, with some extra hologramCamera fields.

HologramCameraGizmos Gizmos

A container for Unity Gizmo settings.

HologramCameraEvents Events

A container for Hologram Camera Events.

OptimizationProperties Optimization

A container for Hologram Camera Optimization Properties.

HologramCameraDebugging Debugging

A container for Hologram Camera Optimization Properties.

QuiltSettings CustomQuiltSettings

A container for custom render settings.

Camera SingleViewCamera

Renders individual views of the scene, where each view may be composited into the quilt. When in 2D preview mode, only 1 view is rendered directly to the screen. This camera is not directly used for rendering to the screen. The results of its renders are used as intermediate steps in the rendering process.

Camera PostProcessCamera

The Camera used to apply final post-processing to a single view of the scene, or a quilt of the scene. This camera is not directly used for rendering to the screen. It is only used for applying graphical changes in internal RenderTextures.

PreviousScript ReferenceNextLKGDisplaySystem.cs

Last updated 11 months ago

Was this helpful?

🔌