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 |
|---|---|---|---|---|
|
The video file that is played. |
|
Value of type ‘File’ |
No |
|
Controls the blending function used to calculate the colors of the sphere with respect to the opacity. |
|
In list { Default, Additive, Polygon, Color Adding } |
Yes |
|
Color map / Transfer function to use if |
|
Value of type ‘File’ |
Yes |
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
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. |
|
Value of type ‘Boolean’ |
Yes |
|
Enables/Disables the fade in and out effects. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
The date and time that the video should end in the format ‘YYYY MM DD hh:mm:ss’. |
|
Value of type ‘Date and time’ |
Yes |
|
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. |
|
In range: ( 0, 1) |
Yes |
|
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. |
|
In range: ( 0, 1) |
Yes |
|
If checked, the video is continues playing from the start when it reaches the end of the video. |
|
Value of type ‘Boolean’ |
Yes |
|
If true, mirror the texture along the x-axis. |
|
Value of type ‘Boolean’ |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0, 1) |
Yes |
|
Specifies whether the texture is applied to the inside of the sphere, the outside of the sphere, or both. |
|
In list { Outside, Inside, Both } |
Yes |
|
Decides whether to play audio when playing back the video. |
|
Value of type ‘Boolean’ |
Yes |
|
The mode of how the video is played back. The Default is |
|
In list { MapToSimulationTime, RealTimeLoop } |
Yes |
|
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. |
|
Value of type ‘Integer’ |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker } |
Yes |
|
The number of segments that the sphere is split into. |
|
Greater or equal to: 4 |
Yes |
|
The radius of the sphere in meters. |
|
Greater than: 0 |
Yes |
|
The date and time that the video should start in the format ‘YYYY MM DD hh:mm:ss’. |
|
Value of type ‘Date and time’ |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties. |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
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. |
|
In list { Equirectangular, Angular Fisheye } |
Yes |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
|
Used to toggle color map on or off for the sphere. Mainly used to transform grayscale textures from data into color images. |
|
Value of type ‘Boolean’ |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0, 1) |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker } |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties. |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
The type of the renderable. |
|
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)