Skip to content

HoloPlay.Renderer

The HoloPlay Renderer displays your three.js scenes in multi-view 3d for the Looking Glass.

Code example

const renderer = new HoloPlay.Renderer();

Constructor

HoloPlay.Renderer(parameters : Object)

parameters - (optional) object which allows you to override some default properties. You can also construct the Renderer with no parameters at all. These properties are available for customization:

quiltResolution : Number - The resolution of the internal multi-view render target. By default the Renderer will choose a resolution optimized for your specific Looking Glass (often 4096 or 8192). Choose a different resolution if you want to optimize for performance or quality.

tileCount : THREE.Vector2 - The grid dimensions of the internal multi-view render target. By default the Renderer will choose a tile count optimized for your specific Looking Glass, usually (5, 9). Choose a different tile count to improve performance or to increase visual quality.

disableFullscreenUi : Boolean - Whether to disable our window management helper. The fullscreen ui aims to help users understand to drag and fullscreen the browser window to their Looking Glass display. Use this option if you'd like to disable the ui entirely.

render2d : Boolean - Whether to render the scene as a flat 2d image. Must be used in conjunction with disableFullscreenUi. Primarily used for debugging purposes (check out the debugoptions example).

renderQuilt : Boolean - Whether to render the scene as a multi-view 'quilt' image. Must be used in conjunction with disableFullscreenUi. Primarily used for debugging purposes (check out the debugoptions example).

Properties

.quiltResolution : Number

Sets the resolution of the rendered quilt. It will default to the ideal resolution for the connected Looking Glass display. 8.9” and 15.6” default at 4096 and the 8K Immersive Display defaults at 8192.

.tileCount : THREE.Vector2

Sets the quilt’s tile count (width by height). The default value is (5, 9).

.render2D : Boolean

Render the scene in 2D instead of 3D. Defaults as false.

.renderQuilt : Boolean

Render the scene as a quilt. Defaults as false.

.webglRenderer : THREE.WebGLRenderer

A reference to the underlying three.js renderer. Only use this if you need advanced rendering features like shadow maps, etc.

.domElement : DOMElement

A canvas where the renderer draws its output. Defaults as the height and width of your Looking Glass display.

Methods

.render(scene : THREE.Scene, camera : HoloPlay.Camera)

Renders your three.js scene in multi-view 3d for your Looking Glass.