RenderableVideoPlane

Inherits Renderable

Creates a textured 3D plane where the texture is a video.

The video can either be played back based on a given simulation time (PlaybackMode MapToSimulationTime) or through the user interface (for PlaybackMode RealTimeLoop). It is also possible to control whether the video should loop or just be played once.

Note that, unless playback is mapped to simulation time, the video must be started manually via the user interface.

Members

Name

Documentation

Type

Description

Optional

Video

The video file that is played.

File

Value of type ‘File’

No

AutoScale

Decides whether the plane should automatically adjust in size to match the aspect ratio of the content. Otherwise it will remain in the given size.

Boolean

Value of type ‘Boolean’

Yes

Billboard

Controls whether the plane will be oriented as a billboard. Setting this value to true is the same as setting it to “Camera Position Normal”, setting it to false is the same as setting it to “Fixed Rotation”. If the value is not specified, the default value of false is used instead. “Camera View Direction” rotates the plane so that it is orthogonal to the viewing direction of the camera (useful for planar displays), and “Camera Position Normal” rotates the plane towards the position of the camera (useful for spherical displays, like dome theaters). In both these cases the plane will be billboarded towards the camera but in a slightly different way. In contrast, “Fixed Rotation” does not rotate the plane at all based on the camera and should be used the plane should be oriented in a fixed way.

Boolean, or String

Value of type ‘Boolean’, or In list { Camera View Direction, Camera Position Normal, Fixed Rotation }

Yes

BlendMode

Determines the blending mode that is applied to this plane.

String

In list { Normal, Additive }

Yes

DimInAtmosphere

Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere.

Boolean

Value of type ‘Boolean’

Yes

DistanceScalingSettings

Settings for scaling points based on camera distance.

Table

Table parameters

Yes

Enabled

Determines whether this object will be visible or not.

Boolean

Value of type ‘Boolean’

Yes

EndTime

The date and time that the video should end in the format ‘YYYY MM DD hh:mm:ss’.

Date and time

Value of type ‘Date and time’

Yes

LoopVideo

If checked, the video is continues playing from the start when it reaches the end of the video.

Boolean

Value of type ‘Boolean’

Yes

MirrorBackside

If false, the image plane will not be mirrored when viewed from the backside. This is usually desirable when the image shows data at a specific location, but not if it is displaying text for example.

Boolean

Value of type ‘Boolean’

Yes

MultiplyColor

An RGB color to multiply with the plane’s texture. Useful for applying a color to grayscale images.

Color3

Value of type ‘Color3’

Yes

Opacity

This value determines the opacity of this renderable. A value of 0 means completely transparent.

Double

In range: ( 0, 1)

Yes

PlayAudio

Decides whether to play audio when playing back the video.

Boolean

Value of type ‘Boolean’

Yes

PlaybackMode

The mode of how the video is played back. The Default is RealTimeLoop, which means that the video is played in realtime using the Play command in the user interface.

String

In list { MapToSimulationTime, RealTimeLoop }

Yes

PlayDelay

The delay, in milliseconds, that the system will wait before issuing the play command. A higher value will increase the time it takes for the video to start but may result in a more synchronized playback start.

Integer

Value of type ‘Integer’

Yes

RenderBinMode

A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step.

String

In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker }

Yes

Size

The size of the plane in meters.

Double, or Vector2<double>

Value of type ‘Double’, or Value of type ‘Vector2

Yes

StartTime

The date and time that the video should start in the format ‘YYYY MM DD hh:mm:ss’.

Date and time

Value of type ‘Date and time’

Yes

Tag

A single tag or a list of tags that this renderable will respond to when setting properties.

Table, or String

Value of type ‘Table’, or Value of type ‘String’

Yes

Type

The type of the renderable.

String

Value of type ‘String’

Yes

Inherited members from Renderable

Name

Documentation

Type

Description

Optional

DimInAtmosphere

Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere.

Boolean

Value of type ‘Boolean’

Yes

Enabled

Determines whether this object will be visible or not.

Boolean

Value of type ‘Boolean’

Yes

Opacity

This value determines the opacity of this renderable. A value of 0 means completely transparent.

Double

In range: ( 0, 1)

Yes

RenderBinMode

A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step.

String

In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker }

Yes

Tag

A single tag or a list of tags that this renderable will respond to when setting properties.

Table, or String

Value of type ‘Table’, or Value of type ‘String’

Yes

Type

The type of the renderable.

String

Value of type ‘String’

Yes

Table parameters for DistanceScalingSettings

Settings for scaling points based on camera distance.

  • Optional: Yes

Name

Documentation

Type

Description

Optional

ApparentSizeMultiplier

Value that controls the visual size of the object when using distance scaling.A value of 1.0 results in a natural angular size based on camera distance and field of view. Smaller values (e.g., 0.01) make the object appear smaller, while larger values make it appear bigger.

Double

Greater than: 0

Yes

ScaleByDistance

Decides whether the plane should automatically adjust in size to based on the distance to the camera. Otherwise it will remain in the given size.

Boolean

Value of type ‘Boolean’

Yes

ScaleByDistanceMaxHeight

The maximum height in meters a plane can get when using distance scaling.

Double

Greater than: 0

Yes

ScaleByDistanceMinHeight

The minimum height in meters a plane can get when using distance scaling.

Double

Greater than: 0

Yes

Asset Examples

Basic

Creates a video plane located in 3D space that plays a video file. The dimensions of the plane are automatically set to match the aspect ratio of the video.

 1-- The video file is here downloaded from a URL. This code returns the path to a folder
 2-- where the file is stored after download
 3local data = asset.resource({
 4  Name = "Example Video",
 5  Type = "UrlSynchronization",
 6  Identifier = "example_video",
 7  Url = "https://liu-se.cdn.openspaceproject.com/files/examples/video/chlorophyll_model_2048.mp4"
 8})
 9
10-- For a local file, use "asset.resource("path/to/local/video.mp4")" here instead
11local video = data .. "chlorophyll_model_2048.mp4"
12
13local Node = {
14  Identifier = "RenderableVideoPlane_Example",
15  Renderable = {
16    Type = "RenderableVideoPlane",
17    MirrorBackside = true, -- Make the plane render the video on both sides
18    Video = video
19  },
20  GUI = {
21    Name = "RenderableVideoPlane - Basic",
22    Path = "/Examples"
23  }
24}
25
26
27asset.onInitialize(function()
28  openspace.addSceneGraphNode(Node)
29end)
30
31asset.onDeinitialize(function()
32  openspace.removeSceneGraphNode(Node)
33end)