This commit is contained in:
Ylva Selling
2023-06-06 12:00:36 -04:00
42 changed files with 705 additions and 260 deletions
+7 -2
View File
@@ -97,6 +97,7 @@ const BaseViewport* currentViewport = nullptr;
Frustum::Mode currentFrustumMode;
glm::mat4 currentModelViewProjectionMatrix;
glm::mat4 currentModelMatrix;
glm::ivec2 currentDrawResolution;
#ifdef OPENVR_SUPPORT
Window* FirstOpenVRWindow = nullptr;
@@ -449,6 +450,7 @@ void mainRenderFunc(const sgct::RenderData& data) {
currentWindow = &data.window;
currentViewport = &data.viewport;
currentFrustumMode = data.frustumMode;
currentDrawResolution = glm::ivec2(data.bufferSize.x, data.bufferSize.y);
glm::vec3 pos;
std::memcpy(
@@ -533,6 +535,7 @@ void mainDraw2DFunc(const sgct::RenderData& data) {
currentWindow = &data.window;
currentViewport = &data.viewport;
currentFrustumMode = data.frustumMode;
currentDrawResolution = glm::ivec2(data.bufferSize.x, data.bufferSize.y);
try {
global::openSpaceEngine->drawOverlays();
@@ -766,7 +769,7 @@ void setSgctDelegateFunctions() {
ZoneScoped;
const Viewport* viewport = dynamic_cast<const Viewport*>(currentViewport);
if (viewport != nullptr) {
if (viewport) {
if (viewport->hasSubViewports() && viewport->nonLinearProjection()) {
ivec2 dim = viewport->nonLinearProjection()->cubemapResolution();
return glm::ivec2(dim.x, dim.y);
@@ -776,7 +779,9 @@ void setSgctDelegateFunctions() {
return glm::ivec2(dim.x, dim.y);
}
}
return glm::ivec2(-1, -1);
else {
return currentDrawResolution;
}
};
sgctDelegate.currentViewportSize = []() {
ZoneScoped;
+21 -11
View File
@@ -58,35 +58,42 @@ local AltAzGrid = {
}
}
local ShowAltaz = {
Identifier = "os.nightsky.ShowAltaz",
Name = "Show Alt/Az grid",
Command = [[
local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera()
local camera = openspace.navigation.getNavigationState()
openspace.setParent("AltAzGridPosition", camera.Anchor)
openspace.setPropertyValueSingle("Scene.AltAzGridPosition.Translation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.AltAzGridPosition.Translation.Latitude", lat)
openspace.setPropertyValueSingle("Scene.AltAzGridPosition.Translation.Longitude", lon)
openspace.setPropertyValueSingle("Scene.AltAzGridPosition.Rotation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.AltAzGridPosition.Rotation.Latitude", lat)
openspace.setPropertyValueSingle("Scene.AltAzGridPosition.Rotation.Longitude", lon)
openspace.setPropertyValueSingle("Scene.AltAzGrid.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.AltAzGrid.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.AltAzGrid.Renderable.Fade", 1.0, 1.0)
openspace.fadeIn("Scene.AltAzGrid.Renderable")
]],
Documentation = "Shows a local Altitude/Azimuth grid centered around your position",
GuiPath = "/Night Sky/Lines and Grids",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local HideAltaz = {
Identifier = "os.nightsky.HideAltaz",
Name = "Hide Alt/Az grid",
Command = "openspace.fadeOut('Scene.AltAzGrid.Renderable')",
Documentation = "Hides the local Altitude/Azimuth grid centered around your position",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local ToggleAltaz = {
Identifier = "os.nightsky.ToggleAltaz",
Name = "Toggle Alt/Az grid",
Command = [[
openspace.setPropertyValueSingle("Scene.AltAzGrid.Renderable.Fade", 0, 1)
local camera = openspace.navigation.getNavigationState()
openspace.setParent("AltAzGridPosition", camera.Anchor)
openspace.setPropertyValueSingle("Scene.AltAzGridPosition.Translation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.AltAzGridPosition.Rotation.Globe", camera.Anchor)
openspace.toggleFade("Scene.AltAzGrid.Renderable")
]],
Documentation = "Hides the Alt/Az grid",
Documentation = "Toggles the local Altitude/Azimuth grid centered around your position",
GuiPath = "/Night Sky/Lines and Grids",
IsLocal = false
}
@@ -96,10 +103,12 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(AltAzGrid)
openspace.action.registerAction(ShowAltaz)
openspace.action.registerAction(HideAltaz)
openspace.action.registerAction(ToggleAltaz)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(ToggleAltaz)
openspace.action.removeAction(HideAltaz)
openspace.action.removeAction(ShowAltaz)
openspace.removeSceneGraphNode(AltAzGrid)
@@ -110,3 +119,4 @@ asset.export(AltAzGridPosition)
asset.export(AltAzGrid)
asset.export("ShowAltaz", ShowAltaz.Identifier)
asset.export("HideAltaz", HideAltaz.Identifier)
asset.export("ToggleAltaz", ToggleAltaz.Identifier)
+39 -26
View File
@@ -3,17 +3,10 @@ local earthAsset = asset.require("scene/solarsystem/planets/earth/earth")
local textures = asset.syncedResource({
Name = "Cardinal Direction Textures",
Type = "UrlSynchronization",
Identifier = "cardinal_direction_textures",
Url = {
"https://wms.openspace.amnh.org/static/sync/url/directions/sphere.png",
"https://wms.openspace.amnh.org/static/sync/url/directions/sphere2.png",
"https://wms.openspace.amnh.org/static/sync/url/directions/sphere3.png",
"https://wms.openspace.amnh.org/static/sync/url/directions/sphere4.png",
"https://wms.openspace.amnh.org/static/sync/url/directions/sphere5.png"
},
Override = false
Name = "Cardinal Directions Textures",
Type = "HttpSynchronization",
Identifier = "cardinal_directions_textures",
Version = 1
})
@@ -60,7 +53,7 @@ local CardinalDirectionSphere = {
Size = 50000,
Segments = 80,
Opacity = 0.9,
Texture = textures .. "sphere.png",
Texture = textures .. "nesw_red.png",
Orientation = "Inside",
MirrorTexture = true,
RenderBinMode = "PostDeferredTransparent"
@@ -76,44 +69,58 @@ local showCommand = [[
local camera = openspace.navigation.getNavigationState()
openspace.setParent("CardinalDirectionsPosition", camera.Anchor)
openspace.setPropertyValueSingle("Scene.CardinalDirectionsPosition.Translation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.CardinalDirectionsPosition.Translation.Latitude", lat)
openspace.setPropertyValueSingle("Scene.CardinalDirectionsPosition.Translation.Longitude", lon)
openspace.setPropertyValueSingle("Scene.CardinalDirectionsPosition.Rotation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.CardinalDirectionsPosition.Rotation.Latitude", lat)
openspace.setPropertyValueSingle("Scene.CardinalDirectionsPosition.Rotation.Longitude", lon)
openspace.setPropertyValueSingle("Scene.CardinalDirectionSphere.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.CardinalDirectionSphere.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.CardinalDirectionSphere.Renderable.Fade", 1.0, 1.0)
openspace.fadeIn("Scene.CardinalDirectionSphere.Renderable")
]]
local ShowNeswBand = {
Identifier = "os.nightsky.ShowNeswBand",
Name = "Show cardinal directions (with ticks)",
Name = "Show cardinal directions (with lines)",
Command = [[
openspace.setPropertyValueSingle("Scene.CardinalDirectionSphere.Renderable.Texture", "]] ..
textures:gsub("\\","/") .. [[sphere5.png")]] .. showCommand,
Documentation = "Shows the cardinal direction sphere with letters and circle with tick marks",
textures:gsub("\\","/") .. [[nesw_lines_red.png")]] .. showCommand,
Documentation = "Shows the cardinal direction sphere with letters and a circle with tick marks",
GuiPath = "/Night Sky/Directions",
IsLocal = false
}
local ShowNeswBandSmall = {
Identifier = "os.nightsky.ShowNeswBandSmall",
Name = "Show cardinal directions (small with lines)",
Command = [[
openspace.setPropertyValueSingle("Scene.CardinalDirectionSphere.Renderable.Texture", "]] ..
textures:gsub("\\","/") .. [[nesw_lines_red_small.png")]] .. showCommand,
Documentation = "Shows the cardinal direction sphere with small letters and a circle with tick marks",
GuiPath = "/Night Sky/Directions",
IsLocal = false
}
local ShowNeswLetters = {
Identifier = "os.nightsky.ShowNeswLetters",
Name = "Show cardinal directions (letters only)",
Command = [[
openspace.setPropertyValueSingle("Scene.CardinalDirectionSphere.Renderable.Texture","]] ..
textures:gsub("\\","/") .. [[sphere.png")]] .. showCommand,
textures:gsub("\\","/") .. [[nesw_red.png")]] .. showCommand,
Documentation = "Shows the cardinal direction sphere with letters only",
GuiPath = "/Night Sky/Directions",
IsLocal = false
}
local ShowNeswLettersSmall = {
Identifier = "os.nightsky.ShowNeswLettersSmall",
Name = "Show cardinal directions (small letters only)",
Command = [[
openspace.setPropertyValueSingle("Scene.CardinalDirectionSphere.Renderable.Texture","]] ..
textures:gsub("\\","/") .. [[nesw_red_small.png")]] .. showCommand,
Documentation = "Shows the cardinal direction sphere with small letters only",
GuiPath = "/Night Sky/Directions",
IsLocal = false
}
local HideNesw = {
Identifier = "os.nightsky.HideNesw",
Name = "Hide cardinal directions",
Command = [[
openspace.setPropertyValueSingle("Scene.CardinalDirectionSphere.Renderable.Fade", 0.0, 1.0)
]],
Command = "openspace.fadeOut('Scene.CardinalDirectionSphere.Renderable')",
Documentation = "Hides the cardinal directions",
GuiPath = "/Night Sky/Directions",
IsLocal = false
@@ -123,13 +130,17 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(CardinalDirectionsPosition)
openspace.addSceneGraphNode(CardinalDirectionSphere)
openspace.action.registerAction(ShowNeswBand)
openspace.action.registerAction(ShowNeswBandSmall)
openspace.action.registerAction(ShowNeswLetters)
openspace.action.registerAction(ShowNeswLettersSmall)
openspace.action.registerAction(HideNesw)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(HideNesw)
openspace.action.removeAction(ShowNeswLettersSmall)
openspace.action.removeAction(ShowNeswLetters)
openspace.action.removeAction(ShowNeswBandSmall)
openspace.action.removeAction(ShowNeswBand)
openspace.removeSceneGraphNode(CardinalDirectionSphere)
openspace.removeSceneGraphNode(CardinalDirectionsPosition)
@@ -138,5 +149,7 @@ end)
asset.export(CardinalDirectionsPosition)
asset.export(CardinalDirectionSphere)
asset.export("ShowNeswBand", ShowNeswBand.Identifier)
asset.export("ShowNeswBandSmall", ShowNeswBand.Identifier)
asset.export("ShowNeswLetters", ShowNeswLetters.Identifier)
asset.export("ShowNeswLettersSmall", ShowNeswLettersSmall.Identifier)
asset.export("HideNesw", HideNesw.Identifier)
+32 -16
View File
@@ -6,7 +6,7 @@ local textures = asset.syncedResource({
Name = "Ecliptic Band Textures",
Type = "HttpSynchronization",
Identifier = "ecliptic_band_textures",
Version = 1
Version = 2
})
@@ -55,7 +55,7 @@ local EclipticBand = {
},
Renderable = {
Type = "RenderableSphere",
Texture = textures .. "band.png",
Texture = textures .. "band2x.png",
Size = 4.28601E17,
Segments = 50,
DisableFadeInOut = true,
@@ -72,23 +72,26 @@ local EclipticBand = {
local ShowEclipticLine = {
Identifier = "os.nightsky.ShowEclipticLine",
Name = "Show ecliptic line",
Command = [[
openspace.setPropertyValueSingle("Scene.EclipticLine.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.EclipticLine.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.EclipticLine.Renderable.Fade", 1.0, 1.0)
]],
Command = "openspace.fadeIn('Scene.EclipticLine.Renderable')",
Documentation = "Shows the ecliptic line",
GuiPath = "/Night Sky/Lines and Grids",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local HideEclipticLine = {
Identifier = "os.nightsky.HideEclipticLine",
Name = "Hide ecliptic line",
Command = [[
openspace.setPropertyValueSingle("Scene.EclipticLine.Renderable.Fade", 0.0, 1.0)
]],
Command = "openspace.fadeOut('Scene.EclipticLine.Renderable')",
Documentation = "Hides the ecliptic line",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local ToggleEclipticLine = {
Identifier = "os.nightsky.ToggleEclipticLine",
Name = "Toggle ecliptic line",
Command = "openspace.toggleFade('Scene.EclipticLine.Renderable')",
Documentation = "Toggles the ecliptic line visibilty",
GuiPath = "/Night Sky/Lines and Grids",
IsLocal = false
}
@@ -97,12 +100,10 @@ local ShowEclipticBand = {
Identifier = "os.nightsky.ShowEclipticBand",
Name = "Show ecliptic band",
Command = [[
openspace.setPropertyValueSingle("Scene.EclipticBand.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.EclipticBand.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.EclipticBand.Renderable.Fade", 1.0, 1.0)
openspace.fadeIn("Scene.EclipticBand.Renderable")
]],
Documentation = "Shows the ecliptic band",
GuiPath = "/Night Sky/Lines and Grids",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
@@ -110,9 +111,18 @@ local HideEclipticBand = {
Identifier = "os.nightsky.HideEclipticBand",
Name = "Hide ecliptic band",
Command = [[
openspace.setPropertyValueSingle("Scene.EclipticBand.Renderable.Fade", 0.0, 1.0)
openspace.fadeOut("Scene.EclipticBand.Renderable")
]],
Documentation = "Hides the ecliptic band",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local ToggleEclipticBand = {
Identifier = "os.nightsky.ToggleEclipticBand",
Name = "Toggle ecliptic band",
Command = "openspace.toggleFade('Scene.EclipticBand.Renderable')",
Documentation = "Toggles the ecliptic band visibilty",
GuiPath = "/Night Sky/Lines and Grids",
IsLocal = false
}
@@ -123,13 +133,17 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(EclipticBand)
openspace.action.registerAction(ShowEclipticLine)
openspace.action.registerAction(HideEclipticLine)
openspace.action.registerAction(ToggleEclipticLine)
openspace.action.registerAction(ShowEclipticBand)
openspace.action.registerAction(HideEclipticBand)
openspace.action.registerAction(ToggleEclipticBand)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(ToggleEclipticBand)
openspace.action.removeAction(HideEclipticBand)
openspace.action.removeAction(ShowEclipticBand)
openspace.action.removeAction(ToggleEclipticLine)
openspace.action.removeAction(HideEclipticLine)
openspace.action.removeAction(ShowEclipticLine)
openspace.removeSceneGraphNode(EclipticBand)
@@ -140,5 +154,7 @@ asset.export(EclipticLine)
asset.export(EclipticBand)
asset.export("ShowEclipticLine", ShowEclipticLine.Identifier)
asset.export("HideEclipticLine", HideEclipticLine.Identifier)
asset.export("ToggleEclipticLine", ToggleEclipticLine.Identifier)
asset.export("ShowEclipticBand", ShowEclipticBand.Identifier)
asset.export("HideEclipticBand", HideEclipticBand.Identifier)
asset.export("ToggleEclipticBand", ToggleEclipticBand.Identifier)
+15 -5
View File
@@ -41,12 +41,10 @@ local ShowEquatorialLine = {
Identifier = "os.nightsky.ShowEquatorialLine",
Name = "Show equatorial line",
Command = [[
openspace.setPropertyValueSingle("Scene.EquatorialLine.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.EquatorialLine.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.EquatorialLine.Renderable.Fade", 1.0, 1.0)
openspace.fadeIn("Scene.EquatorialLine.Renderable")
]],
Documentation = "Shows the equatorial line",
GuiPath = "/Night Sky/Lines and Grids",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
@@ -54,9 +52,18 @@ local HideEquatorialLine = {
Identifier = "os.nightsky.HideEquatorialLine",
Name = "Hide equatorial line",
Command = [[
openspace.setPropertyValueSingle("Scene.EquatorialLine.Renderable.Fade", 0.0, 1.0)
openspace.fadeOut("Scene.EquatorialLine.Renderable")
]],
Documentation = "Hides the equatorial line",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local ToggleEquatorialLine = {
Identifier = "os.nightsky.ToggleEquatorialLine",
Name = "Toggle equatorial line",
Command = "openspace.toggleFade('Scene.EquatorialLine.Renderable')",
Documentation = "Toggles the equatorial line visibilty",
GuiPath = "/Night Sky/Lines and Grids",
IsLocal = false
}
@@ -66,9 +73,11 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(EquatorialLine)
openspace.action.registerAction(ShowEquatorialLine)
openspace.action.registerAction(HideEquatorialLine)
openspace.action.registerAction(ToggleEquatorialLine)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(ToggleEquatorialLine)
openspace.action.removeAction(HideEquatorialLine)
openspace.action.removeAction(ShowEquatorialLine)
openspace.removeSceneGraphNode(EquatorialLine)
@@ -77,3 +86,4 @@ end)
asset.export(EquatorialLine)
asset.export("ShowEquatorialLine", ShowEquatorialLine.Identifier)
asset.export("HideEquatorialLine", HideEquatorialLine.Identifier)
asset.export("ToggleEquatorialLine", ToggleEquatorialLine.Identifier)
+13 -7
View File
@@ -21,7 +21,7 @@ local GalacticBand = {
Enabled = asset.enabled
},
GUI = {
Name = "Galactic Band",
Name = "Galactic Equator Line",
Path = "/Other/Lines"
}
}
@@ -31,12 +31,10 @@ local ShowGalacticBand = {
Identifier = "os.nightsky.ShowGalacticBand",
Name = "Show galactic band",
Command = [[
openspace.setPropertyValueSingle("Scene.GalacticBand.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.GalacticBand.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.GalacticBand.Renderable.Fade", 1.0, 1.0)
openspace.fadeIn("Scene.GalacticBand.Renderable")
]],
Documentation = "Shows the galactic band",
GuiPath = "/Night Sky/Lines and Grids",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
@@ -44,13 +42,21 @@ local HideGalacticBand = {
Identifier = "os.nightsky.HideGalacticBand",
Name = "Hide galactic band",
Command = [[
openspace.setPropertyValueSingle("Scene.GalacticBand.Renderable.Fade", 0.0, 1.0)
openspace.fadeOut("Scene.GalacticBand.Renderable")
]],
Documentation = "Hides the galactic band",
GuiPath = "/Night Sky/Lines and Grids",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local ToggleGalacticBand = {
Identifier = "os.nightsky.ToggleGalacticBand",
Name = "Toggle galactic equator line",
Command = "openspace.toggleFade('Scene.GalacticBand.Renderable')",
Documentation = "Toggles the galactic equator line visibilty",
GuiPath = "/Night Sky/Lines and Grids",
IsLocal = false
}
asset.onInitialize(function()
openspace.addSceneGraphNode(GalacticBand)
+4 -5
View File
@@ -29,8 +29,8 @@ local GroundPanoPosition = {
Latitude = 34.201639,
Longitude = -118.171319,
Altitude = 10.0,
UseCamera = true,
UseCameraAltitude = true
UseCamera = false,
UseCameraAltitude = false
},
Rotation = {
Type = "GlobeRotation",
@@ -151,10 +151,9 @@ local HideGroundPano = {
Identifier = "os.nightsky.HideGroundPano",
Name = "Hide ground panorama",
Command = [[
-- same position as above
openspace.setPropertyValueSingle("Scene.GroundPanoSphere.Renderable.Fade", 0.0, 0.5)
openspace.fadeOut("Scene.GroundPanoSphere.Renderable")
]],
Documentation = "Hides the ground panorama",
Documentation = "Hides the panorama",
GuiPath = "/Night Sky/Panoramas",
IsLocal = false
}
+1 -1
View File
@@ -34,7 +34,7 @@ local LightPollutionSphere = {
},
Renderable = {
Type = "RenderableSphere",
Size = 8.5,
Size = earthAsset.Earth.Renderable.Radii[1] * 1.05,
Segments = 40,
Opacity = 0.0,
Enabled = asset.enabled,
@@ -58,21 +58,14 @@ local ShowMeridian = {
Identifier = "os.nightsky.ShowMeridian",
Name = "Show local meridian",
Command = [[
local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera()
local camera = openspace.navigation.getNavigationState()
openspace.setParent("MeridianPosition", camera.Anchor)
openspace.setPropertyValueSingle("Scene.MeridianPosition.Translation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.MeridianPosition.Translation.Latitude", lat)
openspace.setPropertyValueSingle("Scene.MeridianPosition.Translation.Longitude", lon)
openspace.setPropertyValueSingle("Scene.MeridianPosition.Rotation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.MeridianPosition.Rotation.Latitude", lat)
openspace.setPropertyValueSingle("Scene.MeridianPosition.Rotation.Longitude", lon)
openspace.setPropertyValueSingle("Scene.MeridianPlane.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.MeridianPlane.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.MeridianPlane.Renderable.Fade", 1.0, 1.0)
openspace.fadeIn("Scene.MeridianPlane.Renderable")
]],
Documentation = "Shows a line for the local meridian",
GuiPath = "/Night Sky/Lines and Grids",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
@@ -80,9 +73,25 @@ local HideMeridian = {
Identifier = "os.nightsky.HideMeridian",
Name = "Hide local meridian",
Command = [[
openspace.setPropertyValueSingle("Scene.MeridianPlane.Renderable.Fade", 0.0, 1.0)
openspace.fadeOut("Scene.MeridianPlane.Renderable")
]],
Documentation = "Hides the line for the local meridian",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local ToggleMeridian = {
Identifier = "os.nightsky.ToggleMeridian",
Name = "Toggle local meridian",
Command = [[
local camera = openspace.navigation.getNavigationState()
openspace.setParent("MeridianPosition", camera.Anchor)
openspace.setPropertyValueSingle("Scene.MeridianPosition.Translation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.MeridianPosition.Rotation.Globe", camera.Anchor)
openspace.toggleFade("Scene.MeridianPlane.Renderable")
]],
Documentation = "Toggles the line for the local meridian",
GuiPath = "/Night Sky/Lines and Grids",
IsLocal = false
}
@@ -93,9 +102,11 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(MeridianPlane)
openspace.action.registerAction(ShowMeridian)
openspace.action.registerAction(HideMeridian)
openspace.action.registerAction(ToggleMeridian)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(ToggleMeridian)
openspace.action.removeAction(HideMeridian)
openspace.action.removeAction(ShowMeridian)
openspace.removeSceneGraphNode(MeridianPlane)
@@ -106,3 +117,4 @@ asset.export(MeridianPosition)
asset.export(MeridianPlane)
asset.export("ShowMeridian", ShowMeridian.Identifier)
asset.export("HideMeridian", HideMeridian.Identifier)
asset.export("ToggleMeridian", ToggleMeridian.Identifier)
+1 -1
View File
@@ -4,7 +4,7 @@ asset.require("./ecliptic_band", false)
asset.require("./equatorial_band", false)
asset.require("./galactic_band", false)
asset.require("./ground_panoramas", false)
asset.require("./meredian", false)
asset.require("./meridian", false)
asset.require("./light_pollution", false)
asset.require("./zenith", false)
asset.require("./planets", false)
+39 -23
View File
@@ -41,9 +41,9 @@ local Venus = {
Type = "RenderablePlaneImageLocal",
Enabled = asset.enabled,
Billboard = true,
Size = 6051900 * 500,
Size = 6051900 * 700,
Texture = textures .. "glare.png",
MultiplyColor = { 0.608, 0.604, 0.455 },
MultiplyColor = { 1.0 , 0.992, 0.757 },
DimInAtmosphere = true,
RenderBinMode = "PostDeferredTransparent"
},
@@ -118,23 +118,14 @@ local ShowNightSkyPlanets = {
Identifier = "os.nightsky.ShowNightSkyPlanets",
Name = "Show night sky planets",
Command = [[
openspace.setPropertyValueSingle("Scene.NightSkyMercury.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.NightSkyVenus.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.NightSkyMars.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.NightSkyJupiter.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.NightSkySaturn.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.NightSkyMercury.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.NightSkyVenus.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.NightSkyMars.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.NightSkyJupiter.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.NightSkySaturn.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.NightSkyMercury.Renderable.Fade", 1.0, 0.25)
openspace.setPropertyValueSingle("Scene.NightSkyVenus.Renderable.Fade", 1.0, 0.25)
openspace.setPropertyValueSingle("Scene.NightSkyMars.Renderable.Fade", 1.0, 0.25)
openspace.setPropertyValueSingle("Scene.NightSkyJupiter.Renderable.Fade", 1.0, 0.25)
openspace.setPropertyValueSingle("Scene.NightSkySaturn.Renderable.Fade", 1.0, 0.25)
openspace.fadeIn("Scene.NightSkyMercury.Renderable")
openspace.fadeIn("Scene.NightSkyVenus.Renderable")
openspace.fadeIn("Scene.NightSkyMars.Renderable")
openspace.fadeIn("Scene.NightSkyJupiter.Renderable")
openspace.fadeIn("Scene.NightSkySaturn.Renderable")
openspace.setPropertyValueSingle("Scene.Moon.Scale.Scale", 2)
]],
Documentation = "Show night sky versions of the planets",
Documentation = "Show night sky versions of the planets (Note: Increases the scale of the Moon)",
GuiPath = "/Night Sky/Planets",
IsLocal = false
}
@@ -143,11 +134,12 @@ local HideNightSkyPlanets = {
Identifier = "os.nightsky.HideNightSkyPlanets",
Name = "Hide night sky planets",
Command = [[
openspace.setPropertyValueSingle("Scene.NightSkyMercury.Renderable.Fade", 0.0, 1.0)
openspace.setPropertyValueSingle("Scene.NightSkyVenus.Renderable.Fade", 0.0, 1.0)
openspace.setPropertyValueSingle("Scene.NightSkyMars.Renderable.Fade", 0.0, 1.0)
openspace.setPropertyValueSingle("Scene.NightSkyJupiter.Renderable.Fade", 0.0, 1.0)
openspace.setPropertyValueSingle("Scene.NightSkySaturn.Renderable.Fade", 0.0, 1.0)
openspace.fadeOut("Scene.NightSkyMercury.Renderable")
openspace.fadeOut("Scene.NightSkyVenus.Renderable")
openspace.fadeOut("Scene.NightSkyMars.Renderable")
openspace.fadeOut("Scene.NightSkyJupiter.Renderable")
openspace.fadeOut("Scene.NightSkySaturn.Renderable")
openspace.setPropertyValueSingle("Scene.Moon.Scale.Scale", 1)
]],
Documentation = "Hides night sky versions of the planets",
GuiPath = "/Night Sky/Planets",
@@ -155,6 +147,27 @@ local HideNightSkyPlanets = {
}
local ToggleNightSkyPlanets = {
Identifier = "os.nightsky.ToggleNightSkyPlanets",
Name = "Toggle night sky planets",
Command = [[
openspace.toggleFade("Scene.NightSkyMercury.Renderable")
openspace.toggleFade("Scene.NightSkyVenus.Renderable")
openspace.toggleFade("Scene.NightSkyMars.Renderable")
openspace.toggleFade("Scene.NightSkyJupiter.Renderable")
openspace.toggleFade("Scene.NightSkySaturn.Renderable")
local scale = openspace.getPropertyValue("Scene.Moon.Scale.Scale")
if (scale > 1) then
openspace.setPropertyValueSingle("Scene.Moon.Scale.Scale", 1.0)
else
openspace.setPropertyValueSingle("Scene.Moon.Scale.Scale", 2.0)
end
]],
Documentation = "Toggles visibility of the night sky versions of the planets (Note: Increases the scale of the Moon)",
GuiPath = "/Night Sky/Planets",
IsLocal = false
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Mercury)
openspace.addSceneGraphNode(Venus)
@@ -163,9 +176,11 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(Saturn)
openspace.action.registerAction(ShowNightSkyPlanets)
openspace.action.registerAction(HideNightSkyPlanets)
openspace.action.registerAction(ToggleNightSkyPlanets)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(ToggleNightSkyPlanets)
openspace.action.removeAction(HideNightSkyPlanets)
openspace.action.removeAction(ShowNightSkyPlanets)
openspace.removeSceneGraphNode(Saturn)
@@ -182,3 +197,4 @@ asset.export(Jupiter)
asset.export(Saturn)
asset.export("ShowNightSkyPlanets", ShowNightSkyPlanets.Identifier)
asset.export("HideNightSkyPlanets", HideNightSkyPlanets.Identifier)
asset.export("ToggleNightSkyPlanets", ToggleNightSkyPlanets.Identifier)
+21 -10
View File
@@ -66,21 +66,14 @@ local ShowZenith = {
Identifier = "os.nightsky.ShowZenith",
Name = "Show local zenith",
Command = [[
local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera()
local camera = openspace.navigation.getNavigationState()
openspace.setParent("ZenithPosition", camera.Anchor)
openspace.setPropertyValueSingle("Scene.ZenithPosition.Translation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.ZenithPosition.Translation.Latitude", lat)
openspace.setPropertyValueSingle("Scene.ZenithPosition.Translation.Longitude", lon)
openspace.setPropertyValueSingle("Scene.ZenithPosition.Rotation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.ZenithPosition.Rotation.Latitude", lat)
openspace.setPropertyValueSingle("Scene.ZenithPosition.Rotation.Longitude", lon)
openspace.setPropertyValueSingle("Scene.ZenithDot.Renderable.Enabled", true)
openspace.setPropertyValueSingle("Scene.ZenithDot.Renderable.Fade", 0.0)
openspace.setPropertyValueSingle("Scene.ZenithDot.Renderable.Fade", 1.0, 1.0)
openspace.fadeIn("Scene.ZenithDot.Renderable")
]],
Documentation = "Shows a dot for the local zenith",
GuiPath = "/Night Sky/Lines and Grids",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
@@ -88,9 +81,24 @@ local HideZenith = {
Identifier = "os.nightsky.HideZenith",
Name = "Hide local zenith",
Command = [[
openspace.setPropertyValueSingle("Scene.ZenithDot.Renderable.Fade", 0.0, 1.0)
openspace.fadeOut("Scene.ZenithDot.Renderable")
]],
Documentation = "Hides the dot for the local zenith",
GuiPath = "/Night Sky/Lines and Grids/Show and Hide",
IsLocal = false
}
local ToggleZenith = {
Identifier = "os.nightsky.ToggleZenith",
Name = "Toggle local zenith",
Command = [[
local camera = openspace.navigation.getNavigationState()
openspace.setParent("ZenithPosition", camera.Anchor)
openspace.setPropertyValueSingle("Scene.ZenithPosition.Translation.Globe", camera.Anchor)
openspace.setPropertyValueSingle("Scene.ZenithPosition.Rotation.Globe", camera.Anchor)
openspace.toggleFade("Scene.ZenithDot.Renderable")
]],
Documentation = "Toggles the dot for the local zenith",
GuiPath = "/Night Sky/Lines and Grids",
IsLocal = false
}
@@ -100,9 +108,11 @@ asset.onInitialize(function()
openspace.addSceneGraphNode(ZenithDot)
openspace.action.registerAction(ShowZenith)
openspace.action.registerAction(HideZenith)
openspace.action.registerAction(ToggleZenith)
end)
asset.onDeinitialize(function()
openspace.action.removeAction(ToggleZenith)
openspace.action.removeAction(HideZenith)
openspace.action.removeAction(ShowZenith)
openspace.removeSceneGraphNode(ZenithDot)
@@ -113,3 +123,4 @@ asset.export(ZenithPosition)
asset.export(ZenithDot)
asset.export("ShowZenith", ShowZenith.Identifier)
asset.export("HideZenith", HideZenith.Identifier)
asset.export("ToggleZenith", ToggleZenith.Identifier)
@@ -26,6 +26,7 @@ local Planet = {
GeometryFile = modelFolder .. "Eris_1_2326.glb",
SpecularIntensity = 0.0,
AmbientIntensity = 0.0,
ModelScale = "Kilometer",
LightSources = {
sun.LightSource
}
@@ -26,6 +26,7 @@ local Planet = {
GeometryFile = modelFolder .. "Haumea_1_1000.glb",
SpecularIntensity = 0.0,
AmbientIntensity = 0.0,
ModelScale = "Kilometer",
LightSources = {
sun.LightSource
}
@@ -26,6 +26,7 @@ local Planet = {
GeometryFile = modelFolder .. "Makemake_1_1430.glb",
SpecularIntensity = 0.0,
AmbientIntensity = 0.0,
ModelScale = "Kilometer",
LightSources = {
sun.LightSource
}
@@ -84,6 +84,32 @@ local Mission = {
{
Name = "Encounters",
TimeRange = { Start = "1979 MAR 05 00:00:00", End = "1989 AUG 25 00:00:00" },
Phases = {
{
Name = "Voyager 1 Jupiter Encounter",
TimeRange = { Start = "1979 MAR 05 00:00:00", End = "1979 MAR 05 00:00:00" }
},
{
Name = "Voyager 2 Jupiter Encounter",
TimeRange = { Start = "1979 JUL 09 00:00:00", End = "1979 JUL 09 00:00:00" }
},
{
Name = "Voyager 1 Saturn Encounter",
TimeRange = { Start = "1980 NOV 09 00:00:00", End = "1980 NOV 09 00:00:00" }
},
{
Name = "Voyager 2 Saturn Encounter",
TimeRange = { Start = "1981 AUG 25 00:00:00", End = "1981 AUG 25 00:00:00" }
},
{
Name = "Voyager 2 Uranus Encounter",
TimeRange = { Start = "1986 JAN 24 00:00:00", End = "1986 JAN 24 00:00:00" }
},
{
Name = "Voyager 2 Neptune Encounter",
TimeRange = { Start = "1989 AUG 25 00:00:00", End = "1989 AUG 25 00:00:00" }
}
}
}
}
}
@@ -307,7 +307,8 @@ local VoyagerTrailEncounterNeptune = {
-- @TODO: Probably an off-by-one bug in RenderableTrailTrajectory?
StartTime = "1989 AUG 23 22:30:00",
EndTime = "1989 AUG 26",
SampleInterval = 100
SampleInterval = 100,
Enabled = asset.enabled
},
Tag = { "voyager2_trail" },
GUI = {
@@ -0,0 +1,41 @@
local globe = asset.require("../../moon")
local texturesPath = asset.syncedResource({
Name = "Moon Textures",
Type = "HttpSynchronization",
Identifier = "moon_textures",
Version = 1
})
local Layer = {
Identifier = "Moon_Texture",
Name = "Moon Texture",
Enabled = asset.enabled,
FilePath = texturesPath .. "WAC_GLOBAL_E000N0000_032P.png",
Description = "Lower Resolution offline version of WAC layer"
}
asset.onInitialize(function()
openspace.globebrowsing.addLayer(globe.Moon.Identifier, "ColorLayers", Layer)
end)
asset.onDeinitialize(function()
openspace.globebrowsing.deleteLayer(globe.Moon.Identifier, "ColorLayers", Layer)
end)
asset.export("Layer", Layer)
asset.meta = {
Name = "Moon Texture",
Version = "1.0",
Description = "Offline lower resolution version of Moon WAC layer, available for offline use",
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}
@@ -7,6 +7,7 @@ local Layer = {
Name = "HiRISE Local Set DEM",
Enabled = asset.enabled,
FilePath = asset.localResource("hirisels.wms"),
TilePixelSize = 512,
Description = [[HiRISE (High Resolution Imaging Science Experiment) is the most
powerful camera ever sent to another planet, one of six instruments onboard the
Mars Reconnaissance Orbiter. We launched in 2005, arrived at Mars in 2006 and have
@@ -3,14 +3,20 @@
<ServerUrl>http://astro.arcgis.com/arcgis/rest/services/OnMars/HiRISE_DEM/raw/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180</UpperLeftX> <UpperLeftY>90</UpperLeftY>
<LowerRightX>180</LowerRightX> <LowerRightY>-90</LowerRightY>
<SizeX>20971520</SizeX> <SizeY>10485760</SizeY>
<TileLevel>15</TileLevel> <YOrigin>top</YOrigin>
<UpperLeftX>-180</UpperLeftX>
<UpperLeftY>90</UpperLeftY>
<LowerRightX>180</LowerRightX>
<LowerRightY>-90</LowerRightY>
<SizeX>20971520</SizeX>
<SizeY>10485760</SizeY>
<TileLevel>15</TileLevel>
<YOrigin>top</YOrigin>
</DataWindow>
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190,0]],PRIMEM["Reference_Meridian",0],UNIT["Degree",0.0174532925199433]]</Projection>
<BlockSizeX>512</BlockSizeX> <BlockSizeY>512</BlockSizeY>
<BandsCount>1</BandsCount> <DataType>Int16</DataType>
<BlockSizeX>512</BlockSizeX>
<BlockSizeY>512</BlockSizeY>
<BandsCount>1</BandsCount>
<DataType>Int16</DataType>
<DataValues NoData="0" Min="-8528" Max="21226"/>
<MaxConnections>5</MaxConnections>
<ZeroBlockHttpCodes>404,400</ZeroBlockHttpCodes>
@@ -7,6 +7,7 @@ local Layer = {
Name = "HRSC MOLA Blended DEM Global 200m v2",
Enabled = asset.enabled,
FilePath = asset.localResource("mdem200m.wms"),
TilePixelSize = 513,
Description = [[Blend of data derived from the Mars Orbiter Laser Altimeter
(MOLA, an instrument aboard NASA's Mars Global Surveyor spacecraft), and data derived
from the High-Resolution Stereo Camera (HRSC, an instrument aboard the European Space
@@ -3,14 +3,20 @@
<ServerUrl>http://astro.arcgis.com/arcgis/rest/services/OnMars/MDEM200M/ImageServer/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180.0</UpperLeftX> <UpperLeftY>90.0</UpperLeftY>
<LowerRightX>180.0</LowerRightX> <LowerRightY>-90.0</LowerRightY>
<SizeX>131328</SizeX> <SizeY>65664</SizeY>
<TileLevel>7</TileLevel> <YOrigin>top</YOrigin>
<UpperLeftX>-180.0</UpperLeftX>
<UpperLeftY>90.0</UpperLeftY>
<LowerRightX>180.0</LowerRightX>
<LowerRightY>-90.0</LowerRightY>
<SizeX>131328</SizeX>
<SizeY>65664</SizeY>
<TileLevel>7</TileLevel>
<YOrigin>top</YOrigin>
</DataWindow>
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
<BlockSizeX>513</BlockSizeX> <BlockSizeY>513</BlockSizeY>
<BandsCount>1</BandsCount> <DataType>Int16</DataType>
<BlockSizeX>513</BlockSizeX>
<BlockSizeY>513</BlockSizeY>
<BandsCount>1</BandsCount>
<DataType>Int16</DataType>
<DataValues NoData="-32768" Min="-8528" Max="21226"/>
<MaxConnections>5</MaxConnections>
<ZeroBlockHttpCodes>404,400</ZeroBlockHttpCodes>
@@ -0,0 +1,42 @@
local globe = asset.require("../../mercury")
local texturesPath = asset.syncedResource({
Name = "Mercury Textures",
Type = "HttpSynchronization",
Identifier = "mercury_textures",
Version = 2
})
local Layer = {
Identifier = "Texture",
FilePath = texturesPath .. "Mercury_MESSENGER_MDIS_Basemap_BDR_Mosaic_Global_32ppd.jpg",
Enabled = asset.enabled,
Description = [[The Map Projected Basemap RDR (BDR) data set consists of a global
monochrome map of reflectance at a resolution of 256 pixels per degree (~166 m/p).
This is an offline version with lower resoution than the Messenger BDR layer.]]
}
asset.onInitialize(function()
openspace.globebrowsing.addLayer(globe.Mercury.Identifier, "ColorLayers", Layer)
end)
asset.onDeinitialize(function()
openspace.globebrowsing.deleteLayer(globe.Mercury.Identifier, "ColorLayers", Layer)
end)
asset.export("Layer", Layer)
asset.meta = {
Name = "Mercury Texture",
Version = "1.0",
Description = "Default texture for Mercury",
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}
@@ -1,5 +1,4 @@
asset.require("./layers/colorlayers/clr_mosaic_globalfill_600m_newyork", true)
asset.require("./layers/colorlayers/triton_voyager2_clrmosaic_globalfill_600m", true)
asset.meta = {
@@ -1,39 +0,0 @@
local globe = asset.require("scene/solarsystem/planets/neptune/triton/triton")
local Layer = {
Identifier = "Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork",
Name = "Triton Voyager2 Mosaic [New York]",
Enabled = asset.enabled,
FilePath = asset.localResource("clr_mosaic_globalfill_600m_newyork.vrt"),
Description = [[Voyager 2 data was used to construct the best-ever global color map of
Triton. This map has a resolution of 1,970 feet (600 meters per pixel [m]). Color was
synthesized by combining high-resolution images taken through orange, violet, and
ultraviolet filters; these images were displayed as red, green, and blue images and
combined to create this color version (Smith et al., 1989).]]
}
asset.onInitialize(function()
openspace.globebrowsing.addLayer(globe.Triton.Identifier, "ColorLayers", Layer)
end)
asset.onDeinitialize(function()
openspace.globebrowsing.deleteLayer(globe.Triton.Identifier, "ColorLayers", Layer)
end)
asset.export("layer", Layer)
asset.meta = {
Name = "Triton Voyager2 Mosaic",
Version = "1.0",
Description = [[Voyager2 mosaic of Triton. This layer is hosted on the
OpenSpace server in New York]],
Author = "USGS",
URL = "https://astrogeology.usgs.gov/search/map/Triton/Mosaic/" ..
"Triton_Voyager2_ClrMosaic_GlobalFill_600m/",
License = "NASA/PDS"
}
@@ -1,47 +0,0 @@
<VRTDataset rasterXSize="14138" rasterYSize="7069">
<SRS dataAxisToSRSAxisMapping="2,1">GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 2.5463290422973548e-02, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.5463290422973548e-02</GeoTransform>
<VRTRasterBand dataType="Byte" band="1">
<ColorInterp>Red</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">clr_mosaic_globalfill_600m_newyork.wms</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="14138" RasterYSize="7069" DataType="Byte" BlockXSize="512" BlockYSize="512" />
<SrcRect xOff="0" yOff="0" xSize="14138" ySize="7069" />
<DstRect xOff="0" yOff="0" xSize="14138" ySize="7069" />
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2">
<ColorInterp>Green</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">clr_mosaic_globalfill_600m_newyork.wms</SourceFilename>
<SourceBand>2</SourceBand>
<SourceProperties RasterXSize="14138" RasterYSize="7069" DataType="Byte" BlockXSize="512" BlockYSize="512" />
<SrcRect xOff="0" yOff="0" xSize="14138" ySize="7069" />
<DstRect xOff="0" yOff="0" xSize="14138" ySize="7069" />
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3">
<ColorInterp>Blue</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">clr_mosaic_globalfill_600m_newyork.wms</SourceFilename>
<SourceBand>3</SourceBand>
<SourceProperties RasterXSize="14138" RasterYSize="7069" DataType="Byte" BlockXSize="512" BlockYSize="512" />
<SrcRect xOff="0" yOff="0" xSize="14138" ySize="7069" />
<DstRect xOff="0" yOff="0" xSize="14138" ySize="7069" />
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="4">
<ColorInterp>Alpha</ColorInterp>
<NoDataValue>0</NoDataValue>
<ComplexSource>
<SourceFilename relativeToVRT="1">clr_mosaic_globalfill_600m_newyork.wms</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="14138" RasterYSize="7069" DataType="Byte" BlockXSize="512" BlockYSize="512" />
<SrcRect xOff="0" yOff="0" xSize="14138" ySize="7069" />
<DstRect xOff="0" yOff="0" xSize="14138" ySize="7069" />
<ScaleRatio>255</ScaleRatio>
<NODATA>0</NODATA>
</ComplexSource>
</VRTRasterBand>
</VRTDataset>
@@ -1,20 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://wms.openspace.amnh.org/Triton/Triton_Voyager2_ClrMosaic_GlobalFill_600m/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180.0</UpperLeftX>
<UpperLeftY>90.0</UpperLeftY>
<LowerRightX>180.0</LowerRightX>
<LowerRightY>-90.0</LowerRightY>
<SizeX>14138</SizeX>
<SizeY>7069</SizeY>
<TileLevel>5</TileLevel>
<YOrigin>top</YOrigin>
</DataWindow>
<Projection>EPSG:4326</Projection>
<BlockSizeX>512</BlockSizeX>
<BlockSizeY>512</BlockSizeY>
<BandsCount>4</BandsCount>
<MaxConnections>10</MaxConnections>
</GDAL_WMS>
@@ -0,0 +1,46 @@
local globe = asset.require("../../triton")
local texturesPath = asset.syncedResource({
Name = "Triton Textures",
Type = "HttpSynchronization",
Identifier = "triton_textures",
Version = 1
})
local Layer = {
Identifier = "Triton_Voyager2_ClrMosaic_GlobalFill_600m",
Name = "Triton Voyager2 Mosaic [local]",
Enabled = asset.enabled,
FilePath = texturesPath .. "Triton_Voyager2_ClrMosaic_GlobalFill_600m.png",
Description = [[Voyager 2 data was used to construct the best-ever global color map of Triton.
This map has a resolution of 1,970 feet (600 meters per pixel [m]). Color was synthesized by
combining high-resolution images taken through orange, violet, and ultraviolet filters; these
images were displayed as red, green, and blue images and combined to create this
color version (Smith et al., 1989).]]
}
asset.onInitialize(function()
openspace.globebrowsing.addLayer(globe.Triton.Identifier, "ColorLayers", Layer)
end)
asset.onDeinitialize(function()
openspace.globebrowsing.deleteLayer(globe.Triton.Identifier, "ColorLayers", Layer)
end)
asset.export("Layer", Layer)
asset.meta = {
Name = "Triton Voyager2 Mosaic",
Version = "1.0",
Description = [[Voyager2 mosaic of Triton. This layer is local in the sync folder.]],
Author = "USGS",
URL = "https://astrogeology.usgs.gov/search/map/Triton/Mosaic/" ..
"Triton_Voyager2_ClrMosaic_GlobalFill_600m/",
License = "NASA/PDS"
}
@@ -0,0 +1,53 @@
asset.require("spice/base")
local transforms = asset.require("../transforms")
local kernel = asset.require("../kernels")
local Trail = {
Identifier = "TritonTrail",
Parent = transforms.NeptuneBarycenter.Identifier,
Renderable = {
Type = "RenderableTrailOrbit",
Translation = {
Type = "SpiceTranslation",
Target = "TRITON",
Observer = "NEPTUNE BARYCENTER"
},
Color = { 0.2, 0.5, 0.75 },
Period = 5.877,
Resolution = 1000
},
Tag = { "moonTrail_solarSystem", "moonTrail_giants", "moonTrail_neptune" },
GUI = {
Name = "Triton Trail",
Path = "/Solar System/Planets/Neptune/Major Moons/Triton"
}
}
asset.onInitialize(function()
openspace.spice.loadKernel(kernel.nep097)
openspace.addSceneGraphNode(Trail)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Trail)
openspace.spice.unloadKernel(kernel.nep097)
end)
asset.export(Trail)
asset.meta = {
Name = "Triton Trail",
Version = "1.1",
Description = [[Trail of Triton as observed by the Neptune. Data from NASA Spice (see
base spice asset)]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}
@@ -7,6 +7,11 @@ local Triton = {
Identifier = "Triton",
Parent = transforms.NeptuneBarycenter.Identifier,
Transform = {
Rotation = {
Type = "SpiceRotation",
SourceFrame = "IAU_TRITON",
DestinationFrame = "GALACTIC",
},
Translation = {
Type = "SpiceTranslation",
Target = "TRITON",
@@ -100,8 +105,7 @@ asset.export(TritonLabel)
asset.meta = {
Name = "Triton",
Version = "1.1",
Description = [[Procedural Globe asset containing Neptune's moon: Triton. A blank globe
and SPICE trail are generated for the moon]],
Description = [[Globe asset containing Neptune's moon Triton]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
+30
View File
@@ -147,6 +147,36 @@
"type": "setPropertyValue",
"value": "false"
},
{
"name": "Scene.NixText.Renderable.Enabled",
"type": "setPropertyValue",
"value": "false"
},
{
"name": "Scene.PlutoText.Renderable.Enabled",
"type": "setPropertyValue",
"value": "false"
},
{
"name": "Scene.CharonText.Renderable.Enabled",
"type": "setPropertyValue",
"value": "false"
},
{
"name": "Scene.HydraText.Renderable.Enabled",
"type": "setPropertyValue",
"value": "false"
},
{
"name": "Scene.KerberosText.Renderable.Enabled",
"type": "setPropertyValue",
"value": "false"
},
{
"name": "Scene.StyxText.Renderable.Enabled",
"type": "setPropertyValue",
"value": "false"
},
{
"name": "Scene.PlutoProjection.Renderable.ColorTexturePaths",
"type": "setPropertyValue",
+90
View File
@@ -0,0 +1,90 @@
{
"assets": [
"base_blank",
"customization/globebrowsing",
"events/toggle_sun",
"nightsky/nightsky",
"scene/digitaluniverse/digitaluniverse",
"scene/milkyway/constellations/constellation_art",
"scene/milkyway/constellations/constellation_keybinds",
"scene/milkyway/milkyway/volume",
"scene/solarsystem/dwarf_planets/pluto/system",
"scene/solarsystem/planets/earth/earth",
"scene/solarsystem/planets/earth/layers/colorlayers/blue_marble",
"scene/solarsystem/planets/earth/layers/heightlayers/blue_marble_height",
"scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012",
"scene/solarsystem/planets/earth/moon/layers/colorlayers/moon_texture",
"scene/solarsystem/planets/earth/noaa-sos/land/blue_marble-blue_marble",
"scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture",
"scene/solarsystem/planets/mars/layers/colorlayers/mars_texture",
"scene/solarsystem/planets/mercury/layers/colorlayers/mercury_texture",
"scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture",
"scene/solarsystem/planets/planets",
"scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture",
"scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture",
"scene/solarsystem/planets/venus/layers/colorlayers/venus_texture",
"scene/solarsystem/sun/default_layers",
"scene/solarsystem/sun/glare",
"scene/solarsystem/sun/habitablezone"
],
"camera": {
"altitude": 17000000.0,
"anchor": "Earth",
"latitude": 58.5877,
"longitude": 16.1924,
"type": "goToGeo"
},
"delta_times": [
1.0,
5.0,
30.0,
60.0,
300.0,
1800.0,
3600.0,
43200.0,
86400.0,
604800.0,
1209600.0,
2592000.0,
5184000.0,
7776000.0,
15552000.0,
31536000.0,
63072000.0,
157680000.0,
315360000.0,
630720000.0
],
"mark_nodes": [
"Earth",
"Mars",
"Moon",
"Sun",
"Venus"
],
"meta": {
"author": "OpenSpace Team",
"description": "This profile adds low resolution textures to the planets that do not require internet to view.",
"license": "MIT License",
"name": "Offline",
"url": "https://www.openspaceproject.com",
"version": "1.0"
},
"properties": [
{
"name": "Modules.SkyBrowser.Enabled",
"type": "setPropertyValueSingle",
"value": "false"
}
],
"time": {
"is_paused": false,
"type": "relative",
"value": "-1d"
},
"version": {
"major": 1,
"minor": 4
}
}
@@ -336,6 +336,7 @@ std::vector<documentation::Documentation> GlobeBrowsingModule::documentations()
globebrowsing::SingleImageProvider::Documentation(),
globebrowsing::SizeReferenceTileProvider::Documentation(),
globebrowsing::TemporalTileProvider::Documentation(),
globebrowsing::TileIndexTileProvider::Documentation(),
globebrowsing::TileProviderByIndex::Documentation(),
globebrowsing::TileProviderByLevel::Documentation(),
globebrowsing::GeoJsonManager::Documentation(),
@@ -109,7 +109,7 @@ void main() {
levelWeights = getLevelWeights(distToVertexOnEllipsoid);
// Get the height value and apply skirts
float height = getTileHeight(in_uv, levelWeights) - getTileVertexSkirtLength();
float height = getTileHeight(in_uv, levelWeights) - getTileVertexSkirtLength();
#if USE_ACCURATE_NORMALS
// Calculate tangents
@@ -472,7 +472,7 @@ void MemoryAwareTileCache::createTileAndPut(ProviderTileKey key, RawTile rawTile
_numTextureBytesAllocatedOnCPU += numBytes - previousExpectedDataSize;
tex->reUploadTexture();
}
tex->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap);
tex->setFilter(ghoul::opengl::Texture::FilterMode::Linear);
Tile tile{ tex, std::move(rawTile.tileMetaData), Tile::Status::OK };
TileTextureInitData::HashKey initDataKey = initData.hashKey;
_textureContainerMap[initDataKey].second->put(std::move(key), std::move(tile));
@@ -231,6 +231,15 @@ void ShadowComponent::deinitializeGL() {
}
RenderData ShadowComponent::begin(const RenderData& data) {
glm::ivec2 renderingResolution = global::renderEngine->renderingResolution();
if (_dynamicDepthTextureRes && ((_shadowDepthTextureWidth != renderingResolution.x) ||
(_shadowDepthTextureHeight != renderingResolution.y)))
{
_shadowDepthTextureWidth = renderingResolution.x * 2;
_shadowDepthTextureHeight = renderingResolution.y * 2;
updateDepthTexture();
}
// ===========================================
// Builds light's ModelViewProjectionMatrix:
// ===========================================
@@ -375,15 +384,6 @@ void ShadowComponent::update(const UpdateData&) {
else {
_sunPosition = glm::dvec3(0.0);
}
glm::ivec2 renderingResolution = global::renderEngine->renderingResolution();
if (_dynamicDepthTextureRes && ((_shadowDepthTextureWidth != renderingResolution.x) ||
(_shadowDepthTextureHeight != renderingResolution.y)))
{
_shadowDepthTextureWidth = renderingResolution.x * 2;
_shadowDepthTextureHeight = renderingResolution.y * 2;
updateDepthTexture();
}
}
void ShadowComponent::createDepthTexture() {
@@ -60,7 +60,8 @@ void TextTileProvider::internalDeinitialize() {
}
Tile TextTileProvider::renderTile(const TileIndex& tileIndex, const std::string& text,
const glm::vec2& position, const glm::vec4& color)
const glm::vec2& position, const glm::vec4& color,
const glm::vec4& backgroundColor)
{
ZoneScoped;
TracyGpuZone("tile");
@@ -88,7 +89,12 @@ Tile TextTileProvider::renderTile(const TileIndex& tileIndex, const std::string&
GLsizei h = static_cast<GLsizei>(texture->height());
global::renderEngine->openglStateCache().loadCurrentGLState();
glViewport(0, 0, w, h);
glClearColor(0.f, 0.f, 0.f, 0.f);
glClearColor(
backgroundColor.r,
backgroundColor.g,
backgroundColor.b,
backgroundColor.a
);
glClear(GL_COLOR_BUFFER_BIT);
fontRenderer->render(*font, position, text, color);
@@ -38,7 +38,8 @@ public:
protected:
Tile renderTile(const TileIndex& tileIndex, const std::string& text,
const glm::vec2& position, const glm::vec4& color);
const glm::vec2& position, const glm::vec4& color,
const glm::vec4& backgroundColor = glm::vec4(0.0));
const TileTextureInitData initData;
@@ -24,24 +24,82 @@
#include <modules/globebrowsing/src/tileprovider/tileindextileprovider.h>
namespace openspace::globebrowsing {
#include <openspace/documentation/documentation.h>
TileIndexTileProvider::TileIndexTileProvider(const ghoul::Dictionary&)
namespace {
constexpr openspace::properties::Property::PropertyInfo UniqueBackgroundColors = {
"UniqueBackgroundColor",
"Unique Background Color",
"If 'true' each index tile will have a unique background color assigned to it",
openspace::properties::Property::Visibility::Developer
};
struct [[codegen::Dictionary(TileIndexTileProvider)]] Parameters {
// [[codegen::verbatim(UniqueBackgroundColors.description)]]
std::optional<bool> uniqueBackgroundColors;
};
#include "tileindextileprovider_codegen.cpp"
} // namespace
namespace openspace::globebrowsing {
documentation::Documentation TileIndexTileProvider::Documentation() {
return codegen::doc<Parameters>("globebrowsing_tileindextileprovider");
}
TileIndexTileProvider::TileIndexTileProvider(const ghoul::Dictionary& dictionary)
: TextTileProvider(tileTextureInitData(layers::Group::ID::ColorLayers, false))
{}
, _uniqueBackgroundColors(UniqueBackgroundColors, false)
{
const Parameters p = codegen::bake<Parameters>(dictionary);
_uniqueBackgroundColors = p.uniqueBackgroundColors.value_or(_uniqueBackgroundColors);
addProperty(_uniqueBackgroundColors);
}
Tile TileIndexTileProvider::tile(const TileIndex& tileIndex) {
ZoneScoped;
std::string text = fmt::format(
"level: {}\nx: {}\ny: {}", tileIndex.level, tileIndex.x, tileIndex.y
);
glm::vec2 textPosition = glm::vec2(
glm::vec2 position = glm::vec2(
initData.dimensions.x / 4 -
(initData.dimensions.x / 32) * log10(1 << tileIndex.level),
initData.dimensions.y / 2 + fontSize
);
return TextTileProvider::renderTile(tileIndex, text, textPosition, glm::vec4(1.f));
if (_uniqueBackgroundColors) {
TileIndex::TileHashKey key = tileIndex.hashKey();
size_t hash = std::hash<TileIndex::TileHashKey>{}(key);
// This is pretty ugly, but it's just for debugging and it is reproducable... We
// take the first three bytes of the hash, treat them as an 8-bit unsigned integer
// which makes them [0, 255] and also pseudorandom while being always the same for
// each tile. If we divide the resulting number by 255 we get a value [0, 1] that
// we can use for the color channel
uint8_t red = reinterpret_cast<uint8_t*>(&hash)[0];
uint8_t green = reinterpret_cast<uint8_t*>(&hash)[1];
uint8_t blue = reinterpret_cast<uint8_t*>(&hash)[2];
glm::vec4 backgroundColor = glm::vec4(
static_cast<float>(red) / 255.f,
static_cast<float>(green) / 255.f,
static_cast<float>(blue) / 255.f,
0.75f
);
return TextTileProvider::renderTile(
tileIndex,
text,
position,
glm::vec4(1.f),
backgroundColor
);
}
else {
return TextTileProvider::renderTile(tileIndex, text, position, glm::vec4(1.f));
}
}
Tile::Status TileIndexTileProvider::tileStatus(const TileIndex&) {
@@ -27,6 +27,8 @@
#include <modules/globebrowsing/src/tileprovider/texttileprovider.h>
#include <openspace/properties/scalar/boolproperty.h>
namespace openspace::globebrowsing {
class TileIndexTileProvider : public TextTileProvider {
@@ -40,6 +42,11 @@ public:
int minLevel() override final;
int maxLevel() override final;
float noDataValueAsFloat() override final;
static documentation::Documentation Documentation();
private:
properties::BoolProperty _uniqueBackgroundColors;
};
} // namespace openspace::globebrowsing
+31
View File
@@ -87,6 +87,20 @@ openspace.documentation = {
"'OpenSpaceEngine.FadeDuration' property will be used instead. If the third " ..
"argument (endScript) is provided then that script will be run after the fade " ..
"is finished."
},
{
Name = "toggleFade",
Arguments = {
identifier = "String",
fadeTime = "Number?",
endScript = "String?"
},
Documentation = [[Toggles the fade state of the node(s) with the given identifier over the given
time in seconds. The identifier can contain a tag and/or a wildcard to target
several nodes. If the fade time is not provided then the
"OpenSpaceEngine.FadeDuration" property will be used instead. If the third
argument (endScript) is provided then that script will be run after the fade
is finished.]]
}
}
@@ -302,3 +316,20 @@ openspace.fadeOut = function(identifier, fadeTime, endScript)
)
end
end
openspace.toggleFade = function(renderable, fadeTime, endScript)
if (fadeTime == nil) then
fadeTime = openspace.getPropertyValue("OpenSpaceEngine.FadeDuration")
end
local enabled = openspace.getPropertyValue(renderable .. ".Enabled")
local fadeState = openspace.getPropertyValue(renderable .. ".Fade")
if (enabled) then
if (fadeState < 0.5) then
openspace.fadeIn(renderable, fadeTime-(fadeTime*fadeState), endScript)
else
openspace.fadeOut(renderable, fadeTime*fadeState, endScript)
end
else
openspace.fadeIn(renderable, fadeTime, endScript)
end
end