ScreenSpaceRenderableRenderable
Inherits ScreenSpaceRenderable
This ScreenSpaceRenderable object can render any Renderable type into an image that is shown in screen space. This can be used to display a rendered object as an overlay in front of the regular 3D rendering of the scene.
Note that to use this ScreenSpaceRenderable
, it might be necessary to specify the size
parameter, which determines the resolution of the inset window into which the Renderable is rendered. For many use cases, the default should suffice, however.
A possible use-case for the ScreenSpaceRenderable would be to show a 3D model of a spacecraft without the need to place it at a position in the 3D scene with the need to fly to that object to talk about it.
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The Renderable object that is shown in this ScreenSpace object. See the list of creatable renderable objects for options that can be used for this type. |
|
No |
|
|
The location of the camera’s focal point. The camera’s view direction will always be pointing at the provided center location. This position is provided in meters. |
|
Value of type ‘Vector3 |
Yes |
|
The camera’s field of view in degrees. |
|
Value of type ‘Double’ |
Yes |
|
Specifies the location of the virtual camera that is showing the renderable class. This position is provided in meters. |
|
Value of type ‘Vector3 |
Yes |
|
The direction that is ‘up’ for the provided camera. This value does not have any units. |
|
Value of type ‘Vector3 |
Yes |
|
|
Value of type ‘String’ |
Yes |
|
|
Specifies the start date that is used to control the renderable and the transforms. If no value is specified the date of 2000 JAN 01 12:00:00 is used instead. |
|
Value of type ‘Date and time’ |
Yes |
|
The collection of transformations that are applied to the Renderable before it is shown on screen. |
|
Yes |
Inherited members from ScreenSpaceRenderable
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The type of the |
|
Must name a valid ScreenSpaceRenderable |
No |
|
A fixed color that is combined with the screen space renderable to create the final color. The actual color of the screen space renderable is alpha-blended with the background color to produce the final result. |
|
Value of type ‘Color4’ |
Yes |
|
The color of the border. |
|
Value of type ‘Color3’ |
Yes |
|
If this value is enabled and a border width is set, the border will be rendered as a feathered border rather than a hard corner. |
|
Value of type ‘Boolean’ |
Yes |
|
The width of the border. |
|
Greater than: 0 |
Yes |
|
Determines the position of this screen space plane in Cartesian three-dimensional coordinates (meters). |
|
Value of type ‘Vector3 |
Yes |
|
Determines whether this sceen space object will be rendered or not. |
|
Value of type ‘Boolean’ |
Yes |
|
If enabled, the object will be rotated to face the camera position. Any local rotation is then applied after this rotation. |
|
Value of type ‘Boolean’ |
Yes |
|
Sets the gamma correction of the texture that is applied in addition to the global gamma value. |
|
Value of type ‘Double’ |
Yes |
|
The unique identifier for this screen space renderable. It has to be unique amongst all existing screen space nodes that have been added to the scene. |
|
An identifier string. May not contain ‘.’, spaces, newlines, or tabs |
Yes |
|
If set, the plane’s texture is multiplied with this color. Useful for applying a color grayscale images. |
|
Value of type ‘Color3’ |
Yes |
|
The name of the |
|
Value of type ‘String’ |
Yes |
|
The opacity of the screen space object. If 1, the object is completely opaque. If 0, the object is completely transparent. |
|
In range: ( 0,1 ) |
Yes |
|
Determines the position of this screen space plane in a coordinate system based on radius (meters), azimuth (radians), and elevation (radians). |
|
Value of type ‘Vector3 |
Yes |
|
If true, this screen space renderable is going to ignore the global blackout factor from the Render Engine and will always render at full opacity. If false, it will adhere to the factor and fade out like the rest of the 3D rendering. |
|
Value of type ‘Boolean’ |
Yes |
|
An Euler rotation (x, y, z) to apply to the screen space object. |
|
Value of type ‘Vector3 |
Yes |
|
A scale factor for the plane that can be used to increase or decrease the visual size. The default size is determined separately for each screen space renderable type and may for example be affected by the size of an image being displayed. |
|
Value of type ‘Double’ |
Yes |
|
Defines either a single or multiple tags that apply to this |
|
Value of type ‘String’, or Value of type ‘Table’ |
Yes |
|
Determines whetether the z/radius values affects the size of the plane or not. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether the location of this screen space plane will be specified using radius, azimuth and elevation (if ‘true’) or using Cartesian coordinates. The Cartesian coordinate system is useful if a regular rendering is applied, whereas the radius azimuth elevation are most useful in a planetarium environment. |
|
Value of type ‘Boolean’ |
Yes |
Table parameters for Transform
The collection of transformations that are applied to the Renderable before it is shown on screen.
Optional: Yes
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The Rotation object that is used for the provided Renderable. If no value is specified, a StaticRotation is created instead. |
|
Yes |
|
|
The Scale object that is used for the provided Renderable. If no value is specified, a StaticScale is created instead. |
|
Yes |
|
|
The Translation object that is used for the provided Renderable. If no value is specified, a StaticTranslation is created instead. |
|
Yes |
Asset Examples
Axes
Creates a screenspace image that renders three Cartesian axes into the screen space window. This example also modifies the original camera position to give an oblique view onto the axes and increases the field of view of the camera to a wider degree. We also set the background color to be fully opaque to make it easier to see the axes.
1local Object = {
2 Type = "ScreenSpaceRenderableRenderable",
3 Identifier = "ScreenSpaceRenderableRenderable_Example_Axes",
4 Renderable = {
5 Type = "RenderableCartesianAxes"
6 },
7 BackgroundColor = { 0.0, 0.0, 0.0, 1.0 },
8 CameraPosition = { 1.0, 1.0, 1.0 },
9 CameraFov = 80.0
10}
11
12asset.onInitialize(function()
13 openspace.addScreenSpaceRenderable(Object)
14end)
15
16asset.onDeinitialize(function()
17 openspace.removeScreenSpaceRenderable(Object)
18end)
Basic
Creates a screenspace image that shows a spherical grid as an example for any Renderable that can be displayed.
1local Object = {
2 Type = "ScreenSpaceRenderableRenderable",
3 Identifier = "ScreenSpaceRenderableRenderable_Example",
4 Renderable = {
5 Type = "RenderableSphericalGrid",
6 Opacity = 1.0,
7 Color = { 0.3, 0.84, 1.0 },
8 LineWidth = 2.0
9 }
10}
11
12asset.onInitialize(function()
13 openspace.addScreenSpaceRenderable(Object)
14end)
15
16asset.onDeinitialize(function()
17 openspace.removeScreenSpaceRenderable(Object)
18end)
Model
Creates a screen space window into which 3D model of the Eiffel tower is rendered. As the objects are rendered in meter scale, and the Eiffel tower is about 300m tall, we both shrink the rendering to make the entire model fit into the view and also modify the position of the camera.
1-- Download the model file for the Eiffel tower
2local modelFolder = asset.resource({
3 Name = "Scale Eiffel Tower",
4 Type = "HttpSynchronization",
5 Identifier = "scale_model_eiffel_tower",
6 Version = 1
7})
8
9local Object = {
10 Type = "ScreenSpaceRenderableRenderable",
11 Identifier = "ScreenSpaceRenderableRenderable_Example_Model",
12 Transform = {
13 Scale = {
14 Type = "StaticScale",
15 Scale = 0.0002
16 }
17 },
18 Renderable = {
19 Type = "RenderableModel",
20 GeometryFile = modelFolder .. "eiffeltower.osmodel",
21 RotationVector = { 0.0, 45.0, 0.0 },
22 LightSources = {
23 {
24 Identifier = "Camera",
25 Type = "CameraLightSource",
26 Intensity = 5.0
27 }
28 }
29 },
30 Scale = 1.25,
31 CameraPosition = { 0.0, 1.0, 2.0 },
32 CameraCenter = { 0.0, 0.5, 0.0 }
33}
34
35asset.onInitialize(function()
36 openspace.addScreenSpaceRenderable(Object)
37end)
38
39asset.onDeinitialize(function()
40 openspace.removeScreenSpaceRenderable(Object)
41end)
Model Distance
Creates a screen space window into which 3D model of the Eiffel tower is rendered. As the objects are rendered in meter scale, and the Eiffel tower is about 300m tall, we place the camera at a great distance to be able to see the entire Eiffel tower at the same time.
1-- Download the model file for the Eiffel tower
2local modelFolder = asset.resource({
3 Name = "Scale Eiffel Tower",
4 Type = "HttpSynchronization",
5 Identifier = "scale_model_eiffel_tower",
6 Version = 1
7})
8
9local Object = {
10 Type = "ScreenSpaceRenderableRenderable",
11 Identifier = "ScreenSpaceRenderableRenderable_Example_ModelDistance",
12 Renderable = {
13 Type = "RenderableModel",
14 GeometryFile = modelFolder .. "eiffeltower.osmodel",
15 RotationVector = { 0.0, 45.0, 0.0 },
16 LightSources = {
17 {
18 Identifier = "Camera",
19 Type = "CameraLightSource",
20 Intensity = 5.0
21 }
22 }
23 },
24 Scale = 1.25,
25 CameraPosition = { 0.0, 3500.0, 9000.0 },
26 CameraCenter = { 0.0, 2750.0, 0.0 }
27}
28
29asset.onInitialize(function()
30 openspace.addScreenSpaceRenderable(Object)
31end)
32
33asset.onDeinitialize(function()
34 openspace.removeScreenSpaceRenderable(Object)
35end)