RenderableGalaxy

Inherits Renderable

Members

Name

Documentation

Type

Description

Optional

Points

Table

Table parameters

No

Volume

Table

Table parameters

No

AbsorptionMultiply

A unit-less scale factor for the probability of dust absorbing a light particle. The amount of absorption determines the spectrum of the light that is emitted from the galaxy

Double

Value of type ‘Double’

Yes

EmissionMultiply

A unit-less scale factor for the amount of light being emitted by dust in the galaxy

Double

Value of type ‘Double’

Yes

RaycastingShader

If this value is specified, the default raycasting shader is overwritten and the shader found at the provided location is used instead

File

Value of type ‘File’

Yes

Rotation

The internal rotation of the volume rendering in Euler angles

Vector3<double>

Value of type ‘Vector3

Yes

StarRenderingEnabled

If this value is enabled, the point-based star rendering component of the galaxy rendering is turned on. Otherwise, the volume rendering is skipped

Boolean

Value of type ‘Boolean’

Yes

StarRenderingMethod

This value determines which rendering method is used for visualization of the stars

String

In list { Points, Billboards }

Yes

StepSizeInfo

Determines the distance between steps taken in the volume rendering. The lower the number is, the better the rendering looks, but also takes more computational resources to render

Double

Value of type ‘Double’

Yes

VolumeRenderingEnabled

If this value is enabled, the volume rendering component of the galaxy rendering is turned on. Otherwise, the volume rendering is skipped

Boolean

Value of type ‘Boolean’

Yes

Inherited members from Renderable

Name

Documentation

Type

Description

Optional

DimInAtmosphere

Enables/Disables if the object should be dimmed when the camera is in the sunny part of an atmosphere

Boolean

Value of type ‘Boolean’

Yes

Enabled

This setting 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

This value specifies if the renderable should be rendered in the Background,Opaque, Pre/PostDeferredTransparency, or Overlay 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

This tells the type of the renderable

String

Value of type ‘String’

Yes

Table parameters for Points
  • Optional: No

Name

Documentation

Type

Description

Optional

EnabledPointsRatio

The ratio of point-like stars that are rendered to produce the overall galaxy image. At a value of 0, no stars are rendered, at a value of 1 all points contained in the dataset are rendered. The specific value chosen is a compromise between image fidelity and rendering performance

Double

Value of type ‘Double’

Yes

Filename

File

Value of type ‘File’

No

Texture

File

Value of type ‘File’

No

Table parameters for Volume
  • Optional: No

Name

Documentation

Type

Description

Optional

Dimensions

Vector3<int>

Value of type ‘Vector3

No

Downscale

This value sets the downscaling factor when rendering the current volume

Double

Value of type ‘Double’

Yes

Filename

File

Value of type ‘File’

No

Size

Vector3<double>

Value of type ‘Vector3

No

Steps

This value set the number of integration steps during the raycasting procedure

Double

Value of type ‘Double’

Yes

Asset Examples

 1local transforms = asset.require("scene/solarsystem/sun/transforms")
 2
 3
 4
 5local data = asset.resource({
 6  Name = "Milkyway Volume Data",
 7  Type = "HttpSynchronization",
 8  Identifier = "milkyway_volume_data",
 9  Version = 1
10})
11
12
13local KiloParsec = 3.086E19
14
15local MilkyWayVolume = {
16  Identifier = "MilkyWayVolume_CustomShader",
17  Parent = transforms.SolarSystemBarycenter.Identifier,
18  Transform = {
19    Translation = {
20      Type = "StaticTranslation",
21      -- The center of the Milky Way is approximately 8 kiloparsec from the Sun.
22      -- The x-axis of galactic coordinates points from the sun towards the center
23      -- of the galaxy.
24      Position = { 8 * KiloParsec, 0, 0 }
25    }
26  },
27  Renderable = {
28    Type = "RenderableGalaxy",
29    StepSize = 0.01,
30    AbsorptionMultiply = 200,
31    EmissionMultiply = 250,
32    Rotation = { math.pi, 3.1248, 4.45741 },
33    RaycastingShader = asset.resource("galaxyraycast.glsl"),
34    Volume = {
35      Type = "Volume",
36      Filename = data .. "MilkyWayRGBAVolume1024x1024x128.raw",
37      Dimensions = { 1024, 1024, 128 },
38      Size = { 1.2E21, 1.2E21, 0.15E21 },
39      Downscale = 0.4
40    },
41    Points = {
42      Type = "Points",
43      Filename = data .. "MilkyWayPoints.off",
44      EnabledPointsRatio = 0.3,
45      Texture = data .. "halo.png"
46    }
47  },
48  GUI = {
49    Path = "/Milky Way",
50    Name = "Milky Way Volume (Custom Shader)",
51    Description = "Volumetric rendering of Milky Way galaxy based on simulation from NAOJ"
52  }
53}
54
55
56asset.onInitialize(function()
57  openspace.addSceneGraphNode(MilkyWayVolume)
58end)
59
60asset.onDeinitialize(function()
61  openspace.removeSceneGraphNode(MilkyWayVolume)
62end)
63
64asset.export(MilkyWayVolume)
65
66
67
68asset.meta = {
69  Name = "Milky Way Volume",
70  Version = "1.1",
71  Description = [[Volumetric rendering of Milky Way galaxy based on simulations from "
72  "NAOJ with a custom shader]],
73  Author = "OpenSpace Team",
74  URL = "http://openspaceproject.com",
75  License = "MIT License"
76}