RenderableAtmosphere

Inherits Renderable

Members

Name

Documentation

Type

Description

Optional

AtmosphereHeight

The thickness of the atmosphere in kilometers.

Double

Value of type ‘Double’

No

GroundRadianceEmission

Multiplier of the ground radiance color during the rendering phase.

Double

Value of type ‘Double’

No

Mie

Table

Table parameters

No

PlanetAverageGroundReflectance

Double

Value of type ‘Double’

No

PlanetRadius

The radius of the planet in meters.

Double

Value of type ‘Double’

No

Rayleigh

Table

Table parameters

No

AtmosphereDimmingHeight

Percentage of the atmosphere where other objects, such as the stars, are faded.

Double

Value of type ‘Double’

Yes

Debug

Table

Table parameters

Yes

LightSourceNode

The name of a scene graph node to be used as the source of illumination for the atmosphere. If not specified, the solar system’s Sun is used.

String

Value of type ‘String’

Yes

MieScatteringExtinctionPropCoefficient

Mie Scattering/Extinction Proportion Coefficient.

Double

Value of type ‘Double’

Yes

Ozone

Table

Table parameters

Yes

ShadowGroup

Declares shadow groups, meaning which nodes are considered in shadow calculations.

Table

Table parameters

Yes

SunAngularSize

The angular size of the Sun in degrees.

Double

In range: ( 0,180 )

Yes

SunIntensity

A unitless value that controls the intensity/brightness of the Sun.

Double

Value of type ‘Double’

Yes

SunsetAngle

The angle (degrees) between the Camera and the Sun where the sunset starts, and the atmosphere starts to fade in objects such as the stars.

Vector2<double>

Value of type ‘Vector2

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, PostDeferredTransparent, Overlay }

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 Mie
  • Optional: No

Name

Documentation

Type

Description

Optional

Coefficients

Table

Table parameters

No

G

Double

In range: ( -1,1 )

No

H_M

Double

Value of type ‘Double’

No

Table parameters for Coefficients

  • Optional: No

Name

Documentation

Type

Description

Optional

Extinction

Vector3<double>

Value of type ‘Vector3

No

Scattering

Vector3<double>

Value of type ‘Vector3

No

Table parameters for Rayleigh
  • Optional: No

Name

Documentation

Type

Description

Optional

Coefficients

Table

Table parameters

No

H_R

Double

Value of type ‘Double’

No

Table parameters for Coefficients

  • Optional: No

Name

Documentation

Type

Description

Optional

Scattering

Vector3<double>

Value of type ‘Vector3

No

Wavelengths

Vector3<double>

Value of type ‘Vector3

No

Table parameters for Debug
  • Optional: Yes

Name

Documentation

Type

Description

Optional

PreCalculatedTextureScale

Double

In range: ( 0,1 )

Yes

SaveCalculatedTextures

Boolean

Value of type ‘Boolean’

Yes

Table parameters for Ozone
  • Optional: Yes

Name

Documentation

Type

Description

Optional

Coefficients

Table

Table parameters

Yes

H_O

Double

Value of type ‘Double’

Yes

Table parameters for Coefficients

  • Optional: Yes

Name

Documentation

Type

Description

Optional

Extinction

Vector3<double>

Value of type ‘Vector3

Yes

Table parameters for ShadowGroup

Declares shadow groups, meaning which nodes are considered in shadow calculations.

  • Optional: Yes

Name

Documentation

Type

Description

Optional

Casters

A list of objects that cast light on this atmosphere.

Table

Table parameters

No

Sources

A list of light sources.

Table

Table parameters

No

Table parameters for Casters

A list of objects that cast light on this atmosphere.

  • Optional: No

Name

Documentation

Type

Description

Optional

*

Individual shadow casters.

Table

Table parameters

Yes

Table parameters for *

Individual shadow casters.

  • Optional: Yes

Name

Documentation

Type

Description

Optional

Name

The scene graph node name of the source.

String

Value of type ‘String’

No

Radius

The radius of the object in meters.

Double

Value of type ‘Double’

No

Table parameters for Sources

A list of light sources.

  • Optional: No

Name

Documentation

Type

Description

Optional

*

Individual light sources.

Table

Table parameters

Yes

Table parameters for *

Individual light sources.

  • Optional: Yes

Name

Documentation

Type

Description

Optional

Name

The scene graph node name of the source.

String

Value of type ‘String’

No

Radius

The radius of the object in meters.

Double

Value of type ‘Double’

No

Asset Examples

 1local transforms = asset.require("./titan")
 2
 3
 4
 5local Atmosphere = {
 6  Identifier = "TitanAtmosphere",
 7  Parent = transforms.Titan.Identifier,
 8  Renderable = {
 9    Type = "RenderableAtmosphere",
10    -- Atmosphere radius in Km
11    AtmosphereHeight = 2666.0 - 2576.0,
12    PlanetRadius = 2576.0,
13    PlanetAverageGroundReflectance = 0.1,
14    GroundRadianceEmission = 0.9,
15    SunIntensity = 6.9,
16    Rayleigh = {
17      Coefficients = {
18        -- Wavelengths are given in 10^-9m
19        Wavelengths = { 680, 550, 440 },
20        -- Reflection coefficients are given in km^-1
21        Scattering = { 0.005349578367831898, 0.01265595939366191, 0.03133178295339324 }
22      },
23      -- Thickness of atmosphere if its density were uniform, in Km
24      H_R = 20.0
25    },
26    Mie = {
27        Coefficients = {
28          -- Reflection coefficients are given in km^-1
29          Scattering = { 0.005, 0.012, 0.08 },
30          -- Extinction coefficients are a fraction of the Mie coefficients
31          Extinction = { 0.004 / 0.37, 0.004 / 0.37, 0.004 / 0.37 }
32        },
33        -- Height scale (atmosphere thickness for constant density) in km
34        H_M = 14.85,
35        -- Mie Phase Function Value
36        -- (G e [-1.0, 1.0]. If G = 1.0, Mie phase function = Rayleigh Phase Function)
37        G = -0.52
38    },
39    Debug = {
40        PreCalculatedTextureScale = 1.0,
41        SaveCalculatedTextures = false
42    }
43  },
44  GUI = {
45    Name = "Titan Atmosphere",
46    Path = "/Solar System/Planets/Saturn/Major Moons/Titan"
47  }
48}
49
50
51asset.onInitialize(function()
52  openspace.addSceneGraphNode(Atmosphere)
53end)
54
55asset.onDeinitialize(function()
56  openspace.removeSceneGraphNode(Atmosphere)
57end)
58
59asset.export(Atmosphere)
60
61
62
63asset.meta = {
64  Name = "Titan Atmosphere",
65  Description = "RenderableAtmosphere for Titan",
66  Author = "OpenSpace Team",
67  URL = "http://openspaceproject.com",
68  License = "MIT license"
69}