RenderableVideoSphere

Inherits Renderable

Creates a textured 3D sphere where the texture is a video. Per default, the sphere uses an equirectangular projection for the image mapping and hence expects a video in equirectangular format. However, it can also be used to play fisheye videos by changing the TextureProjection.

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

BlendingOption

Controls the blending function used to calculate the colors of the sphere with respect to the opacity.

String

In list { Default, Additive, Polygon, Color Adding }

Yes

ColorMap

Color map / Transfer function to use if UseColorMap is enabled.

File

Value of type ‘File’

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

DisableDepth

If disabled, no depth values are taken into account for this sphere, meaning that depth values are neither written or tested against during the rendering. This can be useful for spheres that represent a background image.

Boolean

Value of type ‘Boolean’

Yes

DisableFadeInOut

Enables/Disables the fade in and out effects.

Boolean

Value of type ‘Boolean’

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

FadeInThreshold

The distance from the center of the Milky Way at which the sphere should start to fade in, given as a percentage of the size of the object. A value of zero means that no fading in will happen.

Double

In range: ( 0, 1)

Yes

FadeOutThreshold

A threshold for when the sphere should start fading out, given as a percentage of how much of the sphere that is visible before the fading should start. A value of zero means that no fading out will happen.

Double

In range: ( 0, 1)

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

MirrorTexture

If true, mirror the texture along the x-axis.

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

Orientation

Specifies whether the texture is applied to the inside of the sphere, the outside of the sphere, or both.

String

In list { Outside, Inside, Both }

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

Segments

The number of segments that the sphere is split into.

Integer

Greater or equal to: 4

Yes

Size

The radius of the sphere in meters.

Double

Greater than: 0

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

TextureProjection

Specifies the projection mapping to use for any texture loaded onto the sphere (assumes Equirectangular per default). Note that for “Angular Fisheye” only half the sphere will be textured - the hemisphere centered around the z-axis.

String

In list { Equirectangular, Angular Fisheye }

Yes

Type

The type of the renderable.

String

Value of type ‘String’

Yes

UseColorMap

Used to toggle color map on or off for the sphere. Mainly used to transform grayscale textures from data into color images.

Boolean

Value of type ‘Boolean’

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

Asset Examples

Fulldome Fisheye Video

Creates a 3D sphere with an angular fisheye video (fulldome) mapped onto its surface. The video will be shown on half of the sphere.

 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 Angular Fisheye",
 5  Type = "UrlSynchronization",
 6  Identifier = "example_video_angularfisheye",
 7  Url = "https://liu-se.cdn.openspaceproject.com/files/examples/video/examplevideo_fisheye.mp4"
 8})
 9
10-- For a local file, use "asset.resource("path/to/local/video.mp4")" here instead
11local video = data .. "examplevideo_fisheye.mp4"
12
13local Node = {
14  Identifier = "RenderableVideoSphere_Example_FisheyeMapping",
15  Renderable = {
16    Type = "RenderableVideoSphere",
17    Video = video,
18    TextureProjection = "Angular Fisheye",
19    -- Set orientation to also render the inside of the sphere (which is the correct view
20    -- for a fisheye/fulldome video)
21    Orientation = "Both",
22    -- Mirror the image as this RenderableVideoSphere is intended to be watched from the
23    -- inside
24    MirrorTexture = true,
25    -- Increasing the number of segments makes the sphere smoother and reduces distortion
26    -- at the edge of the video
27    Segments = 64
28  },
29  GUI = {
30    Name = "RenderableVideoSphere - Fisheye Video",
31    Path = "/Examples"
32  }
33}
34
35
36asset.onInitialize(function()
37  openspace.addSceneGraphNode(Node)
38end)
39
40asset.onDeinitialize(function()
41  openspace.removeSceneGraphNode(Node)
42end)
Basic

Creates a 3D sphere with a video texture mapped onto its surface.

 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 = "RenderableVideoSphere_Example",
15  Renderable = {
16    Type = "RenderableVideoSphere",
17    Video = video
18  },
19  GUI = {
20    Name = "RenderableVideoSphere - Basic",
21    Path = "/Examples"
22  }
23}
24
25
26asset.onInitialize(function()
27  openspace.addSceneGraphNode(Node)
28end)
29
30asset.onDeinitialize(function()
31  openspace.removeSceneGraphNode(Node)
32end)