RenderableGalaxy
Inherits Renderable
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
|
No |
||
|
|
No |
||
|
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. |
|
Value of type ‘Double’ |
Yes |
|
A unit-less scale factor for the amount of light being emitted by dust in the galaxy. |
|
Value of type ‘Double’ |
Yes |
|
If specified, the default raycasting shader is overwritten and the shader at this location is used instead. |
|
Value of type ‘File’ |
Yes |
|
The internal rotation of the volume rendering in Euler angles. |
|
Value of type ‘Vector3 |
Yes |
|
Decides whether the point-based star rendering component of the galaxy rendering should be enabled or not. If disabled, the point-based star rendering is skipped. |
|
Value of type ‘Boolean’ |
Yes |
|
The rendering method used for visualizing the stars. |
|
In list { Points, Billboards } |
Yes |
|
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. |
|
Value of type ‘Double’ |
Yes |
|
Decides whether the volume rendering component of the galaxy rendering should be enabled or not. If disabled, the volume rendering is skipped. |
|
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, 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 |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
Table parameters for Points
Optional: No
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
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. |
|
Value of type ‘Double’ |
Yes |
|
|
Value of type ‘File’ |
No |
|
|
|
Value of type ‘File’ |
No |
Table parameters for Volume
Optional: No
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
|
Value of type ‘Vector3 |
No |
|
|
The downscaling factor used when rendering the volume. |
|
Value of type ‘Double’ |
Yes |
|
|
Value of type ‘File’ |
No |
|
|
|
Value of type ‘Vector3 |
No |
|
|
The number of integration steps used during the raycasting procedure. |
|
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 Description = [[Volumetric rendering of Milky Way galaxy based on simulations from "
71 "NAOJ with a custom shader]],
72 Author = "OpenSpace Team",
73 URL = "http://openspaceproject.com",
74 License = "MIT License"
75}