RenderableModel
Inherits Renderable
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The file or files that should be loaded in this RenderableModel. The file can contain filesystem tokens. This specifies the model that is rendered by the Renderable. |
|
Value of type ‘File’ |
No |
|
A multiplier for ambient lighting |
|
Value of type ‘Double’ |
Yes |
|
The mode of how the animation should be played back. Default is animation is played back once at the start time. For a more detailed description see: http://wiki.openspaceproject.com/docs/builders/model-animation |
|
In list { Once, LoopFromStart, LoopInfinitely, BounceFromStart, BounceInfinitely } |
Yes |
|
The date and time that the model animation should start. In format ‘YYYY MM DD hh:mm:ss’. |
|
Value of type ‘Date and time’ |
Yes |
|
The time scale for the animation relative to seconds. Ex, if animation is in milliseconds then AnimationTimeScale = 0.001 or AnimationTimeScale = Millisecond, default is Second |
|
In list { Nanosecond, Microsecond, Millisecond, Second, Minute }, or Value of type ‘Double’ |
Yes |
|
Changes the blending function used to calculate the colors of the model with respect to the opacity |
|
Value of type ‘String’ |
Yes |
|
A multiplier for diffuse lighting |
|
Value of type ‘Double’ |
Yes |
|
Enable or disable the animation for the model if it has any |
|
Value of type ‘Boolean’ |
Yes |
|
Enable Depth Testing for the Model |
|
Value of type ‘Boolean’ |
Yes |
|
Enable OpenGL automatic face culling optimization |
|
Value of type ‘Boolean’ |
Yes |
|
Set if invisible parts (parts with no textures or materials) of the model should be forced to render or not. |
|
Value of type ‘Boolean’ |
Yes |
|
The path to the fragment shader program that is used instead of the default shader. |
|
Value of type ‘File’ |
Yes |
|
By default the given ModelScale is used to scale the model down, by setting this setting to true the model is instead scaled up with the given ModelScale |
|
Value of type ‘Boolean’ |
Yes |
|
A list of light sources that this model should accept light from |
|
Yes |
|
|
The scale of the model. For example, if the model is in centimeters then |
|
In list { Nanometer, Micrometer, Millimeter, Centimeter, Decimeter, Meter, Kilometer, Thou, Inch, Foot, Yard, Chain, Furlong, Mile }, or Value of type ‘Double’ |
Yes |
|
This value specifies the model transform that is applied to the model before all other transformations are applied |
|
Value of type ‘Matrix4x4 |
Yes |
|
This value determines whether this model should be shaded by using the position of the Sun |
|
Value of type ‘Boolean’ |
Yes |
|
A vector that moves the place of origin for the model |
|
Value of type ‘Vector3 |
Yes |
|
Rotation Vector using degrees |
|
Value of type ‘Vector3 |
Yes |
|
A multiplier for specular lighting |
|
Value of type ‘Double’ |
Yes |
|
The path to the vertex shader program that is used instead of the default shader. |
|
Value of type ‘File’ |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
Enables/Disables if the object should be dimmed when the camera is in the sunny part of an atmosphere |
|
Value of type ‘Boolean’ |
Yes |
|
This setting 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 |
|
This value specifies if the renderable should be rendered in the Background,Opaque, Pre/PostDeferredTransparency, or Overlay rendering step |
|
In list { Background, Opaque, PreDeferredTransparent, PostDeferredTransparent, Overlay } |
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 |
|
This tells the type of the renderable |
|
Value of type ‘String’ |
Yes |
Table parameters for LightSources
A list of light sources that this model should accept light from
Optional: Yes
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
|
Yes |
Asset Examples
1local sun = asset.require("scene/solarsystem/sun/sun")
2local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
3
4
5
6local model = asset.resource({
7 Name = "Animated Box",
8 Type = "HttpSynchronization",
9 Identifier = "animated_box",
10 Version = 1
11})
12
13
14local Model = {
15 Identifier = "ModelShader",
16 Parent = transforms.EarthCenter.Identifier,
17 Transform = {
18 Translation = {
19 Type = "StaticTranslation",
20 Position = { -11E7, 0.0, 0.0 }
21 }
22 },
23 Renderable = {
24 Type = "RenderableModel",
25 GeometryFile = model .. "BoxAnimated.glb",
26 ModelScale = 3E7,
27 -- (malej 2023-MAY-22) Note that PerformShading should be false in this example,
28 -- these example shaders dont't contain any light calculations
29 PerformShading = false,
30 VertexShader = asset.resource("model_vs.glsl"),
31 FragmentShader = asset.resource("model_fs.glsl"),
32 EnableAnimation = true,
33 AnimationStartTime = "2023 05 11 00:00:00",
34 AnimationTimeScale = "Second",
35 AnimationMode = "LoopInfinitely"
36 },
37 GUI = {
38 Name = "Model Shader",
39 Path = "/Example",
40 Description = "Simple box model with a custom shader"
41 }
42}
43
44
45asset.onInitialize(function()
46 openspace.addSceneGraphNode(Model)
47end)
48
49asset.onDeinitialize(function()
50 openspace.removeSceneGraphNode(Model)
51end)
52
53asset.export(Model)