diff --git a/.gitignore b/.gitignore index 1006d42b46..6d74e0d3f1 100644 --- a/.gitignore +++ b/.gitignore @@ -34,17 +34,8 @@ log.html ScriptLog.txt data/scene/atmosphereearth/textures -data/scene/dawn/ceres/textures -data/scene/dawn/dawn/obj -data/scene/dawn/dawn/textures -data/scene/dawn/vestaprojection/textures -data/scene/dawn/vestaprojection/VestaComet data/scene/debugglobe/textures data/scene/earth/textures -data/scene/juno/juno/Juno.mtl -data/scene/juno/juno/Juno.obj -data/scene/juno/juno/spice -data/scene/juno/juno/textures data/scene/jupiter/callisto/textures data/scene/jupiter/europa/textures data/scene/jupiter/ganymede/textures @@ -54,31 +45,47 @@ data/scene/mars/textures data/scene/mercury/textures data/scene/milkyway/textures data/scene/milkyway-eso/textures +data/scene/missions/dawn/ceres/textures +data/scene/missions/dawn/dawn/obj +data/scene/missions/dawn/dawn/textures +data/scene/missions/dawn/vestaprojection/textures +data/scene/missions/dawn/vestaprojection/VestaComet +data/scene/missions/juno/juno/Juno.mtl +data/scene/missions/juno/juno/Juno.obj +data/scene/missions/juno/juno/spice +data/scene/missions/juno/juno/textures +data/scene/missions/newhorizons/jupiter/callisto/textures +data/scene/missions/newhorizons/jupiter/europa/textures +data/scene/missions/newhorizons/jupiter/ganymede/textures +data/scene/missions/newhorizons/jupiter/io/textures +data/scene/missions/newhorizons/jupiter/jupiter/ProjectionsOfInterest +data/scene/missions/newhorizons/newhorizons/models +data/scene/missions/newhorizons/newhorizons/textures +data/scene/missions/newhorizons/pluto/charon/textures +data/scene/missions/newhorizons/pluto/pluto/assets +data/scene/missions/newhorizons/pluto/pluto/full_images +data/scene/missions/newhorizons/pluto/pluto/images +data/scene/missions/newhorizons/pluto/pluto/textures +data/scene/missions/osirisrex/bennu/models +data/scene/missions/osirisrex/bennu/textures +data/scene/missions/osirisrex/osirisrex/models +data/scene/missions/osirisrex/osirisrex/textures +data/scene/missions/rosetta/67P/obj +data/scene/missions/rosetta/67P/rosettaimages +data/scene/missions/rosetta/67P/textures +data/scene/missions/rosetta/rosetta/rosetta +data/scene/missions/rosetta/rosetta/textures data/scene/moon/textures data/scene/neptune/textures -data/scene/newhorizons/jupiter/callisto/textures -data/scene/newhorizons/jupiter/europa/textures -data/scene/newhorizons/jupiter/ganymede/textures -data/scene/newhorizons/jupiter/io/textures -data/scene/newhorizons/jupiter/jupiter/ProjectionsOfInterest -data/scene/newhorizons/newhorizons/models -data/scene/newhorizons/newhorizons/textures -data/scene/newhorizons/pluto/charon/textures -data/scene/newhorizons/pluto/pluto/assets -data/scene/newhorizons/pluto/pluto/full_images -data/scene/newhorizons/pluto/pluto/images -data/scene/newhorizons/pluto/pluto/textures -data/scene/osirisrex/bennu/models -data/scene/osirisrex/bennu/textures -data/scene/osirisrex/osirisrex/models -data/scene/osirisrex/osirisrex/textures data/scene/pluto/textures -data/scene/saturn/textures -data/scene/rosetta/67P/obj -data/scene/rosetta/67P/rosettaimages -data/scene/rosetta/67P/textures -data/scene/rosetta/rosetta/rosetta -data/scene/rosetta/rosetta/textures +data/scene/saturn/dione/textures +data/scene/saturn/enceladus/textures +data/scene/saturn/iapetus/textures +data/scene/saturn/mimas/textures +data/scene/saturn/rhea/textures +data/scene/saturn/saturn/textures +data/scene/saturn/tethys/textures +data/scene/saturn/titan/textures data/scene/stars/colorbv.cmap data/scene/stars/speck data/scene/stars/textures @@ -90,11 +97,11 @@ data/scene/uranus/textures data/scene/venus/textures data/scene/volumetricmilkyway/milkyway data/spice/DawnKernels -data/spice/jup260.bsp data/spice/de430_1850-2150.bsp +data/spice/jup260.bsp data/spice/MAR063.BSP data/spice/NewHorizonsKernels data/spice/nh_kernels data/spice/OsirisRexKernels data/spice/Rosetta - +data/spice/sat375.bsp diff --git a/data/scene/atmosphereearth.scene b/data/scene/atmosphereearth.scene index bc120bbd57..914c040ca7 100644 --- a/data/scene/atmosphereearth.scene +++ b/data/scene/atmosphereearth.scene @@ -10,7 +10,7 @@ function preInitialization() openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime(openspace.time.currentWallTime()) - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) + dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) end function postInitialization() diff --git a/data/scene/dawn.scene b/data/scene/dawn.scene index 74ad519767..6ae70e3fb9 100644 --- a/data/scene/dawn.scene +++ b/data/scene/dawn.scene @@ -10,7 +10,7 @@ function preInitialization() openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime("2011 AUG 06 00:00:00") - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) + dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) end function postInitialization() @@ -46,18 +46,14 @@ return { "venus", "earth", "mars", - "jupiter", - "saturn", + "jupiter/jupiter", + "saturn/saturn", "uranus", "neptune", "pluto", "stars", "milkyway", - "rosetta", - "67P", - "dawn", - "vestaprojection", - "ceres" + "missions/dawn" } } diff --git a/data/scene/debugmodel.scene b/data/scene/debugmodel.scene deleted file mode 100644 index c53596b87e..0000000000 --- a/data/scene/debugmodel.scene +++ /dev/null @@ -1,53 +0,0 @@ --- TextureResolution = "low" -TextureResolution = "med" --- TextureResolution = "high" - -function preInitialization() - --[[ - The scripts in this function are executed after the scene is loaded but before the - scene elements have been initialized, thus they should be used to set the time at - which the scene should start and other settings that might determine initialization - critical objects. - ]]-- - - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) - - openspace.spice.loadKernel("${SPICE}/naif0011.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") - - openspace.time.setTime("2018-10-25T04:00:00.00") - openspace.time.setDeltaTime(0) -end - -function postInitialization() - --[[ - The scripts in this function are executed after all objects in the scene have been - created and initialized, but before the first render call. This is the place to set - graphical settings for the renderables. - ]]-- - openspace.printInfo("Setting default values") - - openspace.setPropertyValue("Sun.renderable.enabled", false) - openspace.setPropertyValue("SunGlare.renderable.enabled", false) - openspace.setPropertyValue("SunMarker.renderable.enabled", false) - - openspace.printInfo("Done setting default values") - - openspace.resetCameraDirection() -end - -return { - ScenePath = ".", - CommonFolder = "common", - Camera = { - Focus = "DebugModel", - Position = {292946.630948, 377755.961928, 366248.427057}, - Rotation = {0.732615, -0.137003, 0.430036, 0.509485}, - }, - Modules = { - "sun", - "stars", - "debugmodel", - } -} - diff --git a/data/scene/default-moon.scene b/data/scene/default-moon.scene deleted file mode 100644 index 90748de3bf..0000000000 --- a/data/scene/default-moon.scene +++ /dev/null @@ -1,93 +0,0 @@ -function preInitialization() - --[[ - The scripts in this function are executed after the scene is loaded but before the - scene elements have been initialized, thus they should be used to set the time at - which the scene should start and other settings that might determine initialization - critical objects. - ]]-- - - --YYYY-MM-DDTHH:MN:SS - --openspace.time.setTime(openspace.time.currentWallTime()) - --[[ - -- March 9, 2016 total eclipse times from land - -- Palembang, South Sumatra, Indonesia - -- Partial solar eclipse begins: 6:20 a.m. local Western Indonesian Time - -- Total solar eclipse begins: 7:20 a.m. local time - -- Maximum eclipse: 7:21 a.m. local time - -- Total solar eclipse ends: 7:22 a.m. local time - -- Partial solar eclipse ends: 8:31 a.m. local time - - -- 6:20 -> 23:20 day before in UTC - ]]-- - openspace.spice.loadKernel("${SPICE}/naif0011.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") - - openspace.time.setTime("2016-03-08T22:45:00") - - - -- Total Lunar Eclipse Jan 31, 2018 at 10:51:13 UTC - -- Regions seeing, at least, some parts of the eclipse: North/East Europe, - -- Asia, Australia, North/East Africa, North America, North/East South America, - -- Pacific, Atlantic, Indian Ocean, Arctic, Antarctica. - --openspace.time.setTime("2018-01-31T10:30:00") - - --openspace.time.setDeltaTime(200.0) - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) -end - -function postInitialization() - --[[ - The scripts in this function are executed after all objects in the scene have been - created and initialized, but before the first render call. This is the place to set - graphical settings for the renderables. - ]]-- - openspace.printInfo("Setting default values") - openspace.setPropertyValue("Sun.renderable.enabled", false) - openspace.setPropertyValue("SunMarker.renderable.enabled", false) - openspace.setPropertyValue("EarthMarker.renderable.enabled", false) - --openspace.setPropertyValue("Constellation Bounds.renderable.enabled", false) - openspace.setPropertyValue("PlutoTrail.renderable.enabled", false) - openspace.setPropertyValue("PlutoTexture.renderable.enabled", false) - - openspace.setPropertyValue("MilkyWay.renderable.transparency", 0.55) - openspace.setPropertyValue("MilkyWay.renderable.segments", 50) - - openspace.printInfo("Done setting default values") -end - -return { - ScenePath = ".", - CommonFolder = "common", - Camera = { - Focus = "Earth", - --Focus = "Moon", - Position = {526781518487.171326, 257168309890.072144, -1381125204152.817383}, - Rotation = {-0.106166, 0.981574, -0.084545, 0.134513}, - }, - Modules = { - "sun", - "mercury", - "venus", - "earth", - "moon", - "mars", - --"jupiter", - "saturn", - "uranus", - "neptune", - "stars", - -- "stars-denver", - "milkyway", - -- "milkyway-eso", - --"constellationbounds", - -- "fieldlines", - --"io", - --"europa", - --"ganymede", - --"callisto", - --"gridGalactic", - --"gridEcliptic", - --"gridEquatorial", - } -} - diff --git a/data/scene/default.scene b/data/scene/default.scene index 9dc1e2802d..65cfc9d82c 100644 --- a/data/scene/default.scene +++ b/data/scene/default.scene @@ -10,7 +10,7 @@ function preInitialization() openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime(openspace.time.currentWallTime()) - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) + dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) end @@ -21,7 +21,7 @@ function postInitialization() graphical settings for the renderables. ]]-- openspace.printInfo("Setting default values") - openspace.setPropertyValue("Sun.renderable.enab`led", true) + openspace.setPropertyValue("Sun.renderable.enabled", true) openspace.setPropertyValue("SunGlare.renderable.enabled", false) openspace.setPropertyValue("SunMarker.renderable.enabled", false) openspace.setPropertyValue("EarthMarker.renderable.enabled", false) @@ -35,17 +35,7 @@ function postInitialization() openspace.printInfo("Done setting default values") if openspace.modules.isLoaded("ISWA") then - openspace.iswa.addCdfFiles("${OPENSPACE_DATA}/cdflist.json"); - - --openspace.iswa.addCygnet(7); - - --openspace.iswa.addCygnet(-4,"Data","Gm"); - --openspace.iswa.addCygnet(-5,"Data","Gm"); - --openspace.iswa.addCygnet(-6,"Data","Gm"); - --openspace.iswa.addCygnet(-7,"Data","Gm"); - --openspace.iswa.addCygnet(-8,"Data","Gm"); - --openspace.iswa.addCygnet(-9,"Data","Gm"); end end @@ -55,8 +45,8 @@ return { CommonFolder = "common", Camera = { Focus = "Earth", - Position = {526781518487.171326, 257168309890.072144, -1381125204152.817383}, - Rotation = {-0.106166, 0.981574, -0.084545, 0.134513}, + Position = {505370268486.696167, 1089706179272.719116, -890259148524.319458}, + Rotation = {0.250635, -0.028751, 0.879269, 0.404030}, }, Modules = { "sun", diff --git a/data/scene/earth/earth.mod b/data/scene/earth/earth.mod index 2a20e2d275..d59d6bec41 100644 --- a/data/scene/earth/earth.mod +++ b/data/scene/earth/earth.mod @@ -3,6 +3,14 @@ return { { Name = "EarthBarycenter", Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "EARTH", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + } + } }, -- Earth module { @@ -30,12 +38,6 @@ return { } }, Transform = { - Translation = { - Type = "SpiceTranslation", - Body = "EARTH", - Observer = "SUN", - Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - }, Rotation = { Type = "SpiceRotation", SourceFrame = "IAU_EARTH", @@ -51,7 +53,7 @@ return { -- EarthTrail module { Name = "EarthTrail", - Parent = "EarthBarycenter", + Parent = "SolarSystemBarycenter", Renderable = { Type = "RenderableTrail", Body = "EARTH", diff --git a/data/scene/fieldlines.scene b/data/scene/fieldlines.scene index 43068d7b75..3cee4bf1e3 100644 --- a/data/scene/fieldlines.scene +++ b/data/scene/fieldlines.scene @@ -10,7 +10,7 @@ function preInitialization() openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime("2015 JAN 01 12:00:00.000") - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) + dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) end function postInitialization() diff --git a/data/scene/globebrowsing-debug.scene b/data/scene/globebrowsing-debug.scene deleted file mode 100644 index ef64c4ef0d..0000000000 --- a/data/scene/globebrowsing-debug.scene +++ /dev/null @@ -1,46 +0,0 @@ -function preInitialization() - --[[ - The scripts in this function are executed after the scene is loaded but before the - scene elements have been initialized, thus they should be used to set the time at - which the scene should start and other settings that might determine initialization - critical objects. - ]]-- - - --openspace.time.setTime(openspace.time.currentWallTime()) - openspace.spice.loadKernel("${SPICE}/naif0011.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") - - openspace.time.setTime("2015 NOV 24 00:00:00") - - - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) -end - -function postInitialization() - openspace.printInfo("Setting default values") - - openspace.setInteractionMode('GlobeBrowsing') - - openspace.time.setDeltaTime(0) - openspace.restoreCameraStateFromFile("debugstart.view") - openspace.resetCameraDirection() - openspace.gui.show() - - openspace.printInfo("Done setting default values") -end - - -return { - ScenePath = ".", - CommonFolder = "common", - Camera = { - Focus = "DebugGlobe", - Position = {3428016.852415, 616607.056698, 60430.587719}, - Rotation = {0.178551, -0.280661, 0.916566, 0.221935}, - }, - - Modules = { - "debugglobe" - } -} - diff --git a/data/scene/globebrowsing.scene b/data/scene/globebrowsing.scene index b26bbf9099..e26333a9a2 100644 --- a/data/scene/globebrowsing.scene +++ b/data/scene/globebrowsing.scene @@ -10,43 +10,42 @@ function preInitialization() openspace.spice.loadKernel("${SPICE}/naif0011.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") - openspace.time.setTime("2015 NOV 24 00:00:00") - openspace.time.setTime(openspace.time.currentWallTime()) - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) + dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) - -- Toggle trails - openspace.bindKey("t", - helper.property.invert('EarthTrail.renderable.enabled') .. - helper.property.invert('MarsTrail.renderable.enabled') .. - helper.property.invert('MoonTrail.renderable.enabled') - ) - -- Toggle night texture, shading, atmosphere and water openspace.bindKey("s", helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.enabled') .. helper.property.invert('Earth.RenderableGlobe.performShading') .. helper.property.invert('Earth.RenderableGlobe.atmosphere') .. - helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.enabled') + helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.enabled'), + "Toggle night texture, shading, atmosphere, and water for Earth." ) -- Toggle background openspace.bindKey("b", helper.property.invert('MilkyWay.renderable.enabled') .. - helper.property.invert('Sun.renderable.enabled') .. - helper.property.invert('Moon.RenderableGlobe.enabled') .. - helper.property.invert('Mars.RenderableGlobe.enabled') .. - helper.property.invert('Stars.renderable.enabled') + helper.property.invert('Stars.renderable.enabled'), + "Toggle background (Stars and Milkyway)." ) + --[[ + -- Toggle trails + openspace.bindKey("o", + 'openspace.setPropertyValue("*Trail.renderable.enabled", false)' + ) + openspace.bindKey("p", + 'openspace.setPropertyValue("*Trail.renderable.enabled", true)' + ) + +]] end function postInitialization() openspace.printInfo("Setting default values") openspace.setInteractionMode('GlobeBrowsing') - --openspace.restoreCameraStateFromFile("camera_lookat_planet.lua") openspace.setPropertyValue("MilkyWay.renderable.transparency", 0.55) openspace.setPropertyValue("MilkyWay.renderable.segments", 50) @@ -60,7 +59,6 @@ function postInitialization() openspace.setPropertyValue("Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.settings.multiplier", 10) openspace.resetCameraDirection() - openspace.time.setDeltaTime(0) openspace.printInfo("Done setting default values") end @@ -70,16 +68,13 @@ return { ScenePath = ".", CommonFolder = "common", Camera = { - Focus = "Mars", + Focus = "Earth", Position = {138530625167.228241, 42217005217.825005, -46336405755.934372}, Rotation = {0.633883, 0.492158, -0.123913, -0.583625}, }, Modules = { - "lodearth", - "lodmoon", - "lodmars", - --"lodmercury", + "lodglobes", "sun", "stars", "milkyway", diff --git a/data/scene/juno.scene b/data/scene/juno.scene index 346b872c2d..f63276e744 100755 --- a/data/scene/juno.scene +++ b/data/scene/juno.scene @@ -9,7 +9,6 @@ function preInitialization() openspace.spice.loadKernel("${SPICE}/pck00010.tpc") openspace.time.setTime("2016-07-05T10:05:00.00") - openspace.time.setDeltaTime(0) dofile(openspace.absPath('${SCRIPTS}/common.lua')) openspace.clearKeys() @@ -18,8 +17,6 @@ function preInitialization() 1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400, 28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600 }) - - openspace.bindKey("F6", "openspace.setPropertyValue('Interaction.coordinateSystem', 'Jupiter');"); end function postInitialization() @@ -55,12 +52,12 @@ return { "earth", "mars", "jupiter", - "saturn", + "saturn/saturn", "uranus", "neptune", "stars", "milkyway", - "juno" + "missions/juno" } } diff --git a/data/scene/jupiter/europa/europa.mod b/data/scene/jupiter/europa/europa.mod index e4dc06dcbc..38d973e463 100644 --- a/data/scene/jupiter/europa/europa.mod +++ b/data/scene/jupiter/europa/europa.mod @@ -33,11 +33,7 @@ return { Type = "SpiceRotation", SourceFrame = "IAU_EUROPA", DestinationFrame = "IAU_JUPITER", - }, - Scale = { - Type = "StaticScale", - Scale = 1, - }, + } } }, -- EuropaTrail module diff --git a/data/scene/newhorizons/newhorizons/jup260.bsp.torrent b/data/scene/jupiter/jupiter/jup260.bsp.torrent similarity index 100% rename from data/scene/newhorizons/newhorizons/jup260.bsp.torrent rename to data/scene/jupiter/jupiter/jup260.bsp.torrent diff --git a/data/scene/jupiter/jupiter/jupiter.data b/data/scene/jupiter/jupiter/jupiter.data index 34dcaf0900..b22e81119b 100644 --- a/data/scene/jupiter/jupiter/jupiter.data +++ b/data/scene/jupiter/jupiter/jupiter.data @@ -2,4 +2,7 @@ return { FileRequest = { { Identifier = "jupiter_textures", Destination = "textures", Version = 1 } }, + TorrentFiles = { + { File = "jup260.bsp.torrent", Destination = "${SPICE}" }, + } } \ No newline at end of file diff --git a/data/scene/lodearth/textures/test_tile.png b/data/scene/lodearth/textures/test_tile.png deleted file mode 100644 index cb16c0952f..0000000000 Binary files a/data/scene/lodearth/textures/test_tile.png and /dev/null differ diff --git a/data/scene/newhorizons/jupiter/callisto/callisto.data b/data/scene/lodglobes/lodcallisto/callisto.data similarity index 100% rename from data/scene/newhorizons/jupiter/callisto/callisto.data rename to data/scene/lodglobes/lodcallisto/callisto.data diff --git a/data/scene/lodglobes/lodcallisto/lodcallisto.mod b/data/scene/lodglobes/lodcallisto/lodcallisto.mod new file mode 100644 index 0000000000..7b2ce90f05 --- /dev/null +++ b/data/scene/lodglobes/lodcallisto/lodcallisto.mod @@ -0,0 +1,62 @@ +return { + -- RenderableGlobe module + { + Name = "Callisto", + Parent = "JupiterBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_CALLISTO", + DestinationFrame = "GALACTIC", + }, + Translation = { + Type = "SpiceTranslation", + Body = "CALLISTO", + Observer = "JUPITER BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp" + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {2631000, 2631000, 2631000}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Callisto Texture", + FilePath = "textures/callisto.jpg", + Enabled = true, + MinimumPixelSize = 112, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + } + }, + -- Trail module + { + Name = "CallistoTrail", + Parent = "JupiterBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "CALLISTO", + Frame = "GALACTIC", + Observer = "JUPITER BARYCENTER", + RGB = { 0.4, 0.3, 0.01 }, + TropicalOrbitPeriod = 60 , + EarthOrbitRatio = 0.045, + DayLength = 9.9259, + } + }, +} diff --git a/data/scene/lodglobes/lodearth/earth.data b/data/scene/lodglobes/lodearth/earth.data new file mode 100644 index 0000000000..e168d4c8be --- /dev/null +++ b/data/scene/lodglobes/lodearth/earth.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "earth_textures", Destination = "textures", Version = 2 } + }, +} diff --git a/data/scene/lodearth/lodearth.mod b/data/scene/lodglobes/lodearth/lodearth.mod similarity index 92% rename from data/scene/lodearth/lodearth.mod rename to data/scene/lodglobes/lodearth/lodearth.mod index aecaf518fb..d3622c8e10 100644 --- a/data/scene/lodearth/lodearth.mod +++ b/data/scene/lodglobes/lodearth/lodearth.mod @@ -63,12 +63,13 @@ return { }, { Type = "Temporal", - Name = "Temporal MODIS Aqua CorrectedRecflectance TrueColor", - FilePath = "map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml", + Name = "Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature", + FilePath = "map_service_configs/GIBS/Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature.xml", }, { Name = "VIIRS_SNPP_CorrectedReflectance_TrueColor", FilePath = "map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml", + Enabled = true, }, { Type = "SingleImage", @@ -76,12 +77,8 @@ return { FilePath = "textures/test_tile.png", }, }, - GrayScaleLayers = { - - }, - GrayScaleColorOverlays = { - - }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, NightLayers = { { Name = "Earth at Night 2012", @@ -113,7 +110,7 @@ return { Type = "SizeReference", Name = "Size Reference", Radii = earthEllipsoid, - BackgroundImagePath = "../debugglobe/textures/arrows.png", + BackgroundImagePath = "../../debugglobe/textures/arrows.png", }, }, HeightLayers = { diff --git a/data/scene/lodearth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms b/data/scene/lodglobes/lodearth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms similarity index 83% rename from data/scene/lodearth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms rename to data/scene/lodglobes/lodearth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms index ef90f48509..dfaa82712b 100644 --- a/data/scene/lodearth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms +++ b/data/scene/lodglobes/lodearth/map_service_configs/ESRI/ESRI_Imagery_World_2D.wms @@ -13,12 +13,10 @@ 512 3 5 - + false \ No newline at end of file diff --git a/data/scene/lodearth/map_service_configs/ESRI/TERRAIN.wms b/data/scene/lodglobes/lodearth/map_service_configs/ESRI/TERRAIN.wms similarity index 100% rename from data/scene/lodearth/map_service_configs/ESRI/TERRAIN.wms rename to data/scene/lodglobes/lodearth/map_service_configs/ESRI/TERRAIN.wms diff --git a/data/scene/lodearth/map_service_configs/GIBS/Coastlines.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Coastlines.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/Coastlines.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/Coastlines.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/GIBS_Aqua_MODIS_true.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/GIBS_Aqua_MODIS_true.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/GIBS_Aqua_MODIS_true.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/GIBS_Aqua_MODIS_true.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/MODIS_Terra_Brightness_Temp_Band31_Day.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/MODIS_Terra_Brightness_Temp_Band31_Day.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/MODIS_Terra_Brightness_Temp_Band31_Day.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/MODIS_Terra_Brightness_Temp_Band31_Day.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor_temporal.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor_temporal.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor_temporal.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/MODIS_Terra_CorrectedReflectance_TrueColor_temporal.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/MODIS_Water_Mask.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/MODIS_Water_Mask.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/MODIS_Water_Mask.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/MODIS_Water_Mask.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/Reference_Features.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Reference_Features.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/Reference_Features.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/Reference_Features.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/Reference_Labels.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Reference_Labels.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/Reference_Labels.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/Reference_Labels.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/TERRA_CR_B143_2016-04-12.wms b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/TERRA_CR_B143_2016-04-12.wms similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/TERRA_CR_B143_2016-04-12.wms rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/TERRA_CR_B143_2016-04-12.wms diff --git a/data/scene/lodearth/map_service_configs/GIBS/Temporal_Aqua_Orbit_Asc.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_Aqua_Orbit_Asc.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/Temporal_Aqua_Orbit_Asc.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_Aqua_Orbit_Asc.xml diff --git a/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature.xml new file mode 100644 index 0000000000..2a4f525511 --- /dev/null +++ b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_GHRSST_L4_MUR_Sea_Surface_Temperature.xml @@ -0,0 +1,25 @@ + + 2002-06-01 + + 1d + YYYY-MM-DD + + + http://map1.vis.earthdata.nasa.gov/wmts-geo/GHRSST_L4_MUR_Sea_Surface_Temperature/default/${OpenSpaceTimeId}/EPSG4326_1km/${z}/${y}/${x}.png + + + -180.0 + 90 + 396.0 + -198 + 8 + 2 + 1 + top + + EPSG:4326 + 512 + 512 + 4 + + \ No newline at end of file diff --git a/data/scene/lodearth/map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_MODIS_Aqua_CorrectedReflectance_TrueColor.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/Temporal_VIIRS_SNPP_CorrectedReflectance_TrueColor.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/VIIRS_CityLights_2012.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/VIIRS_CityLights_2012.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/VIIRS_CityLights_2012.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/VIIRS_CityLights_2012.xml diff --git a/data/scene/lodearth/map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml b/data/scene/lodglobes/lodearth/map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml rename to data/scene/lodglobes/lodearth/map_service_configs/GIBS/VIIRS_SNPP_CorrectedReflectance_TrueColor.xml diff --git a/data/scene/lodearth/map_service_configs/other/ASTER_GDEM_Greyscale_Shaded_Relief.xml b/data/scene/lodglobes/lodearth/map_service_configs/other/ASTER_GDEM_Greyscale_Shaded_Relief.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/other/ASTER_GDEM_Greyscale_Shaded_Relief.xml rename to data/scene/lodglobes/lodearth/map_service_configs/other/ASTER_GDEM_Greyscale_Shaded_Relief.xml diff --git a/data/scene/lodearth/map_service_configs/other/Landsat_WELD_CorrectedReflectance_TrueColor_Global_Monthly_v3_STD_temporal.xml b/data/scene/lodglobes/lodearth/map_service_configs/other/Landsat_WELD_CorrectedReflectance_TrueColor_Global_Monthly_v3_STD_temporal.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/other/Landsat_WELD_CorrectedReflectance_TrueColor_Global_Monthly_v3_STD_temporal.xml rename to data/scene/lodglobes/lodearth/map_service_configs/other/Landsat_WELD_CorrectedReflectance_TrueColor_Global_Monthly_v3_STD_temporal.xml diff --git a/data/scene/lodearth/map_service_configs/other/MLS_O3_46hPa_Day.xml b/data/scene/lodglobes/lodearth/map_service_configs/other/MLS_O3_46hPa_Day.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/other/MLS_O3_46hPa_Day.xml rename to data/scene/lodglobes/lodearth/map_service_configs/other/MLS_O3_46hPa_Day.xml diff --git a/data/scene/lodearth/map_service_configs/other/OpenStreetMap.xml b/data/scene/lodglobes/lodearth/map_service_configs/other/OpenStreetMap.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/other/OpenStreetMap.xml rename to data/scene/lodglobes/lodearth/map_service_configs/other/OpenStreetMap.xml diff --git a/data/scene/lodearth/map_service_configs/other/frmt_wms_virtualearth.xml b/data/scene/lodglobes/lodearth/map_service_configs/other/frmt_wms_virtualearth.xml similarity index 100% rename from data/scene/lodearth/map_service_configs/other/frmt_wms_virtualearth.xml rename to data/scene/lodglobes/lodearth/map_service_configs/other/frmt_wms_virtualearth.xml diff --git a/data/scene/lodearth/map_service_configs/other/test.wms b/data/scene/lodglobes/lodearth/map_service_configs/other/test.wms similarity index 100% rename from data/scene/lodearth/map_service_configs/other/test.wms rename to data/scene/lodglobes/lodearth/map_service_configs/other/test.wms diff --git a/data/scene/newhorizons/jupiter/europa/europa.data b/data/scene/lodglobes/lodeuropa/europa.data similarity index 100% rename from data/scene/newhorizons/jupiter/europa/europa.data rename to data/scene/lodglobes/lodeuropa/europa.data diff --git a/data/scene/lodglobes/lodeuropa/lodeuropa.mod b/data/scene/lodglobes/lodeuropa/lodeuropa.mod new file mode 100644 index 0000000000..6e81a4f224 --- /dev/null +++ b/data/scene/lodglobes/lodeuropa/lodeuropa.mod @@ -0,0 +1,62 @@ +return { + -- RenderableGlobe module + { + Name = "Europa", + Parent = "JupiterBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_EUROPA", + DestinationFrame = "GALACTIC", + }, + Translation = { + Type = "SpiceTranslation", + Body = "EUROPA", + Observer = "JUPITER BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp" + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {1561000, 1561000, 1561000}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Europa Texture", + FilePath = "textures/europa.jpg", + Enabled = true, + MinimumPixelSize = 256, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + } + }, + -- Trail module + { + Name = "EuropaTrail", + Parent = "JupiterBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "EUROPA", + Frame = "GALACTIC", + Observer = "JUPITER BARYCENTER", + RGB = { 0.5, 0.3, 0.3 }, + TropicalOrbitPeriod = 60, + EarthOrbitRatio = 0.01, + DayLength = 9.9259, + } + }, +} diff --git a/data/scene/newhorizons/jupiter/ganymede/ganymede.data b/data/scene/lodglobes/lodganymede/ganymede.data similarity index 100% rename from data/scene/newhorizons/jupiter/ganymede/ganymede.data rename to data/scene/lodglobes/lodganymede/ganymede.data diff --git a/data/scene/lodglobes/lodganymede/lodganymede.mod b/data/scene/lodglobes/lodganymede/lodganymede.mod new file mode 100644 index 0000000000..04c8a79216 --- /dev/null +++ b/data/scene/lodglobes/lodganymede/lodganymede.mod @@ -0,0 +1,62 @@ +return { + -- RenderableGlobe module + { + Name = "Ganymede", + Parent = "JupiterBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_GANYMEDE", + DestinationFrame = "GALACTIC", + }, + Translation = { + Type = "SpiceTranslation", + Body = "GANYMEDE", + Observer = "JUPITER BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp" + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {2631000, 2631000, 2631000}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Ganymede Texture", + FilePath = "textures/ganymede.jpg", + Enabled = true, + MinimumPixelSize = 112, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + } + }, + -- Trail module + { + Name = "GanymedeTrail", + Parent = "JupiterBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "GANYMEDE", + Frame = "GALACTIC", + Observer = "JUPITER BARYCENTER", + RGB = { 0.4, 0.3, 0.3 }, + TropicalOrbitPeriod = 60 , + EarthOrbitRatio = 0.019, + DayLength = 9.9259, + } + }, +} diff --git a/data/scene/newhorizons/jupiter/io/io.data b/data/scene/lodglobes/lodio/io.data similarity index 100% rename from data/scene/newhorizons/jupiter/io/io.data rename to data/scene/lodglobes/lodio/io.data diff --git a/data/scene/lodglobes/lodio/lodio.mod b/data/scene/lodglobes/lodio/lodio.mod new file mode 100644 index 0000000000..75f4ade969 --- /dev/null +++ b/data/scene/lodglobes/lodio/lodio.mod @@ -0,0 +1,61 @@ +return { + -- RenderableGlobe module + { + Name = "Io", + Parent = "JupiterBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_IO", + DestinationFrame = "GALACTIC", + }, + Translation = { + Type = "SpiceTranslation", + Body = "IO", + Observer = "JUPITER BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp" + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {1821300, 1821300, 1821300}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Io Texture", + FilePath = "textures/io.jpg", + Enabled = true, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + } + }, + -- Trail module + { + Name = "IoTrail", + Parent = "JupiterBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "IO", + Frame = "GALACTIC", + Observer = "JUPITER BARYCENTER", + RGB = { 0.4, 0.4, 0.2 }, + TropicalOrbitPeriod = 40 , + EarthOrbitRatio = 0.0045, + DayLength = 9.9259, + } + }, +} diff --git a/data/scene/lodglobes/lodjupiter/jup260.bsp.torrent b/data/scene/lodglobes/lodjupiter/jup260.bsp.torrent new file mode 100644 index 0000000000..0c82073d38 Binary files /dev/null and b/data/scene/lodglobes/lodjupiter/jup260.bsp.torrent differ diff --git a/data/scene/lodglobes/lodjupiter/jupiter.data b/data/scene/lodglobes/lodjupiter/jupiter.data new file mode 100644 index 0000000000..b22e81119b --- /dev/null +++ b/data/scene/lodglobes/lodjupiter/jupiter.data @@ -0,0 +1,8 @@ +return { + FileRequest = { + { Identifier = "jupiter_textures", Destination = "textures", Version = 1 } + }, + TorrentFiles = { + { File = "jup260.bsp.torrent", Destination = "${SPICE}" }, + } +} \ No newline at end of file diff --git a/data/scene/lodglobes/lodjupiter/lodjupiter.mod b/data/scene/lodglobes/lodjupiter/lodjupiter.mod new file mode 100644 index 0000000000..60d573616d --- /dev/null +++ b/data/scene/lodglobes/lodjupiter/lodjupiter.mod @@ -0,0 +1,72 @@ +return { + -- Barycenter module + { + Name = "JupiterBarycenter", + Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "JUPITER BARYCENTER", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + }, + }, + }, + -- RenderableGlobe module + { + Name = "Jupiter", + Parent = "JupiterBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_JUPITER", + DestinationFrame = "GALACTIC", + }, + Translation = { + Type = "StaticTranslation", + Position = {0, 0, 0}, -- jupiter is at its barycenter + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {71492000, 71492000, 66854000}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Jupiter Texture", + FilePath = "textures/jupiter.jpg", + Enabled = true, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + } + }, + -- Trail module + { + Name = "JupiterTrail", + Parent = "SolarSystemBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "JUPITER BARYCENTER", + Frame = "GALACTIC", + Observer = "SUN", + RGB = { 0.8, 0.7, 0.7 }, + TropicalOrbitPeriod = 4330.595 , + EarthOrbitRatio = 11.857, + DayLength = 9.9259, + } + }, +} \ No newline at end of file diff --git a/data/scene/lodglobes/lodmars/MAR063.BSP.torrent b/data/scene/lodglobes/lodmars/MAR063.BSP.torrent new file mode 100644 index 0000000000..50cab2e6bf Binary files /dev/null and b/data/scene/lodglobes/lodmars/MAR063.BSP.torrent differ diff --git a/data/scene/lodmars/lodmars.mod b/data/scene/lodglobes/lodmars/lodmars.mod similarity index 94% rename from data/scene/lodmars/lodmars.mod rename to data/scene/lodglobes/lodmars/lodmars.mod index 4e6469554f..a3f72a6025 100644 --- a/data/scene/lodmars/lodmars.mod +++ b/data/scene/lodglobes/lodmars/lodmars.mod @@ -1,6 +1,6 @@ local marsEllipsoid = {3396190.0, 3396190.0, 3376200.0} return { - -- Mars barycenter module + -- Barycenter module { Name = "MarsBarycenter", Parent = "SolarSystemBarycenter", @@ -39,7 +39,7 @@ return { { Type = "SingleImage", Name = "Debug Tiles", - FilePath = "../debugglobe/textures/test_tile.png", + FilePath = "../../debugglobe/textures/test_tile.png", }, { Name = "MARS_Viking", @@ -58,7 +58,11 @@ return { }, GrayScaleColorOverlays = { - --[[ + { + Name = "Layered Rock Outcrops in Southwest Candor Chasma", + FilePath = "map_datasets/HiRISE/Layered_Rock_Outcrops_in_Southwest_Candor_Chasma_Texture.vrt", + }, + --[[ { Name = "CTX Mosaic", FilePath = "map_service_configs/CTX_Mosaic.xml", @@ -69,10 +73,6 @@ return { FilePath = "map_datasets/CTX/West_Candor_Chasma_longlat_global.vrt", --Enabled = true, }, - { - Name = "Layered Rock Outcrops in Southwest Candor Chasma", - FilePath = "map_datasets/HiRISE/Layered_Rock_Outcrops_in_Southwest_Candor_Chasma_Texture.vrt", - }, { Name = "MER_Meridianni_Endeavor_Basemap_25cm", FilePath = "map_datasets/Basemap/MER_Meridianni_Endeavor_Basemap_25cm.vrt", @@ -83,12 +83,8 @@ return { }, ]] }, - NightLayers = { - - }, - WaterMasks = { - - }, + NightLayers = { }, + WaterMasks = { }, ColorOverlays = { { Type = "TileIndex", @@ -98,10 +94,16 @@ return { Type = "SizeReference", Name = "Size Reference", Radii = marsEllipsoid, - BackgroundImagePath = "../debugglobe/textures/arrows.png", + BackgroundImagePath = "../../debugglobe/textures/arrows.png", }, }, HeightLayers = { + { + Name = "Layered Rock Outcrops in Southwest Candor Chasma", + FilePath = "map_datasets/HiRISE/Layered_Rock_Outcrops_in_Southwest_Candor_Chasma_Heightmap.vrt", + MinimumPixelSize = 90, + DoPreProcessing = true, + }, --[[ { Name = "Mola Elevation", @@ -125,12 +127,6 @@ return { MinimumPixelSize = 90, DoPreProcessing = true, }, - { - Name = "Layered Rock Outcrops in Southwest Candor Chasma", - FilePath = "map_datasets/HiRISE/Layered_Rock_Outcrops_in_Southwest_Candor_Chasma_Heightmap.vrt", - MinimumPixelSize = 90, - DoPreProcessing = true, - }, { Name = "Part of Area Traversed by the Mars Exploration Rover", FilePath = "map_datasets/HiRISE/Part_of_Area_Traversed_by_the_Mars_Exploration_Rover_Heightmap.vrt", @@ -140,7 +136,7 @@ return { }, } }, - -- MarsTrail module + -- Trail module { Name = "MarsTrail", Parent = "Sun", diff --git a/data/scene/lodmars/map_service_configs/CTX_Mosaic.xml b/data/scene/lodglobes/lodmars/map_service_configs/CTX_Mosaic.xml similarity index 75% rename from data/scene/lodmars/map_service_configs/CTX_Mosaic.xml rename to data/scene/lodglobes/lodmars/map_service_configs/CTX_Mosaic.xml index 9f7a65afb5..423bd07e9d 100644 --- a/data/scene/lodmars/map_service_configs/CTX_Mosaic.xml +++ b/data/scene/lodglobes/lodmars/map_service_configs/CTX_Mosaic.xml @@ -12,4 +12,10 @@ 256 256 + + ./GDAL_CTX_cache + 10 + .png + + true \ No newline at end of file diff --git a/data/scene/lodglobes/lodmars/map_service_configs/MARS_Viking.xml b/data/scene/lodglobes/lodmars/map_service_configs/MARS_Viking.xml new file mode 100644 index 0000000000..7197faf38e --- /dev/null +++ b/data/scene/lodglobes/lodmars/map_service_configs/MARS_Viking.xml @@ -0,0 +1,10 @@ + + http://webgis3.wr.usgs.gov/arcgis/rest/services/Mars_color/MapServer/WMTS/1.0.0/WMTSCapabilities.xml + + -180.0 + 90 + 180.0 + -90 + + 3 + \ No newline at end of file diff --git a/data/scene/lodmars/map_service_configs/MARS_Viking_MDIM21.xml b/data/scene/lodglobes/lodmars/map_service_configs/MARS_Viking_MDIM21.xml similarity index 100% rename from data/scene/lodmars/map_service_configs/MARS_Viking_MDIM21.xml rename to data/scene/lodglobes/lodmars/map_service_configs/MARS_Viking_MDIM21.xml diff --git a/data/scene/lodglobes/lodmars/map_service_configs/MDIM21_color.xml b/data/scene/lodglobes/lodmars/map_service_configs/MDIM21_color.xml new file mode 100644 index 0000000000..caaa46437f --- /dev/null +++ b/data/scene/lodglobes/lodmars/map_service_configs/MDIM21_color.xml @@ -0,0 +1,22 @@ + + + 1.3.0 + http://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/mars/mars_simp_cyl.map + EPSG:4326 + image/png + MDIM21_color + TRUE + + + -180.0 + 90.0 + 180.0 + -90.0 + 2048 + 1024 + bottom + + + \ No newline at end of file diff --git a/data/scene/lodglobes/lodmars/map_service_configs/Mars_MGS_MOLA_DEM.xml b/data/scene/lodglobes/lodmars/map_service_configs/Mars_MGS_MOLA_DEM.xml new file mode 100644 index 0000000000..fbf695ecbd --- /dev/null +++ b/data/scene/lodglobes/lodmars/map_service_configs/Mars_MGS_MOLA_DEM.xml @@ -0,0 +1,17 @@ + + + http://d1poygwgh8gv6r.cloudfront.net/catalog/Mars_MGS_MOLA_DEM_mosaic_global_463m_8/1.0.0//default/default028mm/${z}/${y}/${x}.png + image/png + + + 5 + 2 + 1 + top + + Byte + EPSG:4326 + 256 + 256 + 2 + \ No newline at end of file diff --git a/data/scene/lodmars/map_service_configs/Mola_Elevation.xml b/data/scene/lodglobes/lodmars/map_service_configs/Mola_Elevation.xml similarity index 100% rename from data/scene/lodmars/map_service_configs/Mola_Elevation.xml rename to data/scene/lodglobes/lodmars/map_service_configs/Mola_Elevation.xml diff --git a/data/scene/lodglobes/lodmars/mars.data b/data/scene/lodglobes/lodmars/mars.data new file mode 100644 index 0000000000..afaf7ab69d --- /dev/null +++ b/data/scene/lodglobes/lodmars/mars.data @@ -0,0 +1,8 @@ +return { + FileRequest = { + { Identifier = "mars_textures", Destination = "textures", Version = 1 } + }, + TorrentFiles = { + -- { File = "MAR063.BSP.torrent", Destination = "${SPICE}" } + } +} \ No newline at end of file diff --git a/data/scene/lodmercury/lodmercury.mod b/data/scene/lodglobes/lodmercury/lodmercury.mod similarity index 86% rename from data/scene/lodmercury/lodmercury.mod rename to data/scene/lodglobes/lodmercury/lodmercury.mod index cc8cde9131..d7c76432ed 100644 --- a/data/scene/lodmercury/lodmercury.mod +++ b/data/scene/lodglobes/lodmercury/lodmercury.mod @@ -1,5 +1,5 @@ return { - -- Mercury barycenter module + -- Barycenter module { Name = "MercuryBarycenter", Parent = "SolarSystemBarycenter", @@ -12,7 +12,6 @@ return { }, }, }, - -- RenderableGlobe module { Name = "Mercury", @@ -39,6 +38,13 @@ return { SegmentsPerPatch = 64, Layers = { ColorLayers = { + { + Name = "Simple Texture", + FilePath = "textures/mercury.jpg", + Enabled = true, + MinimumPixelSize = 256, + }, + --[[ { Name = "On Mercury Color", FilePath = "map_service_configs/OnMercuryColor.xml", @@ -48,6 +54,7 @@ return { Name = "On Mercury Image", FilePath = "map_service_configs/OnMercuryImage.xml", }, + ]] }, GrayScaleLayers = { }, GrayScaleColorOverlays = { }, @@ -55,17 +62,18 @@ return { WaterMasks = { }, ColorOverlays = { }, HeightLayers = { + --[[ { Name = "On Mercury Height", FilePath = "map_service_configs/OnMercuryElevationGaskell.xml", Enabled = true, }, + ]] }, }, }, }, - - -- MercuryTrail module + -- Trail module { Name = "MercuryTrail", Parent = "SolarSystemBarycenter", diff --git a/data/scene/lodmercury/map_service_configs/OnMercuryColor.xml b/data/scene/lodglobes/lodmercury/map_service_configs/OnMercuryColor.xml similarity index 100% rename from data/scene/lodmercury/map_service_configs/OnMercuryColor.xml rename to data/scene/lodglobes/lodmercury/map_service_configs/OnMercuryColor.xml diff --git a/data/scene/lodmercury/map_service_configs/OnMercuryElevationGaskell.xml b/data/scene/lodglobes/lodmercury/map_service_configs/OnMercuryElevationGaskell.xml similarity index 100% rename from data/scene/lodmercury/map_service_configs/OnMercuryElevationGaskell.xml rename to data/scene/lodglobes/lodmercury/map_service_configs/OnMercuryElevationGaskell.xml diff --git a/data/scene/lodmercury/map_service_configs/OnMercuryImage.xml b/data/scene/lodglobes/lodmercury/map_service_configs/OnMercuryImage.xml similarity index 100% rename from data/scene/lodmercury/map_service_configs/OnMercuryImage.xml rename to data/scene/lodglobes/lodmercury/map_service_configs/OnMercuryImage.xml diff --git a/data/scene/lodglobes/lodmercury/mercury.data b/data/scene/lodglobes/lodmercury/mercury.data new file mode 100644 index 0000000000..f2df36620b --- /dev/null +++ b/data/scene/lodglobes/lodmercury/mercury.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "mercury_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/lodmoon/lodmoon.mod b/data/scene/lodglobes/lodmoon/lodmoon.mod similarity index 97% rename from data/scene/lodmoon/lodmoon.mod rename to data/scene/lodglobes/lodmoon/lodmoon.mod index 8fc0ce3657..81a594c35b 100644 --- a/data/scene/lodmoon/lodmoon.mod +++ b/data/scene/lodglobes/lodmoon/lodmoon.mod @@ -18,7 +18,7 @@ return { }, Renderable = { Type = "RenderableGlobe", - Radii = {1737000, 1737000, 1737000}, -- Moons's radius + Radii = {1738140, 1738140, 1735970}, -- Moons's radius CameraMinHeight = 300, InteractionDepthBelowEllipsoid = 5000, -- Useful when having negative height map values SegmentsPerPatch = 64, diff --git a/data/scene/lodmoon/map_service_configs/OnMoonColor.xml b/data/scene/lodglobes/lodmoon/map_service_configs/OnMoonColor.xml similarity index 100% rename from data/scene/lodmoon/map_service_configs/OnMoonColor.xml rename to data/scene/lodglobes/lodmoon/map_service_configs/OnMoonColor.xml diff --git a/data/scene/lodmoon/map_service_configs/OnMoonHeight.xml b/data/scene/lodglobes/lodmoon/map_service_configs/OnMoonHeight.xml similarity index 100% rename from data/scene/lodmoon/map_service_configs/OnMoonHeight.xml rename to data/scene/lodglobes/lodmoon/map_service_configs/OnMoonHeight.xml diff --git a/data/scene/lodglobes/lodmoon/moon.data b/data/scene/lodglobes/lodmoon/moon.data new file mode 100644 index 0000000000..f8c7094165 --- /dev/null +++ b/data/scene/lodglobes/lodmoon/moon.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "moon_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/lodglobes/lodneptune/lodneptune.mod b/data/scene/lodglobes/lodneptune/lodneptune.mod new file mode 100644 index 0000000000..20531b941b --- /dev/null +++ b/data/scene/lodglobes/lodneptune/lodneptune.mod @@ -0,0 +1,70 @@ +return { + -- Barycenter module + { + Name = "NeptuneBarycenter", + Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "NEPTUNE BARYCENTER", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + }, + }, + }, + -- RenderableGlobe module + { + Name = "Neptune", + Parent = "NeptuneBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_NEPTUNE", + DestinationFrame = "GALACTIC", + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + -- No translation, Neptune is in its barycenter + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {24764000, 24764000, 24314000}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Texture", + FilePath = "textures/neptune.jpg", + Enabled = true, + MinimumPixelSize = 256, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + }, + }, + -- Trail module + { + Name = "NeptuneTrail", + Parent = "SolarSystemBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "NEPTUNE BARYCENTER", + Frame = "GALACTIC", + Observer = "SUN", + RGB = {0.2, 0.5, 1.0 }, + TropicalOrbitPeriod = 59799.9 , + EarthOrbitRatio = 163.73, + DayLength = 16.11, + }, + } +} diff --git a/data/scene/lodglobes/lodneptune/neptune.data b/data/scene/lodglobes/lodneptune/neptune.data new file mode 100644 index 0000000000..60b294047e --- /dev/null +++ b/data/scene/lodglobes/lodneptune/neptune.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "neptune_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/lodglobes/lodsaturn/lodsaturn.mod b/data/scene/lodglobes/lodsaturn/lodsaturn.mod new file mode 100644 index 0000000000..0754afee7c --- /dev/null +++ b/data/scene/lodglobes/lodsaturn/lodsaturn.mod @@ -0,0 +1,80 @@ +return { + -- Barycenter module + { + Name = "SaturnBarycenter", + Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "SATURN BARYCENTER", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + }, + }, + }, + -- RenderableGlobe module + { + Name = "Saturn", + Parent = "SaturnBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_SATURN", + DestinationFrame = "GALACTIC", + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + -- No translation, Saturn is in its barycenter + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {60268000, 60268000, 54364000}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Saturn Texture", + FilePath = "textures/saturn.jpg", + Enabled = true, + MinimumPixelSize = 256, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + }, + }, + { + Name = "SaturnRings", + Parent = "Saturn", + Renderable = { + Type = "RenderableRings", + Texture = "textures/saturn_rings.png", + Size = 140220000, + Offset = { 74500 / 140445.100671159, 1.0 } -- min / max extend + }, + }, + -- Trail module + { + Name = "SaturnTrail", + Parent = "SolarSystemBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "SATURN BARYCENTER", + Frame = "GALACTIC", + Observer = "SUN", + RGB = {0.85,0.75,0.51 }, + TropicalOrbitPeriod = 10746.94 , + EarthOrbitRatio = 29.424, + DayLength = 10.656, + }, + } +} diff --git a/data/scene/lodglobes/loduranus/loduranus.mod b/data/scene/lodglobes/loduranus/loduranus.mod new file mode 100644 index 0000000000..1539f2ab0c --- /dev/null +++ b/data/scene/lodglobes/loduranus/loduranus.mod @@ -0,0 +1,70 @@ +return { + -- Barycenter module + { + Name = "UranusBarycenter", + Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "URANUS BARYCENTER", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + }, + }, + }, + -- RenderableGlobe module + { + Name = "Uranus", + Parent = "UranusBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_URANUS", + DestinationFrame = "GALACTIC", + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + -- No translation, Uranus is in its barycenter + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {25559000, 25559000, 24973000}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Texture", + FilePath = "textures/uranus.jpg", + Enabled = true, + MinimumPixelSize = 256, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + }, + }, + -- Trail module + { + Name = "UranusTrail", + Parent = "SolarSystemBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "URANUS BARYCENTER", + Frame = "GALACTIC", + Observer = "SUN", + RGB = {0.60,0.95,1.00 }, + TropicalOrbitPeriod = 30588.740 , + EarthOrbitRatio = 83.749, + DayLength = 17.24, + }, + } +} diff --git a/data/scene/lodglobes/loduranus/uranus.data b/data/scene/lodglobes/loduranus/uranus.data new file mode 100644 index 0000000000..1260617597 --- /dev/null +++ b/data/scene/lodglobes/loduranus/uranus.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "uranus_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/lodglobes/lodvenus/lodvenus.mod b/data/scene/lodglobes/lodvenus/lodvenus.mod new file mode 100644 index 0000000000..3b3e3f58d1 --- /dev/null +++ b/data/scene/lodglobes/lodvenus/lodvenus.mod @@ -0,0 +1,75 @@ +return { + -- Barycenter module + { + Name = "VenusBarycenter", + Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "VENUS BARYCENTER", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + }, + }, + }, + -- RenderableGlobe module + { + Name = "Venus", + Parent = "VenusBarycenter", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_VENUS", + DestinationFrame = "GALACTIC", + }, + Scale = { + Type = "StaticScale", + Scale = 1, + }, + Translation = { + Type = "SpiceTranslation", + Body = "VENUS", + Observer = "VENUS BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + }, + }, + Renderable = { + Type = "RenderableGlobe", + Radii = {6051900, 6051900, 6051800}, + CameraMinHeight = 300, + InteractionDepthBelowEllipsoid = 0, -- Useful when having negative height map values + SegmentsPerPatch = 64, + Layers = { + ColorLayers = { + { + Name = "Venus Texture", + FilePath = "textures/venus.jpg", + Enabled = true, + MinimumPixelSize = 256, + }, + }, + GrayScaleLayers = { }, + GrayScaleColorOverlays = { }, + NightLayers = { }, + WaterMasks = { }, + ColorOverlays = { }, + HeightLayers = { }, + }, + }, + }, + -- Trail module + { + Name = "VenusTrail", + Parent = "SolarSystemBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "VENUS", + Frame = "GALACTIC", + Observer = "SUN", + RGB = {1, 0.5, 0.2}, + TropicalOrbitPeriod = 224.695 , + EarthOrbitRatio = 0.615, + DayLength = 2802.0, + }, + } +} diff --git a/data/scene/lodglobes/lodvenus/venus.data b/data/scene/lodglobes/lodvenus/venus.data new file mode 100644 index 0000000000..07753359f6 --- /dev/null +++ b/data/scene/lodglobes/lodvenus/venus.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "venus_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/lodmoon/map_service_configs/OnMoonGrayscaleOverlay.vrt b/data/scene/lodmoon/map_service_configs/OnMoonGrayscaleOverlay.vrt deleted file mode 100644 index 6959072a78..0000000000 --- a/data/scene/lodmoon/map_service_configs/OnMoonGrayscaleOverlay.vrt +++ /dev/null @@ -1,28 +0,0 @@ - - GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] - -1.8000000000000000e+02, 2.1972656250000000e-03, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.1972656250000000e-03 - - 0 - 1 - Gray - - OnMoonColor.xml - 1 - - - - 0 - - - - Alpha - - white_geo.tif - 1 - - - - - - - diff --git a/data/scene/lodmoon/map_service_configs/OnMoonNight.vrt b/data/scene/lodmoon/map_service_configs/OnMoonNight.vrt deleted file mode 100644 index 0741ac74c3..0000000000 --- a/data/scene/lodmoon/map_service_configs/OnMoonNight.vrt +++ /dev/null @@ -1,49 +0,0 @@ - - GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] - -1.8000000000000000e+02, 2.1972656250000000e-03, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.1972656250000000e-03 - - 0 - 1 - Red - - OnMoonColor.xml - 1 - - - - 0 - 16 - 0 - - - - 0 - 1 - Green - - OnMoonColor.xml - 1 - - - - 0 - 16 - 0 - - - - 0 - 1 - Blue - - OnMoonColor.xml - 1 - - - - 0 - 16 - 0 - - - diff --git a/data/scene/mercury/mercury.mod b/data/scene/mercury/mercury.mod index ba64f42565..83b2146d18 100644 --- a/data/scene/mercury/mercury.mod +++ b/data/scene/mercury/mercury.mod @@ -3,6 +3,14 @@ return { { Name = "MercuryBarycenter", Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "MERCURY BARYCENTER", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + }, + } }, -- Mercury module { @@ -28,12 +36,6 @@ return { } }, Transform = { - Translation = { - Type = "SpiceTranslation", - Body = "MERCURY", - Observer = "SUN", - Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - }, Rotation = { Type = "SpiceRotation", SourceFrame = "IAU_MERCURY", @@ -48,7 +50,7 @@ return { -- MercuryTrail module { Name = "MercuryTrail", - Parent = "MercuryBarycenter", + Parent = "SolarSystemBarycenter", Renderable = { Type = "RenderableTrail", Body = "MERCURY", diff --git a/data/scene/dawn/ceres/DawnKernels.torrent b/data/scene/missions/dawn/ceres/DawnKernels.torrent similarity index 100% rename from data/scene/dawn/ceres/DawnKernels.torrent rename to data/scene/missions/dawn/ceres/DawnKernels.torrent diff --git a/data/scene/dawn/ceres/ceres.data b/data/scene/missions/dawn/ceres/ceres.data similarity index 100% rename from data/scene/dawn/ceres/ceres.data rename to data/scene/missions/dawn/ceres/ceres.data diff --git a/data/scene/dawn/ceres/ceres.mod b/data/scene/missions/dawn/ceres/ceres.mod similarity index 100% rename from data/scene/dawn/ceres/ceres.mod rename to data/scene/missions/dawn/ceres/ceres.mod diff --git a/data/scene/dawn/dawn/DawnKernels.torrent b/data/scene/missions/dawn/dawn/DawnKernels.torrent similarity index 100% rename from data/scene/dawn/dawn/DawnKernels.torrent rename to data/scene/missions/dawn/dawn/DawnKernels.torrent diff --git a/data/scene/dawn/dawn/dawn.data b/data/scene/missions/dawn/dawn/dawn.data similarity index 100% rename from data/scene/dawn/dawn/dawn.data rename to data/scene/missions/dawn/dawn/dawn.data diff --git a/data/scene/dawn/dawn/dawn.mod b/data/scene/missions/dawn/dawn/dawn.mod similarity index 100% rename from data/scene/dawn/dawn/dawn.mod rename to data/scene/missions/dawn/dawn/dawn.mod diff --git a/data/scene/dawn/vestaprojection/VestaComet.torrent b/data/scene/missions/dawn/vestaprojection/VestaComet.torrent similarity index 100% rename from data/scene/dawn/vestaprojection/VestaComet.torrent rename to data/scene/missions/dawn/vestaprojection/VestaComet.torrent diff --git a/data/scene/dawn/vestaprojection/vestaprojection.data b/data/scene/missions/dawn/vestaprojection/vestaprojection.data similarity index 100% rename from data/scene/dawn/vestaprojection/vestaprojection.data rename to data/scene/missions/dawn/vestaprojection/vestaprojection.data diff --git a/data/scene/dawn/vestaprojection/vestaprojection.mod b/data/scene/missions/dawn/vestaprojection/vestaprojection.mod similarity index 100% rename from data/scene/dawn/vestaprojection/vestaprojection.mod rename to data/scene/missions/dawn/vestaprojection/vestaprojection.mod diff --git a/data/scene/juno/juno/juno.mod b/data/scene/missions/juno/juno/juno.mod similarity index 98% rename from data/scene/juno/juno/juno.mod rename to data/scene/missions/juno/juno/juno.mod index ec95c0c83f..12c2d45131 100644 --- a/data/scene/juno/juno/juno.mod +++ b/data/scene/missions/juno/juno/juno.mod @@ -1,144 +1,144 @@ -return { - -- New Horizons Body module - { - Name = "Juno", - -- Parent = "PlutoBarycenter", - -- Parent = "JupiterBarycenter", - Parent = "JupiterBarycenter", - Renderable = { - Type = "RenderableModel", - Body = "JUNO", - Geometry = { - Type = "MultiModelGeometry", - GeometryFile = "Juno.obj", - Magnification = 4, - }, - Textures = { - Type = "simple", - Color = "textures/gray.png", - }, - Rotation = { - Source = "JUNO_SPACECRAFT", - Destination = "GALACTIC", - ModelTransform = { - 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, - 0.0, -1.0, 0.0 - } - }, - }, - - Ephemeris = { - Type = "Spice", - Body = "JUNO", - Observer = "JUPITER BARYCENTER", - Kernels = { - "spice/JNO_SCLKSCET.00039.tsc", - "spice/juno_jade_v00.ti", - "spice/juno_jedi_v00.ti", - "spice/juno_jiram_v01.ti", - "spice/juno_junocam_v00.ti", - "spice/juno_mag_v00.ti", - "spice/juno_mwr_v01.ti", - "spice/juno_struct_v01.ti", - "spice/juno_uvs_v00.ti", - "spice/juno_v08.tf", - "spice/juno_waves_v00.ti", - "spice/juno_mwr_v01.ti", - "spice/spk_merge_110805_171017_130515.bsp", - "spice/ck/juno_sc_prl_110930_111028_jc003c01_v01.bc", - "spice/ck/juno_sc_prl_111028_111125_jc004b00_v01.bc", - "spice/ck/juno_sc_prl_111125_111223_jc005b00_v01.bc", - "spice/ck/juno_sc_prl_111223_120127_jc006a02_v01.bc", - "spice/ck/juno_sc_prl_120127_120217_jc007a00_v01.bc", - "spice/ck/juno_sc_prl_120217_120316_jc008b00_v02.bc", - "spice/ck/juno_sc_prl_120316_120413_jc009a00_v01.bc", - "spice/ck/juno_sc_prl_120413_120511_jc010a04_v01.bc", - "spice/ck/juno_sc_prl_120511_120608_jc011a01_v02.bc", - "spice/ck/juno_sc_prl_120608_120706_jc012b01_v01.bc", - "spice/ck/juno_sc_prl_120706_120802_jc013a01_v01.bc", - "spice/ck/juno_sc_prl_120802_120824_jc014b01_v01.bc", - "spice/ck/juno_sc_prl_120824_120928_jc015m00_v01.bc", - "spice/ck/juno_sc_prl_120919_120928_jc015o00_v01.bc", - "spice/ck/juno_sc_prl_120928_121026_jc016c03_v01.bc", - "spice/ck/juno_sc_prl_121026_121123_jc017a01_v01.bc", - "spice/ck/juno_sc_prl_121123_121221_jc018b01_v01.bc", - "spice/ck/juno_sc_prl_121221_130118_jc019a01_v01.bc", - "spice/ck/juno_sc_prl_130118_130215_jc020b01_v01.bc", - "spice/ck/juno_sc_prl_130315_130412_jc022b01_v01.bc", - "spice/ck/juno_sc_prl_130412_130510_jc023b03_v01.bc", - "spice/ck/juno_sc_prl_130510_130607_jc024a01_v01.bc", - "spice/ck/juno_sc_prl_130607_130705_jc025a00_v01.bc", - "spice/ck/juno_sc_prl_130705_130802_jc026a01_v01.bc", - "spice/ck/juno_sc_prl_130726_131020_jx024a02_EFB_v03.bc", - "spice/ck/juno_sc_prl_130802_130830_jc027a02_v01.bc", - "spice/ck/juno_sc_prl_130830_130927_jc028a01_v01.bc", - "spice/ck/juno_sc_prl_130926_131025_jc029a00_v01.bc", - "spice/ck/juno_sc_prl_130927_131025_jc029c01_v01.bc", - "spice/ck/juno_sc_prl_131022_131025_jc029f00_v01.bc", - "spice/ck/juno_sc_prl_131025_131122_jc030b04_v01.bc", - "spice/ck/juno_sc_prl_131122_131220_jc031b01_v01.bc", - "spice/ck/juno_sc_prl_131220_140124_jc032a01_v01.bc", - "spice/ck/juno_sc_prl_140124_140214_jc033a01_v01.bc", - "spice/ck/juno_sc_prl_140214_140314_jc034b01_v01.bc", - "spice/ck/juno_sc_prl_140314_140411_jc035a01_v01.bc", - "spice/ck/juno_sc_prl_140411_140509_jc036b01_v01.bc", - "spice/ck/juno_sc_prl_140509_140606_jc037b02_v01.bc", - "spice/ck/juno_sc_prl_140606_140704_jc038a01_v01.bc", - "spice/ck/juno_sc_prl_140704_140801_jc039b01_v01.bc", - "spice/ck/juno_sc_prl_140801_140829_jc040a01_v01.bc", - "spice/ck/juno_sc_prl_140829_140926_jc041a01_v01.bc", - "spice/ck/juno_sc_prl_140926_141024_jc042a01_v01.bc", - "spice/ck/juno_sc_prl_141024_141121_jc043a01_v01.bc", - "spice/ck/juno_sc_prl_141105_141121_jc043m01_v01.bc", - "spice/ck/juno_sc_prl_141107_141121_jc043s01_v01.bc", - "spice/ck/juno_sc_prl_141121_141219_jc044a01_v01.bc", - "spice/ck/juno_sc_prl_141219_150123_jc045a01_v01.bc", - "spice/ck/juno_sc_prl_150123_150213_jc046a01_v01.bc", - "spice/ck/juno_sc_prl_150213_150313_jc047a01_v01.bc", - "spice/ck/juno_sc_prl_150312_150409_jc048a01_v01.bc", - "spice/ck/juno_sc_prl_150410_150508_jc049a01_v01.bc", - "spice/ck/juno_sc_prl_150508_150605_jc050a01_v01.bc", - "spice/ck/juno_sc_prl_150605_150703_jc051a01_v01.bc", - "spice/ck/juno_sc_prl_150703_150731_jc052a01_v01.bc", - "spice/ck/juno_sc_prl_150731_150828_jc053a01_v01.bc", - "spice/ck/juno_sc_prl_150805_150828_jc053m00_v01.bc", - "spice/ck/juno_sc_prl_150807_150828_jc053s00_v01.bc", - "spice/ck/juno_sc_prl_150828_150924_jc054a00_v01.bc", - "spice/ck/juno_sc_prl_150924_151023_jc055a00_v01.bc", - "spice/ck/juno_sc_prl_151023_151120_jc056a00_v01.bc", - "spice/ck/juno_sc_prl_151120_151218_jc057a00_v01.bc", - "spice/ck/juno_sc_prl_151218_160115_jc058a00_v01.bc", - "spice/ck/juno_sc_prl_160115_160212_jc059a00_v01.bc", - "spice/ck/juno_sc_prl_160212_160311_jc060a00_v01.bc", - "spice/ck/juno_sc_prl_160311_160408_jc061a00_v01.bc", - "spice/ck/juno_sc_prl_160408_160506_jc062a00_v01.bc", - "spice/ck/juno_sc_prl_160506_160603_jc063a00_v01.bc", - "spice/ck/juno_sc_prl_160603_160630_jc064a00_v01.bc", - "spice/ck/juno_sc_prl_160708_160729_jm0001rp_v02.bc", - "spice/ck/juno_sc_prl_160729_160826_jm0002rp_v01.bc", - "spice/ck/juno_sc_prl_161115_161213_jx0405rp_v01.bc" - } - } - }, - --NewHorizonsTrail module - { - Name = "JunoTrail", - Parent = "JupiterBarycenter", - Renderable = { - Type = "RenderableTrail", - Body = "JUNO", - Frame = "GALACTIC", - Observer = "JUPITER BARYCENTER", - RGB = { 0.70,0.50,0.20 }, - TropicalOrbitPeriod = 394250.0, - EarthOrbitRatio = 4.5, - DayLength = 9.9259, - TimeStamps = false, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - }, - }, - }, - } +return { + -- New Horizons Body module + { + Name = "Juno", + -- Parent = "PlutoBarycenter", + -- Parent = "JupiterBarycenter", + Parent = "JupiterBarycenter", + Renderable = { + Type = "RenderableModel", + Body = "JUNO", + Geometry = { + Type = "MultiModelGeometry", + GeometryFile = "Juno.obj", + Magnification = 4, + }, + Textures = { + Type = "simple", + Color = "textures/gray.png", + }, + Rotation = { + Source = "JUNO_SPACECRAFT", + Destination = "GALACTIC", + ModelTransform = { + 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, + 0.0, -1.0, 0.0 + } + }, + }, + + Ephemeris = { + Type = "Spice", + Body = "JUNO", + Observer = "JUPITER BARYCENTER", + Kernels = { + "spice/JNO_SCLKSCET.00039.tsc", + "spice/juno_jade_v00.ti", + "spice/juno_jedi_v00.ti", + "spice/juno_jiram_v01.ti", + "spice/juno_junocam_v00.ti", + "spice/juno_mag_v00.ti", + "spice/juno_mwr_v01.ti", + "spice/juno_struct_v01.ti", + "spice/juno_uvs_v00.ti", + "spice/juno_v08.tf", + "spice/juno_waves_v00.ti", + "spice/juno_mwr_v01.ti", + "spice/spk_merge_110805_171017_130515.bsp", + "spice/ck/juno_sc_prl_110930_111028_jc003c01_v01.bc", + "spice/ck/juno_sc_prl_111028_111125_jc004b00_v01.bc", + "spice/ck/juno_sc_prl_111125_111223_jc005b00_v01.bc", + "spice/ck/juno_sc_prl_111223_120127_jc006a02_v01.bc", + "spice/ck/juno_sc_prl_120127_120217_jc007a00_v01.bc", + "spice/ck/juno_sc_prl_120217_120316_jc008b00_v02.bc", + "spice/ck/juno_sc_prl_120316_120413_jc009a00_v01.bc", + "spice/ck/juno_sc_prl_120413_120511_jc010a04_v01.bc", + "spice/ck/juno_sc_prl_120511_120608_jc011a01_v02.bc", + "spice/ck/juno_sc_prl_120608_120706_jc012b01_v01.bc", + "spice/ck/juno_sc_prl_120706_120802_jc013a01_v01.bc", + "spice/ck/juno_sc_prl_120802_120824_jc014b01_v01.bc", + "spice/ck/juno_sc_prl_120824_120928_jc015m00_v01.bc", + "spice/ck/juno_sc_prl_120919_120928_jc015o00_v01.bc", + "spice/ck/juno_sc_prl_120928_121026_jc016c03_v01.bc", + "spice/ck/juno_sc_prl_121026_121123_jc017a01_v01.bc", + "spice/ck/juno_sc_prl_121123_121221_jc018b01_v01.bc", + "spice/ck/juno_sc_prl_121221_130118_jc019a01_v01.bc", + "spice/ck/juno_sc_prl_130118_130215_jc020b01_v01.bc", + "spice/ck/juno_sc_prl_130315_130412_jc022b01_v01.bc", + "spice/ck/juno_sc_prl_130412_130510_jc023b03_v01.bc", + "spice/ck/juno_sc_prl_130510_130607_jc024a01_v01.bc", + "spice/ck/juno_sc_prl_130607_130705_jc025a00_v01.bc", + "spice/ck/juno_sc_prl_130705_130802_jc026a01_v01.bc", + "spice/ck/juno_sc_prl_130726_131020_jx024a02_EFB_v03.bc", + "spice/ck/juno_sc_prl_130802_130830_jc027a02_v01.bc", + "spice/ck/juno_sc_prl_130830_130927_jc028a01_v01.bc", + "spice/ck/juno_sc_prl_130926_131025_jc029a00_v01.bc", + "spice/ck/juno_sc_prl_130927_131025_jc029c01_v01.bc", + "spice/ck/juno_sc_prl_131022_131025_jc029f00_v01.bc", + "spice/ck/juno_sc_prl_131025_131122_jc030b04_v01.bc", + "spice/ck/juno_sc_prl_131122_131220_jc031b01_v01.bc", + "spice/ck/juno_sc_prl_131220_140124_jc032a01_v01.bc", + "spice/ck/juno_sc_prl_140124_140214_jc033a01_v01.bc", + "spice/ck/juno_sc_prl_140214_140314_jc034b01_v01.bc", + "spice/ck/juno_sc_prl_140314_140411_jc035a01_v01.bc", + "spice/ck/juno_sc_prl_140411_140509_jc036b01_v01.bc", + "spice/ck/juno_sc_prl_140509_140606_jc037b02_v01.bc", + "spice/ck/juno_sc_prl_140606_140704_jc038a01_v01.bc", + "spice/ck/juno_sc_prl_140704_140801_jc039b01_v01.bc", + "spice/ck/juno_sc_prl_140801_140829_jc040a01_v01.bc", + "spice/ck/juno_sc_prl_140829_140926_jc041a01_v01.bc", + "spice/ck/juno_sc_prl_140926_141024_jc042a01_v01.bc", + "spice/ck/juno_sc_prl_141024_141121_jc043a01_v01.bc", + "spice/ck/juno_sc_prl_141105_141121_jc043m01_v01.bc", + "spice/ck/juno_sc_prl_141107_141121_jc043s01_v01.bc", + "spice/ck/juno_sc_prl_141121_141219_jc044a01_v01.bc", + "spice/ck/juno_sc_prl_141219_150123_jc045a01_v01.bc", + "spice/ck/juno_sc_prl_150123_150213_jc046a01_v01.bc", + "spice/ck/juno_sc_prl_150213_150313_jc047a01_v01.bc", + "spice/ck/juno_sc_prl_150312_150409_jc048a01_v01.bc", + "spice/ck/juno_sc_prl_150410_150508_jc049a01_v01.bc", + "spice/ck/juno_sc_prl_150508_150605_jc050a01_v01.bc", + "spice/ck/juno_sc_prl_150605_150703_jc051a01_v01.bc", + "spice/ck/juno_sc_prl_150703_150731_jc052a01_v01.bc", + "spice/ck/juno_sc_prl_150731_150828_jc053a01_v01.bc", + "spice/ck/juno_sc_prl_150805_150828_jc053m00_v01.bc", + "spice/ck/juno_sc_prl_150807_150828_jc053s00_v01.bc", + "spice/ck/juno_sc_prl_150828_150924_jc054a00_v01.bc", + "spice/ck/juno_sc_prl_150924_151023_jc055a00_v01.bc", + "spice/ck/juno_sc_prl_151023_151120_jc056a00_v01.bc", + "spice/ck/juno_sc_prl_151120_151218_jc057a00_v01.bc", + "spice/ck/juno_sc_prl_151218_160115_jc058a00_v01.bc", + "spice/ck/juno_sc_prl_160115_160212_jc059a00_v01.bc", + "spice/ck/juno_sc_prl_160212_160311_jc060a00_v01.bc", + "spice/ck/juno_sc_prl_160311_160408_jc061a00_v01.bc", + "spice/ck/juno_sc_prl_160408_160506_jc062a00_v01.bc", + "spice/ck/juno_sc_prl_160506_160603_jc063a00_v01.bc", + "spice/ck/juno_sc_prl_160603_160630_jc064a00_v01.bc", + "spice/ck/juno_sc_prl_160708_160729_jm0001rp_v02.bc", + "spice/ck/juno_sc_prl_160729_160826_jm0002rp_v01.bc", + "spice/ck/juno_sc_prl_161115_161213_jx0405rp_v01.bc" + } + } + }, + --NewHorizonsTrail module + { + Name = "JunoTrail", + Parent = "JupiterBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "JUNO", + Frame = "GALACTIC", + Observer = "JUPITER BARYCENTER", + RGB = { 0.70,0.50,0.20 }, + TropicalOrbitPeriod = 394250.0, + EarthOrbitRatio = 4.5, + DayLength = 9.9259, + TimeStamps = false, + Textures = { + Type = "simple", + Color = "textures/glare_blue.png", + }, + }, + }, + } diff --git a/data/scene/missions/newhorizons/jupiter/callisto/callisto.data b/data/scene/missions/newhorizons/jupiter/callisto/callisto.data new file mode 100644 index 0000000000..9c381ecce7 --- /dev/null +++ b/data/scene/missions/newhorizons/jupiter/callisto/callisto.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "callisto_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/newhorizons/jupiter/callisto/callisto.mod b/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod similarity index 83% rename from data/scene/newhorizons/jupiter/callisto/callisto.mod rename to data/scene/missions/newhorizons/jupiter/callisto/callisto.mod index 83e4e58c14..5454e41ed6 100644 --- a/data/scene/newhorizons/jupiter/callisto/callisto.mod +++ b/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod @@ -22,20 +22,22 @@ return { Observer = "NEW HORIZONS", Target = "CALLISTO", Aberration = "NONE", - AspectRatio = 2 + AspectRatio = 2, + + Instrument = { + Name = "NH_LORRI", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 0.2907, + Aspect = 1, + Near = 0.2, + Far = 10000, + }, + + PotentialTargets = { + "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" + } }, - Instrument = { - Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.2907, - Aspect = 1, - Near = 0.2, - Far = 10000, - }, - PotentialTargets = { - "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" - } }, Transform = { Translation = { @@ -74,7 +76,7 @@ return { Position = {0, -10000000, 0} }, }, - }, + }, -- CallistoTrail module { Name = "CallistoTrail", @@ -93,7 +95,7 @@ return { Type = "simple", Color = "${COMMON_MODULE}/textures/glare_blue.png", -- need to add different texture - }, + }, }, } } diff --git a/data/scene/newhorizons/jupiter/callisto/textures/Callisto-Text.png b/data/scene/missions/newhorizons/jupiter/callisto/textures/Callisto-Text.png similarity index 100% rename from data/scene/newhorizons/jupiter/callisto/textures/Callisto-Text.png rename to data/scene/missions/newhorizons/jupiter/callisto/textures/Callisto-Text.png diff --git a/data/scene/newhorizons/jupiter/callisto/textures/defaultProj.png b/data/scene/missions/newhorizons/jupiter/callisto/textures/defaultProj.png similarity index 100% rename from data/scene/newhorizons/jupiter/callisto/textures/defaultProj.png rename to data/scene/missions/newhorizons/jupiter/callisto/textures/defaultProj.png diff --git a/data/scene/missions/newhorizons/jupiter/europa/europa.data b/data/scene/missions/newhorizons/jupiter/europa/europa.data new file mode 100644 index 0000000000..4364fcbc49 --- /dev/null +++ b/data/scene/missions/newhorizons/jupiter/europa/europa.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "europa_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/newhorizons/jupiter/europa/europa.mod b/data/scene/missions/newhorizons/jupiter/europa/europa.mod similarity index 82% rename from data/scene/newhorizons/jupiter/europa/europa.mod rename to data/scene/missions/newhorizons/jupiter/europa/europa.mod index f09899f0f3..31933603e7 100644 --- a/data/scene/newhorizons/jupiter/europa/europa.mod +++ b/data/scene/missions/newhorizons/jupiter/europa/europa.mod @@ -22,20 +22,22 @@ return { Observer = "NEW HORIZONS", Target = "EUROPA", Aberration = "NONE", - AspectRatio = 2 + AspectRatio = 2, + + Instrument = { + Name = "NH_LORRI", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 0.2907, + Aspect = 1, + Near = 0.2, + Far = 10000, + }, + + PotentialTargets = { + "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" + } }, - Instrument = { - Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.2907, - Aspect = 1, - Near = 0.2, - Far = 10000, - }, - PotentialTargets = { - "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" - } }, Transform = { Translation = { diff --git a/data/scene/newhorizons/jupiter/europa/textures/Europa-Text.png b/data/scene/missions/newhorizons/jupiter/europa/textures/Europa-Text.png similarity index 100% rename from data/scene/newhorizons/jupiter/europa/textures/Europa-Text.png rename to data/scene/missions/newhorizons/jupiter/europa/textures/Europa-Text.png diff --git a/data/scene/newhorizons/jupiter/europa/textures/defaultProj.png b/data/scene/missions/newhorizons/jupiter/europa/textures/defaultProj.png similarity index 100% rename from data/scene/newhorizons/jupiter/europa/textures/defaultProj.png rename to data/scene/missions/newhorizons/jupiter/europa/textures/defaultProj.png diff --git a/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.data b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.data new file mode 100644 index 0000000000..4ae2714582 --- /dev/null +++ b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "ganymede_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/newhorizons/jupiter/ganymede/ganymede.mod b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod similarity index 82% rename from data/scene/newhorizons/jupiter/ganymede/ganymede.mod rename to data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod index eb6d0aa01b..0e7952fa87 100644 --- a/data/scene/newhorizons/jupiter/ganymede/ganymede.mod +++ b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod @@ -22,20 +22,22 @@ return { Observer = "NEW HORIZONS", Target = "GANYMEDE", Aberration = "NONE", - AspectRatio = 2 + AspectRatio = 2, + + Instrument = { + Name = "NH_LORRI", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 0.2907, + Aspect = 1, + Near = 0.2, + Far = 10000, + }, + + PotentialTargets = { + "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" + } }, - Instrument = { - Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.2907, - Aspect = 1, - Near = 0.2, - Far = 10000, - }, - PotentialTargets = { - "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" - } }, Transform = { Translation = { diff --git a/data/scene/newhorizons/jupiter/ganymede/textures/Ganymede-Text.png b/data/scene/missions/newhorizons/jupiter/ganymede/textures/Ganymede-Text.png similarity index 100% rename from data/scene/newhorizons/jupiter/ganymede/textures/Ganymede-Text.png rename to data/scene/missions/newhorizons/jupiter/ganymede/textures/Ganymede-Text.png diff --git a/data/scene/newhorizons/jupiter/ganymede/textures/defaultProj.png b/data/scene/missions/newhorizons/jupiter/ganymede/textures/defaultProj.png similarity index 100% rename from data/scene/newhorizons/jupiter/ganymede/textures/defaultProj.png rename to data/scene/missions/newhorizons/jupiter/ganymede/textures/defaultProj.png diff --git a/data/scene/missions/newhorizons/jupiter/io/io.data b/data/scene/missions/newhorizons/jupiter/io/io.data new file mode 100644 index 0000000000..baca863e4b --- /dev/null +++ b/data/scene/missions/newhorizons/jupiter/io/io.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "io_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/newhorizons/jupiter/io/io.mod b/data/scene/missions/newhorizons/jupiter/io/io.mod similarity index 84% rename from data/scene/newhorizons/jupiter/io/io.mod rename to data/scene/missions/newhorizons/jupiter/io/io.mod index a5fe7540b3..e6b481c40c 100644 --- a/data/scene/newhorizons/jupiter/io/io.mod +++ b/data/scene/missions/newhorizons/jupiter/io/io.mod @@ -22,20 +22,22 @@ return { Observer = "NEW HORIZONS", Target = "IO", Aberration = "NONE", - AspectRatio = 2 + AspectRatio = 2, + + Instrument = { + Name = "NH_LORRI", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 0.2907, + Aspect = 1, + Near = 0.2, + Far = 10000, + }, + + PotentialTargets = { + "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" + } }, - Instrument = { - Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.2907, - Aspect = 1, - Near = 0.2, - Far = 10000, - }, - PotentialTargets = { - "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" - } }, Transform = { Translation = { diff --git a/data/scene/newhorizons/jupiter/io/textures/Io-Text.png b/data/scene/missions/newhorizons/jupiter/io/textures/Io-Text.png similarity index 100% rename from data/scene/newhorizons/jupiter/io/textures/Io-Text.png rename to data/scene/missions/newhorizons/jupiter/io/textures/Io-Text.png diff --git a/data/scene/newhorizons/jupiter/jupiter/ProjectionsOfInterest.torrent b/data/scene/missions/newhorizons/jupiter/jupiter/ProjectionsOfInterest.torrent similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/ProjectionsOfInterest.torrent rename to data/scene/missions/newhorizons/jupiter/jupiter/ProjectionsOfInterest.torrent diff --git a/data/scene/newhorizons/jupiter/jupiter/jupiter.data b/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.data similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/jupiter.data rename to data/scene/missions/newhorizons/jupiter/jupiter/jupiter.data diff --git a/data/scene/newhorizons/jupiter/jupiter/jupiter.mod b/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod similarity index 55% rename from data/scene/newhorizons/jupiter/jupiter/jupiter.mod rename to data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod index 04d07a3a1e..b1d3377eac 100644 --- a/data/scene/newhorizons/jupiter/jupiter/jupiter.mod +++ b/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod @@ -33,58 +33,59 @@ return { }, Projection = { --Sequence = "F:/JupiterFullSequence", - Sequence = "${OPENSPACE_DATA}/scene/newhorizons/jupiter/jupiter/ProjectionsOfInterest", + Sequence = "${OPENSPACE_DATA}/scene/missions/newhorizons/jupiter/jupiter/ProjectionsOfInterest", SequenceType = "image-sequence", Observer = "NEW HORIZONS", Target = "JUPITER", Aberration = "NONE", - AspectRatio = 2 - }, - DataInputTranslation = { - Instrument = { - LORRI = { - DetectorType = "Camera", - Spice = {"NH_LORRI"}, - }, - }, - Target ={ - Read = { - "TARGET_NAME", - "INSTRUMENT_HOST_NAME", - "INSTRUMENT_ID", - "START_TIME", - "STOP_TIME", - "DETECTOR_TYPE", - --"SEQUENCE_ID", - }, - Convert = { - JRINGS = {"IMAGE-PLANE" }, - J1IO = {"IO" }, - J2EUROPA = {"EUROPA" }, - J6HIMALIA = {"IMAGE-PLANE" }, - J7ELARA = {"IMAGE-PLANE" }, - CALIBRATION = {"CALIBRATION" }, - JUPITER = {"JUPITER" }, - CALLISTO = {"CALLISTO" }, - GANYMEDE = {"GANYMEDE" }, - EARTH = {"EARTH" }, - NEWHORIZONS = {"NEW HORIZONS"}, - CCD = {"CAMERA" }, - FRAMECCD = {"SCANNER" }, + AspectRatio = 2, + + DataInputTranslation = { + Instrument = { + LORRI = { + DetectorType = "Camera", + Spice = {"NH_LORRI"}, + }, + }, + Target ={ + Read = { + "TARGET_NAME", + "INSTRUMENT_HOST_NAME", + "INSTRUMENT_ID", + "START_TIME", + "STOP_TIME", + "DETECTOR_TYPE", + --"SEQUENCE_ID", + }, + Convert = { + JRINGS = {"IMAGE-PLANE" }, + J1IO = {"IO" }, + J2EUROPA = {"EUROPA" }, + J6HIMALIA = {"IMAGE-PLANE" }, + J7ELARA = {"IMAGE-PLANE" }, + CALIBRATION = {"CALIBRATION" }, + JUPITER = {"JUPITER" }, + CALLISTO = {"CALLISTO" }, + GANYMEDE = {"GANYMEDE" }, + EARTH = {"EARTH" }, + NEWHORIZONS = {"NEW HORIZONS"}, + CCD = {"CAMERA" }, + FRAMECCD = {"SCANNER" }, + }, }, }, - }, - Instrument = { - Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.2907, - Aspect = 1, - Near = 0.2, - Far = 10000, - }, - PotentialTargets = { - "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" + Instrument = { + Name = "NH_LORRI", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 0.2907, + Aspect = 1, + Near = 0.2, + Far = 10000, + }, + PotentialTargets = { + "JUPITER", "IO", "EUROPA", "GANYMEDE", "CALLISTO" + } } }, Transform = { diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/1.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/1.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/1.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/1.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/2.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/2.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/2.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/2.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/3.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/3.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/3.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/3.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/Jupiter-text.png b/data/scene/missions/newhorizons/jupiter/jupiter/textures/Jupiter-text.png similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/Jupiter-text.png rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/Jupiter-text.png diff --git a/data/scene/newhorizons/jupiter/io/textures/defaultProj.png b/data/scene/missions/newhorizons/jupiter/jupiter/textures/defaultProj.png similarity index 100% rename from data/scene/newhorizons/jupiter/io/textures/defaultProj.png rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/defaultProj.png diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/defaultProj2.png b/data/scene/missions/newhorizons/jupiter/jupiter/textures/defaultProj2.png similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/defaultProj2.png rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/defaultProj2.png diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/europaRise1.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/europaRise1.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/europaRise1.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/europaRise1.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/europaRise2.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/europaRise2.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/europaRise2.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/europaRise2.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/grid.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/grid.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/grid.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/grid.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/jupiter.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/jupiter.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/jupiter.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/jupiter.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/jupiterFlipped.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/jupiterFlipped.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/jupiterFlipped.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/jupiterFlipped.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/jupiterFlipped_low.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/jupiterFlipped_low.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/jupiterFlipped_low.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/jupiterFlipped_low.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/lor_0034817584_0x630_sci_1.fit.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/lor_0034817584_0x630_sci_1.fit.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/lor_0034817584_0x630_sci_1.fit.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/lor_0034817584_0x630_sci_1.fit.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/lor_0034817654_0x630_sci_1.fit.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/lor_0034817654_0x630_sci_1.fit.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/lor_0034817654_0x630_sci_1.fit.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/lor_0034817654_0x630_sci_1.fit.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/lor_0034817724_0x630_sci_1.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/lor_0034817724_0x630_sci_1.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/lor_0034817724_0x630_sci_1.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/lor_0034817724_0x630_sci_1.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/lor_0034817794_0x630_sci_1.fit.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/lor_0034817794_0x630_sci_1.fit.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/lor_0034817794_0x630_sci_1.fit.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/lor_0034817794_0x630_sci_1.fit.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/lorriTest1.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/lorriTest1.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/lorriTest1.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/lorriTest1.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/lorriTest2.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/lorriTest2.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/lorriTest2.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/lorriTest2.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/scope.png b/data/scene/missions/newhorizons/jupiter/jupiter/textures/scope.png similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/scope.png rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/scope.png diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/show.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/show.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/show.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/show.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/show_3072.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/show_3072.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/show_3072.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/show_3072.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/small.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/small.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/small.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/small.jpg diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/small.png b/data/scene/missions/newhorizons/jupiter/jupiter/textures/small.png similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/small.png rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/small.png diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/test.jpg b/data/scene/missions/newhorizons/jupiter/jupiter/textures/test.jpg similarity index 100% rename from data/scene/newhorizons/jupiter/jupiter/textures/test.jpg rename to data/scene/missions/newhorizons/jupiter/jupiter/textures/test.jpg diff --git a/data/scene/newhorizons/newhorizons/NewHorizonsKernels.torrent b/data/scene/missions/newhorizons/newhorizons/NewHorizonsKernels.torrent similarity index 100% rename from data/scene/newhorizons/newhorizons/NewHorizonsKernels.torrent rename to data/scene/missions/newhorizons/newhorizons/NewHorizonsKernels.torrent diff --git a/data/scene/missions/newhorizons/newhorizons/jup260.bsp.torrent b/data/scene/missions/newhorizons/newhorizons/jup260.bsp.torrent new file mode 100644 index 0000000000..0c82073d38 Binary files /dev/null and b/data/scene/missions/newhorizons/newhorizons/jup260.bsp.torrent differ diff --git a/data/scene/newhorizons/newhorizons/newhorizons.data b/data/scene/missions/newhorizons/newhorizons/newhorizons.data similarity index 100% rename from data/scene/newhorizons/newhorizons/newhorizons.data rename to data/scene/missions/newhorizons/newhorizons/newhorizons.data diff --git a/data/scene/newhorizons/newhorizons/newhorizons.mod b/data/scene/missions/newhorizons/newhorizons/newhorizons.mod similarity index 97% rename from data/scene/newhorizons/newhorizons/newhorizons.mod rename to data/scene/missions/newhorizons/newhorizons/newhorizons.mod index af08d5f56b..c683779d8f 100644 --- a/data/scene/newhorizons/newhorizons/newhorizons.mod +++ b/data/scene/missions/newhorizons/newhorizons/newhorizons.mod @@ -90,7 +90,7 @@ return { Geometry = { Type = "MultiModelGeometry", GeometryFile = "models/NewHorizonsCleanModel.obj", - Magnification = 4, + -- Magnification = 4, }, Textures = { Type = "simple", @@ -114,6 +114,10 @@ return { SourceFrame = "NH_SPACECRAFT", DestinationFrame = "GALACTIC", }, + Scale = { + Type = "StaticScale", + Scale = 1000 + } }, }, --NewHorizonsTrail module @@ -150,7 +154,7 @@ return { Geometry = { Type = "MultiModelGeometry", GeometryFile = "models/Labels.obj", - Magnification = 4, + -- Magnification = 4, }, Textures = { Type = "simple", @@ -166,10 +170,9 @@ return { Fadeable = false, Ghosting = false, }, - }, + } }, - - { + { Name = "NewHorizonsTrailPluto", Parent = "PlutoBarycenter", Renderable = { diff --git a/data/scene/newhorizons/newhorizonsfov/newhorizonsfov.mod b/data/scene/missions/newhorizons/newhorizonsfov/newhorizonsfov.mod similarity index 100% rename from data/scene/newhorizons/newhorizonsfov/newhorizonsfov.mod rename to data/scene/missions/newhorizons/newhorizonsfov/newhorizonsfov.mod diff --git a/data/scene/newhorizons/newhorizonsfov/textures/glare.png b/data/scene/missions/newhorizons/newhorizonsfov/textures/glare.png similarity index 100% rename from data/scene/newhorizons/newhorizonsfov/textures/glare.png rename to data/scene/missions/newhorizons/newhorizonsfov/textures/glare.png diff --git a/data/scene/dawn/dawn/textures/glare_blue.png b/data/scene/missions/newhorizons/newhorizonsfov/textures/glare_blue.png similarity index 100% rename from data/scene/dawn/dawn/textures/glare_blue.png rename to data/scene/missions/newhorizons/newhorizonsfov/textures/glare_blue.png diff --git a/data/scene/newhorizons/pluto/charon/charon.data b/data/scene/missions/newhorizons/pluto/charon/charon.data similarity index 100% rename from data/scene/newhorizons/pluto/charon/charon.data rename to data/scene/missions/newhorizons/pluto/charon/charon.data diff --git a/data/scene/newhorizons/pluto/charon/charon.mod b/data/scene/missions/newhorizons/pluto/charon/charon.mod similarity index 82% rename from data/scene/newhorizons/pluto/charon/charon.mod rename to data/scene/missions/newhorizons/pluto/charon/charon.mod index d800cce9c9..01c370acc6 100644 --- a/data/scene/newhorizons/pluto/charon/charon.mod +++ b/data/scene/missions/newhorizons/pluto/charon/charon.mod @@ -22,38 +22,35 @@ return { Parent = "PlutoBarycenter", Renderable = { Type = "RenderablePlanetProjection", - Frame = "IAU_CHARON", - Body = "CHARON", Geometry = { Type = "SimpleSphere", Radius = { 6.035 , 5 }, Segments = 100 }, Textures = { - Type = "simple", Color = ColorTexture, Height = "textures/cpdem-Mcolor2-MLorriCA-lr-5_ZMfs-cyl.jpg", - Project = "textures/defaultProj.png", - Sequencing = "true", }, Projection = { Observer = "NEW HORIZONS", Target = "CHARON", Aberration = "NONE", - AspectRatio = 2 - }, - Instrument = { - Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.2907, - Aspect = 1, - Near = 0.2, - Far = 10000, - }, - PotentialTargets = { - "PLUTO", - "CHARON" + AspectRatio = 2, + + Instrument = { + Name = "NH_LORRI", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 0.2907, + Aspect = 1, + Near = 0.2, + Far = 10000, + }, + + PotentialTargets = { + "PLUTO", + "CHARON" + } } }, Transform = { diff --git a/data/scene/newhorizons/pluto/hydra/hydra.mod b/data/scene/missions/newhorizons/pluto/hydra/hydra.mod similarity index 100% rename from data/scene/newhorizons/pluto/hydra/hydra.mod rename to data/scene/missions/newhorizons/pluto/hydra/hydra.mod diff --git a/data/scene/newhorizons/pluto/hydra/textures/Hydra-Text.png b/data/scene/missions/newhorizons/pluto/hydra/textures/Hydra-Text.png similarity index 100% rename from data/scene/newhorizons/pluto/hydra/textures/Hydra-Text.png rename to data/scene/missions/newhorizons/pluto/hydra/textures/Hydra-Text.png diff --git a/data/scene/newhorizons/pluto/hydra/textures/gray.jpg b/data/scene/missions/newhorizons/pluto/hydra/textures/gray.jpg similarity index 100% rename from data/scene/newhorizons/pluto/hydra/textures/gray.jpg rename to data/scene/missions/newhorizons/pluto/hydra/textures/gray.jpg diff --git a/data/scene/newhorizons/pluto/kerberos/kerberos.mod b/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod similarity index 100% rename from data/scene/newhorizons/pluto/kerberos/kerberos.mod rename to data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod diff --git a/data/scene/newhorizons/pluto/kerberos/textures/Kerberos-Text.png b/data/scene/missions/newhorizons/pluto/kerberos/textures/Kerberos-Text.png similarity index 100% rename from data/scene/newhorizons/pluto/kerberos/textures/Kerberos-Text.png rename to data/scene/missions/newhorizons/pluto/kerberos/textures/Kerberos-Text.png diff --git a/data/scene/newhorizons/pluto/kerberos/textures/gray.jpg b/data/scene/missions/newhorizons/pluto/kerberos/textures/gray.jpg similarity index 100% rename from data/scene/newhorizons/pluto/kerberos/textures/gray.jpg rename to data/scene/missions/newhorizons/pluto/kerberos/textures/gray.jpg diff --git a/data/scene/newhorizons/pluto/nix/nix.mod b/data/scene/missions/newhorizons/pluto/nix/nix.mod similarity index 100% rename from data/scene/newhorizons/pluto/nix/nix.mod rename to data/scene/missions/newhorizons/pluto/nix/nix.mod diff --git a/data/scene/newhorizons/pluto/nix/textures/Nix-Text.png b/data/scene/missions/newhorizons/pluto/nix/textures/Nix-Text.png similarity index 100% rename from data/scene/newhorizons/pluto/nix/textures/Nix-Text.png rename to data/scene/missions/newhorizons/pluto/nix/textures/Nix-Text.png diff --git a/data/scene/newhorizons/pluto/nix/textures/gray.jpg b/data/scene/missions/newhorizons/pluto/nix/textures/gray.jpg similarity index 100% rename from data/scene/newhorizons/pluto/nix/textures/gray.jpg rename to data/scene/missions/newhorizons/pluto/nix/textures/gray.jpg diff --git a/data/scene/newhorizons/pluto/pluto/pluto.data b/data/scene/missions/newhorizons/pluto/pluto/pluto.data similarity index 100% rename from data/scene/newhorizons/pluto/pluto/pluto.data rename to data/scene/missions/newhorizons/pluto/pluto/pluto.data diff --git a/data/scene/newhorizons/pluto/pluto/pluto.mod b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod similarity index 53% rename from data/scene/newhorizons/pluto/pluto/pluto.mod rename to data/scene/missions/newhorizons/pluto/pluto/pluto.mod index e6c4537046..4434ec1cb0 100644 --- a/data/scene/newhorizons/pluto/pluto/pluto.mod +++ b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod @@ -36,124 +36,122 @@ return { Parent = "PlutoBarycenter", Renderable = { Type = "RenderablePlanetProjection", - Frame = "IAU_PLUTO", - Body = "PLUTO", Geometry = { Type = "SimpleSphere", Radius = { 1.173 , 6 }, Segments = 100 }, Textures = { - Type = "simple", Color = ColorTexture, Height = "textures/pluto_shenk_heightmap.jpg", - Project = "textures/3.jpg", - Sequencing = "true" }, Projection = { - Sequence = "${OPENSPACE_DATA}/scene/newhorizons/pluto/pluto/images", - EventFile = "${OPENSPACE_DATA}/scene/newhorizons/pluto/pluto/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt", + Sequence = "${OPENSPACE_DATA}/scene/missions/newhorizons/pluto/pluto/images", + EventFile = "${OPENSPACE_DATA}/scene/missions/newhorizons/pluto/pluto/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt", SequenceType = "hybrid", Observer = "NEW HORIZONS", Target = "PLUTO", Aberration = "NONE", - AspectRatio = 2 - }, - DataInputTranslation = { - Instrument = { - LORRI = { - DetectorType = "Camera", - Spice = {"NH_LORRI"}, - }, - RALPH_MVIC_PAN_FRAME = { - DetectorType = "Scanner", - StopCommand = "RALPH_ABORT", - Spice = {"NH_RALPH_MVIC_FT"}, - }, - RALPH_MVIC_COLOR = { - DetectorType = "Scanner", - StopCommand = "END_NOM", - Spice = { "NH_RALPH_MVIC_NIR", - "NH_RALPH_MVIC_METHANE", - "NH_RALPH_MVIC_RED", - "NH_RALPH_MVIC_BLUE" }, - }, - RALPH_LEISA = { - DetectorType = "Scanner", - StopCommand = "END_NOM", - Spice = {"NH_RALPH_LEISA"}, - }, - RALPH_MVIC_PAN1 = { - DetectorType = "Scanner", - StopCommand = "END_NOM", - Spice = {"NH_RALPH_MVIC_PAN1"}, - }, - RALPH_MVIC_PAN2 = { - DetectorType = "Scanner", - StopCommand = "END_NOM", - Spice = {"NH_RALPH_MVIC_PAN2"}, - }, - ALICE_Use_AIRGLOW = { - DetectorType = "Scanner", - StopCommand = "ALICE_END_PIXELLIST", - Spice = {"NH_ALICE_AIRGLOW"}, - }, - ALICE_Use_AIRGLOW = { - DetectorType = "Scanner", - StopCommand = "ALICE_END_HISTOGRAM", - Spice = {"NH_ALICE_AIRGLOW"}, - }, - ALICE_Use_SOCC = { - DetectorType = "Scanner", - StopCommand = "ALICE_END_PIXELLIST", - Spice = {"NH_ALICE_SOC"}, - }, - ALICE_Use_SOCC = { - DetectorType = "Scanner", - StopCommand = "ALICE_END_HISTOGRAM", - Spice = {"NH_ALICE_SOC"}, - }, - REX_START = { - DetectorType = "Scanner", - StopCommand = "REX_MODE_OFF", - Spice = { "NH_REX" }, - } - }, - Target ={ - Read = { - "TARGET_NAME", - "INSTRUMENT_HOST_NAME", - "INSTRUMENT_ID", - "START_TIME", - "STOP_TIME", - "DETECTOR_TYPE", - --"SEQUENCE_ID", - }, - Convert = { - PLUTO = {"PLUTO" }, - NEWHORIZONS = {"NEW HORIZONS"}, - CCD = {"CAMERA" }, - FRAMECCD = {"SCANNER" }, + AspectRatio = 2, + + DataInputTranslation = { + Instrument = { + LORRI = { + DetectorType = "Camera", + Spice = {"NH_LORRI"}, + }, + RALPH_MVIC_PAN_FRAME = { + DetectorType = "Scanner", + StopCommand = "RALPH_ABORT", + Spice = {"NH_RALPH_MVIC_FT"}, + }, + RALPH_MVIC_COLOR = { + DetectorType = "Scanner", + StopCommand = "END_NOM", + Spice = { "NH_RALPH_MVIC_NIR", + "NH_RALPH_MVIC_METHANE", + "NH_RALPH_MVIC_RED", + "NH_RALPH_MVIC_BLUE" }, + }, + RALPH_LEISA = { + DetectorType = "Scanner", + StopCommand = "END_NOM", + Spice = {"NH_RALPH_LEISA"}, + }, + RALPH_MVIC_PAN1 = { + DetectorType = "Scanner", + StopCommand = "END_NOM", + Spice = {"NH_RALPH_MVIC_PAN1"}, + }, + RALPH_MVIC_PAN2 = { + DetectorType = "Scanner", + StopCommand = "END_NOM", + Spice = {"NH_RALPH_MVIC_PAN2"}, + }, + ALICE_Use_AIRGLOW = { + DetectorType = "Scanner", + StopCommand = "ALICE_END_PIXELLIST", + Spice = {"NH_ALICE_AIRGLOW"}, + }, + ALICE_Use_AIRGLOW = { + DetectorType = "Scanner", + StopCommand = "ALICE_END_HISTOGRAM", + Spice = {"NH_ALICE_AIRGLOW"}, + }, + ALICE_Use_SOCC = { + DetectorType = "Scanner", + StopCommand = "ALICE_END_PIXELLIST", + Spice = {"NH_ALICE_SOC"}, + }, + ALICE_Use_SOCC = { + DetectorType = "Scanner", + StopCommand = "ALICE_END_HISTOGRAM", + Spice = {"NH_ALICE_SOC"}, + }, + REX_START = { + DetectorType = "Scanner", + StopCommand = "REX_MODE_OFF", + Spice = { "NH_REX" }, + } + }, + Target ={ + Read = { + "TARGET_NAME", + "INSTRUMENT_HOST_NAME", + "INSTRUMENT_ID", + "START_TIME", + "STOP_TIME", + "DETECTOR_TYPE", + --"SEQUENCE_ID", + }, + Convert = { + PLUTO = {"PLUTO" }, + NEWHORIZONS = {"NEW HORIZONS"}, + CCD = {"CAMERA" }, + FRAMECCD = {"SCANNER" }, + }, }, }, + + Instrument = { + Name = "NH_LORRI", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 0.2907, + Aspect = 1, + Near = 0.2, + Far = 10000, + }, + + PotentialTargets = { + "PLUTO", + "CHARON", + "NIX", + "HYDRA", + "P5", + "P4", + } }, - Instrument = { - Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.2907, - Aspect = 1, - Near = 0.2, - Far = 10000, - }, - PotentialTargets = { - "PLUTO", - "CHARON", - "NIX", - "HYDRA", - "P5", - "P4", - } }, Transform = { Translation = { diff --git a/data/scene/newhorizons/pluto/styx/styx.mod b/data/scene/missions/newhorizons/pluto/styx/styx.mod similarity index 100% rename from data/scene/newhorizons/pluto/styx/styx.mod rename to data/scene/missions/newhorizons/pluto/styx/styx.mod diff --git a/data/scene/newhorizons/pluto/styx/textures/Styx-Text.png b/data/scene/missions/newhorizons/pluto/styx/textures/Styx-Text.png similarity index 100% rename from data/scene/newhorizons/pluto/styx/textures/Styx-Text.png rename to data/scene/missions/newhorizons/pluto/styx/textures/Styx-Text.png diff --git a/data/scene/newhorizons/pluto/styx/textures/gray.jpg b/data/scene/missions/newhorizons/pluto/styx/textures/gray.jpg similarity index 100% rename from data/scene/newhorizons/pluto/styx/textures/gray.jpg rename to data/scene/missions/newhorizons/pluto/styx/textures/gray.jpg diff --git a/data/scene/osirisrex/bennu/InstrumentTimes/BaseballDiamond_PolyCam.txt b/data/scene/missions/osirisrex/bennu/InstrumentTimes/BaseballDiamond_PolyCam.txt similarity index 100% rename from data/scene/osirisrex/bennu/InstrumentTimes/BaseballDiamond_PolyCam.txt rename to data/scene/missions/osirisrex/bennu/InstrumentTimes/BaseballDiamond_PolyCam.txt diff --git a/data/scene/osirisrex/bennu/InstrumentTimes/DetailedSurvey_EquatorialStations_Spectrometers.txt b/data/scene/missions/osirisrex/bennu/InstrumentTimes/DetailedSurvey_EquatorialStations_Spectrometers.txt similarity index 100% rename from data/scene/osirisrex/bennu/InstrumentTimes/DetailedSurvey_EquatorialStations_Spectrometers.txt rename to data/scene/missions/osirisrex/bennu/InstrumentTimes/DetailedSurvey_EquatorialStations_Spectrometers.txt diff --git a/data/scene/osirisrex/bennu/InstrumentTimes/OrbitalB_Site08_PolyCamImages.txt b/data/scene/missions/osirisrex/bennu/InstrumentTimes/OrbitalB_Site08_PolyCamImages.txt similarity index 100% rename from data/scene/osirisrex/bennu/InstrumentTimes/OrbitalB_Site08_PolyCamImages.txt rename to data/scene/missions/osirisrex/bennu/InstrumentTimes/OrbitalB_Site08_PolyCamImages.txt diff --git a/data/scene/osirisrex/bennu/InstrumentTimes/Recon_225m_Equatorial_PolyCam.txt b/data/scene/missions/osirisrex/bennu/InstrumentTimes/Recon_225m_Equatorial_PolyCam.txt similarity index 100% rename from data/scene/osirisrex/bennu/InstrumentTimes/Recon_225m_Equatorial_PolyCam.txt rename to data/scene/missions/osirisrex/bennu/InstrumentTimes/Recon_225m_Equatorial_PolyCam.txt diff --git a/data/scene/osirisrex/bennu/InstrumentTimes/Recon_225m_Equatorial_spectrometers.txt b/data/scene/missions/osirisrex/bennu/InstrumentTimes/Recon_225m_Equatorial_spectrometers.txt similarity index 100% rename from data/scene/osirisrex/bennu/InstrumentTimes/Recon_225m_Equatorial_spectrometers.txt rename to data/scene/missions/osirisrex/bennu/InstrumentTimes/Recon_225m_Equatorial_spectrometers.txt diff --git a/data/scene/osirisrex/bennu/InstrumentTimes/Recon_525m_Equatorial_spectrometers.txt b/data/scene/missions/osirisrex/bennu/InstrumentTimes/Recon_525m_Equatorial_spectrometers.txt similarity index 100% rename from data/scene/osirisrex/bennu/InstrumentTimes/Recon_525m_Equatorial_spectrometers.txt rename to data/scene/missions/osirisrex/bennu/InstrumentTimes/Recon_525m_Equatorial_spectrometers.txt diff --git a/data/scene/osirisrex/bennu/bennu.data b/data/scene/missions/osirisrex/bennu/bennu.data similarity index 100% rename from data/scene/osirisrex/bennu/bennu.data rename to data/scene/missions/osirisrex/bennu/bennu.data diff --git a/data/scene/osirisrex/bennu/bennu.mod b/data/scene/missions/osirisrex/bennu/bennu.mod similarity index 62% rename from data/scene/osirisrex/bennu/bennu.mod rename to data/scene/missions/osirisrex/bennu/bennu.mod index eeabed0e09..5835657356 100644 --- a/data/scene/osirisrex/bennu/bennu.mod +++ b/data/scene/missions/osirisrex/bennu/bennu.mod @@ -16,7 +16,7 @@ return { }, }, { - Name = "Bennu2", + Name = "Bennu", Parent = "BennuBarycenter", Renderable = { @@ -38,53 +38,51 @@ return { Project = "textures/defaultProj.png", Default = "textures/defaultProj.png" }, - Rotation = { - Source = "IAU_BENNU", - Destination = "GALACTIC" - }, Projection = { Sequence = "InstrumentTimes", SequenceType = "instrument-times", Observer = "OSIRIS-REX", Target = BENNU_BODY, Aberration = "NONE", - AspectRatio = 2 - }, - DataInputTranslation = { - Instruments = { - ORX_OCAMS_POLYCAM = { - DetectorType = "Camera", - Spice = {"ORX_OCAMS_POLYCAM"}, - Files = { - "BaseballDiamond_PolyCam.txt", - --"OrbitalB_Site08_PolyCamImages.txt", - "Recon_225m_Equatorial_PolyCam.txt", + AspectRatio = 2, + + DataInputTranslation = { + Instruments = { + ORX_OCAMS_POLYCAM = { + DetectorType = "Camera", + Spice = {"ORX_OCAMS_POLYCAM"}, + Files = { + "BaseballDiamond_PolyCam.txt", + --"OrbitalB_Site08_PolyCamImages.txt", + "Recon_225m_Equatorial_PolyCam.txt", + }, }, - }, - ORX_REXIS = { - DetectorType = "Camera", - Spice = {"ORX_REXIS"}, - Files = { - "DetailedSurvey_EquatorialStations_Spectrometers.txt", - "Recon_225m_Equatorial_spectrometers.txt", - "Recon_525m_Equatorial_spectrometers.txt", + ORX_REXIS = { + DetectorType = "Camera", + Spice = {"ORX_REXIS"}, + Files = { + "DetailedSurvey_EquatorialStations_Spectrometers.txt", + "Recon_225m_Equatorial_spectrometers.txt", + "Recon_525m_Equatorial_spectrometers.txt", + }, }, + }, + Target = { + Body = BENNU_BODY, -- Do we need this? }, - }, - Target = { - Body = BENNU_BODY, -- Do we need this? + }, + + Instrument = { -- INVALID DATA - JUST FOR TESTING + Name = "ORX_OCAMS_POLYCAM", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 0.792, + Aspect = 1, + Near = 0.01, + Far = 1000000, }, }, - Instrument = { -- INVALID DATA - JUST FOR TESTING - Name = "ORX_OCAMS_POLYCAM", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 0.792, - Aspect = 1, - Near = 0.01, - Far = 1000000, - }, }, Transform = { diff --git a/data/scene/osirisrex/osirisrex/OsirisRexKernels.torrent b/data/scene/missions/osirisrex/osirisrex/OsirisRexKernels.torrent similarity index 100% rename from data/scene/osirisrex/osirisrex/OsirisRexKernels.torrent rename to data/scene/missions/osirisrex/osirisrex/OsirisRexKernels.torrent diff --git a/data/scene/osirisrex/osirisrex/osirisrex.data b/data/scene/missions/osirisrex/osirisrex/osirisrex.data similarity index 100% rename from data/scene/osirisrex/osirisrex/osirisrex.data rename to data/scene/missions/osirisrex/osirisrex/osirisrex.data diff --git a/data/scene/osirisrex/osirisrex/osirisrex.mission b/data/scene/missions/osirisrex/osirisrex/osirisrex.mission similarity index 100% rename from data/scene/osirisrex/osirisrex/osirisrex.mission rename to data/scene/missions/osirisrex/osirisrex/osirisrex.mission diff --git a/data/scene/missions/osirisrex/osirisrex/osirisrex.mod b/data/scene/missions/osirisrex/osirisrex/osirisrex.mod new file mode 100644 index 0000000000..83b3432517 --- /dev/null +++ b/data/scene/missions/osirisrex/osirisrex/osirisrex.mod @@ -0,0 +1,422 @@ +local BENNU_BODY = "2101955" + +local CaseDependentKernels +if KernelCase == 2 then + CaseDependentKernels = { + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/ORX_Recon_525mSortie_Case02.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case02_0Latitude.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case02_atl_19145_04.atf", + + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case02.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case02_0Latitude.bc" + } +elseif KernelCase == 5 then + CaseDependentKernels = { + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/ORX_Recon_525mSortie_Case05.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_20negLatitude.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_atl_19145_04.atf", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_NominalProfile.bc", + + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case05.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case05_20negLatitude.bc" + } +elseif KernelCase == 8 then + CaseDependentKernels = { + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case08_NominalProfile.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case08.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case08_40negLatitude.bc" + } +elseif KernelCase == 11 then + CaseDependentKernels = { + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case11.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case11_60negLatitude.bc" + } +end + +local OsirisRexKernels = { + -- background + -- SCLK kernels needs to be loaded before CK kernels (and generally first) + "${SPICE}/OsirisRexKernels/background/sclk/ORX_SCLKSCET.00000.tsc", + + -- This cannot be loaded correctly for some reason! + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/dsk/RQ36mod.oct12_CCv0001.bds") + + "${SPICE}/OsirisRexKernels/background/fk/orx_v04.tf", + "${SPICE}/OsirisRexKernels/background/ik/orx_lidar_v00.ti", + "${SPICE}/OsirisRexKernels/background/ik/orx_ocams_v03.ti", + "${SPICE}/OsirisRexKernels/background/ik/orx_otes_v00.ti", + "${SPICE}/OsirisRexKernels/background/ik/orx_rexis_v00.ti", + "${SPICE}/OsirisRexKernels/background/ik/orx_struct_v00.ti", + "${SPICE}/OsirisRexKernels/background/ik/orx_navcam_v00.ti", + "${SPICE}/OsirisRexKernels/background/ik/orx_ola_v00.ti", + "${SPICE}/OsirisRexKernels/background/ik/orx_ovirs_v00.ti", + "${SPICE}/OsirisRexKernels/background/ik/orx_stowcam_v00.ti", + "${SPICE}/OsirisRexKernels/background/lsk/naif0011.tls", + "${SPICE}/OsirisRexKernels/background/pck/bennu_SPH250m.tpc", + "${SPICE}/OsirisRexKernels/background/pck/bennu_v10.tpc", + + -- Low res SPK + "${SPICE}/OsirisRexKernels/background/spk/orx_160917_231024_pgaa3_day15m60_v1.bsp", + "${SPICE}/OsirisRexKernels/background/spk/orx_160914_231024_pgaa3_day12m60_v1.bsp", + + "${SPICE}/OsirisRexKernels/background/spk/orx_160908_231024_pgaa3_day06m60_v1.bsp", + "${SPICE}/OsirisRexKernels/background/spk/spk_orx_160908_231024_pgaa2_day06m60_v3.bsp", + "${SPICE}/OsirisRexKernels/background/spk/orx_160908_231024_pgaa2_day06m60.bsp", + + "${SPICE}/OsirisRexKernels/background/spk/OREX_20160908_M60_complete.bsp", + "${SPICE}/OsirisRexKernels/background/spk/OREX_20160904_M45_complete.bsp", + + -- SPK + "${SPICE}/OsirisRexKernels/background/spk/de421.bsp", + "${SPICE}/OsirisRexKernels/background/spk/sb-101955-76.bsp", + + -- Nominal_Profile_LowRes + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Approach_600s_20180816T230000_20181119T010000.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Approach_NominalProfile_600s_20180816T230000_20181119T010000.bc", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/DetailedSurvey_600s_20190108T000000_20190317T000000.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalA_600s_20181203T230000_20190109T000000.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalA_NominalProfile_600s_20181203T230000_20190109T000000.bc", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalB_600s_20190316T000000_20190521T000000.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/DetailedSurvey_NominalProfile_600s_20190108T000000_20190317T000000.bc", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalB_NominalProfile600s_20190316T000000_20190521T000000.bc", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/PrelimSurvey_600s_20181119T230000_20181204T010000.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/PrelimSurvey_NominalProfile_600s_20181119T230000_20181204T010000.bc", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Recon_600s_20190519T000000_20190830T000000.bsp", + "${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Recon_NominalProfile_600s_20190519T000000_20190830T000000.bc", + + -- Nominal_Observations_Science + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/DustSearch_v1/Phase03_AP_DustSearch_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/LightCurve_v1/Phase03_AP_LightCurve_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/LightCurve_v1/Phase03_AP_LightCurve_2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/NatSatSearch_v1/Phase03_AP_SatSearch_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/NatSatSearch_v1/Phase03_AP_SatSearch_2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/PhaseFunction_v1/Phase03_AP_PhaseFunction_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_3.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_4.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_5.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_6.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_7.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_8.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_9_Forced4x4.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/SpectraMap_v1/Phase03_AP_SpectraMap_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/MapCamOLA_v1/Phase04_PS_MC_1_v1_1a.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/MapCamOLA_v1/Phase04_PS_MC_2_v1_1a.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_3.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_4.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_3.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_4.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_5.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_6.bc", + + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19013_18_BBD1_info.TXT") + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19014_16_BBD2_info.TXT") + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19020_18_BBD3_info.TXT") + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19021_19_BBD4_info.TXT") + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/README.txt") + + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19013_18_BBD1_v2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19014_16_BBD2_v2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19020_18_BBD3_v2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19021_19_BBD4_v2.bc", + + + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_3.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_4.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_5.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_6.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_7.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/PlumeSearch_v1/Phase06_DS_Plume_Search_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/PlumeSearch_v1/Phase06_DS_Plume_Search_2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_1.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_2.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_3.bc", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_1.a", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_2.a", + "${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_3.a", + + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case02_0Latitude.wmv") + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case05_20negLatitude.wmv") + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case08_40negLatitude.wmv") + --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case11_60negLatitude.wmv") + + KernelCase +} + + +return { + ------------------------ + -- Osiris Rex -- + ------------------------ + { + Name = "OsirisRex", + Parent = "SolarSystemBarycenter", + Renderable = { + Type = "RenderableModel", + Body = "OSIRIS-REX", + Geometry = { + Type = "MultiModelGeometry", + GeometryFile = "models/orx_base_resized_12_sep_2016.obj", + Magnification = 0, + }, + Textures = { + Type = "simple", + Color = "textures/osirisTex.png", + }, + Shading = { + PerformShading = true, + Fadeable = false, + Ghosting = false, + }, + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "OSIRIS-REX", + Observer = "SUN", + Kernels = OsirisRexKernels + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "ORX_SPACECRAFT", + DestinationFrame = "GALACTIC", + }, + }, + }, + { + Name = "ORX_OCAMS_POLYCAM", + Parent = "OsirisRex", + Renderable = { + Type = "RenderableModel", + Body = "OSIRIS-REX", + Geometry = { + Type = "MultiModelGeometry", + GeometryFile = "models/orx_polycam_resized_12_sep_2016.obj", + Magnification = 0, + }, + Textures = { + Type = "simple", + Color = "textures/osirisTex.png", + }, + Shading = { + PerformShading = true, + Fadeable = false, + Ghosting = false, + }, + }, + Transform = { + Translation = { + Type = "StaticTranslation", + Position = {-0.2476, 0.2710, 0.3364}, + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "ORX_OCAMS_POLYCAM", + DestinationFrame = "ORX_SPACECRAFT", + }, + }, + }, + { + Name = "ORX_REXIS", + Parent = "OsirisRex", + Renderable = { + Type = "RenderableModel", + Body = "OSIRIS-REX", + Geometry = { + Type = "MultiModelGeometry", + GeometryFile = "models/orx_rexis_resized_12_sep_2016.obj", + Magnification = 0, + }, + Textures = { + Type = "simple", + Color = "textures/osirisTex.png", + }, + Shading = { + PerformShading = true, + Fadeable = false, + Ghosting = false, + }, + }, + Transform = { + Translation = { + Type = "StaticTranslation", + Position = {0, 0.3371, 0.2712}, + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "ORX_REXIS", + DestinationFrame = "ORX_SPACECRAFT", + }, + }, + }, + { + Name = "POLYCAM FOV", + Parent = "ORX_OCAMS_POLYCAM", + Renderable = { + Type = "RenderableFov", + Body = "OSIRIS-REX", + Frame = "ORX_OCAMS_POLYCAM", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "ORX_OCAMS_POLYCAM", + Method = "ELLIPSOID", + Aberration = "NONE", + }, + PotentialTargets = { + BENNU_BODY -- Bennu + } + }, + }, + { + Name = "REXIS FOV", + Parent = "ORX_REXIS", + Renderable = { + Type = "RenderableFov", + Body = "OSIRIS-REX", + Frame = "ORX_REXIS", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "ORX_REXIS", + Method = "ELLIPSOID", + Aberration = "NONE", + }, + PotentialTargets = { + BENNU_BODY -- Bennu + }, + FrameConversions = { + [BENNU_BODY] = "IAU_BENNU" + } + }, + }, + --[[ + -- Latest image taken by POLYCAM + { + Name = "ImagePlaneOsirisRex", + Parent = "Bennu2", + Renderable = { + Type = "RenderablePlaneProjection", + Frame = "IAU_BENNU", + DefaultTarget = BENNU_BODY, + Spacecraft = "OSIRIS-REX", + Instrument = "ORX_OCAMS_POLYCAM", + Moving = false, + Texture = "textures/defaultProj.png", + }, + Ephemeris = { + Type = "Static", + Position = {0, 0, 0, 1} + }, + }, + -- POLYCAM FoV square + { + Name = "FovImagePlane", + Parent = "Bennu2", + Renderable = { + Type = "RenderablePlaneProjection", + Frame = "IAU_BENNU", + DefaultTarget = BENNU_BODY, + Spacecraft = "OSIRIS-REX", + Instrument = "ORX_OCAMS_POLYCAM", + Moving = true, + Texture = "textures/defaultProj.png", + }, + Ephemeris = { + Type = "Static", + Position = {0, 0, 0, 1} + }, + }, + ]] + + -- Trail relative to Earth + { + Name = "OsirisRexTrailEarth", + Parent = "Earth", + Renderable = { + Type = "RenderableTrailNew", + -- Spice + Body = "OSIRIS-REX", + Frame = "IAU_EARTH", + Observer = "EARTH", + -- Optional rendering properties + LineColor = { 0.9, 0.9, 0.0 }, + PointColor = { 0.9, 0.9, 0.0 }, + LineFade = 0.0, -- [0,1] + RenderPart = 1, + LineWidth = 2, + ShowTimeStamps = false, + RenderFullTrail = false, + -- Time interval + TimeRange = { + Start = "2016 SEP 8 23:05:00.50", + End = "2016 SEP 9 00:05:00", + }, + SampleDeltaTime = 60, -- Seconds between each point + SubSamples = 59, + }, + }, + + -- Trail relative to solar system barycenter + { + Name = "OsirisRexTrailSolarSystem", + Parent = "SolarSystemBarycenter", + Renderable = { + Type = "RenderableTrailNew", + -- Spice + Body = "OSIRIS-REX", + Frame = "GALACTIC", + Observer = "SUN", + -- Optional rendering properties + LineColor = { 0.2, 0.9, 0.2 }, + PointColor = { 0.2, 0.9, 0.2 }, + LineFade = 0.0, -- [0,1] + RenderPart = 0.13, + LineWidth = 2, + ShowTimeStamps = false, + RenderFullTrail = false, + -- Time interval + TimeRange = { + Start = "2016 SEP 8 23:05:00.50", + End = "2023 SEP 24 12:00:00", + }, + SampleDeltaTime = 3600, -- Seconds between each point + SubSamples = 0, + }, + }, + + -- Trail relative to Bennu + { + Name = "OsirisRexTrailBennu", + Parent = "BennuBarycenter", + Renderable = { + Type = "RenderableTrailNew", + -- Spice + Body = "OSIRIS-REX", + Frame = "GALACTIC", + Observer = BENNU_BODY, + -- Optional rendering properties + LineColor = { 0.9, 0.2, 0.9 }, + PointColor = { 0.9, 0.2, 0.9 }, + LineFade = 0.5, -- [0,1] + RenderPart = 0.06, + LineWidth = 2, + ShowTimeStamps = false, + RenderFullTrail = false, + -- Time interval + TimeRange = { + Start = "2016 SEP 8 23:05:00.50", + End = "2023 SEP 24 12:00:00", + }, + SampleDeltaTime = 3600, -- Seconds between each point + SubSamples = 3, + }, + }, + + +} diff --git a/data/scene/osirisrex/osirisrex/spice_kernel_times.mission b/data/scene/missions/osirisrex/osirisrex/spice_kernel_times.mission similarity index 100% rename from data/scene/osirisrex/osirisrex/spice_kernel_times.mission rename to data/scene/missions/osirisrex/osirisrex/spice_kernel_times.mission diff --git a/data/scene/osirisrex/scheduled_scripts.lua b/data/scene/missions/osirisrex/scheduled_scripts.lua similarity index 100% rename from data/scene/osirisrex/scheduled_scripts.lua rename to data/scene/missions/osirisrex/scheduled_scripts.lua diff --git a/data/scene/rosetta/67P/67P.data b/data/scene/missions/rosetta/67P/67P.data similarity index 100% rename from data/scene/rosetta/67P/67P.data rename to data/scene/missions/rosetta/67P/67P.data diff --git a/data/scene/rosetta/67P/67P.mod b/data/scene/missions/rosetta/67P/67P.mod similarity index 62% rename from data/scene/rosetta/67P/67P.mod rename to data/scene/missions/rosetta/67P/67P.mod index 1b8d3a5aa7..5358b6b9ce 100644 --- a/data/scene/rosetta/67P/67P.mod +++ b/data/scene/missions/rosetta/67P/67P.mod @@ -17,22 +17,14 @@ return { Renderable = { Type = "RenderableModelProjection", - Body = "CHURYUMOV-GERASIMENKO", Geometry = { Type = "MultiModelGeometry", GeometryFile = "obj/67P_rotated_5_130.obj", Magnification = 0, }, Textures = { - Type = "simple", Color = "textures/gray.jpg", -- Color = "textures/may9_map.jpg", - Project = "textures/defaultProj.png", - Default = "textures/defaultProj.png" - }, - Rotation = { - Source = "67P/C-G_CK", - Destination = "GALACTIC" }, Projection = { Sequence = "rosettaimages", @@ -41,43 +33,45 @@ return { Target = "CHURYUMOV-GERASIMENKO", Aberration = "NONE", TextureMap = true, - ShadowMap = true - }, - DataInputTranslation = { + ShadowMap = true, + + DataInputTranslation = { + Instrument = { + NAVCAM = { + DetectorType = "Camera", + Spice = {"ROS_NAVCAM-A"}, + }, + }, + Target = { + Read = { + "TARGET_NAME", + "INSTRUMENT_HOST_NAME", + "INSTRUMENT_ID", + "START_TIME", + "STOP_TIME", + }, + Convert = { + CHURYUMOV = {"CHURYUMOV-GERASIMENKO"}, + ROSETTA = {"ROSETTA" }, + --NAVCAM = {"NAVCAM"}, + ["ROSETTA-ORBITER"] = {"ROSETTA" }, + CHURYUMOVGERASIMENKO11969R1 = {"CHURYUMOV-GERASIMENKO"}, + CHURYUMOVGERASIMENKO = {"CHURYUMOV-GERASIMENKO"}, + ["CHURYUMOV-GERASIMENKO1(1969R1)"] = {"CHURYUMOV-GERASIMENKO"}, + --NAVIGATIONCAMERA = {"NAVCAM" }, + }, + }, + }, + Instrument = { - NAVCAM = { - DetectorType = "Camera", - Spice = {"ROS_NAVCAM-A"}, - }, - }, - Target = { - Read = { - "TARGET_NAME", - "INSTRUMENT_HOST_NAME", - "INSTRUMENT_ID", - "START_TIME", - "STOP_TIME", - }, - Convert = { - CHURYUMOV = {"CHURYUMOV-GERASIMENKO"}, - ROSETTA = {"ROSETTA" }, - --NAVCAM = {"NAVCAM"}, - ["ROSETTA-ORBITER"] = {"ROSETTA" }, - CHURYUMOVGERASIMENKO11969R1 = {"CHURYUMOV-GERASIMENKO"}, - CHURYUMOVGERASIMENKO = {"CHURYUMOV-GERASIMENKO"}, - ["CHURYUMOV-GERASIMENKO1(1969R1)"] = {"CHURYUMOV-GERASIMENKO"}, - --NAVIGATIONCAMERA = {"NAVCAM" }, - }, + Name = "ROS_NAVCAM-A", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 5.00, + Aspect = 1 }, }, - Instrument = { - Name = "ROS_NAVCAM-A", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 5.00, - Aspect = 1 - }, BoundingSphereRadius = 5000.0 }, Transform = { diff --git a/data/scene/rosetta/67P/67P_rotated_5_130.obj.torrent b/data/scene/missions/rosetta/67P/67P_rotated_5_130.obj.torrent similarity index 100% rename from data/scene/rosetta/67P/67P_rotated_5_130.obj.torrent rename to data/scene/missions/rosetta/67P/67P_rotated_5_130.obj.torrent diff --git a/data/scene/rosetta/67P/rosettaimages.torrent b/data/scene/missions/rosetta/67P/rosettaimages.torrent similarity index 100% rename from data/scene/rosetta/67P/rosettaimages.torrent rename to data/scene/missions/rosetta/67P/rosettaimages.torrent diff --git a/data/scene/rosetta/rosetta/Rosetta.torrent b/data/scene/missions/rosetta/rosetta/Rosetta.torrent similarity index 100% rename from data/scene/rosetta/rosetta/Rosetta.torrent rename to data/scene/missions/rosetta/rosetta/Rosetta.torrent diff --git a/data/scene/rosetta/rosetta/rosetta.data b/data/scene/missions/rosetta/rosetta/rosetta.data similarity index 100% rename from data/scene/rosetta/rosetta/rosetta.data rename to data/scene/missions/rosetta/rosetta/rosetta.data diff --git a/data/scene/rosetta/rosetta/rosetta.mod b/data/scene/missions/rosetta/rosetta/rosetta.mod similarity index 99% rename from data/scene/rosetta/rosetta/rosetta.mod rename to data/scene/missions/rosetta/rosetta/rosetta.mod index 1bb96fe198..dffee7acb6 100644 --- a/data/scene/rosetta/rosetta/rosetta.mod +++ b/data/scene/missions/rosetta/rosetta/rosetta.mod @@ -437,6 +437,9 @@ return { }, PotentialTargets = { "CHURYUMOV-GERASIMENKO" + }, + FrameConversions = { + ["CHURYUMOV-GERASIMENKO"] = "67P/C-G_CK" } }, }, diff --git a/data/scene/newhorizons.scene b/data/scene/newhorizons.scene index 812f30ee3d..ca5e4106c9 100644 --- a/data/scene/newhorizons.scene +++ b/data/scene/newhorizons.scene @@ -14,16 +14,8 @@ function preInitialization() openspace.spice.loadKernel("${SPICE}/naif0011.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") - -- openspace.time.setTime("2007-02-28T11:40:00.000") - - -- openspace.time.setTime("2015-07-08T15:57:45.00") - -- openspace.time.setTime("2015-07-12T07:41:00.00") - -- openspace.time.setTime("2015-07-12T15:43:00.00") - -- openspace.time.setTime("2015-07-12T22:19:20.00") - -- openspace.time.setTime("2015-07-13T20:59:00.00") - -- openspace.time.setTime("2015-07-14T02:41:55.00") openspace.time.setTime("2015-07-14T10:05:00.00") - openspace.time.setDeltaTime(0) + dofile(openspace.absPath('${SCRIPTS}/bind_keys_newhorizons.lua')) end @@ -61,17 +53,17 @@ return { "venus", "earth", "mars", - "saturn", + "saturn/saturn", "uranus", "neptune", - "newhorizons/pluto", - "newhorizons/jupiter", "stars", -- "stars-denver", "milkyway", -- "milkyway-eso", - "newhorizons/newhorizons", - "newhorizons/newhorizonsfov", + "missions/newhorizons/pluto", + "missions/newhorizons/jupiter", + "missions/newhorizons/newhorizons", + "missions/newhorizons/newhorizonsfov" } } diff --git a/data/scene/newhorizons/jupiter/jupiter/textures/defaultProj.png b/data/scene/newhorizons/jupiter/jupiter/textures/defaultProj.png deleted file mode 100644 index 1d48dc35f4..0000000000 Binary files a/data/scene/newhorizons/jupiter/jupiter/textures/defaultProj.png and /dev/null differ diff --git a/data/scene/newhorizons/newhorizonsfov/textures/glare_blue.png b/data/scene/newhorizons/newhorizonsfov/textures/glare_blue.png deleted file mode 100644 index ebae6637e2..0000000000 Binary files a/data/scene/newhorizons/newhorizonsfov/textures/glare_blue.png and /dev/null differ diff --git a/data/scene/newhorizons/newhorizonspath/newhorizonspath.mod b/data/scene/newhorizons/newhorizonspath/newhorizonspath.mod deleted file mode 100644 index d11cb2a8bb..0000000000 --- a/data/scene/newhorizons/newhorizonspath/newhorizonspath.mod +++ /dev/null @@ -1,19 +0,0 @@ -return { - -- NewHorizonsPath module - { - Name = "NewHorizonsPath", - Parent = "Root", - Renderable = { - Type = "RenderablePath", - Body = "NEW HORIZONS", - Frame = "GALACTIC", - Observer = "SUN", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - }, - } -} \ No newline at end of file diff --git a/data/scene/newhorizons/newhorizonspath/textures/glare.png b/data/scene/newhorizons/newhorizonspath/textures/glare.png deleted file mode 100644 index 7b7aa34b33..0000000000 Binary files a/data/scene/newhorizons/newhorizonspath/textures/glare.png and /dev/null differ diff --git a/data/scene/newhorizons/newhorizonspath/textures/glare_blue.png b/data/scene/newhorizons/newhorizonspath/textures/glare_blue.png deleted file mode 100644 index ebae6637e2..0000000000 Binary files a/data/scene/newhorizons/newhorizonspath/textures/glare_blue.png and /dev/null differ diff --git a/data/scene/newhorizons/newhorizonstrail/newhorizonstrail.mod b/data/scene/newhorizons/newhorizonstrail/newhorizonstrail.mod deleted file mode 100644 index e8a334b6ae..0000000000 --- a/data/scene/newhorizons/newhorizonstrail/newhorizonstrail.mod +++ /dev/null @@ -1,22 +0,0 @@ -return { - -- NewHorizonsTrail module - { - Name = "NewHorizonsTrail", - Parent = "Root", - Renderable = { - Type = "RenderableTrail", - Body = "NEW HORIZONS", - Frame = "GALACTIC", - Observer = "SUN", - RGB = { 0.1,0.01,0.30 }, - TropicalOrbitPeriod = 6330.595 , - EarthOrbitRatio = 0.857, - DayLength = 9.9259, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - }, - } -} \ No newline at end of file diff --git a/data/scene/newhorizons/newhorizonstrail/textures/glare.png b/data/scene/newhorizons/newhorizonstrail/textures/glare.png deleted file mode 100644 index 7b7aa34b33..0000000000 Binary files a/data/scene/newhorizons/newhorizonstrail/textures/glare.png and /dev/null differ diff --git a/data/scene/newhorizons/newhorizonstrail/textures/glare_blue.png b/data/scene/newhorizons/newhorizonstrail/textures/glare_blue.png deleted file mode 100644 index ebae6637e2..0000000000 Binary files a/data/scene/newhorizons/newhorizonstrail/textures/glare_blue.png and /dev/null differ diff --git a/data/scene/osirisrex-noglobebrowsing.scene b/data/scene/osirisrex-noglobebrowsing.scene deleted file mode 100644 index c5b83afda2..0000000000 --- a/data/scene/osirisrex-noglobebrowsing.scene +++ /dev/null @@ -1,233 +0,0 @@ --- TextureResolution = "low" -TextureResolution = "med" --- TextureResolution = "high" - -local startTime = "2016 SEP 8 23:05:00.50" - -function preInitialization() - --[[ - The scripts in this function are executed after the scene is loaded but before the - scene elements have been initialized, thus they should be used to set the time at - which the scene should start and other settings that might determine initialization - critical objects. - ]]-- - - -- Load Spice Kernels - openspace.spice.loadKernel("${OPENSPACE_DATA}/spice/de430_1850-2150.bsp") - - -- background - -- SCLK kernels needs to be loaded before CK kernels (and generally first) - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/sclk/ORX_SCLKSCET.00000.tsc") - - -- This cannot be loaded correctly for some reason! - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/dsk/RQ36mod.oct12_CCv0001.bds") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/fk/orx_v04.tf") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_lidar_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_ocams_v03.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_otes_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_rexis_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_struct_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_navcam_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_ola_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_ovirs_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_stowcam_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/lsk/naif0011.tls") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/pck/bennu_SPH250m.tpc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/pck/bennu_v10.tpc") - - -- Low res SPK - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/orx_160917_231024_pgaa3_day15m60_v1.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/orx_160914_231024_pgaa3_day12m60_v1.bsp") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/orx_160908_231024_pgaa3_day06m60_v1.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/spk_orx_160908_231024_pgaa2_day06m60_v3.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/orx_160908_231024_pgaa2_day06m60.bsp") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/OREX_20160908_M60_complete.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/OREX_20160904_M45_complete.bsp") - - -- SPK - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/de421.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/sb-101955-76.bsp") - - -- Nominal_Profile_LowRes - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Approach_600s_20180816T230000_20181119T010000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Approach_NominalProfile_600s_20180816T230000_20181119T010000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/DetailedSurvey_600s_20190108T000000_20190317T000000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/DetailedSurvey_NominalProfile_600s_20190108T000000_20190317T000000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalA_600s_20181203T230000_20190109T000000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalA_NominalProfile_600s_20181203T230000_20190109T000000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalB_600s_20190316T000000_20190521T000000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalB_NominalProfile600s_20190316T000000_20190521T000000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/PrelimSurvey_600s_20181119T230000_20181204T010000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/PrelimSurvey_NominalProfile_600s_20181119T230000_20181204T010000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Recon_600s_20190519T000000_20190830T000000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Recon_NominalProfile_600s_20190519T000000_20190830T000000.bc") - - -- Nominal_Observations_Science - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/DustSearch_v1/Phase03_AP_DustSearch_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/LightCurve_v1/Phase03_AP_LightCurve_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/LightCurve_v1/Phase03_AP_LightCurve_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/NatSatSearch_v1/Phase03_AP_SatSearch_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/NatSatSearch_v1/Phase03_AP_SatSearch_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/PhaseFunction_v1/Phase03_AP_PhaseFunction_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_5.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_6.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_7.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_8.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_9_Forced4x4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/SpectraMap_v1/Phase03_AP_SpectraMap_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/MapCamOLA_v1/Phase04_PS_MC_1_v1_1a.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/MapCamOLA_v1/Phase04_PS_MC_2_v1_1a.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_5.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_6.bc") - - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19013_18_BBD1_info.TXT") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19014_16_BBD2_info.TXT") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19020_18_BBD3_info.TXT") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19021_19_BBD4_info.TXT") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/README.txt") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19013_18_BBD1_v2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19014_16_BBD2_v2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19020_18_BBD3_v2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19021_19_BBD4_v2.bc") - - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_5.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_6.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_7.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/PlumeSearch_v1/Phase06_DS_Plume_Search_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/PlumeSearch_v1/Phase06_DS_Plume_Search_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_1.a") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_2.a") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_3.a") - - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case02_0Latitude.wmv") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case05_20negLatitude.wmv") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case08_40negLatitude.wmv") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case11_60negLatitude.wmv") - - local case = 2 -- Right now we only have the image times for case 2 - - if case == 2 then - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/ORX_Recon_525mSortie_Case02.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case02_0Latitude.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case02_atl_19145_04.atf") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case02.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case02_0Latitude.bc") - elseif case == 5 then - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/ORX_Recon_525mSortie_Case05.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_20negLatitude.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_atl_19145_04.atf") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_NominalProfile.bc") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case05.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case05_20negLatitude.bc") - elseif case == 8 then - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case08_NominalProfile.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case08.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case08_40negLatitude.bc") - elseif case == 11 then - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case11.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case11_60negLatitude.bc") - end - - -- Load planetary constants - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") - - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) - dofile(openspace.absPath('${SCRIPTS}/bind_keys_osirisrex.lua')) - - --local startTime = "2019 APR 16 12:03:00.00" - - openspace.scriptScheduler.load("${OPENSPACE_DATA}/scene/osirisrex/scheduled_scripts.lua") - - -- Removing the line below will cause all scripts prior to to be executed during initialization - -- openspace.scriptScheduler.skipTo(startTime); - -end - -function postInitialization() - --[[ - The scripts in this function are executed after all objects in the scene have been - created and initialized, but before the first render call. This is the place to set - graphical settings for the renderables. - ]]-- - openspace.printInfo("Setting default values") - openspace.setPropertyValue("Sun.renderable.enabled", false) - openspace.setPropertyValue("SunMarker.renderable.enabled", false) - openspace.setPropertyValue("EarthMarker.renderable.enabled", false) - --openspace.setPropertyValue("Constellation Bounds.renderable.enabled", false) - openspace.setPropertyValue("PlutoTrail.renderable.enabled", true) - openspace.setPropertyValue("PlutoTexture.renderable.enabled", false) - - openspace.setPropertyValue("MilkyWay.renderable.transparency", 0.55) - openspace.setPropertyValue("MilkyWay.renderable.segments", 50) - - -- Activate night textures and water masks - openspace.setPropertyValue("Earth.RenderableGlobe.WaterMasks", {0, 1}); - openspace.setPropertyValue("Earth.RenderableGlobe.NightLayers", {0, 1}); - openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", true); - - openspace.printInfo("Done setting default values") - openspace.loadMission("${OPENSPACE_DATA}/scene/osirisrex/osirisrex/osirisrex.mission") - - openspace.time.setTime(startTime) - openspace.time.setDeltaTime(0) - - openspace.resetCameraDirection() -end - -return { - ScenePath = ".", - CommonFolder = "common", - Camera = { - Focus = "OsirisRex", - Position = {26974590199.661884, 76314608558.908020, -127086452897.101791}, - Rotation = {0.729548, -0.126024, 0.416827, 0.527382}, - }, - Modules = { - "sun", - "mercury", - -- "lodmercury", - "venus", - "earth", - "mars", - -- "lodearth", - -- "lodmoon", - -- "lodmars", - "jupiter", - "saturn", - "uranus", - "neptune", - "stars", - -- "stars-denver", - "milkyway", - -- "milkyway-eso", - --"imageplane", - "osirisrex", - } -} - diff --git a/data/scene/osirisrex.scene b/data/scene/osirisrex.scene index 49807ba65b..34d591b208 100644 --- a/data/scene/osirisrex.scene +++ b/data/scene/osirisrex.scene @@ -1,8 +1,5 @@ --- TextureResolution = "low" -TextureResolution = "med" --- TextureResolution = "high" +local KernelCase = 2 -- Right now we only have the image times for case 2 -local startTime = "2016 SEP 8 23:05:00.50" function preInitialization() --[[ @@ -12,160 +9,15 @@ function preInitialization() critical objects. ]]-- - -- Load Spice Kernels - openspace.spice.loadKernel("${OPENSPACE_DATA}/spice/de430_1850-2150.bsp") - - -- background - -- SCLK kernels needs to be loaded before CK kernels (and generally first) - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/sclk/ORX_SCLKSCET.00000.tsc") - - -- This cannot be loaded correctly for some reason! - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/dsk/RQ36mod.oct12_CCv0001.bds") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/fk/orx_v04.tf") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_lidar_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_ocams_v03.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_otes_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_rexis_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_struct_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_navcam_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_ola_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_ovirs_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/ik/orx_stowcam_v00.ti") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/lsk/naif0011.tls") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/pck/bennu_SPH250m.tpc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/pck/bennu_v10.tpc") - - -- Low res SPK - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/orx_160917_231024_pgaa3_day15m60_v1.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/orx_160914_231024_pgaa3_day12m60_v1.bsp") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/orx_160908_231024_pgaa3_day06m60_v1.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/spk_orx_160908_231024_pgaa2_day06m60_v3.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/orx_160908_231024_pgaa2_day06m60.bsp") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/OREX_20160908_M60_complete.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/OREX_20160904_M45_complete.bsp") - - -- SPK - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/de421.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/background/spk/sb-101955-76.bsp") - - -- Nominal_Profile_LowRes - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Approach_600s_20180816T230000_20181119T010000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Approach_NominalProfile_600s_20180816T230000_20181119T010000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/DetailedSurvey_600s_20190108T000000_20190317T000000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/DetailedSurvey_NominalProfile_600s_20190108T000000_20190317T000000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalA_600s_20181203T230000_20190109T000000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalA_NominalProfile_600s_20181203T230000_20190109T000000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalB_600s_20190316T000000_20190521T000000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/OrbitalB_NominalProfile600s_20190316T000000_20190521T000000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/PrelimSurvey_600s_20181119T230000_20181204T010000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/PrelimSurvey_NominalProfile_600s_20181119T230000_20181204T010000.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Recon_600s_20190519T000000_20190830T000000.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Profile_LowRes/Recon_NominalProfile_600s_20190519T000000_20190830T000000.bc") - - -- Nominal_Observations_Science - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/DustSearch_v1/Phase03_AP_DustSearch_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/LightCurve_v1/Phase03_AP_LightCurve_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/LightCurve_v1/Phase03_AP_LightCurve_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/NatSatSearch_v1/Phase03_AP_SatSearch_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/NatSatSearch_v1/Phase03_AP_SatSearch_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/PhaseFunction_v1/Phase03_AP_PhaseFunction_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_5.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_6.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_7.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_8.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/ShapeModel_v1/Phase03_AP_ShapeModel_9_Forced4x4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/03_Approach/SpectraMap_v1/Phase03_AP_SpectraMap_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/MapCamOLA_v1/Phase04_PS_MC_1_v1_1a.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/MapCamOLA_v1/Phase04_PS_MC_2_v1_1a.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/OLA_v1/Phase04_PS_OLA_Nominal_4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_5.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/04_PrelimSurvey/PolyCam_v1/Phase04_PS_PolyCam_6.bc") - - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19013_18_BBD1_info.TXT") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19014_16_BBD2_info.TXT") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19020_18_BBD3_info.TXT") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19021_19_BBD4_info.TXT") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/README.txt") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19013_18_BBD1_v2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19014_16_BBD2_v2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19020_18_BBD3_v2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/BaseballDiamond_v2/atl_19021_19_BBD4_v2.bc") - - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_4.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_5.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_6.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/EquatorialStations_v1/Phase06_DS_Equatorial_Stations_7.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/PlumeSearch_v1/Phase06_DS_Plume_Search_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/06_DetailedSurvey/PlumeSearch_v1/Phase06_DS_Plume_Search_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_1.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_2.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v1/Phase07_OB_CSS_Mapping_3.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_1.a") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_2.a") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/07_OrbitalB/CandidateSampleSite_v2/CSS_Mapping_3.a") - - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case02_0Latitude.wmv") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case05_20negLatitude.wmv") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case08_40negLatitude.wmv") - --openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Case11_60negLatitude.wmv") - - local case = 2 -- Right now we only have the image times for case 2 - - if case == 2 then - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/ORX_Recon_525mSortie_Case02.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case02_0Latitude.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case02_atl_19145_04.atf") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case02.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case02_0Latitude.bc") - elseif case == 5 then - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/ORX_Recon_525mSortie_Case05.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_20negLatitude.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_atl_19145_04.atf") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case05_NominalProfile.bc") - - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case05.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case05_20negLatitude.bc") - elseif case == 8 then - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/525m_Sortie_v2/Recon_525mSortie_Case08_NominalProfile.bc") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case08.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case08_40negLatitude.bc") - elseif case == 11 then - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/ORX_Recon_225mSortie_Case11.bsp") - openspace.spice.loadKernel("${SPICE}/OsirisRexKernels/Nominal_Observations_Science/08_Recon/225m_Sortie_v2/Recon_225mSortie_Case11_60negLatitude.bc") - end - - -- Load planetary constants + openspace.spice.loadKernel("${SPICE}/naif0011.tls") openspace.spice.loadKernel("${SPICE}/pck00010.tpc") - dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) dofile(openspace.absPath('${SCRIPTS}/bind_keys_osirisrex.lua')) --local startTime = "2019 APR 16 12:03:00.00" + openspace.time.setTime("2016 SEP 8 23:00:00.500") - openspace.scriptScheduler.load("${OPENSPACE_DATA}/scene/osirisrex/scheduled_scripts.lua") - - -- Removing the line below will cause all scripts prior to to be executed during initialization - -- openspace.scriptScheduler.skipTo(startTime); + openspace.scriptScheduler.load("${OPENSPACE_DATA}/scene/missions/osirisrex/scheduled_scripts.lua") end @@ -192,10 +44,7 @@ function postInitialization() openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", true); openspace.printInfo("Done setting default values") - openspace.loadMission("${OPENSPACE_DATA}/scene/osirisrex/osirisrex/osirisrex.mission") - - openspace.time.setTime(startTime) - openspace.time.setDeltaTime(0) + openspace.loadMission("${OPENSPACE_DATA}/scene/missions/osirisrex/osirisrex/osirisrex.mission") openspace.resetCameraDirection() end @@ -210,11 +59,11 @@ return { }, Modules = { "sun", - "lodmercury", + "mercury", "venus", "lodearth", - "lodmoon", - "lodmars", + "moon", + "mars", "jupiter", "saturn", "uranus", @@ -223,8 +72,7 @@ return { -- "stars-denver", "milkyway", -- "milkyway-eso", - --"imageplane", - "osirisrex", + "missions/osirisrex", } } diff --git a/data/scene/osirisrex/osirisrex/osirisrex.mod b/data/scene/osirisrex/osirisrex/osirisrex.mod deleted file mode 100644 index 51272879be..0000000000 --- a/data/scene/osirisrex/osirisrex/osirisrex.mod +++ /dev/null @@ -1,267 +0,0 @@ -local BENNU_BODY = "2101955" - -return { - ------------------------ - -- Osiris Rex -- - ------------------------ - { - Name = "OsirisRex", - Parent = "SolarSystemBarycenter", - Renderable = { - Type = "RenderableModel", - Body = "OSIRIS-REX", - Geometry = { - Type = "MultiModelGeometry", - GeometryFile = "models/orx_base_resized_12_sep_2016.obj", - Magnification = 0, - }, - Textures = { - Type = "simple", - Color = "textures/osirisTex.png", - }, - Shading = { - PerformShading = true, - Fadeable = false, - Ghosting = false, - }, - }, - Transform = { - Translation = { - Type = "SpiceTranslation", - Body = "OSIRIS-REX", - Observer = "SUN", - }, - Rotation = { - Type = "SpiceRotation", - SourceFrame = "ORX_SPACECRAFT", - DestinationFrame = "GALACTIC", - }, - }, - }, - { - Name = "ORX_OCAMS_POLYCAM", - Parent = "OsirisRex", - Renderable = { - Type = "RenderableModel", - Body = "OSIRIS-REX", - Geometry = { - Type = "MultiModelGeometry", - GeometryFile = "models/orx_polycam_resized_12_sep_2016.obj", - Magnification = 0, - }, - Textures = { - Type = "simple", - Color = "textures/osirisTex.png", - }, - Shading = { - PerformShading = true, - Fadeable = false, - Ghosting = false, - }, - }, - Transform = { - Translation = { - Type = "StaticTranslation", - Position = {-0.2476, 0.2710, 0.3364}, - }, - Rotation = { - Type = "SpiceRotation", - SourceFrame = "ORX_OCAMS_POLYCAM", - DestinationFrame = "ORX_SPACECRAFT", - }, - }, - }, - { - Name = "ORX_REXIS", - Parent = "OsirisRex", - Renderable = { - Type = "RenderableModel", - Body = "OSIRIS-REX", - Geometry = { - Type = "MultiModelGeometry", - GeometryFile = "models/orx_rexis_resized_12_sep_2016.obj", - Magnification = 0, - }, - Textures = { - Type = "simple", - Color = "textures/osirisTex.png", - }, - Shading = { - PerformShading = true, - Fadeable = false, - Ghosting = false, - }, - }, - Transform = { - Translation = { - Type = "StaticTranslation", - Position = {0, 0.3371, 0.2712}, - }, - Rotation = { - Type = "SpiceRotation", - SourceFrame = "ORX_REXIS", - DestinationFrame = "ORX_SPACECRAFT", - }, - }, - }, - { - Name = "POLYCAM FOV", - Parent = "ORX_OCAMS_POLYCAM", - Renderable = { - Type = "RenderableFov", - Body = "OSIRIS-REX", - Frame = "ORX_OCAMS_POLYCAM", - RGB = { 0.8, 0.7, 0.7 }, - Instrument = { - Name = "ORX_OCAMS_POLYCAM", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - BENNU_BODY -- Bennu - } - }, - }, - { - Name = "REXIS FOV", - Parent = "ORX_REXIS", - Renderable = { - Type = "RenderableFov", - Body = "OSIRIS-REX", - Frame = "ORX_REXIS", - RGB = { 0.8, 0.7, 0.7 }, - Instrument = { - Name = "ORX_REXIS", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - BENNU_BODY -- Bennu - } - }, - }, - --[[ - -- Latest image taken by POLYCAM - { - Name = "ImagePlaneOsirisRex", - Parent = "Bennu2", - Renderable = { - Type = "RenderablePlaneProjection", - Frame = "IAU_BENNU", - DefaultTarget = BENNU_BODY, - Spacecraft = "OSIRIS-REX", - Instrument = "ORX_OCAMS_POLYCAM", - Moving = false, - Texture = "textures/defaultProj.png", - }, - Ephemeris = { - Type = "Static", - Position = {0, 0, 0, 1} - }, - }, - -- POLYCAM FoV square - { - Name = "FovImagePlane", - Parent = "Bennu2", - Renderable = { - Type = "RenderablePlaneProjection", - Frame = "IAU_BENNU", - DefaultTarget = BENNU_BODY, - Spacecraft = "OSIRIS-REX", - Instrument = "ORX_OCAMS_POLYCAM", - Moving = true, - Texture = "textures/defaultProj.png", - }, - Ephemeris = { - Type = "Static", - Position = {0, 0, 0, 1} - }, - }, - ]] - - -- Trail relative to Earth - { - Name = "OsirisRexTrailEarth", - Parent = "Earth", - Renderable = { - Type = "RenderableTrailNew", - -- Spice - Body = "OSIRIS-REX", - Frame = "IAU_EARTH", - Observer = "EARTH", - -- Optional rendering properties - LineColor = { 0.9, 0.9, 0.0 }, - PointColor = { 0.9, 0.9, 0.0 }, - LineFade = 0.0, -- [0,1] - RenderPart = 1, - LineWidth = 2, - ShowTimeStamps = false, - RenderFullTrail = false, - -- Time interval - TimeRange = { - Start = "2016 SEP 8 23:05:00.50", - End = "2016 SEP 9 00:05:00", - }, - SampleDeltaTime = 60, -- Seconds between each point - SubSamples = 59, - }, - }, - - -- Trail relative to solar system barycenter - { - Name = "OsirisRexTrailSolarSystem", - Parent = "SolarSystemBarycenter", - Renderable = { - Type = "RenderableTrailNew", - -- Spice - Body = "OSIRIS-REX", - Frame = "GALACTIC", - Observer = "SUN", - -- Optional rendering properties - LineColor = { 0.2, 0.9, 0.2 }, - PointColor = { 0.2, 0.9, 0.2 }, - LineFade = 0.0, -- [0,1] - RenderPart = 0.13, - LineWidth = 2, - ShowTimeStamps = false, - RenderFullTrail = false, - -- Time interval - TimeRange = { - Start = "2016 SEP 8 23:05:00.50", - End = "2023 SEP 24 12:00:00", - }, - SampleDeltaTime = 3600, -- Seconds between each point - SubSamples = 0, - }, - }, - - -- Trail relative to Bennu - { - Name = "OsirisRexTrailBennu", - Parent = "BennuBarycenter", - Renderable = { - Type = "RenderableTrailNew", - -- Spice - Body = "OSIRIS-REX", - Frame = "GALACTIC", - Observer = BENNU_BODY, - -- Optional rendering properties - LineColor = { 0.9, 0.2, 0.9 }, - PointColor = { 0.9, 0.2, 0.9 }, - LineFade = 0.5, -- [0,1] - RenderPart = 0.06, - LineWidth = 2, - ShowTimeStamps = false, - RenderFullTrail = false, - -- Time interval - TimeRange = { - Start = "2016 SEP 8 23:05:00.50", - End = "2023 SEP 24 12:00:00", - }, - SampleDeltaTime = 3600, -- Seconds between each point - SubSamples = 3, - }, - }, - - -} diff --git a/data/scene/rosetta.scene b/data/scene/rosetta.scene index befa637e83..1142961cc4 100644 --- a/data/scene/rosetta.scene +++ b/data/scene/rosetta.scene @@ -18,10 +18,6 @@ function preInitialization() -- Shadow flyby -- openspace.time.setTime("2015-02-14T12:00:00.000") - - -- openspace.time.setTime("2015-07-29T06:02:10.000") - -- openspace.time.setTime("2014 AUG 21 18:00:00") - -- openspace.time.setTime("2015 SEP 10 19:39:00") dofile(openspace.absPath('${SCRIPTS}/bind_keys_rosetta.lua')) end @@ -59,12 +55,12 @@ return { "earth", "mars", "jupiter/jupiter", - "saturn", + "saturn/saturn", "uranus", "neptune", "stars", "milkyway", - "rosetta", + "missions/rosetta", } } diff --git a/data/scene/saturn/dione/dione.data b/data/scene/saturn/dione/dione.data new file mode 100644 index 0000000000..924a314275 --- /dev/null +++ b/data/scene/saturn/dione/dione.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "dione_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/saturn/dione/dione.mod b/data/scene/saturn/dione/dione.mod new file mode 100644 index 0000000000..6691cc3d8c --- /dev/null +++ b/data/scene/saturn/dione/dione.mod @@ -0,0 +1,46 @@ +return { + { + Name = "Dione", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderablePlanet", + Frame = "IAU_DIONE", + Body = "DIONE", + Geometry = { + Type = "SimpleSphere", + Radius = { 0.563, 3 }, + Segments = 50 + }, + Textures = { + Color = "textures/dione.jpg" + } + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "DIONE", + Observer = "SATURN BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp" + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_ENCELADUS", + DestinationFrame = "GALACTIC" + } + } + }, + { + Name = "DioneTrail", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "DIONE", + Frame = "GALACTIC", + Observer = "SATURN BARYCENTER", + RGB = { 0.5, 0.3, 0.3 }, + TropicalOrbitPeriod = 60, + EarthOrbitRatio = 0.0075, + DayLength = 0.9424218 + } + } +} \ No newline at end of file diff --git a/data/scene/saturn/enceladus/enceladus.data b/data/scene/saturn/enceladus/enceladus.data new file mode 100644 index 0000000000..a31589f158 --- /dev/null +++ b/data/scene/saturn/enceladus/enceladus.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "enceladus_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/saturn/enceladus/enceladus.mod b/data/scene/saturn/enceladus/enceladus.mod new file mode 100644 index 0000000000..b0bb0138a3 --- /dev/null +++ b/data/scene/saturn/enceladus/enceladus.mod @@ -0,0 +1,46 @@ +return { + { + Name = "Enceladus", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderablePlanet", + Frame = "IAU_ENCELADUS", + Body = "ENCELADUS", + Geometry = { + Type = "SimpleSphere", + Radius = { 0.257, 3 }, + Segments = 50 + }, + Textures = { + Color = "textures/enceladus.jpg" + } + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "ENCELADUS", + Observer = "SATURN BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp" + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_ENCELADUS", + DestinationFrame = "GALACTIC" + } + } + }, + { + Name = "EnceladusTrail", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "ENCELADUS", + Frame = "GALACTIC", + Observer = "SATURN BARYCENTER", + RGB = { 0.5, 0.3, 0.3 }, + TropicalOrbitPeriod = 60, + EarthOrbitRatio = 0.005, + DayLength = 0.9424218 + } + } +} \ No newline at end of file diff --git a/data/scene/saturn/iapetus/iapetus.data b/data/scene/saturn/iapetus/iapetus.data new file mode 100644 index 0000000000..0db25d34c1 --- /dev/null +++ b/data/scene/saturn/iapetus/iapetus.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "iapetus_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/saturn/iapetus/iapetus.mod b/data/scene/saturn/iapetus/iapetus.mod new file mode 100644 index 0000000000..e088dfc212 --- /dev/null +++ b/data/scene/saturn/iapetus/iapetus.mod @@ -0,0 +1,46 @@ +return { + { + Name = "Iapetus", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderablePlanet", + Frame = "IAU_IAPETUS", + Body = "IAPETUS", + Geometry = { + Type = "SimpleSphere", + Radius = { 0.746, 3 }, + Segments = 50 + }, + Textures = { + Color = "textures/iapetus.jpg" + } + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "IAPETUS", + Observer = "SATURN BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp" + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_ENCELADUS", + DestinationFrame = "GALACTIC" + } + } + }, + { + Name = "IapetusTrail", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "IAPETUS", + Frame = "GALACTIC", + Observer = "SATURN BARYCENTER", + RGB = { 0.5, 0.3, 0.3 }, + TropicalOrbitPeriod = 60, + EarthOrbitRatio = 0.1, + DayLength = 0.9424218 + } + } +} \ No newline at end of file diff --git a/data/scene/saturn/mimas/mimas.data b/data/scene/saturn/mimas/mimas.data new file mode 100644 index 0000000000..01d792a8d4 --- /dev/null +++ b/data/scene/saturn/mimas/mimas.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "mimas_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/saturn/mimas/mimas.mod b/data/scene/saturn/mimas/mimas.mod new file mode 100644 index 0000000000..9f50cf0fd7 --- /dev/null +++ b/data/scene/saturn/mimas/mimas.mod @@ -0,0 +1,46 @@ +return { + { + Name = "Mimas", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderablePlanet", + Frame = "IAU_MIMAS", + Body = "MIMAS", + Geometry = { + Type = "SimpleSphere", + Radius = { 0.28, 3 }, + Segments = 50 + }, + Textures = { + Color = "textures/mimas.jpg" + } + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "MIMAS", + Observer = "SATURN BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp" + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_MIMAS", + DestinationFrame = "GALACTIC" + } + } + }, + { + Name = "MimasTrail", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "MIMAS", + Frame = "GALACTIC", + Observer = "SATURN BARYCENTER", + RGB = { 0.5, 0.3, 0.3 }, + TropicalOrbitPeriod = 60, + EarthOrbitRatio = 0.0025, + DayLength = 0.9424218 + } + } +} \ No newline at end of file diff --git a/data/scene/saturn/rhea/rhea.data b/data/scene/saturn/rhea/rhea.data new file mode 100644 index 0000000000..9cf25ca314 --- /dev/null +++ b/data/scene/saturn/rhea/rhea.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "rhea_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/saturn/rhea/rhea.mod b/data/scene/saturn/rhea/rhea.mod new file mode 100644 index 0000000000..9decfcb31a --- /dev/null +++ b/data/scene/saturn/rhea/rhea.mod @@ -0,0 +1,46 @@ +return { + { + Name = "Rhea", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderablePlanet", + Frame = "IAU_RHEA", + Body = "RHEA", + Geometry = { + Type = "SimpleSphere", + Radius = { 0.765, 3 }, + Segments = 50 + }, + Textures = { + Color = "textures/rhea.jpg" + } + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "RHEA", + Observer = "SATURN BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp" + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_ENCELADUS", + DestinationFrame = "GALACTIC" + } + } + }, + { + Name = "RheaTrail", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "RHEA", + Frame = "GALACTIC", + Observer = "SATURN BARYCENTER", + RGB = { 0.5, 0.3, 0.3 }, + TropicalOrbitPeriod = 60, + EarthOrbitRatio = 0.01, + DayLength = 0.9424218 + } + } +} \ No newline at end of file diff --git a/data/scene/saturn/saturn/sat375.bsp.torrent b/data/scene/saturn/saturn/sat375.bsp.torrent new file mode 100644 index 0000000000..1939e82e2d Binary files /dev/null and b/data/scene/saturn/saturn/sat375.bsp.torrent differ diff --git a/data/scene/saturn/saturn.data b/data/scene/saturn/saturn/saturn.data similarity index 55% rename from data/scene/saturn/saturn.data rename to data/scene/saturn/saturn/saturn.data index 49ba7a71da..cf0748dfc1 100644 --- a/data/scene/saturn/saturn.data +++ b/data/scene/saturn/saturn/saturn.data @@ -2,4 +2,7 @@ return { FileRequest = { { Identifier = "saturn_textures", Destination = "textures", Version = 2 } }, + TorrentFiles = { + { File = "sat375.bsp.torrent", Destination = "${SPICE}" }, + } } \ No newline at end of file diff --git a/data/scene/saturn/saturn.mod b/data/scene/saturn/saturn/saturn.mod similarity index 81% rename from data/scene/saturn/saturn.mod rename to data/scene/saturn/saturn/saturn.mod index ac59c3d9c9..07884ab016 100644 --- a/data/scene/saturn/saturn.mod +++ b/data/scene/saturn/saturn/saturn.mod @@ -3,6 +3,14 @@ return { { Name = "SaturnBarycenter", Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "SATURN BARYCENTER", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + } + }, }, -- Saturn module @@ -29,16 +37,10 @@ return { } }, Transform = { - Translation = { - Type = "SpiceTranslation", - Body = "SATURN BARYCENTER", - Observer = "SUN", - Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - }, Rotation = { Type = "SpiceRotation", SourceFrame = "IAU_SATURN", - DestinationFrame = "ECLIPJ2000", + DestinationFrame = "GALACTIC", }, Scale = { Type = "StaticScale", @@ -46,10 +48,22 @@ return { }, }, }, + { + Name = "SaturnRings", + Parent = "Saturn", + Renderable = { + Type = "RenderableRings", + Texture = "textures/saturn_rings.png", + Size = 140220000, + Offset = { 74500 / 140445.100671159, 1.0 } -- min / max extend + + }, + + }, -- SaturnTrail module { Name = "SaturnTrail", - Parent = "SaturnBarycenter", + Parent = "SolarSystemBarycenter", Renderable = { Type = "RenderableTrail", Body = "SATURN BARYCENTER", diff --git a/data/scene/saturn/tethys/tethys.data b/data/scene/saturn/tethys/tethys.data new file mode 100644 index 0000000000..fd493213a4 --- /dev/null +++ b/data/scene/saturn/tethys/tethys.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "tethys_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/saturn/tethys/tethys.mod b/data/scene/saturn/tethys/tethys.mod new file mode 100644 index 0000000000..aff56a91ea --- /dev/null +++ b/data/scene/saturn/tethys/tethys.mod @@ -0,0 +1,46 @@ +return { + { + Name = "Tethys", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderablePlanet", + Frame = "IAU_TETHYS", + Body = "TETHYS", + Geometry = { + Type = "SimpleSphere", + Radius = { 0.538, 3 }, + Segments = 50 + }, + Textures = { + Color = "textures/tethys.jpg" + } + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "TETHYS", + Observer = "SATURN BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp" + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_ENCELADUS", + DestinationFrame = "GALACTIC" + } + } + }, + { + Name = "TethysTrail", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "TETHYS", + Frame = "GALACTIC", + Observer = "SATURN BARYCENTER", + RGB = { 0.5, 0.3, 0.3 }, + TropicalOrbitPeriod = 60, + EarthOrbitRatio = 0.005, + DayLength = 0.9424218 + } + } +} \ No newline at end of file diff --git a/data/scene/saturn/titan/titan.data b/data/scene/saturn/titan/titan.data new file mode 100644 index 0000000000..82c5a342b4 --- /dev/null +++ b/data/scene/saturn/titan/titan.data @@ -0,0 +1,5 @@ +return { + FileRequest = { + { Identifier = "titan_textures", Destination = "textures", Version = 1 } + }, +} \ No newline at end of file diff --git a/data/scene/saturn/titan/titan.mod b/data/scene/saturn/titan/titan.mod new file mode 100644 index 0000000000..b0bc0814d9 --- /dev/null +++ b/data/scene/saturn/titan/titan.mod @@ -0,0 +1,46 @@ +return { + { + Name = "Titan", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderablePlanet", + Frame = "IAU_TITAN", + Body = "TITAN", + Geometry = { + Type = "SimpleSphere", + Radius = { 0.2575, 4 }, + Segments = 50 + }, + Textures = { + Color = "textures/titan.jpg" + } + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "TITAN", + Observer = "SATURN BARYCENTER", + Kernels = "${OPENSPACE_DATA}/spice/sat375.bsp" + }, + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_ENCELADUS", + DestinationFrame = "GALACTIC" + } + } + }, + { + Name = "TitanTrail", + Parent = "SaturnBarycenter", + Renderable = { + Type = "RenderableTrail", + Body = "TITAN", + Frame = "GALACTIC", + Observer = "SATURN BARYCENTER", + RGB = { 0.5, 0.3, 0.3 }, + TropicalOrbitPeriod = 60, + EarthOrbitRatio = 0.05, + DayLength = 0.9424218 + } + } +} \ No newline at end of file diff --git a/data/scene/venus/venus.mod b/data/scene/venus/venus.mod index 6b96b1ca1b..6ea5a5afac 100644 --- a/data/scene/venus/venus.mod +++ b/data/scene/venus/venus.mod @@ -3,8 +3,15 @@ return { { Name = "VenusBarycenter", Parent = "SolarSystemBarycenter", + Transform = { + Translation = { + Type = "SpiceTranslation", + Body = "VENUS BARYCENTER", + Observer = "SUN", + Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" + }, + } }, - -- Venus module { Name = "Venus", @@ -28,25 +35,19 @@ return { MieColor = {1.0, 1.0, 1.0} } }, - Ephemeris = { - Type = "Spice", - Body = "VENUS", - Observer = "SUN", - Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp" - }, Rotation = { - Type = "Spice", + Type = "SpiceRotation", Frame = "IAU_VENUS", - Reference = "ECLIPJ2000" + Reference = "GALACTIC" }, }, -- VenusTrail module { Name = "VenusTrail", - Parent = "VenusBarycenter", + Parent = "SolarSystemBarycenter", Renderable = { Type = "RenderableTrail", - Body = "VENUS", + Body = "VENUS BARYCENTER", Frame = "GALACTIC", Observer = "SUN", RGB = {1, 0.5, 0.2}, diff --git a/data/web/common/style.css b/data/web/common/style.css index cf497440ad..ac82e9fe77 100644 --- a/data/web/common/style.css +++ b/data/web/common/style.css @@ -30,6 +30,18 @@ background-color: #fff; } +.documentation-item.remote-scripting { + border-left: 2px solid #4c1315; + background-color: #fcdcdc; + color: #4c1315; +} + +.documentation-item.local-scripting { + border-left: 2px solid #2d4256; + background-color: #dcf1f9; + color: #2d4256; +} + .documentation-type { color: #888; font-size: 0.8em; diff --git a/data/web/documentation/documentation.hbs b/data/web/documentation/documentation.hbs index 93957bdecf..2b7bbbd84d 100644 --- a/data/web/documentation/documentation.hbs +++ b/data/web/documentation/documentation.hbs @@ -11,7 +11,8 @@ {{/if}}

-

{{description}}

+

{{description}}

+

{{documentation}}

{{#with restrictions}} {{>documentation}} {{/with}} diff --git a/data/web/documentation/script.js b/data/web/documentation/script.js index c2b320ce70..f9af37e558 100644 --- a/data/web/documentation/script.js +++ b/data/web/documentation/script.js @@ -18,6 +18,10 @@ window.onload = function () { return identifier; }); + documentation.sort(function (a, b) { + return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0); + }); + var data = { documentation: documentation, version: version diff --git a/data/web/factories/script.js b/data/web/factories/script.js index 6334c7b2a4..4776d5656e 100644 --- a/data/web/factories/script.js +++ b/data/web/factories/script.js @@ -18,6 +18,10 @@ window.onload = function () { return identifier; }); + factories.sort(function (a, b) { + return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0); + }); + var data = { factories: factories, version: version diff --git a/data/web/keybindings/keybinding.hbs b/data/web/keybindings/keybinding.hbs index 1b4d5414c2..29773e357e 100644 --- a/data/web/keybindings/keybinding.hbs +++ b/data/web/keybindings/keybinding.hbs @@ -1,9 +1,9 @@ -
+

- {{key}} + {{key}} {{#if remoteScripting}}Remote scripting{{else}}Local scripting{{/if}}

{{script}}

diff --git a/data/web/keybindings/script.js b/data/web/keybindings/script.js index 149cba1892..6b4bdd444e 100644 --- a/data/web/keybindings/script.js +++ b/data/web/keybindings/script.js @@ -18,6 +18,10 @@ window.onload = function () { return identifier; }); + keybindings.sort(function (a, b) { + return a.key < b.key ? -1 : (a.key > b.key ? 1 : 0); + }); + var data = { keybindings: keybindings, version: version, diff --git a/data/web/luascripting/script.js b/data/web/luascripting/script.js index b43af6f884..6d43a33b07 100644 --- a/data/web/luascripting/script.js +++ b/data/web/luascripting/script.js @@ -18,6 +18,10 @@ window.onload = function () { return identifier; }); + scripting.sort(function (a, b) { + return a.library < b.library ? -1 : (a.library > b.library ? 1 : 0); + }); + var data = { scripting: scripting, version: version diff --git a/data/web/properties/script.js b/data/web/properties/script.js index 70f303f15f..f7302a5e0b 100644 --- a/data/web/properties/script.js +++ b/data/web/properties/script.js @@ -46,6 +46,10 @@ window.onload = function () { return identifier; }); + propertyOwners.sort(function (a, b) { + return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0); + }); + var data = { propertyOwners: propertyOwners, version: version, diff --git a/ext/ghoul b/ext/ghoul index f9e1207470..e37387fbd5 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit f9e12074702627b1feef9a09670270fed511ff5a +Subproject commit e37387fbd595babfaeb0ce31eb389cb2a70bd5cb diff --git a/ext/sgct b/ext/sgct index fb95dc335b..c7f321dd50 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit fb95dc335ba7d396723fbfeca64aa3b7451376c8 +Subproject commit c7f321dd504c184e6ac65d26b33aec2f7699c476 diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h index 1adcc9b140..bc8dd451b7 100644 --- a/include/openspace/documentation/verifier.h +++ b/include/openspace/documentation/verifier.h @@ -199,6 +199,19 @@ struct TableVerifier : public TemplateVerifier { Exhaustive exhaustive; }; +/** + * A Verifier that checks whether all values contained in a Table are of type \c string. + */ +struct StringListVerifier : public TableVerifier { + /** + * Constructor for a StringListVerifier. + * \param elementDocumentation The documentation for each string in the list + */ + StringListVerifier(std::string elementDocumentation = ""); + + std::string type() const override; +}; + //---------------------------------------------------------------------------------------- // Vector verifiers //---------------------------------------------------------------------------------------- @@ -235,6 +248,100 @@ struct Vector4Verifier : public TemplateVerifier>, public VectorVe std::string type() const override; }; +//---------------------------------------------------------------------------------------- +// Matrix verifiers +//---------------------------------------------------------------------------------------- + +/** +* This struct is the base class for all Verifier%s that check for \c glm matrix types. +* The template parameter for the subclasses is the containing type, not the full matrix +* type. For example to check for glm::dmat4x3, one would create a +* Matrix4x3Verifier. +*/ +struct MatrixVerifier {}; + +/** +* This Verifier checks whether the value is of type glm::mat2x2 +*/ +template +struct Matrix2x2Verifier : + public TemplateVerifier>, public MatrixVerifier +{ + std::string type() const override; +}; + +/** +* This Verifier checks whether the value is of type glm::mat2x3 +*/ +template +struct Matrix2x3Verifier : + public TemplateVerifier>, public MatrixVerifier { + std::string type() const override; +}; + +/** +* This Verifier checks whether the value is of type glm::mat2x4 +*/ +template +struct Matrix2x4Verifier : + public TemplateVerifier>, public MatrixVerifier { + std::string type() const override; +}; + +/** +* This Verifier checks whether the value is of type glm::mat3x2 +*/ +template +struct Matrix3x2Verifier : + public TemplateVerifier>, public MatrixVerifier { + std::string type() const override; +}; + +/** +* This Verifier checks whether the value is of type glm::mat3x3 +*/ +template +struct Matrix3x3Verifier : + public TemplateVerifier>, public MatrixVerifier { + std::string type() const override; +}; + +/** +* This Verifier checks whether the value is of type glm::mat3x4 +*/ +template +struct Matrix3x4Verifier : + public TemplateVerifier>, public MatrixVerifier { + std::string type() const override; +}; + +/** +* This Verifier checks whether the value is of type glm::mat4x2 +*/ +template +struct Matrix4x2Verifier : + public TemplateVerifier>, public MatrixVerifier { + std::string type() const override; +}; + +/** +* This Verifier checks whether the value is of type glm::mat4x3 +*/ +template +struct Matrix4x3Verifier : + public TemplateVerifier>, public MatrixVerifier { + std::string type() const override; +}; + +/** +* This Verifier checks whether the value is of type glm::mat4x4 +*/ +template +struct Matrix4x4Verifier : + public TemplateVerifier>, public MatrixVerifier { + std::string type() const override; +}; + //---------------------------------------------------------------------------------------- // Operator verifiers //---------------------------------------------------------------------------------------- @@ -840,6 +947,28 @@ using IntVector4Verifier = Vector4Verifier; /// A short-hand definition for a Verifier checking for glm::dvec4 using DoubleVector4Verifier = Vector4Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat2x2 +using DoubleMatrix2x2Verifier = Matrix2x2Verifier; +using DoubleMatrix2Verifier = DoubleMatrix2x2Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat2x3 +using DoubleMatrix2x3Verifier = Matrix2x3Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat2x4 +using DoubleMatrix2x4Verifier = Matrix2x4Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat3x2 +using DoubleMatrix3x2Verifier = Matrix3x2Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat3x3 +using DoubleMatrix3x3Verifier = Matrix3x3Verifier; +using DoubleMatrix3Verifier = DoubleMatrix3x3Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat3x4 +using DoubleMatrix3x4Verifier = Matrix3x4Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat4x2 +using DoubleMatrix4x2Verifier = Matrix4x2Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat4x3 +using DoubleMatrix4x3Verifier = Matrix4x3Verifier; +/// A short-hand definition for a Verifier checking for glm::dmat4x4 +using DoubleMatrix4x4Verifier = Matrix4x4Verifier; +using DoubleMatrix4Verifier = DoubleMatrix4x4Verifier; + /// A short-hand definition for a LessVerifier with a type check for \c int using IntLessVerifier = LessVerifier; /// A short-hand definition for a LessVerifier with a type check for \c double @@ -936,6 +1065,16 @@ extern template struct Vector4Verifier; extern template struct Vector4Verifier; extern template struct Vector4Verifier; +extern template struct Matrix2x2Verifier; +extern template struct Matrix2x3Verifier; +extern template struct Matrix2x4Verifier; +extern template struct Matrix3x2Verifier; +extern template struct Matrix3x3Verifier; +extern template struct Matrix3x4Verifier; +extern template struct Matrix4x2Verifier; +extern template struct Matrix4x3Verifier; +extern template struct Matrix4x4Verifier; + extern template struct LessVerifier; extern template struct LessVerifier; extern template struct LessEqualVerifier; diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index deaa984b3d..8df5f6e3f6 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -74,6 +74,69 @@ std::string Vector4Verifier::type() const { return "Vector4<"s + typeid(T).name() + ">"; } +template +std::string Matrix2x2Verifier::type() const { + using namespace std::string_literals; + + return "Matrix2x2<"s + typeid(T).name() + ">"; +} + +template +std::string Matrix2x3Verifier::type() const { + using namespace std::string_literals; + + return "Matrix2x3<"s + typeid(T).name() + ">"; +} + +template +std::string Matrix2x4Verifier::type() const { + using namespace std::string_literals; + + return "Matrix2x4<"s + typeid(T).name() + ">"; +} + +template +std::string Matrix3x2Verifier::type() const { + using namespace std::string_literals; + + return "Matrix3x2<"s + typeid(T).name() + ">"; +} + +template +std::string Matrix3x3Verifier::type() const { + using namespace std::string_literals; + + return "Matrix3x3<"s + typeid(T).name() + ">"; +} + +template +std::string Matrix3x4Verifier::type() const { + using namespace std::string_literals; + + return "Matrix3x4<"s + typeid(T).name() + ">"; +} + +template +std::string Matrix4x2Verifier::type() const { + using namespace std::string_literals; + + return "Matrix4x2<"s + typeid(T).name() + ">"; +} + +template +std::string Matrix4x3Verifier::type() const { + using namespace std::string_literals; + + return "Matrix4x3<"s + typeid(T).name() + ">"; +} + +template +std::string Matrix4x4Verifier::type() const { + using namespace std::string_literals; + + return "Matrix4x4<"s + typeid(T).name() + ">"; +} + template OperatorVerifier::OperatorVerifier(typename T::Type value) : value(std::move(value)) diff --git a/include/openspace/engine/configurationmanager.h b/include/openspace/engine/configurationmanager.h index 3f57aa59d9..f63649a8b6 100644 --- a/include/openspace/engine/configurationmanager.h +++ b/include/openspace/engine/configurationmanager.h @@ -109,6 +109,8 @@ public: /// The key that stores the switch for enabling/disabling the rendering on a master /// computer static const std::string KeyRenderingMethod; + /// The key that determines whether a new cache folder is used for each scene file + static const std::string KeyPerSceneCache; /// The key that stores the http proxy settings for the downloadmanager static const std::string KeyHttpProxy; /// The key that stores the address of the http proxy diff --git a/include/openspace/engine/moduleengine.h b/include/openspace/engine/moduleengine.h index 6075ebe125..2e06a4f930 100644 --- a/include/openspace/engine/moduleengine.h +++ b/include/openspace/engine/moduleengine.h @@ -75,6 +75,14 @@ public: */ std::vector modules() const; + /** + * Returns the combined minimum OpenGL version. The return value is the maximum + * version of all registered modules' OpenGL versions. + * \return The combined minimum OpenGL version + */ + ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version + requiredOpenGLVersion() const; + /** * Returns the Lua library that contains all Lua functions available to affect the * modules. diff --git a/include/openspace/engine/wrapper/sgctwindowwrapper.h b/include/openspace/engine/wrapper/sgctwindowwrapper.h index a9c4778005..678e2fe25e 100644 --- a/include/openspace/engine/wrapper/sgctwindowwrapper.h +++ b/include/openspace/engine/wrapper/sgctwindowwrapper.h @@ -49,6 +49,7 @@ public: glm::ivec2 currentWindowSize() const override; glm::ivec2 currentWindowResolution() const override; glm::ivec2 currentDrawBufferResolution() const override; + glm::vec2 dpiScaling() const override; int currentNumberOfAaSamples() const override; bool isRegularRendering() const override; diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h index af26f105b4..75924841bc 100644 --- a/include/openspace/engine/wrapper/windowwrapper.h +++ b/include/openspace/engine/wrapper/windowwrapper.h @@ -138,6 +138,13 @@ public: * \return The resolution of the currently active window in pixel coordinates */ virtual glm::ivec2 currentDrawBufferResolution() const; + + /** + * Returns the DPI scaling factor for the current window. This is normally 1 on all + * regular monitors and 2 on Retina screens. + * \return The DPI scaling factor for the current window + */ + virtual glm::vec2 dpiScaling() const; /** * Returns the number of anti-aliasing samples used in the current window. diff --git a/include/openspace/interaction/interactionhandler.h b/include/openspace/interaction/interactionhandler.h index 3efacae9fe..1018f37068 100644 --- a/include/openspace/interaction/interactionhandler.h +++ b/include/openspace/interaction/interactionhandler.h @@ -34,6 +34,7 @@ #include #include +#include #include @@ -70,8 +71,18 @@ public: void addKeyframe(const datamessagestructures::CameraKeyframe &kf); void clearKeyframes(); - void bindKeyLocal(Key key, KeyModifier modifier, std::string lua); - void bindKey(Key key, KeyModifier modifier, std::string lua); + void bindKeyLocal( + Key key, + KeyModifier modifier, + std::string luaCommand, + std::string documentation = "" + ); + void bindKey( + Key key, + KeyModifier modifier, + std::string luaCommand, + std::string documentation = "" + ); void lockControls(); void unlockControls(); @@ -105,11 +116,19 @@ public: void writeKeyboardDocumentation(const std::string& type, const std::string& file); private: + using Synchronized = ghoul::Boolean; + + struct KeyInformation { + std::string command; + Synchronized synchronization; + std::string documentation; + }; + void setInteractionMode(std::shared_ptr interactionMode); bool _cameraUpdatedFromScript = false; - std::multimap> _keyLua; + std::multimap _keyLua; std::unique_ptr _inputState; Camera* _camera; diff --git a/include/openspace/interaction/interactionmode.h b/include/openspace/interaction/interactionmode.h index 06fcf97796..4a5f418db9 100644 --- a/include/openspace/interaction/interactionmode.h +++ b/include/openspace/interaction/interactionmode.h @@ -31,10 +31,6 @@ #include #include -#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED -#include -#include -#endif #include @@ -42,7 +38,10 @@ namespace openspace { class Camera; class SceneGraphNode; -class RenderableGlobe; + +namespace globebrowsing { + class RenderableGlobe; +} namespace interaction { diff --git a/include/openspace/network/parallelconnection.h b/include/openspace/network/parallelconnection.h index e372d75001..6b77861e4d 100644 --- a/include/openspace/network/parallelconnection.h +++ b/include/openspace/network/parallelconnection.h @@ -44,14 +44,7 @@ #include #include -#ifdef WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -#include -#endif + #if defined(WIN32) || defined(__MING32__) || defined(__MING64__) typedef size_t _SOCKET; @@ -60,6 +53,8 @@ typedef int _SOCKET; #include #endif +struct addrinfo; + namespace openspace { class ParallelConnection { diff --git a/include/openspace/performance/performancelayout.h b/include/openspace/performance/performancelayout.h index 70568e67e5..aa57208b6f 100644 --- a/include/openspace/performance/performancelayout.h +++ b/include/openspace/performance/performancelayout.h @@ -42,7 +42,9 @@ struct PerformanceLayout { char name[LengthName]; float renderTime[NumberValues]; float updateRenderable[NumberValues]; - float updateEphemeris[NumberValues]; + float updateTranslation[NumberValues]; + float updateRotation[NumberValues]; + float updateScaling[NumberValues]; }; SceneGraphPerformanceLayout sceneGraphEntries[MaxValues]; int16_t nScaleGraphEntries; diff --git a/include/openspace/properties/optionproperty.h b/include/openspace/properties/optionproperty.h index 39466779cf..7f153af8da 100644 --- a/include/openspace/properties/optionproperty.h +++ b/include/openspace/properties/optionproperty.h @@ -51,8 +51,8 @@ public: }; enum class DisplayType { - RADIO, - DROPDOWN + Radio, + Dropdown }; /** diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index c8c5b2b5fb..2120554775 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -27,15 +27,12 @@ #include -#include -#include -#include +#include +#include +#include #include - -#include - namespace ghoul { namespace fontrendering { class Font; @@ -49,6 +46,10 @@ class SharedMemory; namespace openspace { +namespace performance { +class PerformanceManager; +} + // Forward declare to minimize dependencies class Camera; class SyncBuffer; @@ -59,7 +60,7 @@ class RaycasterManager; class ScreenLog; class ScreenSpaceRenderable; -class RenderEngine { +class RenderEngine : public properties::PropertyOwner { public: enum class RendererImplementation { Framebuffer = 0, @@ -112,10 +113,8 @@ public: void takeScreenshot(bool applyWarping = false); void toggleInfoText(bool b); - void toggleFrametimeType(int t); // Performance measurements - void setPerformanceMeasurements(bool performanceMeasurements); bool doesPerformanceMeasurements() const; performance::PerformanceManager* performanceManager(); @@ -193,15 +192,6 @@ public: glm::ivec2 renderingResolution() const; glm::ivec2 fontResolution() const; - // This is temporary until a proper screenspace solution is found ---abock - struct OnScreenInformation{ - glm::vec2 _position; - unsigned int _size; - int _node; - }; - - SyncData _onScreenInformation; - std::vector getSyncables(); private: @@ -214,6 +204,7 @@ private: Scene* _sceneGraph; RaycasterManager* _raycasterManager; + properties::BoolProperty _performanceMeasurements; std::unique_ptr _performanceManager; std::unique_ptr _renderer; @@ -222,7 +213,9 @@ private: ghoul::Dictionary _resolveData; ScreenLog* _log; - FrametimeType _frametimeType; + properties::OptionProperty _frametimeType; + + //FrametimeType _frametimeType; bool _showInfo; bool _showLog; diff --git a/include/openspace/scene/rotation.h b/include/openspace/scene/rotation.h index 42e35bd3bd..0bcb1b0df2 100644 --- a/include/openspace/scene/rotation.h +++ b/include/openspace/scene/rotation.h @@ -25,27 +25,31 @@ #ifndef __ROTATION_H__ #define __ROTATION_H__ -#include -#include +#include #include +#include + +#include namespace openspace { -class Rotation { +class Rotation : public properties::PropertyOwner { public: static Rotation* createFromDictionary(const ghoul::Dictionary& dictionary); Rotation(const ghoul::Dictionary& dictionary); virtual ~Rotation(); virtual bool initialize(); - virtual const glm::dmat3& matrix() const = 0; + const glm::dmat3& matrix() const; virtual void update(const UpdateData& data); static openspace::Documentation Documentation(); protected: Rotation(); + + glm::dmat3 _matrix; }; } // namespace openspace diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index 365e8662be..94e16f395e 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -51,7 +51,9 @@ public: struct PerformanceRecord { long long renderTime; // time in ns long long updateTimeRenderable; // time in ns - long long updateTimeEphemeris; // time in ns + long long updateTimeTranslation; // time in ns + long long updateTimeRotation; // time in ns + long long updateTimeScaling; // time in ns }; static const std::string RootNodeName; @@ -101,13 +103,6 @@ public: const Renderable* renderable() const; Renderable* renderable(); - // @TODO Remove once the scalegraph is in effect ---abock - - void setEphemeris(Translation* eph) { - delete _translation; - _translation = eph; - } - static documentation::Documentation Documentation(); private: @@ -129,9 +124,11 @@ private: PowerScaledScalar _boundingSphere; // Transformation defined by ephemeris, rotation and scale - Translation* _translation; - Rotation* _rotation; - Scale* _scale; + struct { + std::unique_ptr translation; + std::unique_ptr rotation; + std::unique_ptr scale; + } _transform; // Cached transform data glm::dvec3 _worldPositionCached; diff --git a/include/openspace/util/openspacemodule.h b/include/openspace/util/openspacemodule.h index 2cda76686a..83d0b6e444 100644 --- a/include/openspace/util/openspacemodule.h +++ b/include/openspace/util/openspacemodule.h @@ -29,6 +29,8 @@ #include +#include + #include #include @@ -66,8 +68,20 @@ public: */ void deinitialize(); + /** + * Returns a list of Documentation classes that are valid for this OpenSpaceModule. + * \return A list of Documentation classes that are valid for this OpenSapceModule + */ virtual std::vector documentations() const; + /** + * Returns the minimum required OpenGL version of this OpenSpaceModule. Unless + * overwritten, it returns an OpenGL version of 3.3. + * \return The minimum required OpenGL version of this OpenSpaceModule + */ + virtual ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version + requiredOpenGLVersion() const; + protected: /** * Customization point for each derived class. The internalInitialize method is called diff --git a/include/openspace/util/updatestructures.h b/include/openspace/util/updatestructures.h index 22ed70bef7..72116a7899 100644 --- a/include/openspace/util/updatestructures.h +++ b/include/openspace/util/updatestructures.h @@ -45,8 +45,8 @@ struct TransformData { struct UpdateData { TransformData modelTransform; double time; - bool isTimeJump; double delta; + bool isTimeJump; bool doPerformanceMeasurement; }; diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index d5a0d62923..771253709e 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -136,9 +136,13 @@ void BaseModule::internalInitialize() { std::vector BaseModule::documentations() const { return { + SpiceRotation::Documentation(), StaticScale::Documentation(), StaticTranslation::Documentation(), - SpiceTranslation::Documentation() + SpiceTranslation::Documentation(), + RenderableRings::Documentation(), + modelgeometry::ModelGeometry::Documentation(), + planetgeometry::PlanetGeometry::Documentation() }; } diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index 655c883a2e..38288d425e 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -23,6 +23,8 @@ ****************************************************************************************/ #include + +#include #include #include #include @@ -35,59 +37,70 @@ namespace { const int8_t CurrentCacheVersion = 3; const std::string keyType = "Type"; const std::string keyName = "Name"; - const std::string keySize = "Magnification"; } namespace openspace { namespace modelgeometry { +Documentation ModelGeometry::Documentation() { + using namespace documentation; + return { + "Model Geometry", + "base_geometry_model", + { + { + keyType, + new StringVerifier, + "The type of the Model Geometry that should be generated", + Optional::No + }, + { + keyGeomModelFile, + new StringVerifier, + "The file that should be loaded in this ModelGeometry. The file can " + "contain filesystem tokens or can be specified relatively to the " + "location of the .mod file.", + Optional::No + } + } + }; +} + + ModelGeometry* ModelGeometry::createFromDictionary(const ghoul::Dictionary& dictionary) { - std::string geometryType; - const bool success = dictionary.getValue( - keyType, geometryType); - if (!success) { - LERROR("ModelGeometry did not contain a correct value of the key '" - << keyType << "'"); - return nullptr; + if (!dictionary.hasKeyAndValue(keyType)) { + throw ghoul::RuntimeError("Dictionary did not contain a key 'Type'"); } - ghoul::TemplateFactory* factory - = FactoryManager::ref().factory(); + + std::string geometryType = dictionary.value(keyType); + auto factory = FactoryManager::ref().factory(); ModelGeometry* result = factory->create(geometryType, dictionary); if (result == nullptr) { - LERROR("Failed to create a ModelGeometry object of type '" << geometryType - << "'"); - return nullptr; + throw ghoul::RuntimeError( + "Failed to create a ModelGeometry object of type '" + geometryType + "'" + ); } return result; } ModelGeometry::ModelGeometry(const ghoul::Dictionary& dictionary) : _parent(nullptr) - , _magnification("magnification", "Magnification", 1.f, 0.f, 10.f) , _mode(GL_TRIANGLES) { + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "ModelGeometry" + ); + setName("ModelGeometry"); std::string name; bool success = dictionary.getValue(keyName, name); ghoul_assert(success, "Name tag was not present"); - if (dictionary.hasKeyAndValue(keySize)) - _magnification = static_cast(dictionary.value(keySize)); - - success = dictionary.getValue(keyGeomModelFile, _file); - if (!success) { - LERROR("Geometric Model file of '" << name << "' did not provide a key '" - << keyGeomModelFile << "'"); - } - _file = FileSys.absolutePath(_file); - - if (!FileSys.fileExists(_file, ghoul::filesystem::FileSystem::RawPath::Yes)) - LERROR("Could not load the geometric model file '" << _file << "': File not found"); - - - addProperty(_magnification); + _file = absPath(dictionary.value(keyGeomModelFile)); } double ModelGeometry::boundingRadius() const { @@ -273,7 +286,6 @@ bool ModelGeometry::getIndices(std::vector* indexList) { } void ModelGeometry::setUniforms(ghoul::opengl::ProgramObject& program) { - program.setUniform("_magnification", _magnification); } } // namespace modelgeometry diff --git a/modules/base/rendering/modelgeometry.h b/modules/base/rendering/modelgeometry.h index b85062b897..edfbada197 100644 --- a/modules/base/rendering/modelgeometry.h +++ b/modules/base/rendering/modelgeometry.h @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -59,13 +60,14 @@ public: virtual void setUniforms(ghoul::opengl::ProgramObject& program); + static openspace::Documentation Documentation(); + protected: Renderable* _parent; bool loadObj(const std::string& filename); bool loadCachedFile(const std::string& filename); bool saveCachedFile(const std::string& filename); - properties::FloatProperty _magnification; GLuint _vaoID; GLuint _vbo; diff --git a/modules/base/rendering/planetgeometry.cpp b/modules/base/rendering/planetgeometry.cpp index 32e366b0fd..a876bbf041 100644 --- a/modules/base/rendering/planetgeometry.cpp +++ b/modules/base/rendering/planetgeometry.cpp @@ -25,6 +25,8 @@ #include #include +#include + namespace { const std::string _loggerCat = "PlanetGeometry"; const std::string KeyType = "Type"; @@ -33,22 +35,38 @@ namespace { namespace openspace { namespace planetgeometry { -PlanetGeometry* PlanetGeometry::createFromDictionary(const ghoul::Dictionary& dictionary) { - std::string geometryType; - const bool success = dictionary.getValue(KeyType, geometryType); - if (!success) { - LERROR("PlanetGeometry did not contain a correct value of the key '" - << KeyType << "'"); - return nullptr; - } - ghoul::TemplateFactory* factory - = FactoryManager::ref().factory(); +Documentation PlanetGeometry::Documentation() { + using namespace documentation; + return { + "Planet Geometry", + "base_geometry_planet", + { + { + KeyType, + new StringVerifier, + "The type of the PlanetGeometry that will can be constructed.", + Optional::No + } + } + }; +} + +PlanetGeometry* PlanetGeometry::createFromDictionary(const ghoul::Dictionary& dictionary) +{ + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "PlanetGeometry" + ); + + std::string geometryType = dictionary.value(KeyType); + auto factory = FactoryManager::ref().factory(); PlanetGeometry* result = factory->create(geometryType, dictionary); if (result == nullptr) { - LERROR("Failed to create a PlanetGeometry object of type '" << geometryType - << "'"); - return nullptr; + throw ghoul::RuntimeError( + "Failed to create a PlanetGeometry object of type '" + geometryType + "'" + ); } return result; } diff --git a/modules/base/rendering/planetgeometry.h b/modules/base/rendering/planetgeometry.h index 3a38f3be81..2442fa11d5 100644 --- a/modules/base/rendering/planetgeometry.h +++ b/modules/base/rendering/planetgeometry.h @@ -26,10 +26,11 @@ #define __PLANETGEOMETRY_H__ #include -#include -#include + +#include namespace openspace { +class Renderable; namespace planetgeometry { @@ -43,6 +44,8 @@ public: virtual void deinitialize(); virtual void render() = 0; + static openspace::Documentation Documentation(); + protected: Renderable* _parent; }; diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index 19724e482d..5f842336ca 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -28,6 +28,7 @@ #include #include +#include #include #include diff --git a/modules/base/rendering/renderableplanet.cpp b/modules/base/rendering/renderableplanet.cpp index eac80732c3..bedd4ca84b 100644 --- a/modules/base/rendering/renderableplanet.cpp +++ b/modules/base/rendering/renderableplanet.cpp @@ -57,15 +57,7 @@ namespace { const std::string keyShadowGroup = "Shadow_Group"; const std::string keyShadowSource = "Source"; const std::string keyShadowCaster = "Caster"; - const std::string keyAtmosphere = "Atmosphere"; - const std::string keyAtmosphereRadius = "AtmoshereRadius"; const std::string keyPlanetRadius = "PlanetRadius"; - const std::string keyAverageGroundReflectance = "PlanetAverageGroundReflectance"; - const std::string keyRayleigh = "Rayleigh"; - const std::string keyRayleighHeightScale = "H_R"; - const std::string keyMie = "Mie"; - const std::string keyMieHeightScale = "H_M"; - const std::string keyMiePhaseConstant = "G"; const std::string keyBody = "Body"; } @@ -76,58 +68,17 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) , _colorTexturePath("colorTexture", "Color Texture") , _nightTexturePath("nightTexture", "Night Texture") , _heightMapTexturePath("heightMap", "Heightmap Texture") - , _cloudsTexturePath("clouds", "Clouds Texture") - , _reflectanceTexturePath("reflectance", "Reflectance Texture") , _heightExaggeration("heightExaggeration", "Height Exaggeration", 1.f, 0.f, 10.f) , _programObject(nullptr) - , _transmittanceProgramObject(nullptr) - , _irradianceProgramObject(nullptr) - , _irradianceSupTermsProgramObject(nullptr) - , _inScatteringProgramObject(nullptr) - , _inScatteringSupTermsProgramObject(nullptr) - , _deltaEProgramObject(nullptr) - , _deltaSProgramObject(nullptr) - , _deltaSSupTermsProgramObject(nullptr) - , _deltaJProgramObject(nullptr) - , _atmosphereProgramObject(nullptr) , _texture(nullptr) , _nightTexture(nullptr) - , _reflectanceTexture(nullptr) - , _heightMapTexture(nullptr) - , _cloudsTexture(nullptr) , _geometry(nullptr) , _performShading("performShading", "Perform Shading", true) , _rotation("rotation", "Rotation", 0, 0, 360) , _alpha(1.f) , _planetRadius(0.f) - , _transmittanceTableTexture(0) - , _irradianceTableTexture(0) - , _inScatteringTableTexture(0) - , _deltaETableTexture(0) - , _deltaSRayleighTableTexture(0) - , _deltaSMieTableTexture(0) - , _deltaJTableTexture(0) - , _dummyTexture(0) - , _dummy3DTexture(0) - , _atmosphereTexture(0) - , _atmosphereFBO(0) - , _atmosphereRenderVAO(0) - , _atmosphereRenderVBO(0) - , _atmosphereCalculated(false) - , _atmosphereEnabled(false) - , _atmosphereRadius(0.f) - , _atmospherePlanetRadius(0.f) - , _planetAverageGroundReflectance(0.f) - , _rayleighHeightScale(0.f) - , _mieHeightScale(0.f) - , _miePhaseConstant(0.f) - , _mieExtinctionCoeff(glm::vec3(0.f)) - , _rayleighScatteringCoeff(glm::vec3(0.f)) - , _mieScatteringCoeff(glm::vec3(0.f)) , _hasNightTexture(false) , _hasHeightTexture(false) - , _hasReflectanceTexture(false) - , _hasCloudsTexture(false) , _shadowEnabled(false) { std::string name; @@ -135,16 +86,10 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) ghoul_assert(success, "RenderablePlanet need the '" << SceneGraphNode::KeyName<<"' be specified"); - //std::string path; - //success = dictionary.getValue(constants::scenegraph::keyPathModule, path); - //ghoul_assert(success, - // "RenderablePlanet need the '"<(keyShading)) { @@ -224,7 +148,6 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) // Mainly for debugging purposes @AA addProperty(_rotation); - // Shadow data: ghoul::Dictionary shadowDictionary; success = dictionary.getValue(keyShadowGroup, shadowDictionary); @@ -299,107 +222,6 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) } } } - - // Atmosphere data: - bool errorReadingAtmosphereData = false; - ghoul::Dictionary atmosphereDictionary; - success = dictionary.getValue(keyAtmosphere, atmosphereDictionary); - if (success) { - if (!atmosphereDictionary.getValue(keyAtmosphereRadius, _atmosphereRadius)) { - errorReadingAtmosphereData = true; - LWARNING("No Atmosphere Radius value expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - if (!atmosphereDictionary.getValue(keyPlanetRadius, _atmospherePlanetRadius)) { - errorReadingAtmosphereData = true; - LWARNING("No Planet Radius value expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - if (!atmosphereDictionary.getValue(keyAverageGroundReflectance, _planetAverageGroundReflectance)) { - errorReadingAtmosphereData = true; - LWARNING("No Average Atmosphere Ground Reflectance value expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - ghoul::Dictionary rayleighDictionary; - success = atmosphereDictionary.getValue(keyRayleigh, rayleighDictionary); - - if (success) { - // Not using right now. - glm::vec3 rayleighWavelengths; - success = rayleighDictionary.getValue("Coefficients.Wavelengths", rayleighWavelengths); - - if (!rayleighDictionary.getValue("Coefficients.Scattering", _rayleighScatteringCoeff)) { - errorReadingAtmosphereData = true; - LWARNING("No Rayleigh Scattering parameters expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - if (!rayleighDictionary.getValue(keyRayleighHeightScale, _rayleighHeightScale)) { - errorReadingAtmosphereData = true; - LWARNING("No Rayleigh Height Scale value expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - } - else { - errorReadingAtmosphereData = true; - LWARNING("No Rayleigh parameters expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - ghoul::Dictionary mieDictionary; - success = atmosphereDictionary.getValue(keyMie, mieDictionary); - if (success) { - if (!mieDictionary.getValue(keyMieHeightScale, _mieHeightScale)) { - errorReadingAtmosphereData = true; - LWARNING("No Mie Height Scale value expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - if (!mieDictionary.getValue("Coefficients.Scattering", _mieScatteringCoeff)) { - errorReadingAtmosphereData = true; - LWARNING("No Mie Scattering parameters expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - if (!mieDictionary.getValue("Coefficients.Extinction", _mieExtinctionCoeff)) { - errorReadingAtmosphereData = true; - LWARNING("No Mie Extinction parameters expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - if (!mieDictionary.getValue(keyMiePhaseConstant, _miePhaseConstant)) { - errorReadingAtmosphereData = true; - LWARNING("No Mie Phase Constant value expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - } - else { - errorReadingAtmosphereData = true; - LWARNING("No Mie parameters expecified for Atmosphere Effects of " - << name << " planet.\nDisabling atmosphere effects for this planet."); - } - - if (!errorReadingAtmosphereData) { - _atmosphereEnabled = true; - - //// DEBUG: - //std::stringstream ss; - //ss << "\n\nAtmosphere Values:\n" - // << "Radius: " << _atmosphereRadius << std::endl - // << "Planet Radius: " << _atmospherePlanetRadius << std::endl - // << "Average Reflection: " << _planetAverageGroundReflectance << std::endl - // << "Rayleigh HR: " << _rayleighHeightScale << std::endl - // << "Mie HR: " << _mieHeightScale << std::endl - // << "Mie G phase constant: " << _miePhaseConstant << std::endl - // << "Mie Extinction coeff: " << _mieExtinctionCoeff << std::endl - // << "Rayleigh Scattering coeff: " << _rayleighScatteringCoeff << std::endl - // << "Mie Scattering coeff: " << _mieScatteringCoeff << std::endl; - //std::cout << ss.str() << std::endl; - } - } } RenderablePlanet::~RenderablePlanet() { @@ -416,15 +238,7 @@ bool RenderablePlanet::initialize() { LERROR(ss.str()); } - if (_programObject == nullptr && _atmosphereEnabled && _shadowEnabled && _hasNightTexture) { - // shadow program - _programObject = renderEngine.buildRenderProgram( - "atmosphereAndShadowProgram", - "${MODULE_BASE}/shaders/atmosphere_vs.glsl", - "${MODULE_BASE}/shaders/atmosphere_fs.glsl"); - if (!_programObject) - return false; - } else if (_programObject == nullptr && _shadowEnabled && _hasNightTexture) { + if (_programObject == nullptr && _shadowEnabled && _hasNightTexture) { // shadow program _programObject = renderEngine.buildRenderProgram( "shadowNightProgram", @@ -455,8 +269,8 @@ bool RenderablePlanet::initialize() { // pscstandard _programObject = renderEngine.buildRenderProgram( "pscstandard", - "${MODULE_BASE}/shaders/pscstandard_vs.glsl", - "${MODULE_BASE}/shaders/pscstandard_fs.glsl"); + "${MODULE_BASE}/shaders/renderableplanet_vs.glsl", + "${MODULE_BASE}/shaders/renderableplanet_fs.glsl"); if (!_programObject) return false; } @@ -464,13 +278,6 @@ bool RenderablePlanet::initialize() { _programObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); _programObject->setIgnoreUniformLocationError(IgnoreError::Yes); - /*_atmosphereProgramObject = renderEngine.buildRenderProgram( - "atmosphereDeferredProgram", - "${MODULE_BASE}/shaders/atmosphere_deferred_vs.glsl", - "${MODULE_BASE}/shaders/atmosphere_deferred_fs.glsl"); - if (!_atmosphereProgramObject) - return false;*/ - while ((err = glGetError()) != GL_NO_ERROR) { const GLubyte * errString = gluErrorString(err); std::stringstream ss; @@ -493,24 +300,9 @@ bool RenderablePlanet::initialize() { while ((err = glGetError()) != GL_NO_ERROR) { const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Shader Programs Creation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); + LERROR("Shader Programs Creation. OpenGL error: " << errString); } - //Atmosphere precomputation and tables - if (_atmosphereEnabled && !_atmosphereCalculated) { - _atmosphereCalculated = true; - - preCalculateAtmosphereParam(); - - //createAtmosphereFBO(); - - createRenderQuad(&_atmosphereRenderVAO, &_atmosphereRenderVBO, 6); - } - - count = 0; - return isReady(); } @@ -526,67 +318,9 @@ bool RenderablePlanet::deinitialize() { _programObject = nullptr; } - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - if (_irradianceSupTermsProgramObject) { - renderEngine.removeRenderProgram(_irradianceSupTermsProgramObject); - _irradianceSupTermsProgramObject = nullptr; - } - - if (_inScatteringProgramObject) { - renderEngine.removeRenderProgram(_inScatteringProgramObject); - _inScatteringProgramObject = nullptr; - } - - if (_inScatteringSupTermsProgramObject) { - renderEngine.removeRenderProgram(_inScatteringSupTermsProgramObject); - _inScatteringSupTermsProgramObject = nullptr; - } - - if (_deltaEProgramObject) { - renderEngine.removeRenderProgram(_deltaEProgramObject); - _deltaEProgramObject = nullptr; - } - - if (_deltaSProgramObject) { - renderEngine.removeRenderProgram(_deltaSProgramObject); - _deltaSProgramObject = nullptr; - } - - if (_deltaSSupTermsProgramObject) { - renderEngine.removeRenderProgram(_deltaSSupTermsProgramObject); - _deltaSSupTermsProgramObject = nullptr; - } - - if (_deltaJProgramObject) { - renderEngine.removeRenderProgram(_deltaJProgramObject); - _deltaJProgramObject = nullptr; - } - _geometry = nullptr; _texture = nullptr; _nightTexture = nullptr; - _reflectanceTexture = nullptr; - _cloudsTexture = nullptr; - - glDeleteTextures(1, &_transmittanceTableTexture); - glDeleteTextures(1, &_irradianceTableTexture); - glDeleteTextures(1, &_inScatteringTableTexture); - glDeleteTextures(1, &_deltaETableTexture); - glDeleteTextures(1, &_deltaSRayleighTableTexture); - glDeleteTextures(1, &_deltaSMieTableTexture); - glDeleteTextures(1, &_deltaJTableTexture); - glDeleteTextures(1, &_atmosphereTexture); - - glDeleteFramebuffers(1, &_atmosphereFBO); return true; } @@ -603,24 +337,28 @@ void RenderablePlanet::render(const RenderData& data) { // activate shader _programObject->activate(); + glm::dmat4 modelTransform = + glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation + glm::dmat4(data.modelTransform.rotation) * // Spice rotation + glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale))); + // scale the planet to appropriate size since the planet is a unit sphere - glm::mat4 transform = glm::mat4(1); + //glm::mat4 transform = glm::mat4(1); //earth needs to be rotated for that to work. - glm::mat4 rot = glm::rotate(transform, static_cast(M_PI_2), glm::vec3(1, 0, 0)); - glm::mat4 roty = glm::rotate(transform, static_cast(M_PI_2), glm::vec3(0, -1, 0)); - glm::mat4 rotProp = glm::rotate(transform, glm::radians(static_cast(_rotation)), glm::vec3(0, 1, 0)); + glm::dmat4 rot = glm::rotate(glm::dmat4(1.0), M_PI_2, glm::dvec3(1, 0, 0)); + glm::dmat4 roty = glm::rotate(glm::dmat4(1.0), M_PI_2, glm::dvec3(0, -1, 0)); + //glm::dmat4 rotProp = glm::rotate(glm::dmat4(1.0), glm::radians(static_cast(_rotation)), glm::dvec3(0, 1, 0)); + modelTransform = modelTransform * rot /** roty*/ /** rotProp*/; - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 3; j++){ - transform[i][j] = static_cast(_stateMatrix[i][j]); - } - } - transform = transform * rot * roty * rotProp; + glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; _programObject->setUniform("transparency", _alpha); - _programObject->setUniform("ViewProjection", data.camera.viewProjectionMatrix()); - _programObject->setUniform("ModelTransform", transform); + _programObject->setUniform( + "modelViewProjectionTransform", + data.camera.projectionMatrix() * glm::mat4(modelViewTransform) + ); + _programObject->setUniform("ModelTransform", glm::mat4(modelTransform)); // Normal Transformation glm::mat4 translateObjTrans = glm::translate(glm::mat4(1.0), data.position.vec3()); @@ -628,13 +366,9 @@ void RenderablePlanet::render(const RenderData& data) { float scaleFactor = data.camera.scaling().x * powf(10.0, data.camera.scaling().y); glm::mat4 scaleCamTrans = glm::scale(glm::mat4(1.0), glm::vec3(scaleFactor)); - glm::mat4 ModelViewTrans = data.camera.viewMatrix() * scaleCamTrans * - translateCamTrans * translateObjTrans * transform; - if (_atmosphereEnabled) - _programObject->setUniform("NormalTransform", - glm::transpose(glm::inverse(ModelViewTrans))); - + translateCamTrans * translateObjTrans * glm::mat4(modelTransform); + setPscUniforms(*_programObject.get(), data.camera, data.position); _programObject->setUniform("_performShading", _performShading); @@ -745,91 +479,6 @@ void RenderablePlanet::render(const RenderData& data) { } } - // Atmosphere Data - if (_atmosphereEnabled) { - -// GLenum err; -// while ((err = glGetError()) != GL_NO_ERROR) { -// const GLubyte * errorString = gluErrorString(err); -// std::stringstream ss; -// ss << "Error setting up atmosphere framebuffer. OpenGL error: " -// << err << " - " << errorString << std::endl; -// LERROR(ss.str()); -// } - - // Object Space (in Km) - glm::mat4 obj2World = glm::translate(glm::mat4(1.0), data.position.vec3() / 1000.0f); - /*glm::mat4 M = data.camera.viewMatrix() * scaleCamTrans * glm::mat4(data.camera.viewRotationMatrix()) * - translateCamTrans * obj2World * transform; - */ - glm::mat4 M = glm::mat4(data.camera.combinedViewMatrix()) * scaleCamTrans * obj2World * transform; - - glm::mat4 completeInverse = glm::inverse(M); - - _programObject->setUniform("completeInverse", completeInverse); - _programObject->setUniform("projInverse", glm::inverse(data.camera.projectionMatrix())); - - // This is camera position and planet position vector in object coordinates, in Km. - glm::mat4 world2Obj = glm::inverse(obj2World * transform); - glm::vec4 cameraPosObj = world2Obj * glm::vec4(data.camera.position().vec3() / 1000.0f, 1.0); - glm::vec4 planetPositionObj = world2Obj * glm::vec4(data.position.vec3() / 1000.0f, 1.0); - _programObject->setUniform("cameraPosObj", cameraPosObj); - _programObject->setUniform("planetPositionObj", planetPositionObj); - - // I know it is (0,0,0). It is here just for sake of sanity. :-p - glm::dvec3 sunPosWorld = - SpiceManager::ref().targetPosition("SUN", "SUN", "GALACTIC", {}, _time, lt); - glm::vec4 sunPosObj = world2Obj * glm::vec4(sunPosWorld.x, sunPosWorld.y, sunPosWorld.z, 1.0); - _programObject->setUniform("sunPositionObj", glm::vec3(sunPosObj)); - - _transmittanceTableTextureUnit.activate(); - _programObject->setUniform("transmittanceTexture", _transmittanceTableTextureUnit); - - _irradianceTableTextureUnit.activate(); - _programObject->setUniform("irradianceTexture", _irradianceTableTextureUnit); - - _inScatteringTableTextureUnit.activate(); - _programObject->setUniform("inscatterTexture", _inScatteringTableTextureUnit); - - GLint m_viewport[4]; - glGetIntegerv(GL_VIEWPORT, m_viewport); - _programObject->setUniform("screenX", (float)m_viewport[0]); - _programObject->setUniform("screenY", (float)m_viewport[1]); - _programObject->setUniform("screenWIDTH", (float)m_viewport[2]); - _programObject->setUniform("screenHEIGHT", (float)m_viewport[3]); - - - _programObject->setUniform("Rg", _atmospherePlanetRadius); - _programObject->setUniform("Rt", _atmosphereRadius); - _programObject->setUniform("AVERAGE_GROUND_REFLECTANCE", _planetAverageGroundReflectance); - _programObject->setUniform("HR", _rayleighHeightScale); - _programObject->setUniform("betaR", _rayleighScatteringCoeff); - _programObject->setUniform("HM", _mieHeightScale); - _programObject->setUniform("betaMSca", _mieScatteringCoeff); - _programObject->setUniform("betaMEx", _mieExtinctionCoeff); - _programObject->setUniform("mieG", _miePhaseConstant); - - - ghoul::opengl::TextureUnit reflectanceUnit; - if (_hasReflectanceTexture) { - reflectanceUnit.activate(); - _reflectanceTexture->bind(); - _programObject->setUniform("reflectanceTexture", reflectanceUnit); - } - - ghoul::opengl::TextureUnit cloudsUnit; - if (_hasCloudsTexture) { - cloudsUnit.activate(); - _cloudsTexture->bind(); - _programObject->setUniform("cloudsTexture", cloudsUnit); - } - - // HDR - _programObject->setUniform("exposure", 0.4f); - - } - - // render _geometry->render(); @@ -840,7 +489,8 @@ void RenderablePlanet::render(const RenderData& data) { void RenderablePlanet::update(const UpdateData& data) { // set spice-orientation in accordance to timestamp - _stateMatrix = SpiceManager::ref().positionTransformMatrix(_frame, "GALACTIC", data.time); + _stateMatrix = data.modelTransform.rotation; + //_stateMatrix = SpiceManager::ref().positionTransformMatrix(_frame, "GALACTIC", data.time); _time = data.time; } @@ -849,6 +499,10 @@ void RenderablePlanet::loadTexture() { if (_colorTexturePath.value() != "") { _texture = std::move(ghoul::io::TextureReader::ref().loadTexture(absPath(_colorTexturePath))); if (_texture) { + if (_texture->numberOfChannels() == 1) { + _texture->setSwizzleMask({ GL_RED, GL_RED, GL_RED, GL_RED }); + } + LDEBUG("Loaded texture from '" << _colorTexturePath << "'"); _texture->uploadTexture(); @@ -862,9 +516,7 @@ void RenderablePlanet::loadTexture() { GLenum err; while ((err = glGetError()) != GL_NO_ERROR) { const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error after reading memory 1. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); + LERROR("Error after reading color texture. OpenGL error: " << errString); } if (_hasNightTexture) { @@ -882,31 +534,9 @@ void RenderablePlanet::loadTexture() { while ((err = glGetError()) != GL_NO_ERROR) { const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error after reading memory 2. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); + LERROR("Error after reading night texture. OpenGL error: " << errString); } - - if (_hasReflectanceTexture) { - _reflectanceTexture = nullptr; - if (_reflectanceTexturePath.value() != "") { - _reflectanceTexture = std::move(ghoul::io::TextureReader::ref().loadTexture(absPath(_reflectanceTexturePath))); - if (_reflectanceTexture) { - LDEBUG("Loaded texture from '" << _reflectanceTexturePath << "'"); - _reflectanceTexture->uploadTexture(); - _reflectanceTexture->setFilter(ghoul::opengl::Texture::FilterMode::Linear); - //_reflectanceTexture->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap); - } - } - } - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error after reading memory 3. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - + if (_hasHeightTexture) { _heightMapTexture = nullptr; if (_heightMapTexturePath.value() != "") { @@ -920,1119 +550,9 @@ void RenderablePlanet::loadTexture() { } } -// while ((err = glGetError()) != GL_NO_ERROR) { -// const GLubyte * errString = gluErrorString(err); -// std::stringstream ss; -// ss << "Error after reading memory 4. OpenGL error: " << errString << std::endl; -// LERROR(ss.str()); -// } - - if (_hasCloudsTexture) { - _cloudsTexture = nullptr; - if (_cloudsTexturePath.value() != "") { - _cloudsTexture = std::move(ghoul::io::TextureReader::ref().loadTexture(absPath(_cloudsTexturePath))); - if (_cloudsTexture) { - LDEBUG("Loaded texture from '" << _cloudsTexturePath << "'"); - _cloudsTexture->uploadTexture(); - _cloudsTexture->setFilter(ghoul::opengl::Texture::FilterMode::Linear); - //_cloudsTexture->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap); - } - } - } - -// while ((err = glGetError()) != GL_NO_ERROR) { -// const GLubyte * errString = gluErrorString(err); -// std::stringstream ss; -// ss << "Error after reading memory 5. OpenGL error: " << errString << std::endl; -// LERROR(ss.str()); -// } -} - -void RenderablePlanet::loadComputationPrograms() { - - RenderEngine& renderEngine = OsEng.renderEngine(); - - //============== Transmittance ================= - if (_transmittanceProgramObject == nullptr) { - _transmittanceProgramObject = renderEngine.buildRenderProgram( - "transmittanceCalcProgram", - "${MODULE_BASE}/shaders/transmittance_calc_vs.glsl", - "${MODULE_BASE}/shaders/transmittance_calc_fs.glsl"); - if (!_transmittanceProgramObject) { - return; - } - } - using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; - _transmittanceProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _transmittanceProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); - - //============== Irradiance ================= - if (_irradianceProgramObject == nullptr) { - _irradianceProgramObject = renderEngine.buildRenderProgram( - "irradianceCalcProgram", - "${MODULE_BASE}/shaders/irradiance_calc_vs.glsl", - "${MODULE_BASE}/shaders/irradiance_calc_fs.glsl"); - if (!_irradianceProgramObject) { - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - return; - } - } - _irradianceProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _irradianceProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); - - if (_irradianceSupTermsProgramObject == nullptr) { - _irradianceSupTermsProgramObject = renderEngine.buildRenderProgram( - "irradianceSupTermsCalcProgram", - "${MODULE_BASE}/shaders/irradiance_sup_calc_vs.glsl", - "${MODULE_BASE}/shaders/irradiance_sup_calc_fs.glsl"); - if (!_irradianceSupTermsProgramObject) { - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - return; - } - } - _irradianceSupTermsProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _irradianceSupTermsProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); - - //============== InScattering ================= - if (_inScatteringProgramObject == nullptr) { - _inScatteringProgramObject = renderEngine.buildRenderProgram( - "inScatteringCalcProgram", - "${MODULE_BASE}/shaders/inScattering_calc_vs.glsl", - "${MODULE_BASE}/shaders/inScattering_calc_fs.glsl", - "${MODULE_BASE}/shaders/inScattering_calc_gs.glsl"); - if (!_inScatteringProgramObject) { - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - if (_irradianceSupTermsProgramObject) { - renderEngine.removeRenderProgram(_irradianceSupTermsProgramObject); - _irradianceSupTermsProgramObject = nullptr; - } - - return; - } - } - _inScatteringProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _inScatteringProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); - - if (_inScatteringSupTermsProgramObject == nullptr) { - _inScatteringSupTermsProgramObject = renderEngine.buildRenderProgram( - "inScatteringSupTermsCalcProgram", - "${MODULE_BASE}/shaders/inScattering_sup_calc_vs.glsl", - "${MODULE_BASE}/shaders/inScattering_sup_calc_fs.glsl", - "${MODULE_BASE}/shaders/inScattering_sup_calc_gs.glsl"); - if (!_inScatteringSupTermsProgramObject) { - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - if (_irradianceSupTermsProgramObject) { - renderEngine.removeRenderProgram(_irradianceSupTermsProgramObject); - _irradianceSupTermsProgramObject = nullptr; - } - - if (_inScatteringProgramObject) { - renderEngine.removeRenderProgram(_inScatteringProgramObject); - _inScatteringProgramObject = nullptr; - } - - return; - } - } - _inScatteringSupTermsProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _inScatteringSupTermsProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); - - //============== Delta E ================= - if (_deltaEProgramObject == nullptr) { - _deltaEProgramObject = renderEngine.buildRenderProgram( - "deltaECalcProgram", - "${MODULE_BASE}/shaders/deltaE_calc_vs.glsl", - "${MODULE_BASE}/shaders/deltaE_calc_fs.glsl"); - if (!_deltaEProgramObject) { - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - if (_irradianceSupTermsProgramObject) { - renderEngine.removeRenderProgram(_irradianceSupTermsProgramObject); - _irradianceSupTermsProgramObject = nullptr; - } - - if (_inScatteringProgramObject) { - renderEngine.removeRenderProgram(_inScatteringProgramObject); - _inScatteringProgramObject = nullptr; - } - - if (_inScatteringSupTermsProgramObject) { - renderEngine.removeRenderProgram(_inScatteringSupTermsProgramObject); - _inScatteringSupTermsProgramObject = nullptr; - } - - return; - } - } - _deltaEProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _deltaEProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); - - //============== Delta S ================= - if (_deltaSProgramObject == nullptr) { - _deltaSProgramObject = renderEngine.buildRenderProgram( - "deltaSCalcProgram", - "${MODULE_BASE}/shaders/deltaS_calc_vs.glsl", - "${MODULE_BASE}/shaders/deltaS_calc_fs.glsl", - "${MODULE_BASE}/shaders/deltaS_calc_gs.glsl"); - if (!_deltaSProgramObject) { - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - if (_irradianceSupTermsProgramObject) { - renderEngine.removeRenderProgram(_irradianceSupTermsProgramObject); - _irradianceSupTermsProgramObject = nullptr; - } - - if (_inScatteringProgramObject) { - renderEngine.removeRenderProgram(_inScatteringProgramObject); - _inScatteringProgramObject = nullptr; - } - - if (_inScatteringSupTermsProgramObject) { - renderEngine.removeRenderProgram(_inScatteringSupTermsProgramObject); - _inScatteringSupTermsProgramObject = nullptr; - } - - if (_deltaEProgramObject) { - renderEngine.removeRenderProgram(_deltaEProgramObject); - _deltaEProgramObject = nullptr; - } - - return; - } - } - _deltaSProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _deltaSProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); - - if (_deltaSSupTermsProgramObject == nullptr) { - _deltaSSupTermsProgramObject = renderEngine.buildRenderProgram( - "deltaSSUPTermsCalcProgram", - "${MODULE_BASE}/shaders/deltaS_sup_calc_vs.glsl", - "${MODULE_BASE}/shaders/deltaS_sup_calc_fs.glsl", - "${MODULE_BASE}/shaders/deltaS_sup_calc_gs.glsl"); - if (!_deltaSSupTermsProgramObject) { - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - if (_irradianceSupTermsProgramObject) { - renderEngine.removeRenderProgram(_irradianceSupTermsProgramObject); - _irradianceSupTermsProgramObject = nullptr; - } - - if (_inScatteringProgramObject) { - renderEngine.removeRenderProgram(_inScatteringProgramObject); - _inScatteringProgramObject = nullptr; - } - - if (_inScatteringSupTermsProgramObject) { - renderEngine.removeRenderProgram(_inScatteringSupTermsProgramObject); - _inScatteringSupTermsProgramObject = nullptr; - } - - if (_deltaEProgramObject) { - renderEngine.removeRenderProgram(_deltaEProgramObject); - _deltaEProgramObject = nullptr; - } - - if (_deltaSProgramObject) { - renderEngine.removeRenderProgram(_deltaSProgramObject); - _deltaSProgramObject = nullptr; - } - - return; - } - } - _deltaSSupTermsProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _deltaSSupTermsProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); - - //============== Delta J (Radiance Scattered) ================= - if (_deltaJProgramObject == nullptr) { - // shadow program - _deltaJProgramObject = renderEngine.buildRenderProgram( - "deltaJCalcProgram", - "${MODULE_BASE}/shaders/deltaJ_calc_vs.glsl", - "${MODULE_BASE}/shaders/deltaJ_calc_fs.glsl", - "${MODULE_BASE}/shaders/deltaJ_calc_gs.glsl"); - if (!_deltaJProgramObject) { - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - if (_irradianceSupTermsProgramObject) { - renderEngine.removeRenderProgram(_irradianceSupTermsProgramObject); - _irradianceSupTermsProgramObject = nullptr; - } - - if (_inScatteringProgramObject) { - renderEngine.removeRenderProgram(_inScatteringProgramObject); - _inScatteringProgramObject = nullptr; - } - - if (_inScatteringSupTermsProgramObject) { - renderEngine.removeRenderProgram(_inScatteringSupTermsProgramObject); - _inScatteringSupTermsProgramObject = nullptr; - } - - if (_deltaEProgramObject) { - renderEngine.removeRenderProgram(_deltaEProgramObject); - _deltaEProgramObject = nullptr; - } - - if (_deltaSProgramObject) { - renderEngine.removeRenderProgram(_deltaSProgramObject); - _deltaSProgramObject = nullptr; - } - - if (_deltaSSupTermsProgramObject) { - renderEngine.removeRenderProgram(_deltaSSupTermsProgramObject); - _deltaSSupTermsProgramObject = nullptr; - } - - return; - } - - } - _deltaJProgramObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); - _deltaJProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes); -} - -void RenderablePlanet::unloadComputationPrograms() { - - RenderEngine& renderEngine = OsEng.renderEngine(); - - if (_transmittanceProgramObject) { - renderEngine.removeRenderProgram(_transmittanceProgramObject); - _transmittanceProgramObject = nullptr; - } - - if (_irradianceProgramObject) { - renderEngine.removeRenderProgram(_irradianceProgramObject); - _irradianceProgramObject = nullptr; - } - - if (_irradianceSupTermsProgramObject) { - renderEngine.removeRenderProgram(_irradianceSupTermsProgramObject); - _irradianceSupTermsProgramObject = nullptr; - } - - if (_inScatteringProgramObject) { - renderEngine.removeRenderProgram(_inScatteringProgramObject); - _inScatteringProgramObject = nullptr; - } - - if (_inScatteringSupTermsProgramObject) { - renderEngine.removeRenderProgram(_inScatteringSupTermsProgramObject); - _inScatteringSupTermsProgramObject = nullptr; - } - - if (_deltaEProgramObject) { - renderEngine.removeRenderProgram(_deltaEProgramObject); - _deltaEProgramObject = nullptr; - } - - if (_deltaSProgramObject) { - renderEngine.removeRenderProgram(_deltaSProgramObject); - _deltaSProgramObject = nullptr; - } - - if (_deltaSSupTermsProgramObject) { - renderEngine.removeRenderProgram(_deltaSSupTermsProgramObject); - _deltaSSupTermsProgramObject = nullptr; - } - - if (_deltaJProgramObject) { - renderEngine.removeRenderProgram(_deltaJProgramObject); - _deltaJProgramObject = nullptr; - } -} - -void RenderablePlanet::createComputationTextures() { - // TODO: Change precision of textures: GL_RGB16F to GL_RGB32F - //========== Create Tables (textures) ============== - - GLenum err; while ((err = glGetError()) != GL_NO_ERROR) { const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error before creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - _dummyTextureUnit.activate(); - glGenTextures(1, &_dummyTexture); - glBindTexture(GL_TEXTURE_2D, _dummyTexture); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, TRANSMITTANCE_TABLE_WIDTH, - TRANSMITTANCE_TABLE_HEIGHT, 0, GL_RGB, GL_FLOAT, nullptr); - - //GLenum err; - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 1 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - ghoul::opengl::TextureUnit _dummy3DTextureUnit; - _dummy3DTextureUnit.activate(); - glGenTextures(1, &_dummy3DTexture); - glBindTexture(GL_TEXTURE_3D, _dummy3DTexture); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16F, MU_S_SAMPLES * NU_SAMPLES, - MU_SAMPLES, R_SAMPLES, 0, GL_RGB, GL_FLOAT, nullptr); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 2 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - //============== Transmittance ================= - _transmittanceTableTextureUnit.activate(); - glGenTextures(1, &_transmittanceTableTexture); - glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, TRANSMITTANCE_TABLE_WIDTH, - TRANSMITTANCE_TABLE_HEIGHT, 0, GL_RGB, GL_FLOAT, nullptr); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 3 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - //============== Irradiance ================= - _irradianceTableTextureUnit.activate(); - glGenTextures(1, &_irradianceTableTexture); - glBindTexture(GL_TEXTURE_2D, _irradianceTableTexture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, IRRADIANCE_TABLE_WIDTH, - IRRADIANCE_TABLE_HEIGHT, 0, GL_RGB, GL_FLOAT, nullptr); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 4 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - //============== InScattering ================= - _inScatteringTableTextureUnit.activate(); - glGenTextures(1, &_inScatteringTableTexture); - glBindTexture(GL_TEXTURE_3D, _inScatteringTableTexture); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA16F_ARB, MU_S_SAMPLES * NU_SAMPLES, - MU_SAMPLES, R_SAMPLES, 0, GL_RGB, GL_FLOAT, nullptr); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 5 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - //============== Delta E ================= - _deltaETableTextureUnit.activate(); - glGenTextures(1, &_deltaETableTexture); - glBindTexture(GL_TEXTURE_2D, _deltaETableTexture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, DELTA_E_TABLE_WIDTH, - DELTA_E_TABLE_HEIGHT, 0, GL_RGB, GL_FLOAT, nullptr); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 6 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - //============== Delta S ================= - _deltaSRayleighTableTextureUnit.activate(); - glGenTextures(1, &_deltaSRayleighTableTexture); - glBindTexture(GL_TEXTURE_3D, _deltaSRayleighTableTexture); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16F, MU_S_SAMPLES * NU_SAMPLES, - MU_SAMPLES, R_SAMPLES, 0, GL_RGB, GL_FLOAT, nullptr); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 7 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - _deltaSMieTableTextureUnit.activate(); - glGenTextures(1, &_deltaSMieTableTexture); - glBindTexture(GL_TEXTURE_3D, _deltaSMieTableTexture); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16F, MU_S_SAMPLES * NU_SAMPLES, - MU_SAMPLES, R_SAMPLES, 0, GL_RGB, GL_FLOAT, nullptr); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 8 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - //============== Delta J (Radiance Scattered) ================= - _deltaJTableTextureUnit.activate(); - glGenTextures(1, &_deltaJTableTexture); - glBindTexture(GL_TEXTURE_3D, _deltaJTableTexture); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB16F, MU_S_SAMPLES * NU_SAMPLES, - MU_SAMPLES, R_SAMPLES, 0, GL_RGB, GL_FLOAT, nullptr); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error 9 creating OpenGL textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } -} - -void RenderablePlanet::deleteComputationTextures() { - // Cleaning up - glDeleteTextures(1, &_dummyTexture); - glDeleteTextures(1, &_dummy3DTexture); - glDeleteTextures(1, &_transmittanceTableTexture); - glDeleteTextures(1, &_irradianceTableTexture); - glDeleteTextures(1, &_inScatteringTableTexture); - glDeleteTextures(1, &_deltaETableTexture); - glDeleteTextures(1, &_deltaSRayleighTableTexture); - glDeleteTextures(1, &_deltaSMieTableTexture); - glDeleteTextures(1, &_deltaJTableTexture); -} - -void RenderablePlanet::deleteUnusedComputationTextures() { - glDeleteTextures(1, &_dummyTexture); - glDeleteTextures(1, &_dummy3DTexture); - glDeleteTextures(1, &_deltaETableTexture); - glDeleteTextures(1, &_deltaSRayleighTableTexture); - glDeleteTextures(1, &_deltaSMieTableTexture); - glDeleteTextures(1, &_deltaJTableTexture); -} - -void RenderablePlanet::loadAtmosphereDataIntoShaderProgram(std::unique_ptr & shaderProg) { - shaderProg->setUniform("Rg", _atmospherePlanetRadius); - shaderProg->setUniform("Rt", _atmosphereRadius); - shaderProg->setUniform("AVERAGE_GROUND_REFLECTANCE", _planetAverageGroundReflectance); - shaderProg->setUniform("HR", _rayleighHeightScale); - shaderProg->setUniform("betaR", _rayleighScatteringCoeff); - shaderProg->setUniform("HM", _mieHeightScale); - shaderProg->setUniform("betaMSca", _mieScatteringCoeff); - shaderProg->setUniform("betaMEx", _mieExtinctionCoeff); - shaderProg->setUniform("mieG", _miePhaseConstant); -} - - -void RenderablePlanet::executeCalculations(const GLuint vao, const GLenum drawBuffers[2], const GLsizei vertexSize) { - // =========================================================== - // See Precomputed Atmosphere Scattering from Bruneton et al. paper, algorithm 4.1: - // =========================================================== - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummyTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _transmittanceTableTexture, 0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, TRANSMITTANCE_TABLE_WIDTH, TRANSMITTANCE_TABLE_HEIGHT); - _transmittanceProgramObject->activate(); - loadAtmosphereDataIntoShaderProgram(_transmittanceProgramObject); - renderQuadForCalc(vao, vertexSize); - /*saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, std::string("transmittance_texture.ppm"), - TRANSMITTANCE_TABLE_WIDTH, TRANSMITTANCE_TABLE_HEIGHT);*/ - - GLenum err; - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 1. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // line 2 in algorithm 4.1 - glBindTexture(GL_TEXTURE_2D, _dummyTexture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, - DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT, 0, - GL_RGB, GL_FLOAT, nullptr); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummyTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _deltaETableTexture, 0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT); - _irradianceProgramObject->activate(); - _irradianceProgramObject->setUniform("transmittanceTexture", _transmittanceTableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_irradianceProgramObject); - renderQuadForCalc(vao, vertexSize); - /*saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, std::string("deltaE_table_texture.ppm"), - DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT);*/ - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 2. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // line 3 in algorithm 4.1 - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummy3DTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _deltaSRayleighTableTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, _deltaSMieTableTexture, 0); - GLenum colorBuffers[3] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2 }; - glDrawBuffers(3, colorBuffers); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES); - _inScatteringProgramObject->activate(); - _inScatteringProgramObject->setUniform("transmittanceTexture", _transmittanceTableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_inScatteringProgramObject); - for (int layer = 0; layer < R_SAMPLES; ++layer) { - step3DTexture(_inScatteringProgramObject, layer); - renderQuadForCalc(vao, vertexSize); - } - /*saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, std::string("deltaS_rayleigh_texture.ppm"), - MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES); - saveTextureToPPMFile(GL_COLOR_ATTACHMENT2, std::string("deltaS_mie_texture.ppm"), - MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES);*/ - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_2D, 0, 0); - glDrawBuffers(2, drawBuffers); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 3. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // line 4 in algorithm 4.1 - glBindTexture(GL_TEXTURE_2D, _dummyTexture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, - DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT, 0, - GL_RGB, GL_FLOAT, nullptr); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummyTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _irradianceTableTexture, 0); - glDrawBuffers(2, drawBuffers); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT); - _deltaEProgramObject->activate(); - _deltaEProgramObject->setUniform("line", 4); - _deltaEProgramObject->setUniform("deltaETexture", _deltaETableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_deltaEProgramObject); - renderQuadForCalc(vao, vertexSize); - /*saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, std::string("irradiance_texture.ppm"), - DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT);*/ - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 4. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // line 5 in algorithm 4.1 - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummy3DTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _inScatteringTableTexture, 0); - glViewport(0, 0, MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES); - _deltaSProgramObject->activate(); - _deltaSProgramObject->setUniform("deltaSRTexture", _deltaSRayleighTableTextureUnit); - _deltaSProgramObject->setUniform("deltaSMTexture", _deltaSMieTableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_deltaSProgramObject); - for (int layer = 0; layer < R_SAMPLES; ++layer) { - step3DTexture(_deltaSProgramObject, layer, false); - renderQuadForCalc(vao, vertexSize); - } - /*saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, std::string("S_texture.ppm"), - MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES);*/ - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 5. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // loop in line 6 in algorithm 4.1 - for (int scatteringOrder = 2; scatteringOrder <= 4; ++scatteringOrder) { - - // line 7 in algorithm 4.1 - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummy3DTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _deltaJTableTexture, 0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES); - _deltaJProgramObject->activate(); - if (scatteringOrder == 2) - _deltaJProgramObject->setUniform("first", 1.0f); - else - _deltaJProgramObject->setUniform("first", 0.0f); - _deltaJProgramObject->setUniform("transmittanceTexture", _transmittanceTableTextureUnit); - _deltaJProgramObject->setUniform("deltaETexture", _deltaETableTextureUnit); - _deltaJProgramObject->setUniform("deltaSRTexture", _deltaSRayleighTableTextureUnit); - _deltaJProgramObject->setUniform("deltaSMTexture", _deltaSMieTableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_deltaJProgramObject); - for (int layer = 0; layer < R_SAMPLES; ++layer) { - step3DTexture(_deltaJProgramObject, layer); - renderQuadForCalc(vao, vertexSize); - } - /*std::stringstream sst; - sst << "deltaJ_texture-scattering_order-" << scatteringOrder << ".ppm"; - saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, sst.str(), - MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES);*/ - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 6. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // line 8 in algorithm 4.1 - glBindTexture(GL_TEXTURE_2D, _dummyTexture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, - DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT, 0, - GL_RGB, GL_FLOAT, nullptr); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummyTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _deltaETableTexture, 0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT); - _irradianceSupTermsProgramObject->activate(); - if (scatteringOrder == 2) - _irradianceSupTermsProgramObject->setUniform("first", 1.0f); - else - _irradianceSupTermsProgramObject->setUniform("first", 0.0f); - _irradianceSupTermsProgramObject->setUniform("transmittanceTexture", _transmittanceTableTextureUnit); - _irradianceSupTermsProgramObject->setUniform("deltaSRTexture", _deltaSRayleighTableTextureUnit); - _irradianceSupTermsProgramObject->setUniform("deltaSMTexture", _deltaSMieTableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_irradianceSupTermsProgramObject); - renderQuadForCalc(vao, vertexSize); - /*sst.str(std::string()); - sst << "deltaE_texture-scattering_order-" << scatteringOrder << ".ppm"; - saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, sst.str(), - DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT);*/ - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 7. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // line 9 in algorithm 4.1 - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummy3DTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _deltaSRayleighTableTexture, 0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES); - _inScatteringSupTermsProgramObject->activate(); - if (scatteringOrder == 2) - _inScatteringSupTermsProgramObject->setUniform("first", 1.0f); - else - _inScatteringSupTermsProgramObject->setUniform("first", 0.0f); - _inScatteringSupTermsProgramObject->setUniform("transmittanceTexture", _transmittanceTableTextureUnit); - _inScatteringSupTermsProgramObject->setUniform("deltaJTexture", _deltaJTableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_inScatteringSupTermsProgramObject); - for (int layer = 0; layer < R_SAMPLES; ++layer) { - step3DTexture(_inScatteringSupTermsProgramObject, layer); - renderQuadForCalc(vao, vertexSize); - } - /*sst.str(std::string()); - sst << "deltaS_texture-scattering_order-" << scatteringOrder << ".ppm"; - saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, sst.str(), - MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES);*/ - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 8. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - glEnable(GL_BLEND); - glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD); - glBlendFuncSeparate(GL_ONE, GL_ONE, GL_ONE, GL_ONE); - - // line 10 in algorithm 4.1 - glBindTexture(GL_TEXTURE_2D, _dummyTexture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, - DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT, 0, - GL_RGB, GL_FLOAT, nullptr); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummyTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _irradianceTableTexture, 0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT); - _deltaEProgramObject->activate(); - _deltaEProgramObject->setUniform("line", 10); - _deltaEProgramObject->setUniform("deltaETexture", _deltaETableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_deltaEProgramObject); - renderQuadForCalc(vao, vertexSize); - /*sst.str(std::string()); - sst << "irradianceTable_order-" << scatteringOrder << ".ppm"; - saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, sst.str(), - DELTA_E_TABLE_WIDTH, DELTA_E_TABLE_HEIGHT);*/ - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 9. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // line 11 in algorithm 4.1 - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummy3DTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _inScatteringTableTexture, 0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Computation Framework not built."); - glViewport(0, 0, MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES); - _deltaSSupTermsProgramObject->activate(); - _deltaSSupTermsProgramObject->setUniform("deltaSTexture", _deltaSRayleighTableTextureUnit); - loadAtmosphereDataIntoShaderProgram(_deltaSSupTermsProgramObject); - for (int layer = 0; layer < R_SAMPLES; ++layer) { - step3DTexture(_deltaSSupTermsProgramObject, layer, false); - renderQuadForCalc(vao, vertexSize); - } - /*sst.str(std::string()); - sst << "inscatteringTable_order-" << scatteringOrder << ".ppm"; - saveTextureToPPMFile(GL_COLOR_ATTACHMENT1, sst.str(), - MU_S_SAMPLES * NU_SAMPLES, MU_SAMPLES);*/ - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error executing computation 10. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - glDisable(GL_BLEND); - } - -} - -void RenderablePlanet::preCalculateAtmosphereParam() { - - //========================================================== - //========= Load Shader Programs for Calculations ========== - //========================================================== - loadComputationPrograms(); - - GLenum err; - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error loading shader programs for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - //========================================================== - //============ Create Textures for Calculations ============ - //========================================================== - createComputationTextures(); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error creating textures for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // Preparing FBO... - GLint defaultFBO; - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO); - - GLuint calcFBO; - glGenFramebuffers(1, &calcFBO); - glBindFramebuffer(GL_FRAMEBUFFER, calcFBO); - glReadBuffer(GL_COLOR_ATTACHMENT1); - //glDrawBuffer(GL_COLOR_ATTACHMENT1); - GLenum drawBuffers[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 }; - glDrawBuffers(2, drawBuffers); - - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errString = gluErrorString(err); - std::stringstream ss; - ss << "Error creating FrameBuffer Object for Atmosphere computation. OpenGL error: " << errString << std::endl; - LERROR(ss.str()); - } - - // Prepare for rendering/calculations - GLuint calcVAO; - GLuint calcVBO; - createRenderQuad(&calcVAO, &calcVBO, 1.0f); - - GLint m_viewport[4]; - glGetIntegerv(GL_VIEWPORT, m_viewport); - - // Execute Calculations... - LDEBUG("Starting precalculations for scattering effects..."); - - //========================================================== - //=================== Execute Calculations ================= - //========================================================== - executeCalculations(calcVAO, drawBuffers, 6); - - deleteUnusedComputationTextures(); - - glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); - glViewport(m_viewport[0], m_viewport[1], - m_viewport[2], m_viewport[3]); - glDeleteBuffers(1, &calcVBO); - glDeleteVertexArrays(1, &calcVAO); - glDeleteFramebuffers(1, &calcFBO); - - LDEBUG("Ended precalculations for scattering effects..."); -} - -void RenderablePlanet::createAtmosphereFBO() { - - GLint m_viewport[4]; - glGetIntegerv(GL_VIEWPORT, m_viewport); - - /*GLint defaultFBO; - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO); */ - - _atmosphereTextureUnit.activate(); - glGenTextures(1, &_atmosphereTexture); - glBindTexture(GL_TEXTURE_2D, _atmosphereTexture); - //glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _atmosphereTexture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_viewport[2], - m_viewport[2], 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr); - /*glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 8, GL_RGBA, - m_viewport[2], m_viewport[3], true);*/ - glGenFramebuffers(1, &_atmosphereFBO); - /*glBindFramebuffer(GL_FRAMEBUFFER, _atmosphereFBO); - glReadBuffer(GL_COLOR_ATTACHMENT1); - GLenum drawBuffers[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 }; - glDrawBuffers(2, drawBuffers); - - GLenum err; - while ((err = glGetError()) != GL_NO_ERROR) { - std::stringstream ss; - ss << "Error creating atmosphere framebuffer. OpenGL error: " << err << std::endl; - LERROR(ss.str()); - } - - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _dummyTexture, 0); - glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, _atmosphereTexture, 0); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) - LERROR("Atmosphere Framework not built."); - - glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); - glViewport(m_viewport[0], m_viewport[1], - m_viewport[2], m_viewport[3]);*/ - -} - -void RenderablePlanet::createRenderQuad(GLuint * vao, GLuint * vbo, const GLfloat size) { - - glGenVertexArrays(1, vao); - glGenBuffers(1, vbo); - glBindVertexArray(*vao); - glBindBuffer(GL_ARRAY_BUFFER, *vbo); - - const GLfloat vertex_data[] = { - // x y z w - -size, -size, 0.0f, 1.0f, - size, size, 0.0f, 1.0f, - -size, size, 0.0f, 1.0f, - -size, -size, 0.0f, 1.0f, - size, -size, 0.0f, 1.0f, - size, size, 0.0f, 1.0f - }; - - glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW); - glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 4, reinterpret_cast(0)); - glEnableVertexAttribArray(0); - - GLenum err; - while ((err = glGetError()) != GL_NO_ERROR) { - std::stringstream ss; - ss << "Error creating vertexbuffer for computation. OpenGL error: " << err << std::endl; - LERROR(ss.str()); - } -} - -void RenderablePlanet::renderQuadForCalc(const GLuint vao, const GLsizei size) -{ - glBindVertexArray(vao); - glDrawArrays(GL_TRIANGLES, 0, size); - glBindVertexArray(0); -} - -void RenderablePlanet::step3DTexture(std::unique_ptr & shaderProg, - const int layer, const bool doCalc) -{ - // See OpenGL redbook 8th Edition page 556 for Layered Rendering - //if (doCalc) - { - - float earth2 = _atmospherePlanetRadius * _atmospherePlanetRadius; - float atm2 = _atmosphereRadius * _atmosphereRadius; - float diff = atm2 - earth2; - float r = static_cast(layer) / static_cast(R_SAMPLES - 1); - float r2 = r * r; - float c = 0.0; - if (layer == 0) - c = 0.01f; - else if (layer == (R_SAMPLES - 1)) - c = -0.001f; - else - c = 0.0; - r = sqrtf(earth2 + r2 * diff) + c; - float dmin = _atmosphereRadius - r; - float dmax = sqrtf(r * r - earth2) + sqrtf(diff); - float dminp = r - _atmospherePlanetRadius; - float dmaxp = sqrtf(r * r - earth2); - - shaderProg->setUniform("r", r); - shaderProg->setUniform("dhdH", dmin, dmax, dminp, dmaxp); - } - - shaderProg->setUniform("layer", static_cast(layer)); -} - -void RenderablePlanet::saveTextureToPPMFile(const GLenum color_buffer_attachment, const std::string & fileName, - const int width, const int height) const { - std::fstream ppmFile; - - ppmFile.open(fileName.c_str(), std::fstream::out); - if (ppmFile.is_open()) { - unsigned char * pixels = new unsigned char[width*height * 3]; - for (int t = 0; t < width*height * 3; ++t) - pixels[t] = 255; - - - // check OpenGL error - GLenum err; - while ((err = glGetError()) != GL_NO_ERROR) { - const GLubyte * errorString = gluErrorString(err); - - std::cout << "\n\nBefore Reading Texture from card. OpenGL error: " - << err << " - " << errorString << std::endl; - } - - glReadBuffer(color_buffer_attachment); - glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); - - ppmFile << "P3" << std::endl; - ppmFile << width << " " << height << std::endl; - ppmFile << "255" << std::endl; - - std::cout << "\n\nFILE\n\n"; - int k = 0; - for (int i = 0; i < width; i++) { - for (int j = 0; j < height; j++) { - ppmFile << (unsigned int)pixels[k] << " " << (unsigned int)pixels[k + 1] << " " << (unsigned int)pixels[k + 2] << " "; - k += 3; - } - ppmFile << std::endl; - } - delete[] pixels; - - ppmFile.close(); + LERROR("Error after reading height mapping texture. OpenGL error: " << errString); } } diff --git a/modules/base/rendering/renderableplanet.h b/modules/base/rendering/renderableplanet.h index 11df2513df..9080b60fd4 100644 --- a/modules/base/rendering/renderableplanet.h +++ b/modules/base/rendering/renderableplanet.h @@ -66,38 +66,6 @@ public: bool isShadowing; }; - // See: Precomputed Atmospheric Scattering from Bruneton et al. - // for explanation of the following parameters. - - const unsigned int TRANSMITTANCE_TABLE_WIDTH = 256; - const unsigned int TRANSMITTANCE_TABLE_HEIGHT = 64; - - const unsigned int IRRADIANCE_TABLE_WIDTH = 64; - const unsigned int IRRADIANCE_TABLE_HEIGHT = 16; - - const unsigned int DELTA_E_TABLE_WIDTH = 64; - const unsigned int DELTA_E_TABLE_HEIGHT = 16; - - - /*const unsigned int TRANSMITTANCE_TABLE_WIDTH = 512; - const unsigned int TRANSMITTANCE_TABLE_HEIGHT = 128; - - const unsigned int IRRADIANCE_TABLE_WIDTH = 128; - const unsigned int IRRADIANCE_TABLE_HEIGHT = 32; - - const unsigned int DELTA_E_TABLE_WIDTH = 128; - const unsigned int DELTA_E_TABLE_HEIGHT = 32;*/ - - const unsigned int R_SAMPLES = 32; - const unsigned int MU_SAMPLES = 128; - const unsigned int MU_S_SAMPLES = 32; - const unsigned int NU_SAMPLES = 8; - - /*const unsigned int R_SAMPLES = 64; - const unsigned int MU_SAMPLES = 256; - const unsigned int MU_S_SAMPLES = 64; - const unsigned int NU_SAMPLES = 16;*/ - public: explicit RenderablePlanet(const ghoul::Dictionary& dictionary); ~RenderablePlanet(); @@ -111,71 +79,17 @@ public: protected: void loadTexture(); - -private: - void loadComputationPrograms(); - void unloadComputationPrograms(); - void createComputationTextures(); - void deleteComputationTextures(); - void deleteUnusedComputationTextures(); - void loadAtmosphereDataIntoShaderProgram(std::unique_ptr & shaderProg); - void executeCalculations(const GLuint vao, const GLenum drawBuffers[2], const GLsizei vertexSize); - void preCalculateAtmosphereParam(); - void createAtmosphereFBO(); - void createRenderQuad(GLuint * vao, GLuint * vbo, const GLfloat size); - void renderQuadForCalc(const GLuint vao, const GLsizei size); - void step3DTexture(std::unique_ptr & shaderProg, - const int layer, const bool doCalc = true); - void saveTextureToPPMFile(const GLenum color_buffer_attachment, const std::string & fileName, - const int width, const int height) const; - private: properties::StringProperty _colorTexturePath; properties::StringProperty _nightTexturePath; properties::StringProperty _heightMapTexturePath; - properties::StringProperty _cloudsTexturePath; - properties::StringProperty _reflectanceTexturePath; - + std::unique_ptr _programObject; - std::unique_ptr _transmittanceProgramObject; - std::unique_ptr _irradianceProgramObject; - std::unique_ptr _irradianceSupTermsProgramObject; - std::unique_ptr _inScatteringProgramObject; - std::unique_ptr _inScatteringSupTermsProgramObject; - std::unique_ptr _deltaEProgramObject; - std::unique_ptr _deltaSProgramObject; - std::unique_ptr _deltaSSupTermsProgramObject; - std::unique_ptr _deltaJProgramObject; - std::unique_ptr _atmosphereProgramObject; - ghoul::opengl::TextureUnit _dummyTextureUnit; - ghoul::opengl::TextureUnit _dummy3DTextureUnit; - ghoul::opengl::TextureUnit _transmittanceTableTextureUnit; - ghoul::opengl::TextureUnit _irradianceTableTextureUnit; - ghoul::opengl::TextureUnit _inScatteringTableTextureUnit; - ghoul::opengl::TextureUnit _deltaETableTextureUnit; - ghoul::opengl::TextureUnit _deltaSRayleighTableTextureUnit; - ghoul::opengl::TextureUnit _deltaSMieTableTextureUnit; - ghoul::opengl::TextureUnit _deltaJTableTextureUnit; - ghoul::opengl::TextureUnit _atmosphereTextureUnit; + std::unique_ptr _texture; - std::unique_ptr _nightTexture; - std::unique_ptr _reflectanceTexture; + std::unique_ptr _nightTexture; std::unique_ptr _heightMapTexture; - std::unique_ptr _cloudsTexture; - GLuint _transmittanceTableTexture; - GLuint _irradianceTableTexture; - GLuint _inScatteringTableTexture; - GLuint _deltaETableTexture; - GLuint _deltaSRayleighTableTexture; - GLuint _deltaSMieTableTexture; - GLuint _deltaJTableTexture; - GLuint _dummyTexture; - GLuint _dummy3DTexture; - GLuint _atmosphereTexture; - GLuint _atmosphereFBO; - GLuint _atmosphereRenderVAO; - GLuint _atmosphereRenderVBO; - + properties::FloatProperty _heightExaggeration; planetgeometry::PlanetGeometry* _geometry; @@ -189,31 +103,12 @@ private: std::string _frame; std::string _target; bool _hasNightTexture; - bool _hasReflectanceTexture; bool _hasHeightTexture; - bool _hasCloudsTexture; bool _shadowEnabled; double _time; - // Atmosphere Data - bool _atmosphereCalculated; - bool _atmosphereEnabled; - float _atmosphereRadius; - float _atmospherePlanetRadius; - float _planetAverageGroundReflectance; - float _rayleighHeightScale; - float _mieHeightScale; - float _miePhaseConstant; - glm::vec3 _mieExtinctionCoeff; - glm::vec3 _rayleighScatteringCoeff; - glm::vec3 _mieScatteringCoeff; - - bool tempPic; - unsigned int count; - - }; } // namespace openspace diff --git a/modules/base/rendering/renderablerings.cpp b/modules/base/rendering/renderablerings.cpp index bc3da200cd..6ee8ed363f 100644 --- a/modules/base/rendering/renderablerings.cpp +++ b/modules/base/rendering/renderablerings.cpp @@ -24,9 +24,10 @@ #include +#include #include #include -#include +#include #include #include @@ -35,25 +36,56 @@ #include namespace { - const std::string _loggerCat = "RenderableRings"; - - const std::string KeySize = "Size"; const std::string KeyTexture = "Texture"; - const std::string KeyBody = "Body"; - const std::string KeyFrame = "Frame"; - const std::string KeyOrientation = "Orientation"; + const std::string KeySize = "Size"; const std::string KeyOffset = "Offset"; - const std::string KeyNightFactor = "NightFactor"; - const std::string KeyTransparency = "Transparency"; } namespace openspace { +Documentation RenderableRings::Documentation() { + using namespace documentation; + return { + "Renderable Rings", + "base_renderable_rings", + { + { + "Type", + new StringEqualVerifier("RenderableRings"), + "", + Optional::No + }, + { + KeyTexture, + new StringVerifier, + "The one dimensional texture that is used for both sides of the ring.", + Optional::No + }, + { + KeySize, + new DoubleVerifier, + "The radius of the rings in meters.", + Optional::No + }, + { + KeyOffset, + new DoubleVector2Verifier, + "The offset that is used to limit the width of the rings. Each of the " + "two values is a value between 0 and 1, where 0 is the center of the " + "ring and 1 is the maximum extent at the radius. If this value is, for " + "example {0.5, 1.0}, the ring is only shown between radius/2 and radius. " + "It defaults to {0.0, 1.0}.", + Optional::Yes + } + } + }; +} + RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _texturePath("texture", "Texture") - , _size("size", "Size", glm::vec2(1.f, 1.f), glm::vec2(0.f), glm::vec2(1.f, 25.f)) - , _offset("offset", "Texture Offset", glm::vec2(0.f, 1.f), glm::vec2(0.f), glm::vec2(1.f)) + , _size("size", "Size", 1.f, 0.f, std::pow(1.f, 25.f)) + , _offset("offset", "Offset", glm::vec2(0, 1.f), glm::vec2(0.f), glm::vec2(1.f)) , _nightFactor("nightFactor", "Night Factor", 0.33f, 0.f, 1.f) , _transparency("transparency", "Transparency", 0.15f, 0.f, 1.f) , _shader(nullptr) @@ -63,62 +95,36 @@ RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary) , _quad(0) , _vertexPositionBuffer(0) , _planeIsDirty(false) - , _hasSunPosition(false) { - glm::vec2 size; - dictionary.getValue(KeySize, size); - _size = size; - - if (dictionary.hasKeyAndValue(KeyBody)) { - _body = dictionary.value(KeyBody); - _hasSunPosition = true; - } - - if (dictionary.hasKeyAndValue(KeyFrame)) { - _frame = dictionary.value(KeyFrame); - } - - if (dictionary.hasKeyAndValue(KeyOrientation)) { - _orientation = dictionary.value(KeyOrientation); - } + using ghoul::filesystem::File; + + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "RenderableRings" + ); + + _size = dictionary.value(KeySize); + setBoundingSphere(PowerScaledScalar::CreatePSS(_size)); + addProperty(_size); + _size.onChange([&]() { _planeIsDirty = true; }); + + _texturePath = absPath(dictionary.value(KeyTexture)); + _textureFile = std::make_unique(_texturePath); - if (dictionary.hasKeyAndValue(KeyTexture)) { - _texturePath = absPath(dictionary.value(KeyTexture)); - _textureFile = std::make_unique(_texturePath); - } - if (dictionary.hasKeyAndValue(KeyOffset)) { - glm::vec2 off = dictionary.value(KeyOffset); - _offset = off; + _offset = dictionary.value(KeyOffset); } - - if (dictionary.hasKeyAndValue(KeyNightFactor)) { - float v = dictionary.value(KeyNightFactor); - _nightFactor = v; - } - - if (dictionary.hasKeyAndValue(KeyTransparency)) { - float v = dictionary.value(KeyTransparency); - _transparency = v; - } - addProperty(_offset); - addProperty(_size); - _size.onChange([&](){ _planeIsDirty = true; }); addProperty(_texturePath); _texturePath.onChange([&](){ loadTexture(); }); - _textureFile->setCallback( - [&](const ghoul::filesystem::File&) { _textureIsDirty = true; } - ); + _textureFile->setCallback([&](const File&) { _textureIsDirty = true; }); addProperty(_nightFactor); - addProperty(_transparency); - - setBoundingSphere(_size.value()); } bool RenderableRings::isReady() const { @@ -132,18 +138,14 @@ bool RenderableRings::initialize() { "${MODULE_BASE}/shaders/rings_vs.glsl", "${MODULE_BASE}/shaders/rings_fs.glsl" ); - if (!_shader) - return false; - _shader->setIgnoreUniformLocationError( ghoul::opengl::ProgramObject::IgnoreError::Yes ); } - glGenVertexArrays(1, &_quad); // generate array - glGenBuffers(1, &_vertexPositionBuffer); // generate buffer + glGenVertexArrays(1, &_quad); + glGenBuffers(1, &_vertexPositionBuffer); createPlane(); - loadTexture(); return isReady(); @@ -159,11 +161,8 @@ bool RenderableRings::deinitialize() { _textureFile = nullptr; _texture = nullptr; - RenderEngine& renderEngine = OsEng.renderEngine(); - if (_shader) { - renderEngine.removeRenderProgram(_shader); - _shader = nullptr; - } + OsEng.renderEngine().removeRenderProgram(_shader); + _shader = nullptr; return true; } @@ -171,18 +170,27 @@ bool RenderableRings::deinitialize() { void RenderableRings::render(const RenderData& data) { _shader->activate(); - _shader->setUniform("ViewProjection", data.camera.viewProjectionMatrix()); - _shader->setUniform("ModelTransform", glm::mat4(_orientation * _state)); + glm::dmat4 modelTransform = + glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * + glm::dmat4(data.modelTransform.rotation) * + glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale))); + + glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; + + _shader->setUniform( + "modelViewProjectionTransform", + data.camera.projectionMatrix() * glm::mat4(modelViewTransform) + ); _shader->setUniform("textureOffset", _offset); _shader->setUniform("transparency", _transparency); - _shader->setUniform("hasSunPosition", _hasSunPosition); - if (_hasSunPosition) { - _shader->setUniform("_nightFactor", _nightFactor); - _shader->setUniform("sunPosition", _sunPosition); - } + _shader->setUniform("_nightFactor", _nightFactor); + _shader->setUniform( + "sunPosition", + _sunPosition + ); - setPscUniforms(*_shader.get(), data.camera, data.position); + setPscUniforms(*_shader, data.camera, data.position); ghoul::opengl::TextureUnit unit; unit.activate(); @@ -212,37 +220,26 @@ void RenderableRings::update(const UpdateData& data) { loadTexture(); _textureIsDirty = false; } - - if (!_frame.empty()) { - _state = SpiceManager::ref().positionTransformMatrix(_frame, "GALACTIC", data.time); - } - - if (!_body.empty()) { - double lt; - _sunPosition = SpiceManager::ref().targetPosition( - "SUN", - _body, - "GALACTIC", - {}, - data.time, - lt - ); - } + + _sunPosition = OsEng.renderEngine().scene()->sceneGraphNode("Sun")->worldPosition() - + data.modelTransform.translation; } void RenderableRings::loadTexture() { if (_texturePath.value() != "") { - std::unique_ptr texture = ghoul::io::TextureReader::ref().loadTexture(absPath(_texturePath)); + std::unique_ptr texture = + ghoul::io::TextureReader::ref().loadTexture(absPath(_texturePath)); + if (texture) { - LDEBUG("Loaded texture from '" << absPath(_texturePath) << "'"); + LDEBUGC( + "RenderableRings", + "Loaded texture from '" << absPath(_texturePath) << "'" + ); _texture = std::move(texture); - // Textures of planets looks much smoother with AnisotropicMipMap rather than linear -// _texture->setFilter(ghoul::opengl::Texture::FilterMode::Linear); _texture->uploadTexture(); _texture->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap); - _textureFile = std::make_unique(_texturePath); _textureFile->setCallback( [&](const ghoul::filesystem::File&) { _textureIsDirty = true; } @@ -252,28 +249,45 @@ void RenderableRings::loadTexture() { } void RenderableRings::createPlane() { - // ============================ - // GEOMETRY (quad) - // ============================ - const GLfloat size = _size.value()[0]; - const GLfloat w = _size.value()[1]; - const GLfloat vertex_data[] = { - // x y z w s t - -size, -size, 0.f, w, 0.f, 0.f, - size, size, 0.f, w, 1.f, 1.f, - -size, size, 0.f, w, 0.f, 1.f, - -size, -size, 0.f, w, 0.f, 0.f, - size, -size, 0.f, w, 1.f, 0.f, - size, size, 0.f, w, 1.f, 1.f, + const GLfloat size = _size.value(); + + struct VertexData { + GLfloat x; + GLfloat y; + GLfloat s; + GLfloat t; + }; + + VertexData data[] = { + -size, -size, 0.f, 0.f, + size, size, 1.f, 1.f, + -size, size, 0.f, 1.f, + -size, -size, 0.f, 0.f, + size, -size, 1.f, 0.f, + size, size, 1.f, 1.f, }; - glBindVertexArray(_quad); // bind array - glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer); // bind buffer - glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW); + glBindVertexArray(_quad); + glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer); + glBufferData(GL_ARRAY_BUFFER, sizeof(data), data, GL_STATIC_DRAW); glEnableVertexAttribArray(0); - glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast(0)); + glVertexAttribPointer( + 0, + 2, + GL_FLOAT, + GL_FALSE, + sizeof(VertexData), + reinterpret_cast(0) + ); glEnableVertexAttribArray(1); - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast(sizeof(GLfloat) * 4)); + glVertexAttribPointer( + 1, + 2, + GL_FLOAT, + GL_FALSE, + sizeof(VertexData), + reinterpret_cast(offsetof(VertexData, s)) + ); } } // namespace openspace diff --git a/modules/base/rendering/renderablerings.h b/modules/base/rendering/renderablerings.h index 1836404e71..75aa28a8c8 100644 --- a/modules/base/rendering/renderablerings.h +++ b/modules/base/rendering/renderablerings.h @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -54,12 +55,14 @@ public: void render(const RenderData& data) override; void update(const UpdateData& data) override; + static openspace::Documentation Documentation(); + private: void loadTexture(); void createPlane(); properties::StringProperty _texturePath; - properties::Vec2Property _size; + properties::FloatProperty _size; properties::Vec2Property _offset; properties::FloatProperty _nightFactor; properties::FloatProperty _transparency; @@ -72,14 +75,8 @@ private: GLuint _quad; GLuint _vertexPositionBuffer; bool _planeIsDirty; - - std::string _frame; - glm::mat3 _orientation; - glm::mat3 _state; - - std::string _body; + glm::vec3 _sunPosition; - bool _hasSunPosition; }; } // namespace openspace diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index 557831bd43..fb619e8255 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -22,7 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ - #include #include @@ -122,7 +121,7 @@ bool RenderableSphere::initialize() { RenderEngine& renderEngine = OsEng.renderEngine(); _shader = renderEngine.buildRenderProgram("Sphere", "${MODULE_BASE}/shaders/sphere_vs.glsl", - "${MODULES}/base/shaders/sphere_fs.glsl"); + "${MODULE_BASE}/shaders/sphere_fs.glsl"); if (!_shader) return false; diff --git a/modules/base/rendering/renderablestars.cpp b/modules/base/rendering/renderablestars.cpp index addbbe2a9b..73a6d2dec4 100644 --- a/modules/base/rendering/renderablestars.cpp +++ b/modules/base/rendering/renderablestars.cpp @@ -205,6 +205,7 @@ void RenderableStars::render(const RenderData& data) { _program->setUniform("alphaValue", _alphaValue); _program->setUniform("scaleFactor", _scaleFactor); _program->setUniform("minBillboardSize", _minBillboardSize); + _program->setUniform("screenSize", glm::vec2(OsEng.renderEngine().renderingResolution())); setPscUniforms(*_program.get(), data.camera, data.position); _program->setUniform("scaling", scaling); diff --git a/modules/base/rotation/spicerotation.cpp b/modules/base/rotation/spicerotation.cpp index 709292554d..d671f76d6c 100644 --- a/modules/base/rotation/spicerotation.cpp +++ b/modules/base/rotation/spicerotation.cpp @@ -24,6 +24,8 @@ #include +#include + #include #include @@ -38,56 +40,93 @@ namespace { namespace openspace { -SpiceRotation::SpiceRotation(const ghoul::Dictionary& dictionary) - : _sourceFrame("") - , _destinationFrame("") - , _rotationMatrix(1.0) - , _kernelsLoadedSuccessfully(true) -{ - const bool hasSourceFrame = dictionary.getValue(KeySourceFrame, _sourceFrame); - if (!hasSourceFrame) - LERROR("SpiceRotation does not contain the key '" << KeySourceFrame << "'"); - - const bool hasDestinationFrame = dictionary.getValue(KeyDestinationFrame, _destinationFrame); - if (!hasDestinationFrame) - LERROR("SpiceRotation does not contain the key '" << KeyDestinationFrame << "'"); - - ghoul::Dictionary kernels; - dictionary.getValue(KeyKernels, kernels); - for (size_t i = 1; i <= kernels.size(); ++i) { - std::string kernel; - bool success = kernels.getValue(std::to_string(i), kernel); - if (!success) - LERROR("'" << KeyKernels << "' has to be an array-style table"); - - try { - SpiceManager::ref().loadKernel(kernel); - _kernelsLoadedSuccessfully = true; +Documentation SpiceRotation::Documentation() { + using namespace openspace::documentation; + return { + "Spice Rotation", + "base_transform_rotation_spice", + { + { + "Type", + new StringEqualVerifier("SpiceRotation"), + "", + Optional::No + }, + { + KeySourceFrame, + new StringAnnotationVerifier("A valid SPICE NAIF name or integer"), + "The source frame that is used as the basis for the coordinate " + "transformation. This has to be a valid SPICE name.", + Optional::No + }, + { + KeyDestinationFrame, + new StringAnnotationVerifier("A valid SPICE NAIF name or integer"), + "The destination frame that is used for the coordinate transformation. " + "This has to be a valid SPICE name.", + Optional::No + }, + { + KeyKernels, + new OrVerifier( + new TableVerifier({ + { "*", new StringVerifier } + }), + new StringVerifier + ), + "A single kernel or list of kernels that this SpiceTranslation depends " + "on. All provided kernels will be loaded before any other operation is " + "performed.", + Optional::Yes + } } - catch (const SpiceManager::SpiceException& e) { - LERROR("Could not load SPICE kernel: " << e.what()); - _kernelsLoadedSuccessfully = false; + }; +} + +SpiceRotation::SpiceRotation(const ghoul::Dictionary& dictionary) + : _sourceFrame("source", "Source", "") + , _destinationFrame("destination", "Destination", "") +{ + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "SpiceRotation" + ); + + _sourceFrame = dictionary.value(KeySourceFrame); + _destinationFrame = dictionary.value(KeyDestinationFrame); + + if (dictionary.hasKeyAndValue(KeyKernels)) { + SpiceManager::ref().loadKernel(dictionary.value(KeyKernels)); + } + else if (dictionary.hasKeyAndValue(KeyKernels)) { + ghoul::Dictionary kernels = dictionary.value(KeyKernels); + for (size_t i = 1; i <= kernels.size(); ++i) { + if (!kernels.hasKeyAndValue(std::to_string(i))) { + throw ghoul::RuntimeError("Kernels has to be an array-style table"); + } + + std::string kernel = kernels.value(std::to_string(i)); + SpiceManager::ref().loadKernel(kernel); } } + + addProperty(_sourceFrame); + addProperty(_destinationFrame); } -const glm::dmat3& SpiceRotation::matrix() const { - return _rotationMatrix; -} - void SpiceRotation::update(const UpdateData& data) { - if (!_kernelsLoadedSuccessfully) - return; try { - _rotationMatrix = SpiceManager::ref().positionTransformMatrix( + _matrix = SpiceManager::ref().positionTransformMatrix( _sourceFrame, _destinationFrame, - data.time); + data.time + ); } catch (const ghoul::RuntimeError&) { // In case of missing coverage - _rotationMatrix = glm::dmat3(1); + _matrix = glm::dmat3(1); } } -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/modules/base/rotation/spicerotation.h b/modules/base/rotation/spicerotation.h index 034ff7fece..4c3cecf729 100644 --- a/modules/base/rotation/spicerotation.h +++ b/modules/base/rotation/spicerotation.h @@ -26,20 +26,22 @@ #define __SPICEROTATION_H__ #include +#include +#include namespace openspace { class SpiceRotation : public Rotation { public: SpiceRotation(const ghoul::Dictionary& dictionary); - virtual const glm::dmat3& matrix() const; + const glm::dmat3& matrix() const; void update(const UpdateData& data) override; + static openspace::Documentation Documentation(); + private: - std::string _sourceFrame; - std::string _destinationFrame; - glm::dmat3 _rotationMatrix; - bool _kernelsLoadedSuccessfully; + properties::StringProperty _sourceFrame; + properties::StringProperty _destinationFrame; }; } // namespace openspace diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index a009fa571e..85e528060b 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -24,29 +24,67 @@ #include +#include + namespace { - const std::string KeyEulerAngles = "EulerAngles"; + const std::string KeyRotation = "Rotation"; } namespace openspace { +Documentation StaticRotation::Documentation() { + using namespace openspace::documentation; + return { + "Static Rotation", + "base_transform_rotation_static", + { + { + "Type", + new StringEqualVerifier("StaticRotation"), + "", + Optional::No + }, + { + KeyRotation, + new OrVerifier( + new DoubleVector3Verifier(), + new DoubleMatrix3Verifier() + ), + "Stores the static rotation as either a vector containing Euler angles " + "or by specifiying the 3x3 rotation matrix directly", + Optional::No + } + }, + Exhaustive::Yes + }; +} + +StaticRotation::StaticRotation() + : _rotationMatrix("rotation", "Rotation", glm::dmat3(1.0)) +{} + StaticRotation::StaticRotation(const ghoul::Dictionary& dictionary) - : _rotationMatrix(1.0) + : StaticRotation() { - const bool hasEulerAngles = dictionary.hasKeyAndValue(KeyEulerAngles); - if (hasEulerAngles) { - glm::dvec3 tmp; - dictionary.getValue(KeyEulerAngles, tmp); - _rotationMatrix = glm::mat3_cast(glm::dquat(tmp)); + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "StaticRotation" + ); + + + if (dictionary.hasKeyAndValue(KeyRotation)) { + _rotationMatrix = glm::mat3_cast( + glm::dquat(dictionary.value(KeyRotation)) + ); } + else { + // Must be glm::dmat3 due to specification restriction + _rotationMatrix = dictionary.value(KeyRotation); + } + + addProperty(_rotationMatrix); + _rotationMatrix.onChange([this]() { _matrix = _rotationMatrix; }); } -StaticRotation::~StaticRotation() {} - -const glm::dmat3& StaticRotation::matrix() const { - return _rotationMatrix; -} - -void StaticRotation::update(const UpdateData&) {} - -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/modules/base/rotation/staticrotation.h b/modules/base/rotation/staticrotation.h index 4474081057..8df5c8637e 100644 --- a/modules/base/rotation/staticrotation.h +++ b/modules/base/rotation/staticrotation.h @@ -27,17 +27,20 @@ #include +#include +#include + namespace openspace { -class StaticRotation: public Rotation { +class StaticRotation : public Rotation { public: - StaticRotation(const ghoul::Dictionary& dictionary - = ghoul::Dictionary()); - virtual ~StaticRotation(); - virtual const glm::dmat3& matrix() const; - virtual void update(const UpdateData& data) override; + StaticRotation(); + StaticRotation(const ghoul::Dictionary& dictionary); + + static openspace::Documentation Documentation(); + private: - glm::dmat3 _rotationMatrix; + properties::DMat3Property _rotationMatrix; }; } // namespace openspace diff --git a/modules/base/shaders/nighttexture_fs.glsl b/modules/base/shaders/nighttexture_fs.glsl index dd527d5537..94175a9f7b 100644 --- a/modules/base/shaders/nighttexture_fs.glsl +++ b/modules/base/shaders/nighttexture_fs.glsl @@ -45,8 +45,6 @@ in vec4 test; #include "fragment.glsl" Fragment getFragment() { - vec4 position = vs_position; - float depth = pscDepth(position); vec4 diffuse = texture(texture1, vs_st); vec4 diffuse2 = texture(nightTex, vs_st); @@ -76,7 +74,7 @@ Fragment getFragment() { diffuse[3] = transparency; frag.color = diffuse; - frag.depth = depth; + frag.depth = vs_position.w; return frag; } diff --git a/modules/base/shaders/nighttexture_vs.glsl b/modules/base/shaders/nighttexture_vs.glsl index e278611ebb..8056fd63ad 100644 --- a/modules/base/shaders/nighttexture_vs.glsl +++ b/modules/base/shaders/nighttexture_vs.glsl @@ -36,27 +36,23 @@ out vec2 vs_st; out vec4 vs_normal; out vec4 vs_position; -uniform mat4 ViewProjection; uniform mat4 ModelTransform; +uniform mat4 modelViewProjectionTransform; uniform sampler2D heightTex; uniform bool _hasHeightMap; uniform float _heightExaggeration; - -void main() -{ +void main() { // set variables vs_st = in_st; - vs_position = in_position; vec4 tmp = in_position; // this is wrong for the normal. The normal transform is the transposed inverse of the model transform vs_normal = normalize(ModelTransform * vec4(in_normal,0)); // vs_normal = vec4(in_normal, 0.0); - vec4 position = pscTransform(tmp, ModelTransform); - vs_position = tmp; + vec4 position = vec4(tmp.xyz * pow(10, tmp. w), 1.0); if (_hasHeightMap) { float height = texture(heightTex, in_st).r; @@ -64,8 +60,9 @@ void main() float displacementFactor = height * _heightExaggeration; position.xyz = position.xyz + displacementDirection * displacementFactor; } -// - position = ViewProjection * position; + + position = modelViewProjectionTransform * position; + vs_position = z_normalization(position); - gl_Position = z_normalization(position); + gl_Position = vs_position; } \ No newline at end of file diff --git a/modules/base/shaders/renderableplanet_fs.glsl b/modules/base/shaders/renderableplanet_fs.glsl new file mode 100644 index 0000000000..f275091d76 --- /dev/null +++ b/modules/base/shaders/renderableplanet_fs.glsl @@ -0,0 +1,82 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +uniform vec4 campos; +uniform vec4 objpos; +//uniform vec3 camdir; // add this for specular + +uniform vec3 sun_pos; + +uniform bool _performShading = true; +uniform float transparency; +uniform int shadows; + +uniform float time; +uniform sampler2D texture1; + +in vec2 vs_st; +in vec4 vs_normal; +in vec4 vs_position; + +#include "fragment.glsl" +#include "PowerScaling/powerScaling_fs.hglsl" + +//#include "PowerScaling/powerScaling_vs.hglsl" +Fragment getFragment() { + vec4 diffuse = texture(texture1, vs_st); + + Fragment frag; + if (_performShading) { + // directional lighting + vec3 origin = vec3(0.0); + vec4 spec = vec4(0.0); + + vec3 n = normalize(vs_normal.xyz); + //vec3 e = normalize(camdir); + vec3 l_pos = vec3(sun_pos); // sun. + vec3 l_dir = normalize(l_pos-objpos.xyz); + float intensity = min(max(5*dot(n,l_dir), 0.0), 1); + + float shine = 0.0001; + + vec4 specular = vec4(0.5); + vec4 ambient = vec4(0.0,0.0,0.0,transparency); + /* + if(intensity > 0.f){ + // halfway vector + vec3 h = normalize(l_dir + e); + // specular factor + float intSpec = max(dot(h,n),0.0); + spec = specular * pow(intSpec, shine); + } + */ + diffuse = max(intensity * diffuse, ambient); + } + + diffuse[3] = transparency; + frag.color = diffuse; + frag.depth = vs_position.w; + + return frag; +} diff --git a/modules/base/shaders/renderableplanet_vs.glsl b/modules/base/shaders/renderableplanet_vs.glsl new file mode 100644 index 0000000000..e726d0149a --- /dev/null +++ b/modules/base/shaders/renderableplanet_vs.glsl @@ -0,0 +1,58 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#version __CONTEXT__ + +uniform mat4 ModelTransform; +uniform mat4 modelViewProjectionTransform; + +layout(location = 0) in vec4 in_position; +//in vec3 in_position; +layout(location = 1) in vec2 in_st; +layout(location = 2) in vec3 in_normal; + +out vec2 vs_st; +out vec4 vs_normal; +out vec4 vs_position; +out float s; + +#include "PowerScaling/powerScaling_vs.hglsl" + +void main() { + // set variables + vs_st = in_st; + vec4 tmp = in_position; + + // this is wrong for the normal. The normal transform is the transposed inverse of the model transform + vs_normal = normalize(ModelTransform * vec4(in_normal,0)); + // vs_normal = vec4(in_normal, 0.0); + + vec4 position = vec4(tmp.xyz * pow(10, tmp.w), 1.0); + position = modelViewProjectionTransform * position; + + vs_position = z_normalization(position); + + + gl_Position = vs_position; +} \ No newline at end of file diff --git a/modules/base/shaders/rings_fs.glsl b/modules/base/shaders/rings_fs.glsl index 8a7c237de3..6de4b8503f 100644 --- a/modules/base/shaders/rings_fs.glsl +++ b/modules/base/shaders/rings_fs.glsl @@ -37,9 +37,6 @@ uniform vec3 sunPosition; uniform float _nightFactor; Fragment getFragment() { - vec4 position = vs_position; - float depth = pscDepth(position); - // Moving the origin to the center vec2 st = (vs_st - vec2(0.5)) * 2.0; @@ -66,28 +63,26 @@ Fragment getFragment() { diffuse.a = pow(colorValue / (3*transparency), 1); } - if (hasSunPosition) { - // The normal for the one plane depends on whether we are dealing - // with a front facing or back facing fragment - vec3 normal; - // The plane is oriented on the xz plane - // WARNING: This might not be the case for Uranus - if (gl_FrontFacing) { - normal = vec3(-1.0, 0.0, 0.0); - } - else { - normal = vec3(1.0, 0.0, 0.0); - } - - // Reduce the color of the fragment by the user factor - // if we are facing away from the Sun - if (dot(sunPosition, normal) < 0) - diffuse.xyz *= _nightFactor; + // The normal for the one plane depends on whether we are dealing + // with a front facing or back facing fragment + vec3 normal; + // The plane is oriented on the xz plane + // WARNING: This might not be the case for Uranus + if (gl_FrontFacing) { + normal = vec3(-1.0, 0.0, 0.0); } + else { + normal = vec3(1.0, 0.0, 0.0); + } + + // Reduce the color of the fragment by the user factor + // if we are facing away from the Sun + if (dot(sunPosition, normal) < 0) + diffuse.xyz *= _nightFactor; Fragment frag; frag.color = diffuse; - frag.depth = depth; + frag.depth = vs_position.w; return frag; } diff --git a/modules/base/shaders/rings_vs.glsl b/modules/base/shaders/rings_vs.glsl index b1299f30ce..86ecefef8e 100644 --- a/modules/base/shaders/rings_vs.glsl +++ b/modules/base/shaders/rings_vs.glsl @@ -26,22 +26,30 @@ #include "PowerScaling/powerScaling_vs.hglsl" -layout(location = 0) in vec4 in_position; +layout(location = 0) in vec2 in_position; layout(location = 1) in vec2 in_st; out vec2 vs_st; out vec4 vs_position; -uniform mat4 ViewProjection; -uniform mat4 ModelTransform; +uniform mat4 modelViewProjectionTransform; void main() { - vec4 tmp = in_position; - vec4 position = pscTransform(tmp, ModelTransform); - - vs_position = tmp; vs_st = in_st; + + vs_position = z_normalization( + modelViewProjectionTransform * vec4(in_position.xy, 0.0, 1.0) + ); + gl_Position = vs_position; + + // vec4 tmp = in_position; + + + // vec4 tmp = in_position; + // vec4 position = pscTransform(tmp, ModelTransform); + + // vs_position = tmp; - position = ViewProjection * position; - gl_Position = z_normalization(position); + // position = ViewProjection * position; + // gl_Position = z_normalization(position); } diff --git a/modules/base/shaders/star_ge.glsl b/modules/base/shaders/star_ge.glsl index 09af7ddecf..0315797b0a 100644 --- a/modules/base/shaders/star_ge.glsl +++ b/modules/base/shaders/star_ge.glsl @@ -53,6 +53,7 @@ uniform mat4 projection; uniform float scaleFactor; uniform float minBillboardSize; +uniform vec2 screenSize; void main() { if ((psc_position[0].x == 0.0) && (psc_position[0].y == 0.0) && (psc_position[0].z == 0.0)) @@ -75,7 +76,6 @@ void main() { // Calculate the positions of the lower left and upper right corners of the // billboard in screen-space - const vec2 screenSize = vec2(#{rendererData.windowWidth}, #{rendererData.windowHeight}); vec2 ll = (((projPos[1].xy / projPos[1].w) + 1) / 2) * screenSize; vec2 ur = (((projPos[2].xy / projPos[2].w) + 1) / 2) * screenSize; diff --git a/modules/base/translation/spicetranslation.cpp b/modules/base/translation/spicetranslation.cpp index dbb6060933..2fd3942c2a 100644 --- a/modules/base/translation/spicetranslation.cpp +++ b/modules/base/translation/spicetranslation.cpp @@ -130,6 +130,9 @@ SpiceTranslation::SpiceTranslation(const ghoul::Dictionary& dictionary) } } } + + addProperty(_target); + addProperty(_origin); } glm::dvec3 SpiceTranslation::position() const { diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index 6021edb8be..907d1e0ffd 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -114,7 +114,9 @@ namespace openspace { // Check for errors GLenum error = glGetError(); if (error != GL_NO_ERROR) { - LERROR(error); + // Commenting this line. It causes errors to be printed. However + // the errors are not caused by DebugRenderer!! + //LERROR(error); } // Clean up after the draw call was made diff --git a/modules/globebrowsing/chunk/chunk.cpp b/modules/globebrowsing/chunk/chunk.cpp index 2ad10454a7..741f66611e 100644 --- a/modules/globebrowsing/chunk/chunk.cpp +++ b/modules/globebrowsing/chunk/chunk.cpp @@ -30,7 +30,10 @@ #include #include #include +#include #include +#include + #include diff --git a/modules/globebrowsing/chunk/culling.cpp b/modules/globebrowsing/chunk/culling.cpp index 77b30b3eae..f7c9541a0e 100644 --- a/modules/globebrowsing/chunk/culling.cpp +++ b/modules/globebrowsing/chunk/culling.cpp @@ -68,9 +68,9 @@ namespace globebrowsing { dvec4 cornerClippingSpace = modelViewProjectionTransform * corners[i]; clippingSpaceCorners[i] = cornerClippingSpace; - dvec3 cornerScreenSpace = + dvec3 cornerNDC = (1.0f / glm::abs(cornerClippingSpace.w)) * cornerClippingSpace; - bounds.expand(cornerScreenSpace); + bounds.expand(cornerNDC); } return !_viewFrustum.intersects(bounds); diff --git a/modules/globebrowsing/chunk/culling.h b/modules/globebrowsing/chunk/culling.h index 8f329ef128..2ab121c866 100644 --- a/modules/globebrowsing/chunk/culling.h +++ b/modules/globebrowsing/chunk/culling.h @@ -65,8 +65,8 @@ namespace globebrowsing { class FrustumCuller : public ChunkCuller { public: /** - * \param viewFrustum is the view space in screen space. Hence it is an axis - * aligned bounding box and not a real frustum. + * \param viewFrustum is the view space in normalized device coordinates space. + Hence it is an axis aligned bounding box and not a real frustum. */ FrustumCuller(const AABB3 viewFrustum); ~FrustumCuller(); diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp index 5541e675f2..d4776092bd 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.cpp +++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp @@ -22,8 +22,10 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ + #include +#include #include #include #include @@ -42,6 +44,18 @@ // ghoul includes #include +#include + +// open space includes +#include +#include +#include + +#include +#include + + + #define _USE_MATH_DEFINES #include diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index 536c9b97ef..c62d397ba8 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -25,26 +25,23 @@ #ifndef __CHUNKED_LOD_GLOBE__ #define __CHUNKED_LOD_GLOBE__ -#include - -#include - -// open space includes -#include #include -#include -#include #include -#include -#include -#include +#include #include +#include + namespace openspace { namespace globebrowsing { + class Chunk; + class ChunkCuller; class ChunkLevelEvaluator; + class ChunkNode; + class ChunkRenderer; + class LayerManager; class RenderableGlobe; class ChunkedLodGlobe : public Renderable { diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index 94e6a2f04e..6336818f2e 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -24,7 +24,12 @@ // globe browsing #include + #include + +#include + +#include #include // open space includes diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h index 37beaa3496..ed66466d1b 100644 --- a/modules/globebrowsing/globes/renderableglobe.h +++ b/modules/globebrowsing/globes/renderableglobe.h @@ -35,10 +35,8 @@ #include #include -#include -#include -#include #include +#include #include #include diff --git a/modules/globebrowsing/rendering/gpulayermanager.h b/modules/globebrowsing/rendering/gpulayermanager.h index 411a2b7512..f4278f97cf 100644 --- a/modules/globebrowsing/rendering/gpulayermanager.h +++ b/modules/globebrowsing/rendering/gpulayermanager.h @@ -124,7 +124,7 @@ public: private: GPUTexture gpuTexture; - GPUTileUvTransform gpuTileUvTransform; + GPUTileUvTransform gpuTileUvTransform; }; /** @@ -192,7 +192,7 @@ class Layer; /** * Manages a GPU representation of a Layer */ -class GPULayer { +class GPULayer { public: /** @@ -227,7 +227,7 @@ private: * Manages a GPU representation of a Layer representing * a height map. */ -class GPUHeightLayer : public GPULayer{ +class GPUHeightLayer : public GPULayer { public: /** diff --git a/modules/globebrowsing/rendering/layermanager.cpp b/modules/globebrowsing/rendering/layermanager.cpp index 33a227aad2..80fff54721 100644 --- a/modules/globebrowsing/rendering/layermanager.cpp +++ b/modules/globebrowsing/rendering/layermanager.cpp @@ -26,6 +26,9 @@ #include #include +#include +#include + #include diff --git a/modules/globebrowsing/rendering/layermanager.h b/modules/globebrowsing/rendering/layermanager.h index 252a293d03..c909ba444f 100644 --- a/modules/globebrowsing/rendering/layermanager.h +++ b/modules/globebrowsing/rendering/layermanager.h @@ -22,15 +22,10 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __LAYER_MANAGER_H__ -#define __LAYER_MANAGER_H__ +#ifndef __LAYERMANAGER_H__ +#define __LAYERMANAGER_H__ -#include #include -#include - -#include -#include #include #include @@ -43,6 +38,8 @@ namespace openspace { namespace globebrowsing { + class TileProvider; + struct LayerRenderSettings : public properties::PropertyOwner{ LayerRenderSettings(); properties::FloatProperty opacity; @@ -62,7 +59,7 @@ namespace globebrowsing { ChunkTilePile getChunkTilePile(const TileIndex& tileIndex, int pileSize) const; - bool enabled() const { return _enabled.value(); } + bool enabled() const { return _enabled.value(); } TileProvider* tileProvider() const { return _tileProvider.get(); } const LayerRenderSettings& renderSettings() const { return _renderSettings; } @@ -137,4 +134,4 @@ namespace globebrowsing { } // namespace globebrowsing } // namespace openspace -#endif // __LAYER_MANAGER_H__ +#endif // __LAYERMANAGER_H__ diff --git a/modules/globebrowsing/tile/tile.h b/modules/globebrowsing/tile/tile.h index 8baefbf8af..21c0cc5ece 100644 --- a/modules/globebrowsing/tile/tile.h +++ b/modules/globebrowsing/tile/tile.h @@ -28,6 +28,9 @@ #include // Texture #include + +#include + #include namespace openspace { diff --git a/modules/globebrowsing/tile/tileselector.cpp b/modules/globebrowsing/tile/tileselector.cpp index a21722d40b..05d206aab7 100644 --- a/modules/globebrowsing/tile/tileselector.cpp +++ b/modules/globebrowsing/tile/tileselector.cpp @@ -119,7 +119,7 @@ namespace globebrowsing { std::vector TileSelector::getTilesSortedByHighestResolution(const LayerGroup& layerGroup, const TileIndex& tileIndex) { std::vector tiles; - for (const auto& layer : layerGroup.activeLayers()){ + for (const auto& layer : layerGroup.activeLayers()) { tiles.push_back(getHighestResolutionTile(layer->tileProvider(), tileIndex)); } diff --git a/modules/globebrowsing/tile/tileselector.h b/modules/globebrowsing/tile/tileselector.h index 0d5f438070..d36fde2b89 100644 --- a/modules/globebrowsing/tile/tileselector.h +++ b/modules/globebrowsing/tile/tileselector.h @@ -25,25 +25,29 @@ #ifndef __TILE_SELECTOR_H__ #define __TILE_SELECTOR_H__ +#include #include #include -#include -#include + #include namespace openspace { namespace globebrowsing { - class LayerGroup; + //struct LayerGroup; + class TileProvider; class TileSelector { public: static ChunkTile getHighestResolutionTile(TileProvider* tileProvider, TileIndex tileIndex, int parents = 0); - static ChunkTile getHighestResolutionTile(const LayerGroup& layerGroup, TileIndex tileIndex); + static ChunkTile getHighestResolutionTile( + const LayerGroup& layerGroup, + TileIndex tileIndex + ); static ChunkTilePile getHighestResolutionTilePile(TileProvider* tileProvider, TileIndex tileIndex, int pileSize); - static std::vector getTilesSortedByHighestResolution(const LayerGroup&, const TileIndex& tileIndex); + static std::vector getTilesSortedByHighestResolution(const LayerGroup& layerGroup, const TileIndex& tileIndex); struct CompareResolution { bool operator() (const ChunkTile& a, const ChunkTile& b); diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp index 53610bf633..005062a21a 100644 --- a/modules/iswa/rendering/iswacygnet.cpp +++ b/modules/iswa/rendering/iswacygnet.cpp @@ -107,7 +107,10 @@ bool IswaCygnet::initialize(){ }else{ _delete.onChange([this](){ deinitialize(); - OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + name() + "')"); + OsEng.scriptEngine().queueScript( + "openspace.removeSceneGraphNode('" + name() + "')", + scripting::ScriptEngine::RemoteScripting::Yes + ); }); } @@ -260,7 +263,10 @@ void IswaCygnet::initializeGroup(){ groupEvent->subscribe(name(), "clearGroup", [&](ghoul::Dictionary dict){ LDEBUG(name() + " Event clearGroup"); - OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + name() + "')"); + OsEng.scriptEngine().queueScript( + "openspace.removeSceneGraphNode('" + name() + "')", + scripting::ScriptEngine::RemoteScripting::Yes + ); }); } diff --git a/modules/iswa/rendering/iswadatagroup.h b/modules/iswa/rendering/iswadatagroup.h index d08b16506a..83d259a562 100644 --- a/modules/iswa/rendering/iswadatagroup.h +++ b/modules/iswa/rendering/iswadatagroup.h @@ -1,32 +1,37 @@ /***************************************************************************************** -* * -* OpenSpace * -* * -* Copyright (c) 2014-2015 * -* * -* Permission is hereby granted, free of charge, to any person obtaining a copy of this * -* software and associated documentation files (the "Software"), to deal in the Software * -* without restriction, including without limitation the rights to use, copy, modify, * -* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * -* permit persons to whom the Software is furnished to do so, subject to the following * -* conditions: * -* * -* The above copyright notice and this permission notice shall be included in all copies * -* or substantial portions of the Software. * -* * -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * -* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * -* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * -* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * -* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * -* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -****************************************************************************************/ + * * + * OpenSpace * + * * + * Copyright (c) 2014-2015 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + #ifndef __ISWADATAGROUP_H__ #define __ISWADATAGROUP_H__ + #include -namespace openspace{ -class IswaDataGroup : public IswaBaseGroup{ +#include + +namespace openspace { + +class IswaDataGroup : public IswaBaseGroup { public: IswaDataGroup(std::string name, std::string type); ~IswaDataGroup(); diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index 4273f8330e..c48b5a36b7 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -130,7 +130,10 @@ void IswaKameleonGroup::updateFieldlineSeeds(){ // if this option was turned off if( std::find(selectedOptions.begin(), selectedOptions.end(), seedPath.first)==selectedOptions.end() && std::get<2>(seedPath.second)){ LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second)); - OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')"); + OsEng.scriptEngine().queueScript( + "openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')", + scripting::ScriptEngine::RemoteScripting::Yes + ); std::get<2>(seedPath.second) = false; // if this option was turned on } else if( std::find(selectedOptions.begin(), selectedOptions.end(), seedPath.first)!=selectedOptions.end() && !std::get<2>(seedPath.second)) { @@ -146,7 +149,10 @@ void IswaKameleonGroup::clearFieldlines(){ for (auto& seedPath: _fieldlineState) { if(std::get<2>(seedPath.second)){ LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second)); - OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')"); + OsEng.scriptEngine().queueScript( + "openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')", + scripting::ScriptEngine::RemoteScripting::Yes + ); std::get<2>(seedPath.second) = false; } } diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index 9a5dab1125..b316147738 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -232,7 +232,10 @@ void KameleonPlane::updateFieldlineSeeds(){ if(OsEng.renderEngine().scene()->sceneGraphNode(std::get<0>(seedPath.second)) == nullptr) return; LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second)); - OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')"); + OsEng.scriptEngine().queueScript( + "openspace.removeSceneGraphNode('" + std::get<0>(seedPath.second) + "')", + scripting::ScriptEngine::RemoteScripting::Yes + ); std::get<2>(seedPath.second) = false; // if this option was turned on } else if( std::find(selectedOptions.begin(), selectedOptions.end(), seedPath.first)!=selectedOptions.end() && !std::get<2>(seedPath.second)) { diff --git a/modules/iswa/rendering/screenspacecygnet.cpp b/modules/iswa/rendering/screenspacecygnet.cpp index 73eb771e28..32c2c340a0 100644 --- a/modules/iswa/rendering/screenspacecygnet.cpp +++ b/modules/iswa/rendering/screenspacecygnet.cpp @@ -59,7 +59,8 @@ ScreenSpaceCygnet::ScreenSpaceCygnet(const ghoul::Dictionary& dictionary) _delete.onChange([this](){ OsEng.scriptEngine().queueScript( - "openspace.iswa.removeScreenSpaceCygnet("+std::to_string(_cygnetId)+");" + "openspace.iswa.removeScreenSpaceCygnet("+std::to_string(_cygnetId)+");", + scripting::ScriptEngine::RemoteScripting::Yes ); }); // IswaManager::ref().deleteIswaCygnet(name());}); diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index bad0b41bf7..63976748ca 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -439,7 +439,10 @@ std::string IswaManager::jsonSphereToLuaTable(std::shared_ptr da void IswaManager::createScreenSpace(int id){ std::string script = "openspace.iswa.addScreenSpaceCygnet(" "{CygnetId =" + std::to_string(id) + "});"; - OsEng.scriptEngine().queueScript(script); + OsEng.scriptEngine().queueScript( + script, + scripting::ScriptEngine::RemoteScripting::Yes + ); } void IswaManager::createPlane(std::shared_ptr data){ @@ -475,7 +478,10 @@ void IswaManager::createPlane(std::shared_ptr data){ std::string luaTable = jsonPlaneToLuaTable(data); if(luaTable != ""){ std::string script = "openspace.addSceneGraphNode(" + luaTable + ");"; - OsEng.scriptEngine().queueScript(script); + OsEng.scriptEngine().queueScript( + script, + scripting::ScriptEngine::RemoteScripting::Yes + ); } } @@ -504,7 +510,10 @@ void IswaManager::createSphere(std::shared_ptr data){ std::string luaTable = jsonSphereToLuaTable(data); if(luaTable != ""){ std::string script = "openspace.addSceneGraphNode(" + luaTable + ");"; - OsEng.scriptEngine().queueScript(script); + OsEng.scriptEngine().queueScript( + script, + scripting::ScriptEngine::RemoteScripting::Yes + ); } } @@ -536,7 +545,10 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut){ std::string luaTable = parseKWToLuaTable(info, cut); if(!luaTable.empty()){ std::string script = "openspace.addSceneGraphNode(" + luaTable + ");"; - OsEng.scriptEngine().queueScript(script); + OsEng.scriptEngine().queueScript( + script, + scripting::ScriptEngine::RemoteScripting::Yes + ); } }else{ LWARNING( absPath(info.path) + " is not a cdf file or can't be found."); @@ -570,7 +582,10 @@ void IswaManager::createFieldline(std::string name, std::string cdfPath, std::st "}"; if(!luaTable.empty()){ std::string script = "openspace.addSceneGraphNode(" + luaTable + ");"; - OsEng.scriptEngine().queueScript(script); + OsEng.scriptEngine().queueScript( + script, + scripting::ScriptEngine::RemoteScripting::Yes + ); } }else{ LWARNING( cdfPath + " is not a cdf file or can't be found."); @@ -661,21 +676,18 @@ scripting::LuaLibrary IswaManager::luaLibrary() { &luascriptfunctions::iswa_addCygnet, "int, string, string", "Adds a IswaCygnet", - true }, { "addScreenSpaceCygnet", &luascriptfunctions::iswa_addScreenSpaceCygnet, "int, string, string", "Adds a Screen Space Cygnets", - true }, { "addKameleonPlanes", &luascriptfunctions::iswa_addKameleonPlanes, "string, int", "Adds KameleonPlanes from cdf file.", - true }, // { // "addKameleonPlane", @@ -689,35 +701,30 @@ scripting::LuaLibrary IswaManager::luaLibrary() { &luascriptfunctions::iswa_addCdfFiles, "string", "Adds a cdf files to choose from.", - true }, { "removeCygnet", &luascriptfunctions::iswa_removeCygnet, "string", "Remove a Cygnets", - true }, { "removeScreenSpaceCygnet", &luascriptfunctions::iswa_removeScrenSpaceCygnet, "int", "Remove a Screen Space Cygnets", - true }, { "removeGroup", &luascriptfunctions::iswa_removeGroup, "int", "Remove a group of Cygnets", - true }, { "setBaseUrl", &luascriptfunctions::iswa_setBaseUrl, "string", "sets the base url", - true } } }; diff --git a/modules/iswa/util/iswamanager_lua.inl b/modules/iswa/util/iswamanager_lua.inl index 703a053ba0..1a704b8aee 100644 --- a/modules/iswa/util/iswamanager_lua.inl +++ b/modules/iswa/util/iswamanager_lua.inl @@ -114,7 +114,10 @@ int iswa_addScreenSpaceCygnet(lua_State* L){ int iswa_removeCygnet(lua_State* L){ std::string name = luaL_checkstring(L, -1); - OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + name + "')"); + OsEng.scriptEngine().queueScript( + "openspace.removeSceneGraphNode('" + name + "')", + scripting::ScriptEngine::RemoteScripting::Yes + ); // IswaManager::ref().deleteIswaCygnet(s); return 0; } @@ -134,7 +137,10 @@ int iswa_removeScrenSpaceCygnet(lua_State* L){ info->selected = false; std::string script = "openspace.unregisterScreenSpaceRenderable('" + cygnetInformation[id]->name + "');"; - OsEng.scriptEngine().queueScript(script); + OsEng.scriptEngine().queueScript( + script, + scripting::ScriptEngine::RemoteScripting::Yes + ); return 0; } diff --git a/modules/newhorizons/newhorizonsmodule.cpp b/modules/newhorizons/newhorizonsmodule.cpp index 72caa9b844..49e3beb07e 100644 --- a/modules/newhorizons/newhorizonsmodule.cpp +++ b/modules/newhorizons/newhorizonsmodule.cpp @@ -71,4 +71,12 @@ void NewHorizonsModule::internalInitialize() { fDecoder->registerClass("Target"); } +std::vector NewHorizonsModule::documentations() const { + return { + RenderableModelProjection::Documentation(), + RenderablePlanetProjection::Documentation(), + ProjectionComponent::Documentation() + }; +} + } // namespace openspace diff --git a/modules/newhorizons/newhorizonsmodule.h b/modules/newhorizons/newhorizonsmodule.h index e4b57eaa7a..8bd39cbce4 100644 --- a/modules/newhorizons/newhorizonsmodule.h +++ b/modules/newhorizons/newhorizonsmodule.h @@ -33,6 +33,8 @@ class NewHorizonsModule : public OpenSpaceModule { public: NewHorizonsModule(); + std::vector documentations() const override; + protected: void internalInitialize() override; }; diff --git a/modules/newhorizons/rendering/renderablecrawlingline.cpp b/modules/newhorizons/rendering/renderablecrawlingline.cpp index 4c538c180a..1c0035e086 100644 --- a/modules/newhorizons/rendering/renderablecrawlingline.cpp +++ b/modules/newhorizons/rendering/renderablecrawlingline.cpp @@ -132,7 +132,7 @@ void RenderableCrawlingLine::render(const RenderData& data) { _program->setUniform("ModelTransform", transform); int frame = _frameCounter % 60; - float fadingFactor = static_cast(sin((frame * pi_c()) / 60)); + float fadingFactor = static_cast(sin((frame * 3.14159) / 60)); float alpha = 0.6f + fadingFactor*0.4f; glLineWidth(2.f); diff --git a/modules/newhorizons/rendering/renderablefov.cpp b/modules/newhorizons/rendering/renderablefov.cpp index 878d833186..eb7d419780 100644 --- a/modules/newhorizons/rendering/renderablefov.cpp +++ b/modules/newhorizons/rendering/renderablefov.cpp @@ -46,6 +46,7 @@ namespace { const std::string keyInstrumentMethod = "Instrument.Method"; const std::string keyInstrumentAberration = "Instrument.Aberration"; const std::string keyPotentialTargets = "PotentialTargets"; + const std::string keyFrameConversions = "FrameConversions"; const int InterpolationSteps = 10; const int Stride = 8; @@ -94,6 +95,17 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) _potentialTargets[i] = target; } + ghoul::Dictionary frameConversions; + success = dictionary.getValue(keyFrameConversions, frameConversions); + if (success) { + for (const std::string& key : frameConversions.keys()) { + openspace::SpiceManager::ref().addFrame( + key, + frameConversions.value(key) + ); + } + } + addProperty(_lineWidth); addProperty(_drawSolid); } @@ -253,7 +265,7 @@ psc RenderableFov::checkForIntercept(glm::dvec3 ray) { ivec *= 0.9999;// because fov lands exactly on top of surface we need to move it out slightly _interceptVector = PowerScaledCoordinate::CreatePowerScaledCoordinate(ivec[0], ivec[1], ivec[2]); - _interceptVector[3] += 3; + //_interceptVector[3] += 3; return _interceptVector; } @@ -507,7 +519,7 @@ void RenderableFov::computeIntercepts(const RenderData& data) { if (_interceptTag[r]) { _interceptVector = PowerScaledCoordinate::CreatePowerScaledCoordinate(ivec[0], ivec[1], ivec[2]); - _interceptVector[3] += 3; + //_interceptVector[3] += 3; // INTERCEPTIONS insertPoint(_fovBounds, fovOrigin, col_start); insertPoint(_fovBounds, _interceptVector.vec4(), col_end); diff --git a/modules/newhorizons/rendering/renderablemodelprojection.cpp b/modules/newhorizons/rendering/renderablemodelprojection.cpp index 3daadde566..76dc7dd40a 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.cpp +++ b/modules/newhorizons/rendering/renderablemodelprojection.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -38,17 +39,62 @@ namespace { const std::string _loggerCat = "RenderableModelProjection"; const std::string keySource = "Rotation.Source"; const std::string keyDestination = "Rotation.Destination"; - const std::string keyBody = "Body"; const std::string keyGeometry = "Geometry"; + const std::string keyProjection = "Projection"; const std::string keyBoundingSphereRadius = "BoundingSphereRadius"; const std::string keyTextureColor = "Textures.Color"; - const std::string keyTextureProject = "Textures.Project"; - const std::string keyTextureDefault = "Textures.Default"; + + const std::string _destination = "GALACTIC"; } namespace openspace { +Documentation RenderableModelProjection::Documentation() { + using namespace documentation; + + return { + "Renderable Model Projection", + "newhorizons_renderable_modelprojection", + { + { + "Type", + new StringEqualVerifier("RenderableModelProjection"), + "", + Optional::No + }, + { + keyGeometry, + new ReferencingVerifier("base_geometry_model"), + "The geometry that is used for rendering this model.", + Optional::No + }, + { + keyProjection, + new ReferencingVerifier("newhorizons_projectioncomponent"), + "Contains information about projecting onto this planet.", + Optional::No + }, + { + keyTextureColor, + new StringVerifier, + "The base texture for the model that is shown before any projection " + "occurred.", + Optional::No + }, + { + keyBoundingSphereRadius, + new DoubleVerifier, + "The radius of the bounding sphere of this object. This has to be a " + "radius that is larger than anything that is rendered by it. It has to " + "be at least as big as the convex hull of the object. The default value " + "is 10e9 meters.", + Optional::Yes + } + } + }; +} + RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _colorTexturePath("colorTexture", "Color Texture") @@ -59,44 +105,35 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di , _geometry(nullptr) , _performShading("performShading", "Perform Shading", true) { + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "RenderableModelProjection" + ); + std::string name; bool success = dictionary.getValue(SceneGraphNode::KeyName, name); ghoul_assert(success, "Name was not passed to RenderableModelProjection"); - ghoul::Dictionary geometryDictionary; - success = dictionary.getValue(keyGeometry, geometryDictionary); - if (success) { - using modelgeometry::ModelGeometry; - geometryDictionary.setValue(SceneGraphNode::KeyName, name); - _geometry = std::unique_ptr( - ModelGeometry::createFromDictionary(geometryDictionary) - ); - } + using ghoul::Dictionary; + Dictionary geometryDictionary = dictionary.value(keyGeometry); + using modelgeometry::ModelGeometry; + geometryDictionary.setValue(SceneGraphNode::KeyName, name); + _geometry = std::unique_ptr( + ModelGeometry::createFromDictionary(geometryDictionary) + ); - std::string texturePath = ""; - success = dictionary.getValue(keyTextureColor, texturePath); - if (success) - _colorTexturePath = absPath(texturePath); + _colorTexturePath = absPath(dictionary.value(keyTextureColor)); - success = dictionary.getValue(keyTextureDefault, texturePath); - if (success) - _defaultProjImage = absPath(texturePath); - addPropertySubOwner(_geometry.get()); addPropertySubOwner(_projectionComponent); addProperty(_colorTexturePath); _colorTexturePath.onChange(std::bind(&RenderableModelProjection::loadTextures, this)); - dictionary.getValue(keySource, _source); - dictionary.getValue(keyDestination, _destination); - dictionary.getValue(keyBody, _target); - - - bool completeSuccess = true; - completeSuccess &= _projectionComponent.initializeProjectionSettings(dictionary); - - openspace::SpiceManager::ref().addFrame(_target, _source); + _projectionComponent.initialize( + dictionary.value(keyProjection) + ); float boundingSphereRadius = 1.0e9; dictionary.getValue(keyBoundingSphereRadius, boundingSphereRadius); @@ -104,9 +141,6 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di Renderable::addProperty(_performShading); Renderable::addProperty(_rotation); - - success = _projectionComponent.initializeParser(dictionary); - ghoul_assert(success, ""); } bool RenderableModelProjection::isReady() const { @@ -139,15 +173,12 @@ bool RenderableModelProjection::initialize() { completeSuccess &= loadTextures(); - completeSuccess &= _projectionComponent.initialize(); + completeSuccess &= _projectionComponent.initializeGL(); auto bs = getBoundingSphere(); completeSuccess &= _geometry->initialize(this); setBoundingSphere(bs); // ignore bounding sphere set by geometry. - completeSuccess &= !_source.empty(); - completeSuccess &= !_destination.empty(); - return completeSuccess; } @@ -246,18 +277,12 @@ void RenderableModelProjection::update(const UpdateData& data) { } } - // set spice-orientation in accordance to timestamp - if (!_source.empty()) { - _stateMatrix = SpiceManager::ref().positionTransformMatrix( - _source, _destination, _time - ); - } - - double lt; + _stateMatrix = data.modelTransform.rotation; + glm::dvec3 p = - openspace::SpiceManager::ref().targetPosition( - "SUN", _target, "GALACTIC", {}, _time, lt - ); + OsEng.renderEngine().scene()->sceneGraphNode("Sun")->worldPosition() - + data.modelTransform.translation; + _sunPosition = PowerScaledCoordinate::CreatePowerScaledCoordinate(p.x, p.y, p.z); } @@ -308,7 +333,6 @@ void RenderableModelProjection::imageProjectGPU( void RenderableModelProjection::attitudeParameters(double time) { try { - _stateMatrix = SpiceManager::ref().positionTransformMatrix(_source, _destination, time); _instrumentMatrix = SpiceManager::ref().positionTransformMatrix(_projectionComponent.instrumentId(), _destination, time); } catch (const SpiceManager::SpiceException& e) { diff --git a/modules/newhorizons/rendering/renderablemodelprojection.h b/modules/newhorizons/rendering/renderablemodelprojection.h index 1a0ef2c259..60349f5033 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.h +++ b/modules/newhorizons/rendering/renderablemodelprojection.h @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -59,6 +60,8 @@ public: ghoul::opengl::Texture& baseTexture() const; + static openspace::Documentation Documentation(); + private: bool loadTextures(); void attitudeParameters(double time); @@ -83,11 +86,6 @@ private: glm::dmat3 _stateMatrix; glm::dmat3 _instrumentMatrix; - std::string _defaultProjImage; - std::string _source; - std::string _destination; - std::string _target; - // uniforms glm::vec2 _camScaling; glm::vec3 _up; diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index 3f892aecb0..80338f7e79 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -45,16 +46,64 @@ namespace { const std::string _loggerCat = "RenderablePlanetProjection"; - const std::string keyFrame = "Frame"; const std::string keyGeometry = "Geometry"; + const std::string keyProjection = "Projection"; + const std::string keyColorTexture = "Textures.Color"; + const std::string keyHeightTexture = "Textures.Height"; + + const std::string keyRadius = "Geometry.Radius"; const std::string keyShading = "PerformShading"; - const std::string keyBody = "Body"; const std::string _mainFrame = "GALACTIC"; } namespace openspace { +Documentation RenderablePlanetProjection::Documentation() { + using namespace openspace::documentation; + return { + "Renderable Planet Projection", + "newhorizons_renderable_planetprojection", + { + { + "Type", + new StringEqualVerifier("RenderablePlanetProjection"), + "", + Optional::No + }, + { + keyGeometry, + new ReferencingVerifier("base_geometry_planet"), + "The geometry that is used for rendering this planet.", + Optional::No + }, + { + keyProjection, + new ReferencingVerifier("newhorizons_projectioncomponent"), + "Contains information about projecting onto this planet.", + Optional::No + }, + { + keyColorTexture, + new StringVerifier, + "The path to the base color texture that is used on the planet prior to " + "any image projection. The path can use tokens of the form '${...}' or " + "be specified relative to the directory of the mod file.", + Optional::No + }, + { + keyHeightTexture, + new StringVerifier, + "The path to the height map texture that is used on the planet. The path " + "can use tokens of the form '${...}' or be specified relative to the " + "directory of the mod file. If no height map is specified the planet " + "does not use a height field.", + Optional::Yes + } + } + }; +} + RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _colorTexturePath("planetTexture", "RGB Texture") @@ -68,6 +117,12 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& , _heightMapTexture(nullptr) , _capture(false) { + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "RenderablePlanetProject" + ); + std::string name; bool success = dictionary.getValue(SceneGraphNode::KeyName, name); ghoul_assert(success, ""); @@ -83,11 +138,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& ); } - dictionary.getValue(keyFrame, _frame); - dictionary.getValue(keyBody, _body); - - success = _projectionComponent.initializeProjectionSettings(dictionary); - ghoul_assert(success, ""); + _projectionComponent.initialize(dictionary.value(keyProjection)); // TODO: textures need to be replaced by a good system similar to the geometry as soon // as the requirements are fixed (ab) @@ -117,9 +168,6 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& addProperty(_heightExaggeration); addProperty(_debugProjectionTextureRotation); - - success = _projectionComponent.initializeParser(dictionary); - ghoul_assert(success, ""); } RenderablePlanetProjection::~RenderablePlanetProjection() {} @@ -138,7 +186,7 @@ bool RenderablePlanetProjection::initialize() { ); completeSuccess &= loadTextures(); - completeSuccess &= _projectionComponent.initialize(); + completeSuccess &= _projectionComponent.initializeGL(); completeSuccess &= _geometry->initialize(this); if (completeSuccess) { @@ -233,7 +281,6 @@ void RenderablePlanetProjection::imageProjectGPU( void RenderablePlanetProjection::attitudeParameters(double time) { // precomputations for shader - _stateMatrix = SpiceManager::ref().positionTransformMatrix(_frame, _mainFrame, time); _instrumentMatrix = SpiceManager::ref().positionTransformMatrix( _projectionComponent.instrumentId(), _mainFrame, time ); @@ -256,12 +303,7 @@ void RenderablePlanetProjection::attitudeParameters(double time) { glm::vec3(0, 1, 0) ); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 3; j++){ - _transform[i][j] = static_cast(_stateMatrix[i][j]); - } - } - _transform = _transform * rot * roty * rotProp; + _transform = glm::mat4(_stateMatrix) * rot * roty * rotProp; glm::dvec3 bs; try { @@ -411,6 +453,7 @@ void RenderablePlanetProjection::update(const UpdateData& data) { } } + _stateMatrix = data.modelTransform.rotation; } bool RenderablePlanetProjection::loadTextures() { diff --git a/modules/newhorizons/rendering/renderableplanetprojection.h b/modules/newhorizons/rendering/renderableplanetprojection.h index c5f2553183..6e7cac4630 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.h +++ b/modules/newhorizons/rendering/renderableplanetprojection.h @@ -26,10 +26,11 @@ #define __RENDERABLEPLANETPROJECTION_H__ #include -#include #include +#include +#include #include #include #include @@ -56,6 +57,8 @@ public: void update(const UpdateData& data) override; ghoul::opengl::Texture& baseTexture() const; + static openspace::Documentation Documentation(); + protected: bool loadTextures(); void attitudeParameters(double time); @@ -95,7 +98,6 @@ private: std::vector _imageTimes; - std::string _body; std::string _frame; bool _capture; diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index 21a36cbd61..d2e05d6dfa 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -29,12 +29,14 @@ #include #include +#include #include #include #include #include #include +#include #include namespace { @@ -44,17 +46,18 @@ namespace { const std::string keyInstrumentFovy = "Instrument.Fovy"; const std::string keyInstrumentAspect = "Instrument.Aspect"; - const std::string keyProjObserver = "Projection.Observer"; - const std::string keyProjTarget = "Projection.Target"; - const std::string keyProjAberration = "Projection.Aberration"; - - const std::string keySequenceDir = "Projection.Sequence"; - const std::string keySequenceType = "Projection.SequenceType"; const std::string keyTranslation = "DataInputTranslation"; - const std::string keyNeedsTextureMapDilation = "Projection.TextureMap"; - const std::string keyNeedsShadowing = "Projection.ShadowMap"; - const std::string keyTextureMapAspectRatio = "Projection.AspectRatio"; + const std::string keyProjObserver = "Observer"; + const std::string keyProjTarget = "Target"; + const std::string keyProjAberration = "Aberration"; + + const std::string keySequenceDir = "Sequence"; + const std::string keySequenceType = "SequenceType"; + + const std::string keyNeedsTextureMapDilation = "TextureMap"; + const std::string keyNeedsShadowing = "ShadowMap"; + const std::string keyTextureMapAspectRatio = "AspectRatio"; const std::string sequenceTypeImage = "image-sequence"; const std::string sequenceTypePlaybook = "playbook"; @@ -72,6 +75,94 @@ namespace openspace { using ghoul::Dictionary; using glm::ivec2; +Documentation ProjectionComponent::Documentation() { + using namespace documentation; + return { + "Projection Component", + "newhorizons_projectioncomponent", + { + { + keyInstrument, + new StringAnnotationVerifier("A SPICE name of an instrument"), + "The instrument that is used to perform the projections", + Optional::No + }, + { + keyInstrumentFovy, + new DoubleVerifier, + "The field of view in degrees along the y axis", + Optional::No + }, + { + keyInstrumentAspect, + new DoubleVerifier, + "The aspect ratio of the instrument in relation between x and y axis", + Optional::No + }, + { + keyProjObserver, + new StringAnnotationVerifier("A SPICE name of the observing object"), + "The observer that is doing the projection. This has to be a valid SPICE " + "name or SPICE integer.", + Optional::No + }, + { + keyProjTarget, + new StringAnnotationVerifier("A SPICE name of the observed object"), + "The observed object that is projected on. This has to be a valid SPICE " + "name or SPICE integer.", + Optional::No + }, + { + keyProjAberration, + new StringInListVerifier({ + // from SpiceManager::AberrationCorrection::AberrationCorrection + "NONE", "LT", "LT+S", "CN", "CN+S", "XLT", "XLT+S", "XCN", "XCN+S" + }), + "The aberration correction that is supposed to be used for the " + "projection. The values for the correction correspond to the SPICE " + "definition as described in " + "ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/IDL/cspice/spkezr_c.html", + Optional::No + }, + { + keyPotentialTargets, + new StringListVerifier, + "The list of potential targets that are involved with the image " + "projection", + Optional::Yes + }, + { + keyNeedsTextureMapDilation, + new BoolVerifier, + "Determines whether a dilation step of the texture map has to be " + "performed after each projection. This is necessary if the texture of " + "the projected object is a texture map where the borders are not " + "touching. The default value is 'false'.", + Optional::Yes + }, + { + keyNeedsShadowing, + new BoolVerifier, + "Determines whether the object requires a self-shadowing algorithm. This " + "is necessary if the object is concave and might cast a shadow on itself " + "during presentation. The default value is 'false'.", + Optional::Yes + }, + { + keyTextureMapAspectRatio, + new DoubleVerifier, + "Sets the desired aspect ratio of the projected texture. This might be " + "necessary as planets usually have 2x1 aspect ratios, whereas this does " + "not hold for non-planet objects (comets, asteroids, etc). The default " + "value is '1.0'.", + Optional::Yes + } + + } + }; +} + ProjectionComponent::ProjectionComponent() : properties::PropertyOwner() , _performProjection("performProjection", "Perform Projections", true) @@ -96,7 +187,123 @@ ProjectionComponent::ProjectionComponent() _applyTextureSize.onChange([this]() { _textureSizeDirty = true; }); } -bool ProjectionComponent::initialize() { +void ProjectionComponent::initialize(const ghoul::Dictionary& dictionary) { + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "ProjectionComponent" + ); + _instrumentID = dictionary.value(keyInstrument); + _projectorID = dictionary.value(keyProjObserver); + _projecteeID = dictionary.value(keyProjTarget); + _fovy = dictionary.value(keyInstrumentFovy); + _aspectRatio = dictionary.value(keyInstrumentAspect); + + _aberration = SpiceManager::AberrationCorrection( + dictionary.value(keyProjAberration) + ); + + if (dictionary.hasKeyAndValue(keyPotentialTargets)) { + ghoul::Dictionary potentialTargets = dictionary.value( + keyPotentialTargets + ); + + _potentialTargets.reserve(potentialTargets.size()); + for (int i = 1; i <= potentialTargets.size(); ++i) { + _potentialTargets.emplace_back( + potentialTargets.value(std::to_string(i)) + ); + } + } + + if (dictionary.hasKeyAndValue(keyNeedsTextureMapDilation)) { + _dilation.isEnabled = dictionary.value(keyNeedsTextureMapDilation); + } + + if (dictionary.hasKeyAndValue(keyNeedsShadowing)) { + _shadowing.isEnabled = dictionary.value(keyNeedsShadowing); + } + + _projectionTextureAspectRatio = 1.f; + if (dictionary.hasKeyAndValue(keyTextureMapAspectRatio)) { + _projectionTextureAspectRatio = + static_cast(dictionary.value(keyTextureMapAspectRatio)); + } + + std::string name; + dictionary.getValue(SceneGraphNode::KeyName, name); + + std::vector parsers; + + std::string sequenceSource; + std::string sequenceType; + bool foundSequence = dictionary.getValue(keySequenceDir, sequenceSource); + if (foundSequence) { + sequenceSource = absPath(sequenceSource); + + foundSequence = dictionary.getValue(keySequenceType, sequenceType); + //Important: client must define translation-list in mod file IFF playbook + if (dictionary.hasKey(keyTranslation)) { + ghoul::Dictionary translationDictionary; + //get translation dictionary + dictionary.getValue(keyTranslation, translationDictionary); + + if (sequenceType == sequenceTypePlaybook) { + parsers.push_back(new HongKangParser( + name, + sequenceSource, + _projectorID, + translationDictionary, + _potentialTargets)); + } + else if (sequenceType == sequenceTypeImage) { + parsers.push_back(new LabelParser( + name, + sequenceSource, + translationDictionary)); + } + else if (sequenceType == sequenceTypeHybrid) { + //first read labels + parsers.push_back(new LabelParser( + name, + sequenceSource, + translationDictionary)); + + std::string _eventFile; + bool foundEventFile = dictionary.getValue("Projection.EventFile", _eventFile); + if (foundEventFile) { + //then read playbook + _eventFile = absPath(_eventFile); + parsers.push_back(new HongKangParser( + name, + _eventFile, + _projectorID, + translationDictionary, + _potentialTargets)); + } + else { + LWARNING("No eventfile has been provided, please check modfiles"); + } + } + else if (sequenceType == sequenceTypeInstrumentTimes) { + parsers.push_back(new InstrumentTimesParser( + name, + sequenceSource, + translationDictionary)); + } + + for (SequenceParser* parser : parsers) { + openspace::ImageSequencer::ref().runSequenceParser(parser); + delete parser; + } + } + else { + LWARNING("No playbook translation provided, please make sure all spice calls match playbook!"); + } + } +} + +bool ProjectionComponent::initializeGL() { int maxSize = OpenGLCap.max2DTextureSize(); glm::ivec2 size; @@ -193,131 +400,6 @@ bool ProjectionComponent::isReady() const { return (_projectionTexture != nullptr); } -bool ProjectionComponent::initializeProjectionSettings(const Dictionary& dictionary) { - bool completeSuccess = true; - completeSuccess &= dictionary.getValue(keyInstrument, _instrumentID); - completeSuccess &= dictionary.getValue(keyProjObserver, _projectorID); - completeSuccess &= dictionary.getValue(keyProjTarget, _projecteeID); - completeSuccess &= dictionary.getValue(keyInstrumentFovy, _fovy); - completeSuccess &= dictionary.getValue(keyInstrumentAspect, _aspectRatio); - - ghoul_assert(completeSuccess, "All neccessary attributes not found in modfile"); - - std::string a = "NONE"; - bool s = dictionary.getValue(keyProjAberration, a); - _aberration = SpiceManager::AberrationCorrection(a); - completeSuccess &= s; - ghoul_assert(completeSuccess, "All neccessary attributes not found in modfile"); - - - if (dictionary.hasKeyAndValue(keyPotentialTargets)) { - ghoul::Dictionary potentialTargets = dictionary.value( - keyPotentialTargets - ); - - _potentialTargets.resize(potentialTargets.size()); - for (int i = 0; i < potentialTargets.size(); ++i) { - std::string target; - potentialTargets.getValue(std::to_string(i + 1), target); - _potentialTargets[i] = target; - } - } - - if (dictionary.hasKeyAndValue(keyNeedsTextureMapDilation)) { - _dilation.isEnabled = dictionary.value(keyNeedsTextureMapDilation); - } - - if (dictionary.hasKeyAndValue(keyNeedsShadowing)) { - _shadowing.isEnabled = dictionary.value(keyNeedsShadowing); - } - - _projectionTextureAspectRatio = 1.f; - if (dictionary.hasKeyAndValue(keyTextureMapAspectRatio)) { - _projectionTextureAspectRatio = - static_cast(dictionary.value(keyTextureMapAspectRatio)); - } - - return completeSuccess; -} - -bool ProjectionComponent::initializeParser(const ghoul::Dictionary& dictionary) { - bool completeSuccess = true; - - std::string name; - dictionary.getValue(SceneGraphNode::KeyName, name); - - std::vector parsers; - - std::string sequenceSource; - std::string sequenceType; - bool foundSequence = dictionary.getValue(keySequenceDir, sequenceSource); - if (foundSequence) { - sequenceSource = absPath(sequenceSource); - - foundSequence = dictionary.getValue(keySequenceType, sequenceType); - //Important: client must define translation-list in mod file IFF playbook - if (dictionary.hasKey(keyTranslation)) { - ghoul::Dictionary translationDictionary; - //get translation dictionary - dictionary.getValue(keyTranslation, translationDictionary); - - if (sequenceType == sequenceTypePlaybook) { - parsers.push_back(new HongKangParser( - name, - sequenceSource, - _projectorID, - translationDictionary, - _potentialTargets)); - } - else if (sequenceType == sequenceTypeImage) { - parsers.push_back(new LabelParser( - name, - sequenceSource, - translationDictionary)); - } - else if (sequenceType == sequenceTypeHybrid) { - //first read labels - parsers.push_back(new LabelParser( - name, - sequenceSource, - translationDictionary)); - - std::string _eventFile; - bool foundEventFile = dictionary.getValue("Projection.EventFile", _eventFile); - if (foundEventFile) { - //then read playbook - _eventFile = absPath(_eventFile); - parsers.push_back(new HongKangParser( - name, - _eventFile, - _projectorID, - translationDictionary, - _potentialTargets)); - } - else { - LWARNING("No eventfile has been provided, please check modfiles"); - } - } - else if (sequenceType == sequenceTypeInstrumentTimes) { - parsers.push_back(new InstrumentTimesParser( - name, - sequenceSource, - translationDictionary)); - } - - for(SequenceParser* parser : parsers){ - openspace::ImageSequencer::ref().runSequenceParser(parser); - delete parser; - } - } - else { - LWARNING("No playbook translation provided, please make sure all spice calls match playbook!"); - } - } - - return completeSuccess; -} - void ProjectionComponent::imageProjectBegin() { // keep handle to the current bound FBO glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO); diff --git a/modules/newhorizons/util/projectioncomponent.h b/modules/newhorizons/util/projectioncomponent.h index 6bae9afa6f..ef6b57cd4e 100644 --- a/modules/newhorizons/util/projectioncomponent.h +++ b/modules/newhorizons/util/projectioncomponent.h @@ -26,6 +26,8 @@ #define __PROJECTIONCOMPONENT_H__ #include + +#include #include #include #include @@ -48,14 +50,12 @@ class ProjectionComponent : public properties::PropertyOwner { public: ProjectionComponent(); - bool initialize(); + void initialize(const ghoul::Dictionary& dictionary); + bool initializeGL(); bool deinitialize(); bool isReady() const; - bool initializeProjectionSettings(const ghoul::Dictionary& dictionary); - bool initializeParser(const ghoul::Dictionary& dictionary); - ghoul::opengl::Texture& depthTexture(); void imageProjectBegin(); void imageProjectEnd(); @@ -101,6 +101,8 @@ public: float fieldOfViewY() const; float aspectRatio() const; + static openspace::Documentation Documentation(); + private: bool generateProjectionLayerTexture(const glm::ivec2& size); bool generateDepthTexture(const glm::ivec2& size); diff --git a/modules/onscreengui/include/gui.h b/modules/onscreengui/include/gui.h index 673e7dbb31..2c25bb36fd 100644 --- a/modules/onscreengui/include/gui.h +++ b/modules/onscreengui/include/gui.h @@ -56,7 +56,7 @@ public: bool keyCallback(Key key, KeyModifier modifier, KeyAction action); bool charCallback(unsigned int character, KeyModifier modifier); - void startFrame(float deltaTime, const glm::vec2& windowSize, const glm::vec2& mousePosCorrectionFactor, const glm::vec2& mousePos, uint32_t mouseButtons); + void startFrame(float deltaTime, const glm::vec2& windowSize, const glm::vec2& dpiScaling, const glm::vec2& mousePos, uint32_t mouseButtons); void endFrame(); void render(); diff --git a/modules/onscreengui/include/guiperformancecomponent.h b/modules/onscreengui/include/guiperformancecomponent.h index f5beabd38a..647b44e406 100644 --- a/modules/onscreengui/include/guiperformancecomponent.h +++ b/modules/onscreengui/include/guiperformancecomponent.h @@ -27,6 +27,8 @@ #include +#include + #include namespace ghoul { diff --git a/modules/onscreengui/src/gui.cpp b/modules/onscreengui/src/gui.cpp index e149022b67..2c4a523413 100644 --- a/modules/onscreengui/src/gui.cpp +++ b/modules/onscreengui/src/gui.cpp @@ -406,13 +406,13 @@ void GUI::deinitializeGL() { } void GUI::startFrame(float deltaTime, const glm::vec2& windowSize, - const glm::vec2& framebufferSize, + const glm::vec2& dpiScaling, const glm::vec2& mousePos, uint32_t mouseButtonsPressed) { ImGuiIO& io = ImGui::GetIO(); io.DisplaySize = ImVec2(windowSize.x, windowSize.y); - io.DisplayFramebufferScale = ImVec2(framebufferSize.x / windowSize.x, framebufferSize.y / windowSize.y); + io.DisplayFramebufferScale = ImVec2(dpiScaling.x, dpiScaling.y); io.DeltaTime = deltaTime; io.MousePos = ImVec2(mousePos.x, mousePos.y); @@ -506,37 +506,6 @@ void GUI::render() { _origin.render(); _time.render(); - // These are temporary until the scalegraph is in effect ---abock - bool toSun = ImGui::Button("Coordinate System to Sun"); - bool toPluto = ImGui::Button("Coordinate System to Pluto"); - bool toJupiter = ImGui::Button("Coordinate System to Jupiter"); - bool to67P = ImGui::Button("Coordinate System to 67P"); - - if (toSun) { - OsEng.scriptEngine().queueScript( - "openspace.setPropertyValue('Interaction.coordinateSystem', 'Sun');", - scripting::ScriptEngine::RemoteScripting::Yes - ); - } - if (toPluto) { - OsEng.scriptEngine().queueScript( - "openspace.setPropertyValue('Interaction.coordinateSystem', 'Pluto');", - scripting::ScriptEngine::RemoteScripting::Yes - ); - } - if (toJupiter) { - OsEng.scriptEngine().queueScript( - "openspace.setPropertyValue('Interaction.coordinateSystem', 'Jupiter');", - scripting::ScriptEngine::RemoteScripting::Yes - ); - } - if (to67P) { - OsEng.scriptEngine().queueScript( - "openspace.setPropertyValue('Interaction.coordinateSystem', '67P');", - scripting::ScriptEngine::RemoteScripting::Yes - ); - } - ImGui::Checkbox("Help", &_help._isEnabled); static const int addImageBufferSize = 256; diff --git a/modules/onscreengui/src/guiiswacomponent.cpp b/modules/onscreengui/src/guiiswacomponent.cpp index e09a294a85..458400acae 100644 --- a/modules/onscreengui/src/guiiswacomponent.cpp +++ b/modules/onscreengui/src/guiiswacomponent.cpp @@ -74,7 +74,8 @@ void GuiIswaComponent::render() { if (ImGui::SmallButton("Add Cygnet")) { OsEng.scriptEngine().queueScript( - "openspace.iswa.addCygnet(" + std::string(addCygnetBuffer) + ");" + "openspace.iswa.addCygnet(" + std::string(addCygnetBuffer) + ");", + scripting::ScriptEngine::RemoteScripting::Yes ); } @@ -83,9 +84,15 @@ void GuiIswaComponent::render() { std::string x = "openspace.iswa.addCygnet(-4, 'Data', 'GMData');"; std::string y = "openspace.iswa.addCygnet(-5, 'Data', 'GMData');"; std::string z = "openspace.iswa.addCygnet(-6, 'Data', 'GMData');"; - OsEng.scriptEngine().queueScript(x + y + z); + OsEng.scriptEngine().queueScript( + x + y + z, + scripting::ScriptEngine::RemoteScripting::Yes + ); } else { - OsEng.scriptEngine().queueScript("openspace.iswa.removeGroup('GMData');"); + OsEng.scriptEngine().queueScript( + "openspace.iswa.removeGroup('GMData');", + scripting::ScriptEngine::RemoteScripting::Yes + ); } } @@ -94,19 +101,29 @@ void GuiIswaComponent::render() { std::string x = "openspace.iswa.addCygnet(-4, 'Texture', 'GMImage');"; std::string y = "openspace.iswa.addCygnet(-5, 'Texture', 'GMImage');"; std::string z = "openspace.iswa.addCygnet(-6, 'Texture', 'GMImage');"; - OsEng.scriptEngine().queueScript(x + y + z); + OsEng.scriptEngine().queueScript( + x + y + z, + scripting::ScriptEngine::RemoteScripting::Yes + ); } else { - OsEng.scriptEngine().queueScript("openspace.iswa.removeGroup('GMImage');"); + OsEng.scriptEngine().queueScript( + "openspace.iswa.removeGroup('GMImage');", + scripting::ScriptEngine::RemoteScripting::Yes + ); } } if(_ionData != oldIonDataValue) { if(_ionData) { OsEng.scriptEngine().queueScript( - "openspace.iswa.addCygnet(-10,'Data','Ionosphere');" + "openspace.iswa.addCygnet(-10,'Data','Ionosphere');", + scripting::ScriptEngine::RemoteScripting::Yes ); } else { - OsEng.scriptEngine().queueScript("openspace.iswa.removeGroup('Ionosphere');"); + OsEng.scriptEngine().queueScript( + "openspace.iswa.removeGroup('Ionosphere');", + scripting::ScriptEngine::RemoteScripting::Yes + ); } } @@ -147,13 +164,16 @@ void GuiIswaComponent::render() { groupName + "'," + std::to_string(cdfOption) + - ");" + ");", + scripting::ScriptEngine::RemoteScripting::Yes ); OsEng.scriptEngine().queueScript( - "openspace.time.setTime('" + date + "');" + "openspace.time.setTime('" + date + "');", + scripting::ScriptEngine::RemoteScripting::Yes ); OsEng.scriptEngine().queueScript( - "openspace.time.setDeltaTime(0);" + "openspace.time.setDeltaTime(0);", + scripting::ScriptEngine::RemoteScripting::Yes ); } } @@ -181,13 +201,15 @@ void GuiIswaComponent::render() { if (info->selected) { OsEng.scriptEngine().queueScript( "openspace.iswa.addScreenSpaceCygnet(" - "{CygnetId = " + std::to_string(id) + " });" + "{CygnetId = " + std::to_string(id) + " });", + scripting::ScriptEngine::RemoteScripting::Yes ); } else { OsEng.scriptEngine().queueScript( "openspace.iswa.removeScreenSpaceCygnet(" + std::to_string(id) + - ");" + ");", + scripting::ScriptEngine::RemoteScripting::Yes ); } } diff --git a/modules/onscreengui/src/guiperformancecomponent.cpp b/modules/onscreengui/src/guiperformancecomponent.cpp index 6e564a7122..16f70f2f00 100644 --- a/modules/onscreengui/src/guiperformancecomponent.cpp +++ b/modules/onscreengui/src/guiperformancecomponent.cpp @@ -42,10 +42,12 @@ namespace { enum class Sorting { NoSorting = -1, - UpdateEphemeris = 0, - UpdateRender = 1, - Render = 2, - Total = 3 + UpdateTranslation = 0, + UpdateRotation = 1, + UpdateScaling = 2, + UpdateRender = 3, + Render = 4, + Total = 5 }; } @@ -80,9 +82,19 @@ void GuiPerformanceComponent::render() { static_cast(Sorting::NoSorting) ); ImGui::RadioButton( - "UpdateEphemeris", + "UpdateTranslation", &_sortingSelection, - static_cast(Sorting::UpdateEphemeris) + static_cast(Sorting::UpdateTranslation) + ); + ImGui::RadioButton( + "UpdateRotation", + &_sortingSelection, + static_cast(Sorting::UpdateRotation) + ); + ImGui::RadioButton( + "UpdateScaling", + &_sortingSelection, + static_cast(Sorting::UpdateScaling) ); ImGui::RadioButton( "UpdateRender", @@ -106,15 +118,17 @@ void GuiPerformanceComponent::render() { std::iota(indices.begin(), indices.end(), 0); // Ordering: - // updateEphemeris + // updateTranslation + // updateRotation + // updateScaling // UpdateRender // RenderTime - std::vector> averages( + std::vector> averages( layout->nScaleGraphEntries, - { 0.f, 0.f, 0.f } + { 0.f, 0.f, 0.f, 0.f, 0.f } ); - std::vector, 3>> minMax( + std::vector, 5>> minMax( layout->nScaleGraphEntries ); @@ -122,20 +136,26 @@ void GuiPerformanceComponent::render() { const PerformanceLayout::SceneGraphPerformanceLayout& entry = layout->sceneGraphEntries[i]; - int nValues[3] = { 0, 0, 0 }; + int nValues[5] = { 0, 0, 0, 0, 0 }; // Compute the averages and count the number of values so we don't divide // by 0 later for (int j = 0; j < PerformanceLayout::NumberValues; ++j) { - averages[i][0] += entry.updateEphemeris[j]; - if (entry.updateEphemeris[j] != 0.f) + averages[i][0] += entry.updateTranslation[j]; + if (entry.updateTranslation[j] != 0.f) ++(nValues[0]); - averages[i][1] += entry.updateRenderable[j]; - if (entry.updateRenderable[j] != 0.f) + averages[i][1] += entry.updateRotation[j]; + if (entry.updateRotation[j] != 0.f) ++(nValues[1]); - averages[i][2] += entry.renderTime[j]; - if (entry.renderTime[j] != 0.f) + averages[i][2] += entry.updateScaling[j]; + if (entry.updateScaling[j] != 0.f) ++(nValues[2]); + averages[i][3] += entry.updateRenderable[j]; + if (entry.updateRenderable[j] != 0.f) + ++(nValues[3]); + averages[i][4] += entry.renderTime[j]; + if (entry.renderTime[j] != 0.f) + ++(nValues[4]); } if (nValues[0] != 0) @@ -144,23 +164,45 @@ void GuiPerformanceComponent::render() { averages[i][1] /= static_cast(nValues[1]); if (nValues[2] != 0) averages[i][2] /= static_cast(nValues[2]); - + if (nValues[3] != 0) + averages[i][3] /= static_cast(nValues[3]); + if (nValues[4] != 0) + averages[i][4] /= static_cast(nValues[4]); + // Get the minimum/maximum values for each of the components so that we // can scale the plot by these numbers - auto minmaxEphemeris = std::minmax_element( - std::begin(entry.updateEphemeris), - std::end(entry.updateEphemeris) + auto minmaxTranslation = std::minmax_element( + std::begin(entry.updateTranslation), + std::end(entry.updateTranslation) ); minMax[i][0] = std::make_pair( - *(minmaxEphemeris.first), - *(minmaxEphemeris.second) + *(minmaxTranslation.first), + *(minmaxTranslation.second) + ); + + auto minmaxRotation = std::minmax_element( + std::begin(entry.updateRotation), + std::end(entry.updateRotation) + ); + minMax[i][1] = std::make_pair( + *(minmaxRotation.first), + *(minmaxRotation.second) + ); + + auto minmaxScaling = std::minmax_element( + std::begin(entry.updateScaling), + std::end(entry.updateScaling) + ); + minMax[i][2] = std::make_pair( + *(minmaxScaling.first), + *(minmaxScaling.second) ); auto minmaxUpdateRenderable = std::minmax_element( std::begin(entry.updateRenderable), std::end(entry.updateRenderable) ); - minMax[i][1] = std::make_pair( + minMax[i][3] = std::make_pair( *(minmaxUpdateRenderable.first), *(minmaxUpdateRenderable.second) ); @@ -169,7 +211,7 @@ void GuiPerformanceComponent::render() { std::begin(entry.renderTime), std::end(entry.renderTime) ); - minMax[i][2] = std::make_pair( + minMax[i][4] = std::make_pair( *(minmaxRendering.first), *(minmaxRendering.second) ); @@ -216,6 +258,16 @@ void GuiPerformanceComponent::render() { sortFunc ); } + else { + // NoSorting -> So we sort by names instead + std::sort( + indices.begin(), + indices.end(), + [layout](size_t a, size_t b) { + return std::string(layout->sceneGraphEntries[a].name) < std::string(layout->sceneGraphEntries[b].name); + } + ); + } for (int i = 0; i < layout->nScaleGraphEntries; ++i) { // We are using the indices list as an additional level of indirection @@ -227,24 +279,60 @@ void GuiPerformanceComponent::render() { if (ImGui::CollapsingHeader(entry.name)) { - std::string updateEphemerisTime = std::to_string( - entry.updateEphemeris[PerformanceLayout::NumberValues - 1] + std::string updateTranslationTime = std::to_string( + entry.updateTranslation[PerformanceLayout::NumberValues - 1] ) + "us"; ImGui::PlotLines( fmt::format( - "UpdateEphemeris\nAverage: {}us", + "UpdateTranslation\nAverage: {}us", averages[indices[i]][0] ).c_str(), - &entry.updateEphemeris[0], + &entry.updateTranslation[0], PerformanceLayout::NumberValues, 0, - updateEphemerisTime.c_str(), + updateTranslationTime.c_str(), minMax[indices[i]][0].first, minMax[indices[i]][0].second, ImVec2(0, 40) ); + std::string updateRotationTime = std::to_string( + entry.updateRotation[PerformanceLayout::NumberValues - 1] + ) + "us"; + + ImGui::PlotLines( + fmt::format( + "UpdateRotation\nAverage: {}us", + averages[indices[i]][1] + ).c_str(), + &entry.updateRotation[0], + PerformanceLayout::NumberValues, + 0, + updateRotationTime.c_str(), + minMax[indices[i]][1].first, + minMax[indices[i]][1].second, + ImVec2(0, 40) + ); + + std::string updateScalingTime = std::to_string( + entry.updateScaling[PerformanceLayout::NumberValues - 1] + ) + "us"; + + ImGui::PlotLines( + fmt::format( + "UpdateScaling\nAverage: {}us", + averages[indices[i]][2] + ).c_str(), + &entry.updateScaling[0], + PerformanceLayout::NumberValues, + 0, + updateScalingTime.c_str(), + minMax[indices[i]][2].first, + minMax[indices[i]][2].second, + ImVec2(0, 40) + ); + std::string updateRenderableTime = std::to_string( entry.updateRenderable[PerformanceLayout::NumberValues - 1] ) + "us"; @@ -252,14 +340,14 @@ void GuiPerformanceComponent::render() { ImGui::PlotLines( fmt::format( "UpdateRender\nAverage: {}us", - averages[indices[i]][1] + averages[indices[i]][3] ).c_str(), &entry.updateRenderable[0], PerformanceLayout::NumberValues, 0, updateRenderableTime.c_str(), - minMax[indices[i]][1].first, - minMax[indices[i]][1].second, + minMax[indices[i]][3].first, + minMax[indices[i]][3].second, ImVec2(0, 40) ); @@ -270,14 +358,14 @@ void GuiPerformanceComponent::render() { ImGui::PlotLines( fmt::format( "RenderTime\nAverage: {}us", - averages[indices[i]][2] + averages[indices[i]][4] ).c_str(), &entry.renderTime[0], PerformanceLayout::NumberValues, 0, renderTime.c_str(), - minMax[indices[i]][2].first, - minMax[indices[i]][2].second, + minMax[indices[i]][4].first, + minMax[indices[i]][4].second, ImVec2(0, 40) ); } diff --git a/modules/onscreengui/src/guipropertycomponent.cpp b/modules/onscreengui/src/guipropertycomponent.cpp index 79af1a59f0..4c189c2d6d 100644 --- a/modules/onscreengui/src/guipropertycomponent.cpp +++ b/modules/onscreengui/src/guipropertycomponent.cpp @@ -102,7 +102,14 @@ void GuiPropertyComponent::render() { ImGui::Spacing(); if (_function) { - const std::vector& owners = _function(); + std::vector owners = _function(); + std::sort( + owners.begin(), + owners.end(), + [](properties::PropertyOwner* lhs, properties::PropertyOwner* rhs) { + return lhs->name() < rhs->name(); + } + ); for (properties::PropertyOwner* pOwner : owners) { if (pOwner->propertiesRecursive().empty()) diff --git a/modules/onscreengui/src/guitimecomponent.cpp b/modules/onscreengui/src/guitimecomponent.cpp index c2b1d15d0d..5256d55135 100644 --- a/modules/onscreengui/src/guitimecomponent.cpp +++ b/modules/onscreengui/src/guitimecomponent.cpp @@ -35,7 +35,7 @@ namespace gui { void GuiTimeComponent::render() { float deltaTime = static_cast(Time::ref().deltaTime()); - bool changed = ImGui::SliderFloat("Delta Time", &deltaTime, -5000.f, 5000.f); + bool changed = ImGui::SliderFloat("Delta Time", &deltaTime, -50000.f, 50000.f); if (changed) { OsEng.scriptEngine().queueScript( "openspace.time.setDeltaTime(" + std::to_string(deltaTime) + ")", diff --git a/modules/onscreengui/src/renderproperties.cpp b/modules/onscreengui/src/renderproperties.cpp index 60d3ce1724..74ae140c1e 100644 --- a/modules/onscreengui/src/renderproperties.cpp +++ b/modules/onscreengui/src/renderproperties.cpp @@ -72,16 +72,16 @@ void renderOptionProperty(Property* prop, const std::string& ownerName) { int value = *p; std::vector options = p->options(); switch (p->displayType()) { - case OptionProperty::DisplayType::RADIO: { + case OptionProperty::DisplayType::Radio: { + ImGui::Text(name.c_str()); + ImGui::Separator(); for (const OptionProperty::Option& o : options) { - ImGui::RadioButton(name.c_str(), &value, o.value); - ImGui::SameLine(); - ImGui::Text(o.description.c_str()); + ImGui::RadioButton(o.description.c_str(), &value, o.value); renderTooltip(prop); } break; } - case OptionProperty::DisplayType::DROPDOWN: { + case OptionProperty::DisplayType::Dropdown: { std::string nodeNames = ""; for (const OptionProperty::Option& o : options) { nodeNames += o.description + '\0'; diff --git a/openspace.cfg b/openspace.cfg index 26fb6f447d..995794fb20 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -66,6 +66,7 @@ return { File = "${DOCUMENTATION}/FactoryDocumentation.html" }, ShutdownCountdown = 3, + -- PerSceneCache = true, DownloadRequestURL = "http://data.openspaceproject.com/request.cgi", RenderingMethod = "Framebuffer" --RenderingMethod = "ABuffer" -- alternative: "Framebuffer" diff --git a/scripts/bind_common_keys.lua b/scripts/bind_common_keys.lua new file mode 100644 index 0000000000..3101b7945e --- /dev/null +++ b/scripts/bind_common_keys.lua @@ -0,0 +1,20 @@ +--[[ OpenSpace keybinding script ]]-- + +-- Load the common helper functions +dofile(openspace.absPath('${SCRIPTS}/common.lua')) + +openspace.clearKeys() +helper.setCommonKeys() +helper.setDeltaTimeKeys({ +-- 1 2 3 4 5 6 7 8 9 0 +-------------------------------------------------------------------------------------------------------------------------- +-- 1s 2s 5s 10s 30s 1m 2m 5m 10m 30m + 1, 2, 5, 10, 30, 60, 120, 300, 600, 1800, + +-- 1h 2h 3h 6h 12h 1d 2d 4d 1w 2w + 3600, 7200, 10800, 21600, 43200, 86400, 172800, 345600, 604800, 1209600, + +-- 1mo 2mo 3mo 6mo 1yr 2y 5y 10y 20y 50y + 2592000, 5184000, 7776000, 15552000, 31536000, 63072000, 157680000, 315360000, 630720000, 1576800000 +}) +-- OBS: One month (1mo) is approximated by 30 days. diff --git a/scripts/bind_keys.lua b/scripts/bind_keys.lua deleted file mode 100644 index 3cd8f4cee0..0000000000 --- a/scripts/bind_keys.lua +++ /dev/null @@ -1,36 +0,0 @@ ---[[ OpenSpace keybinding script ]]-- - --- Load the common helper functions -dofile(openspace.absPath('${SCRIPTS}/common.lua')) - -openspace.clearKeys() -helper.setCommonKeys() -helper.setDeltaTimeKeys({ --- 1 2 3 4 5 6 7 8 9 0 --------------------------------------------------------------------------------------------------------------------------- --- 1s 2s 5s 10s 30s 1m 2m 5m 10m 30 min - 1, 2, 5, 10, 30, 60, 120, 300, 600, 1800, - --- 1h 2h 3h 6h 12h 1d 2d 4d 1w 2w - 3600, 7200, 10800, 21600, 43200, 86400, 172800, 345600, 604800, 1209600, - --- 1mo 2mo 3mo 6mo 1yr 2y 5y 10y 20y 50y - 2592000, 5184000, 7776000, 15552000, 31536000, 63072000, 157680000, 315360000, 630720000, 1576800000 -}) --- OBS: One month (1mo) is approximated by 30 days. - - -openspace.bindKey("q", helper.renderable.toggle('SunMarker')) -openspace.bindKey("e", helper.renderable.toggle('EarthMarker')) -openspace.bindKey("x", helper.renderable.toggle('Constellation Bounds')) - ---openspace.bindKey("c", "openspace.parallel.setAddress('130.236.142.51');openspace.parallel.setPassword('newhorizons-20150714');openspace.parallel.connect();") - ---openspace.bindKey("h", "openspace.iswa.setBaseUrl('https://iswa-demo-server.herokuapp.com/')"); -openspace.bindKey("g", "openspace.iswa.setBaseUrl('http://128.183.168.116:3000/')"); -openspace.bindKey("l", "openspace.iswa.setBaseUrl('http://localhost:3000/')"); - -openspace.bindKey("v", "openspace.time.setTime('2015-03-15T02:00:00.00')"); - -openspace.bindKeyLocal("h", "openspace.parallel.setAddress('127.0.0.1');openspace.parallel.setPort('25001');openspace.parallel.setPassword('test');openspace.parallel.connect();openspace.parallel.requestHostship('test');") -openspace.bindKeyLocal("c", "openspace.parallel.setAddress('127.0.0.1');openspace.parallel.setPort('25001');openspace.parallel.setPassword('test');openspace.parallel.connect();") diff --git a/scripts/bind_keys_newhorizons.lua b/scripts/bind_keys_newhorizons.lua index 246a526d3c..4d0310a146 100644 --- a/scripts/bind_keys_newhorizons.lua +++ b/scripts/bind_keys_newhorizons.lua @@ -1,74 +1,135 @@ ---[[ OpenSpace keybinding script ]]-- +--[[ OpenSpace keybinding script loaded from the newhorizons.scene file ]]-- -- Load the common helper functions dofile(openspace.absPath('${SCRIPTS}/common.lua')) openspace.clearKeys() helper.setCommonKeys() - helper.setDeltaTimeKeys({ 1, 5, 10, 20, 40, 60, 120, 360, 540, 1080, 2160, 4320, 8640 }) -openspace.bindKey("a", "openspace.setPropertyValue('Interaction.origin', 'NewHorizons')") -openspace.bindKey("s", "openspace.setPropertyValue('Interaction.origin', 'PlutoProjection')") -openspace.bindKey("d", "openspace.setPropertyValue('Interaction.origin', 'Charon')") -openspace.bindKey("z", "openspace.setPropertyValue('Interaction.origin', 'JupiterProjection')") -openspace.bindKey("x", "openspace.setPropertyValue('Interaction.origin', 'Europa')") - -openspace.bindKey("F5", "openspace.setPropertyValue('Interaction.coordinateSystem', 'Sun'); openspace.printInfo('Changing Viewpoint to Sun');"); -openspace.bindKey("F6", "openspace.setPropertyValue('Interaction.coordinateSystem', 'Jupiter'); openspace.printInfo('Changing Viewpoint to Jupiter');"); -openspace.bindKey("F7", "openspace.setPropertyValue('Interaction.coordinateSystem', 'Pluto'); openspace.printInfo('Changing Viewpoint to Pluto');"); - -openspace.bindKey("F8", "openspace.setPropertyValue('PlutoProjection.renderable.ProjectionComponent.clearAllProjections', true); openspace.setPropertyValue('Charon.renderable.ProjectionComponent.clearAllProjections', true);") - --- Quickfix backjumps in pluto sequence -openspace.bindKey("F9", "openspace.time.setTime('2015-07-14T09:00:00.00'); openspace.setPropertyValue('PlutoProjection.renderable.clearAllProjections', true); openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);") -openspace.bindKey("F10", "openspace.time.setTime('2015-07-14T10:00:00.00'); openspace.setPropertyValue('PlutoProjection.renderable.clearAllProjections', true); openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);") -openspace.bindKey("F11", "openspace.time.setTime('2015-07-14T11:17:00.00'); openspace.setPropertyValue('PlutoProjection.renderable.clearAllProjections', true); openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);") -openspace.bindKey("F12", "openspace.time.setTime('2015-07-14T12:45:00.00'); openspace.setPropertyValue('PlutoProjection.renderable.clearAllProjections', true); openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);") - -openspace.bindKey("r", helper.property.invert('PlutoProjection.renderable.fk')) - -openspace.bindKey("KP_8", helper.property.increment('PlutoProjection.renderable.heightExaggeration', 2)) -openspace.bindKey("KP_2", helper.property.decrement('PlutoProjection.renderable.heightExaggeration', 2)) - -openspace.bindKey("KP_9", helper.property.increment('Charon.renderable.heightExaggeration', 2)) -openspace.bindKey("KP_3", helper.property.decrement('Charon.renderable.heightExaggeration', 2)) - - -openspace.bindKey("g", "openspace.time.setTime('2007-02-28T11:40:00.00'); openspace.time.setDeltaTime(1);") - -openspace.bindKey("h", "openspace.time.setTime('2015-07-14T10:00:00.00'); openspace.time.setDeltaTime(1); openspace.setPropertyValue('Interaction.coordinateSystem', 'Pluto');openspace.setPropertyValue('Interaction.origin', 'PlutoProjection'); openspace.printInfo('Changing Viewpoint to Pluto-in-center');") - -openspace.bindKey("q", helper.property.invert('SunMarker.renderable.enabled')) -openspace.bindKey("e", helper.property.invert('EarthMarker.renderable.enabled')) -openspace.bindKey("o", helper.property.invert('PlutoTrail.renderable.enabled')) - -openspace.bindKey("k", - helper.renderable.toggle('HydraText') .. helper.renderable.toggle('NixText') .. helper.renderable.toggle('KerberosText') .. helper.renderable.toggle('StyxText') +openspace.bindKey( + "a", + "openspace.setPropertyValue('Interaction.origin', 'NewHorizons')", + "Sets the focus of the camera on 'NewHorizons'." +) +openspace.bindKey( + "s", + "openspace.setPropertyValue('Interaction.origin', 'PlutoProjection')", + "Sets the focus of the camera on 'Pluto'" +) +openspace.bindKey( + "d", + "openspace.setPropertyValue('Interaction.origin', 'Charon')", + "Sets the focus of the camera on 'Charon'." +) +openspace.bindKey( + "z", + "openspace.setPropertyValue('Interaction.origin', 'JupiterProjection')", + "Sets the focus of the camera on 'Jupiter'." +) +openspace.bindKey( + "x", + "openspace.setPropertyValue('Interaction.origin', 'Europa')", + "Sets the focus of the camera on 'Europa'." ) -openspace.bindKey("j", helper.renderable.toggle('PlutoText')) -openspace.bindKey("l", helper.property.invert('Labels.renderable.performFading')) +openspace.bindKey( + "F8", + "openspace.setPropertyValue('PlutoProjection.renderable.ProjectionComponent.clearAllProjections', true);" .. + "openspace.setPropertyValue('Charon.renderable.ProjectionComponent.clearAllProjections', true);", + "Removes all image projections from Pluto and Charon." +) + +openspace.bindKey( + "F9", + "openspace.time.setTime('2015-07-14T09:00:00.00');" .. + "openspace.setPropertyValue('PlutoProjection.renderable.clearAllProjections', true);" .. + "openspace.setPropertyValue('Charon.renderable.clearAllProjections', true);", + "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections." +) + +openspace.bindKey( + "KP_8", + helper.property.increment('PlutoProjection.renderable.heightExaggeration', 2), + "Increases the height map exaggeration on Pluto." +) +openspace.bindKey( + "KP_2", + helper.property.decrement('PlutoProjection.renderable.heightExaggeration', 2), + "Decreases the height map exaggeration on Pluto." +) +openspace.bindKey( + "KP_9", + helper.property.increment('Charon.renderable.heightExaggeration', 2), + "Increases the height map exaggeration on Charon." +) +openspace.bindKey( + "KP_3", + helper.property.decrement('Charon.renderable.heightExaggeration', 2), + "Decreases the height map exaggeration on Charon." +) + +openspace.bindKey( + "q", + helper.property.invert('SunMarker.renderable.enabled'), + "Toggles the visibility of the text marking the location of the Sun." +) +openspace.bindKey( + "e", + helper.property.invert('EarthMarker.renderable.enabled'), + "Toggles the visibility of the text marking the location of the Earth." +) +openspace.bindKey( + "o", + helper.property.invert('PlutoTrail.renderable.enabled'), + "Toggles the visibility of the trail behind Pluto." +) + +openspace.bindKey( + "j", + helper.renderable.toggle('PlutoText') .. helper.renderable.toggle('CharonText') .. + helper.renderable.toggle('HydraText') .. helper.renderable.toggle('NixText') .. + helper.renderable.toggle('KerberosText') .. helper.renderable.toggle('StyxText'), + "Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx." +) + +openspace.bindKey( + "l", + helper.property.invert('Labels.renderable.performFading'), + "Toggles the visibility of the labels for the New Horizons instruments." +) openspace.bindKey("m", - helper.property.invert('NH_LORRI.renderable.solidDraw') .. helper.property.invert('NH_RALPH_LEISA.renderable.solidDraw') .. - helper.property.invert('NH_RALPH_MVIC_PAN1.renderable.solidDraw') .. helper.property.invert('NH_RALPH_MVIC_PAN2.renderable.solidDraw') .. - helper.property.invert('NH_RALPH_MVIC_RED.renderable.solidDraw') .. helper.property.invert('NH_RALPH_MVIC_BLUE.renderable.solidDraw') .. - helper.property.invert('NH_RALPH_MVIC_FT.renderable.solidDraw') .. helper.property.invert('NH_RALPH_MVIC_METHANE.renderable.solidDraw') .. - helper.property.invert('NH_RALPH_MVIC_NIR.renderable.solidDraw') .. helper.property.invert('NH_ALICE_AIRGLOW.renderable.solidDraw') .. - helper.property.invert('NH_ALICE_SOC.renderable.solidDraw') + helper.property.invert('NH_LORRI.renderable.solidDraw') .. + helper.property.invert('NH_RALPH_LEISA.renderable.solidDraw') .. + helper.property.invert('NH_RALPH_MVIC_PAN1.renderable.solidDraw') .. + helper.property.invert('NH_RALPH_MVIC_PAN2.renderable.solidDraw') .. + helper.property.invert('NH_RALPH_MVIC_RED.renderable.solidDraw') .. + helper.property.invert('NH_RALPH_MVIC_BLUE.renderable.solidDraw') .. + helper.property.invert('NH_RALPH_MVIC_FT.renderable.solidDraw') .. + helper.property.invert('NH_RALPH_MVIC_METHANE.renderable.solidDraw') .. + helper.property.invert('NH_RALPH_MVIC_NIR.renderable.solidDraw') .. + helper.property.invert('NH_ALICE_AIRGLOW.renderable.solidDraw') .. + helper.property.invert('NH_ALICE_SOC.renderable.solidDraw'), + "Draws the instrument field of views in a solid color or as lines." ) -openspace.bindKey("t", helper.renderable.toggle('PlutoShadow') .. helper.renderable.toggle('CharonShadow')) +openspace.bindKey( + "t", + helper.renderable.toggle('PlutoShadow') .. helper.renderable.toggle('CharonShadow'), + "Toggles the visibility of the shadow visualization of Pluto and Charon." +) openspace.bindKey("p", - helper.property.invert('JupiterProjection.renderable.performProjection') .. helper.property.invert('Io.renderable.performProjection') .. - helper.property.invert('Ganymede.renderable.performProjection') .. helper.property.invert('Europa.renderable.performProjection') .. - helper.property.invert('Callisto.renderable.performProjection') .. helper.property.invert('PlutoProjection.renderable.performProjection') .. - helper.property.invert('Charon.renderable.performProjection') + helper.property.invert('JupiterProjection.renderable.performProjection') .. + helper.property.invert('Io.renderable.performProjection') .. + helper.property.invert('Ganymede.renderable.performProjection') .. + helper.property.invert('Europa.renderable.performProjection') .. + helper.property.invert('Callisto.renderable.performProjection') .. + helper.property.invert('PlutoProjection.renderable.performProjection') .. + helper.property.invert('Charon.renderable.performProjection'), + "Enables or disables the image projection on the different available objects." ) - -openspace.bindKey("c", "openspace.parallel.setAddress('130.236.142.51');openspace.parallel.setPassword('newhorizons-20150714');openspace.parallel.connect();") diff --git a/scripts/bind_keys_osirisrex.lua b/scripts/bind_keys_osirisrex.lua index 536a63cd1a..1963734dad 100644 --- a/scripts/bind_keys_osirisrex.lua +++ b/scripts/bind_keys_osirisrex.lua @@ -1,33 +1,59 @@ ---[[ OpenSpace keybinding script ]]-- +--[[ OpenSpace keybinding script loaded from the osirisrex.scene file ]]-- -- Load the common helper functions dofile(openspace.absPath('${SCRIPTS}/common.lua')) - ---openspace.clearKeys() ---helper.setCommonKeys() +dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) -- Set focuses -openspace.bindKey("o", "openspace.setPropertyValue('Interaction.origin', 'OsirisRex')") -openspace.bindKey("b", "openspace.setPropertyValue('Interaction.origin', 'Bennu2')") +openspace.bindKey( + "a", + "openspace.setPropertyValue('Interaction.origin', 'OsirisRex')", + "Sets the focus of the camera on 'Osiris Rex'." +) +openspace.bindKey( + "s", + "openspace.setPropertyValue('Interaction.origin', 'BennuBarycenter')", + "Sets the focus of the camera on 'Bennu'." +) +openspace.bindKey( + "F6" , + "openspace.printInfo('Set time: Launch');openspace.time.setTime('2016 SEP 08 23:05:00');", + "Sets the time to the launch." +) +openspace.bindKey( + "F7", + "openspace.printInfo('Set time: Gravity Assist');openspace.time.setTime('2017 SEP 22 15:00:00');", + "Sets the time to the Earth gravity assist." +) +openspace.bindKey( + "F8", + "openspace.printInfo('Set time: Approach');openspace.time.setTime('2018-SEP-11 21:31:01.183');", + "Sets the time to the approach at Bennu." +) +openspace.bindKey( + "F9", + "openspace.printInfo('Set time: Preliminary Survey');openspace.time.setTime('2018-NOV-20 01:13:12.183');", + "Sets the time to the preliminary survey of Bennu." +) +openspace.bindKey( + "F10", + "openspace.printInfo('Set time: Orbital B');openspace.time.setTime('2019-APR-08 10:35:27.186');", + "Sets the time to the orbital B event." +) +openspace.bindKey( + "F11", + "openspace.printInfo('Set time: Recon');openspace.time.setTime('2019-MAY-25 03:50:31.195');", + "Sets the time to the recon event." +) --- Quickfix backjumps in Osiris rex -openspace.bindKey("F6" , "openspace.printInfo('Set time: Launch'); openspace.time.setTime('2016 SEP 08 23:05:00');") -openspace.bindKey("F7" , "openspace.printInfo('Set time: Gravity Assist'); openspace.time.setTime('2017 SEP 22 15:00:00');") -openspace.bindKey("F8" , "openspace.printInfo('Set time: Approach'); openspace.time.setTime('2018-SEP-11 21:31:01.183');") -openspace.bindKey("F9" , "openspace.printInfo('Set time: Preliminary Survey'); openspace.time.setTime('2018-NOV-20 01:13:12.183');") -openspace.bindKey("F10", "openspace.printInfo('Set time: Orbital B'); openspace.time.setTime('2019-APR-08 10:35:27.186');") -openspace.bindKey("F11", "openspace.printInfo('Set time: Recon'); openspace.time.setTime('2019-MAY-25 03:50:31.195');") --- OBS!! Avoid key F12 --- Pressing F12 triggers a breakpoint on AMNH Windows machine, with with the following stack trace: --- ntdll.dll!DbgBreakPoint() --- ntdll.dll!DbgUiRemoteBreakin() --- kernel32.dll!BaseThreadInitThunk() --- ntdll.dll!RtUserThreadStart() - -openspace.bindKey("F4", "openspace.scriptScheduler.clear(); openspace.scriptScheduler.load('${OPENSPACE_DATA}/scene/osirisrex/scheduled_scripts.lua');") - -openspace.bindKey("q", helper.property.invert('SunMarker.renderable.enabled')) -openspace.bindKey("e", helper.property.invert('EarthMarker.renderable.enabled')) - -openspace.bindKey("c", "openspace.parallel.setAddress('130.236.142.51');openspace.parallel.setPassword('osiris2016');openspace.parallel.connect();") +openspace.bindKey( + "q", + helper.property.invert('SunMarker.renderable.enabled'), + "Toggles the visibility of the text marking the location of the Sun." +) +openspace.bindKey( + "e", + helper.property.invert('EarthMarker.renderable.enabled'), + "Toggles the visibility of the text marking the location of the Earth." +) diff --git a/scripts/bind_keys_rosetta.lua b/scripts/bind_keys_rosetta.lua index a81ff43db5..5683217018 100644 --- a/scripts/bind_keys_rosetta.lua +++ b/scripts/bind_keys_rosetta.lua @@ -1,4 +1,4 @@ ---[[ OpenSpace keybinding script ]]-- +--[[ OpenSpace keybinding script loaded from the rosetta.scene file ]]-- -- This script sets the default keybindings and is executed at startup -- Load the common helper functions @@ -12,18 +12,57 @@ helper.setDeltaTimeKeys({ 28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600 }) -openspace.bindKey("a", "openspace.setPropertyValue('Interaction.origin', '67P')") -openspace.bindKey("s", "openspace.setPropertyValue('Interaction.origin', 'Rosetta')") +openspace.bindKey( + "a", + "openspace.setPropertyValue('Interaction.origin', '67P')", + "Sets the focus of the camera on '67P'." +) +openspace.bindKey( + "s", + "openspace.setPropertyValue('Interaction.origin', 'Rosetta')", + "Sets the focus of the camera on 'Rosetta'." +) --- openspace.bindKey("F5", "openspace.setPropertyValue('Interaction.coordinateSystem', 'Sun'); openspace.printInfo('Changing Viewpoint to Sun');"); -openspace.bindKey("F6", "openspace.setPropertyValue('Interaction.coordinateSystem', '67P'); openspace.printInfo('Changing Viewpoint to 67P');"); -openspace.bindKey("F7", "openspace.time.setTime('2014-08-15T03:05:18.101')"); -openspace.bindKey("F8", "openspace.setPropertyValue('67P.renderable.ProjectionComponent.clearAllProjections', true);"); +openspace.bindKey( + "F5", + "openspace.time.setTime('2014-08-01T03:05:18.101')", + "Jumps to the time of initial approach of Rosetta to 67P." +) +openspace.bindKey( + "F6", + "openspace.time.setTime('2014-11-12T08:20:00.00')", + "Jumps to the time when the Philae lander is released." +) +openspace.bindKey( + "F8", + "openspace.setPropertyValue('67P.renderable.ProjectionComponent.clearAllProjections', true)", + "Removes all image projections from 67P." +) -openspace.bindKey("i", helper.renderable.toggle('ImagePlaneRosetta')) -openspace.bindKey("q", helper.renderable.toggle('SunMarker')) -openspace.bindKey("e", helper.renderable.toggle('JupiterTrail') .. helper.renderable.toggle('SaturnTrail') .. helper.renderable.toggle('UranusTrail') .. helper.renderable.toggle('NeptuneTrail')) -openspace.bindKey("f", helper.renderable.toggle('PhilaeTrail')) +openspace.bindKey( + "i", + helper.renderable.toggle('ImagePlaneRosetta'), + "Toggles the visibility of the free floating image plane." +) +openspace.bindKey( + "q", + helper.renderable.toggle('SunMarker'), + "Toggles the visibility of the text marking the location of the Sun." +) +openspace.bindKey( + "e", + helper.renderable.toggle('JupiterTrail') .. helper.renderable.toggle('SaturnTrail') .. + helper.renderable.toggle('UranusTrail') .. helper.renderable.toggle('NeptuneTrail'), + "Toggles the visibility of all trails further from the Sun than 67P." +) +openspace.bindKey( + "f", + helper.renderable.toggle('PhilaeTrail'), + "Toggles the visibility of Philae's trail." +) -openspace.bindKeyLocal("h", "openspace.parallel.setAddress('127.0.0.1');openspace.parallel.setPort('25001');openspace.parallel.setPassword('test');openspace.parallel.connect();openspace.parallel.requestHostship('test');") -openspace.bindKeyLocal("c", "openspace.parallel.setAddress('127.0.0.1');openspace.parallel.setPort('25001');openspace.parallel.setPassword('test');openspace.parallel.connect();") +openspace.bindKey( + "p", + helper.property.invert('67P.renderable.ProjectionComponent.performProjection'), + "Enables or disables the image projection on 67P." +) diff --git a/scripts/common.lua b/scripts/common.lua index 00fa5b2163..9f3e882e37 100644 --- a/scripts/common.lua +++ b/scripts/common.lua @@ -12,26 +12,67 @@ helper.scheduledScript.reversible = {} -- Function that sets the most common key bindings that are common to most (all?) -- scenes helper.setCommonKeys = function() - openspace.bindKeyLocal("F1", "openspace.gui.toggle()") - openspace.bindKeyLocal("F2", "openspace.setPerformanceMeasurement(true)") - openspace.bindKeyLocal("F3", "openspace.setPerformanceMeasurement(false)") + openspace.bindKeyLocal( + "F1", + "openspace.gui.toggle()", + "Toggles the visibility of the on-screen GUI." + ) + openspace.bindKeyLocal( + "F2", + helper.property.invert("RenderEngine.performanceMeasurements"), + "Toogles performance measurements that shows rendering time informations." + ) - openspace.bindKeyLocal("t", "openspace.toggleFrametimeType(1)") - openspace.bindKeyLocal("Shift+t", "openspace.toggleFrametimeType(0)") + openspace.bindKeyLocal( + "ESC", + "openspace.toggleShutdown()", + "Toggles the shutdown that will stop OpenSpace after a grace period. Press again to cancel the shutdown during this period." + ) - openspace.bindKeyLocal("ESC", "openspace.toggleShutdown()") + openspace.bindKeyLocal( + "PRINT_SCREEN", + "openspace.takeScreenshot()", + "Saves the contents of the screen to a file in the working directory." + ) + openspace.bindKey( + "SPACE", + "openspace.time.togglePause()", + "Starts and stops the simulation time." + ) - openspace.bindKeyLocal("PRINT_SCREEN", "openspace.takeScreenshot()") - openspace.bindKey("SPACE", "openspace.time.togglePause()") + openspace.bindKey( + "COMMA", + "openspace.setRenderer('Framebuffer');", + "Changes the currently used renderer to use the 'Framebuffer' implementation." + ) + openspace.bindKey( + "PERIOD", + "openspace.setRenderer('ABuffer');", + "Changes the currently used renderer to use the 'ABuffer' implementation." + ) - openspace.bindKey("COMMA", "openspace.setRenderer('Framebuffer');") - openspace.bindKey("PERIOD", "openspace.setRenderer('ABuffer');") + openspace.bindKey( + "f", + helper.property.invert('Interaction.horizontalFriction'), + "Toggles the horizontal friction of the camera. If it is disabled, the camera rotates around the focus object indefinitely." + ) - openspace.bindKey("f", helper.property.invert('Interaction.horizontalFriction')) - openspace.bindKey("Shift+f", helper.property.invert('Interaction.verticalFriction')) - openspace.bindKey("Ctrl+f", helper.property.invert('Interaction.rotationalFriction')) + openspace.bindKey( + "Shift+f", + helper.property.invert('Interaction.verticalFriction'), + "Toggles the vertical friction of the camera. If it is disabled, the camera rises up from or closes in towards the focus object indefinitely." + ) + openspace.bindKey( + "Ctrl+f", + helper.property.invert('Interaction.rotationalFriction'), + "Toggles the rotational friction of the camera. If it is disabled, the camera rotates around its own axis indefinitely." + ) - openspace.bindKey("w", "openspace.toggleFade(3)") + openspace.bindKey( + "w", + "openspace.toggleFade(3)", + "Toggles the fade to black within 3 seconds or shows the rendering after 3 seconds." + ) end helper.setDeltaTimeKeys = function(t) @@ -48,7 +89,11 @@ helper.setDeltaTimeKeys = function(t) end for i, v in ipairs(t) do - openspace.bindKey(Keys[i], 'openspace.time.setDeltaTime(' .. v .. ")") + openspace.bindKey( + Keys[i], + 'openspace.time.setDeltaTime(' .. v .. ")", + 'Setting the simulation speed to ' .. v .. ' seconds per realtime second' + ) end end @@ -62,7 +107,7 @@ end helper.property.increment = function(property, value) local v = value or 1 local escaped_property = "'" .. property .. "'" - return "openspace.setPropertyValue(" .. escaped_property .. ", openspace.getPropertyValue(" .. escaped_property .. ") + " .. v .. ")" + return "openspace.setPropertyValue(" .. escaped_property .. ", openspace.getPropertyValue(" .. escaped_property .. ") + " .. v .. ");" end -- Function that returns the string that decrements the 'property' by the 'value' diff --git a/shaders/PowerScaling/powerScalingMath.hglsl b/shaders/PowerScaling/powerScalingMath.hglsl index 035b21a958..58ffd0d978 100644 --- a/shaders/PowerScaling/powerScalingMath.hglsl +++ b/shaders/PowerScaling/powerScalingMath.hglsl @@ -30,7 +30,7 @@ const float k = 10.0; const float FLT_MAX = 1e38; // Not max but large enough for the purpose float log10(float x) { - return log(x) / log(10); + return log(x) / log(10.0); } vec4 psc_normalization(vec4 v) { diff --git a/shaders/fragment.glsl b/shaders/fragment.glsl index c409fbd073..1d122a49b9 100644 --- a/shaders/fragment.glsl +++ b/shaders/fragment.glsl @@ -25,8 +25,8 @@ #ifndef _FRAGMENT_GLSL_ #define _FRAGMENT_GLSL_ -#define BLEND_MODE_NORMAL 0 -#define BLEND_MODE_ADDITIVE 1 +#define BLEND_MODE_NORMAL 0u +#define BLEND_MODE_ADDITIVE 1u struct Fragment { vec4 color; diff --git a/shaders/framebuffer/raycastframebuffer.frag b/shaders/framebuffer/raycastframebuffer.frag index 0eab935531..375bed06b7 100644 --- a/shaders/framebuffer/raycastframebuffer.frag +++ b/shaders/framebuffer/raycastframebuffer.frag @@ -30,7 +30,7 @@ uniform sampler2DMS mainDepthTexture; uniform bool insideRaycaster; uniform vec3 cameraPosInRaycaster; - +uniform vec2 windowSize; #include "blending.glsl" #include "rand.glsl" @@ -56,8 +56,7 @@ uniform int nAaSamples; void main() { - vec2 texCoord = vec2(gl_FragCoord.x / #{rendererData.windowWidth}, - gl_FragCoord.y / #{rendererData.windowHeight}); + vec2 texCoord = vec2(gl_FragCoord.xy / windowSize); vec4 exitColorTexture = texture(exitColorTexture, texCoord); diff --git a/src/documentation/core_registration.cpp b/src/documentation/core_registration.cpp index 8777700213..4f87a5ee20 100644 --- a/src/documentation/core_registration.cpp +++ b/src/documentation/core_registration.cpp @@ -35,11 +35,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -54,7 +54,6 @@ namespace openspace { void registerCoreClasses(documentation::DocumentationEngine& engine) { engine.addDocumentation(ConfigurationManager::Documentation()); - engine.addDocumentation(Translation::Documentation()); engine.addDocumentation(Mission::Documentation()); engine.addDocumentation(Renderable::Documentation()); engine.addDocumentation(Rotation::Documentation()); @@ -63,6 +62,7 @@ void registerCoreClasses(documentation::DocumentationEngine& engine) { engine.addDocumentation(SceneGraphNode::Documentation()); engine.addDocumentation(ScreenSpaceRenderable::Documentation()); engine.addDocumentation(TimeRange::Documentation()); + engine.addDocumentation(Translation::Documentation()); } void registerCoreClasses(scripting::ScriptEngine& engine) { diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 0bcab0e7c3..0181f0178d 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -83,6 +83,7 @@ std::string generateTextDocumentation(const Documentation& d, int& indentLevel) result += indentMessage("Key", (p.key == "*") ? p.key : "\"" + p.key + "\""); result += indentMessage("Optional", (p.optional ? "true" : "false")); result += indentMessage("Type", p.verifier->type()); + result += indentMessage("Documentation", p.documentation); TableVerifier* tv = dynamic_cast(p.verifier.get()); ReferencingVerifier* rv = dynamic_cast(p.verifier.get()); @@ -134,6 +135,7 @@ std::string generateJsonDocumentation(const Documentation& d) { result << "\"key\": \"" << p.key << "\","; result << "\"optional\": " << (p.optional ? "true" : "false") << ","; result << "\"type\": \"" << p.verifier->type() << "\","; + result << "\"documentation\": \"" << p.documentation << "\","; TableVerifier* tv = dynamic_cast(p.verifier.get()); ReferencingVerifier* rv = dynamic_cast(p.verifier.get()); @@ -167,6 +169,7 @@ std::string generateJsonDocumentation(const Documentation& d) { if (&p != &d.entries.back()) { result << ", "; } + } result << ']'; @@ -186,6 +189,7 @@ std::string generateHtmlDocumentation(const Documentation& d) { << "\t\t\n" << "\t\t" << p.key << "\n" << "\t\t" << (p.optional ? "Optional" : "Required") << "\n" + << "\t\t" << p.documentation << "\n" << "\t\t" << p.verifier->type() << "\n"; TableVerifier* tv = dynamic_cast(p.verifier.get()); @@ -366,6 +370,13 @@ void DocumentationEngine::writeDocumentation(const std::string& f, const std::st } void DocumentationEngine::addDocumentation(Documentation doc) { + for (const DocumentationEntry& e : doc.entries) { + ghoul_assert( + e.documentation.find('"') == std::string::npos, + "Documentation cannot contain \" character" + ); + } + if (doc.id.empty()) { _documentations.push_back(std::move(doc)); } diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 4c68386f7c..28b83f13d1 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -41,6 +41,16 @@ template struct Vector4Verifier; template struct Vector4Verifier; template struct Vector4Verifier; +template struct Matrix2x2Verifier; +template struct Matrix2x3Verifier; +template struct Matrix2x4Verifier; +template struct Matrix3x2Verifier; +template struct Matrix3x3Verifier; +template struct Matrix3x4Verifier; +template struct Matrix4x2Verifier; +template struct Matrix4x3Verifier; +template struct Matrix4x4Verifier; + template struct LessVerifier; template struct LessVerifier; template struct LessEqualVerifier; @@ -188,6 +198,14 @@ std::string TableVerifier::type() const { return "Table"; } +StringListVerifier::StringListVerifier(std::string elementDocumentation) + : TableVerifier({{ "*", new StringVerifier, std::move(elementDocumentation) }}) +{} + +std::string StringListVerifier::type() const { + return "List of strings"; +} + ReferencingVerifier::ReferencingVerifier(std::string id) : identifier(std::move(id)) { diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index 2e326d520c..6cdfc6d496 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -70,6 +70,7 @@ const string ConfigurationManager::KeyCapabilitiesVerbosity = const string ConfigurationManager::KeyShutdownCountdown = "ShutdownCountdown"; const string ConfigurationManager::KeyDisableMasterRendering = "DisableRenderingOnMaster"; const string ConfigurationManager::KeyDownloadRequestURL = "DownloadRequestURL"; +const string ConfigurationManager::KeyPerSceneCache = "PerSceneCache"; const string ConfigurationManager::KeyRenderingMethod = "RenderingMethod"; const string ConfigurationManager::KeyOnScreenTextScaling = "OnScreenTextScaling"; diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 3f1b33c058..e53fb1b464 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -42,7 +42,8 @@ Documentation ConfigurationManager::Documentation() { { ConfigurationManager::KeyConfigScene, new StringAnnotationVerifier( - "A valid scene file as described in the Scene documentation"), + "A valid scene file as described in the Scene documentation" + ), "The scene description that is used to populate the application after " "startup. The scene determines which objects are loaded, the startup " "time and other scene-specific settings. More information is provided in " @@ -50,9 +51,7 @@ Documentation ConfigurationManager::Documentation() { }, { ConfigurationManager::KeyPaths, - new TableVerifier({ - { "*", new StringVerifier } - }), + new StringListVerifier, "A list of paths that are automatically registered with the file system. " "If a key X is used in the table, it is then useable by referencing ${X} " "in all other configuration files or scripts.", @@ -60,9 +59,7 @@ Documentation ConfigurationManager::Documentation() { }, { ConfigurationManager::KeyFonts, - new TableVerifier({ - { "*", new StringVerifier, "Font paths loadable by FreeType" } - }), + new StringListVerifier("Font paths loadable by FreeType"), "A list of all fonts that will automatically be loaded on startup. Each " "key-value pair contained in the table will become the name and the file " "for a font.", @@ -75,7 +72,7 @@ Documentation ConfigurationManager::Documentation() { ConfigurationManager::PartLogLevel, new StringInListVerifier( // List from logmanager.cpp::levelFromString - {"Debug", "Info", "Warning", "Error", "Fatal", "None" } + { "Debug", "Info", "Warning", "Error", "Fatal", "None" } ), "The severity of log messages that will be displayed. Only " "messages of the selected level or higher will be displayed. All " @@ -202,8 +199,8 @@ Documentation ConfigurationManager::Documentation() { new StringInListVerifier( // List taken from ScriptEngine::writeLog { "text" } - ), - "The type of logfile that will be created." + ), + "The type of logfile that will be created." }, { ConfigurationManager::PartFile, @@ -214,8 +211,8 @@ Documentation ConfigurationManager::Documentation() { } }), "Contains a log of all Lua scripts that were executed in the last " - "session.", - Optional::Yes + "session.", + Optional::Yes }, { ConfigurationManager::KeyKeyboardShortcuts, @@ -295,6 +292,15 @@ Documentation ConfigurationManager::Documentation() { "shutdown is aborted.", Optional::Yes }, + { + ConfigurationManager::KeyPerSceneCache, + new BoolVerifier, + "If this is set to 'true', the name of the scene will be appended to the " + "cache directory, thus not reusing the same directory. This is useful in " + "cases where the same instance of OpenSpace is run with multiple scenes, but " + "the caches should be retained. This value defaults to 'false'.", + Optional::Yes + }, { ConfigurationManager::KeyOnScreenTextScaling, new StringInListVerifier({ @@ -303,17 +309,15 @@ Documentation ConfigurationManager::Documentation() { }), "The method for scaling the onscreen text in the window. As the resolution " "of the rendering can be different from the size of the window, the onscreen " - "text can either be scaled according to the window size (\"window\"), or the " - "rendering resolution (\"framebuffer\"). This value defaults to \"window\".", + "text can either be scaled according to the window size ('window'), or the " + "rendering resolution ('framebuffer'). This value defaults to 'window'.", Optional::Yes }, { ConfigurationManager::KeyDownloadRequestURL, new OrVerifier( new StringVerifier, - new TableVerifier({ - { "*", new StringVerifier } - }) + new StringListVerifier ), "The URL from which files will be downloaded by the Launcher. This can " "either be a single URL or a list of possible URLs from which the " diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index 7cc15c84d5..4527c6041f 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -40,8 +40,9 @@ namespace { namespace openspace { void ModuleEngine::initialize() { - for (OpenSpaceModule* m : AllModules()) + for (OpenSpaceModule* m : AllModules()) { registerModule(std::unique_ptr(m)); + } } void ModuleEngine::deinitialize() { @@ -77,11 +78,25 @@ void ModuleEngine::registerModule(std::unique_ptr module) { std::vector ModuleEngine::modules() const { std::vector result; - for (auto& m : _modules) + for (auto& m : _modules) { result.push_back(m.get()); + } return result; } +ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version +ModuleEngine::requiredOpenGLVersion() const +{ + using Version = ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version; + Version version = { 0,0 }; + + for (const auto& m : _modules) { + version = std::max(version, m->requiredOpenGLVersion()); + } + + return version; +} + scripting::LuaLibrary ModuleEngine::luaLibrary() { return { "modules", diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 408fbc7f11..efbf494a30 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -156,10 +157,10 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName, , _shutdownWait(0.f) , _isFirstRenderingFirstFrame(true) { - _interactionHandler->setPropertyOwner(_globalPropertyNamespace.get()); _globalPropertyNamespace->addPropertySubOwner(_interactionHandler.get()); _globalPropertyNamespace->addPropertySubOwner(_settingsEngine.get()); + _globalPropertyNamespace->addPropertySubOwner(_renderEngine.get()); FactoryManager::initialize(); FactoryManager::ref().addFactory( @@ -288,10 +289,32 @@ bool OpenSpaceEngine::create(int argc, char** argv, return false; } - if (!commandlineArgumentPlaceholders.cacheFolder.empty()) { + bool hasCacheCommandline = !commandlineArgumentPlaceholders.cacheFolder.empty(); + bool hasCacheConfiguration = _engine->configurationManager().hasKeyAndValue( + ConfigurationManager::KeyPerSceneCache + ); + std::string cacheFolder = absPath("${CACHE}"); + if (hasCacheCommandline) { + cacheFolder = commandlineArgumentPlaceholders.cacheFolder; + //FileSys.registerPathToken( + // "${CACHE}", + // commandlineArgumentPlaceholders.cacheFolder, + // ghoul::filesystem::FileSystem::Override::Yes + //); + } + if (hasCacheConfiguration) { + std::string scene = _engine->configurationManager().value( + ConfigurationManager::KeyConfigScene + ); + cacheFolder += "-" + ghoul::filesystem::File(scene).baseName(); + } + + if (hasCacheCommandline || hasCacheConfiguration) { + LINFO("Old cache: " << absPath("${CACHE}")); + LINFO("New cache: " << cacheFolder); FileSys.registerPathToken( "${CACHE}", - commandlineArgumentPlaceholders.cacheFolder, + cacheFolder, ghoul::filesystem::FileSystem::Override::Yes ); } @@ -403,7 +426,17 @@ bool OpenSpaceEngine::initialize() { verbosity = verbosityMap[v]; } SysCap.logCapabilities(verbosity); - + + // Check the required OpenGL versions of the registered modules + ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version version = + _engine->_moduleEngine->requiredOpenGLVersion(); + LINFO("Required OpenGL version: " << version.toString()); + + if (OpenGLCap.openGLVersion() < version) { + LFATAL("Module required higher OpenGL version than is supported"); + return false; + } + std::string requestURL = ""; bool success = configurationManager().getValue(ConfigurationManager::KeyDownloadRequestURL, requestURL); if (success) { @@ -461,13 +494,13 @@ bool OpenSpaceEngine::initialize() { _renderEngine->setGlobalBlackOutFactor(0.0); _renderEngine->startFading(1, 3.0); - - //_interactionHandler->setKeyboardController(new interaction::KeyboardControllerFixed); - //_interactionHandler->setMouseController(new interaction::OrbitalMouseController); - // Run start up scripts - runPreInitializationScripts(scenePath); - + try { + runPreInitializationScripts(scenePath); + } + catch (const ghoul::RuntimeError& e) { + LFATALC(e.component, e.message); + } #ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED LINFO("Initializing GUI"); @@ -476,7 +509,8 @@ bool OpenSpaceEngine::initialize() { [&]() { std::vector res = { _settingsEngine.get(), - _interactionHandler.get() + _interactionHandler.get(), + _renderEngine.get() }; return res; } @@ -632,24 +666,6 @@ void OpenSpaceEngine::runScripts(const ghoul::Dictionary& scripts) { scripts.getValue(key, scriptPath); std::string&& absoluteScriptPath = absPath(scriptPath); _engine->scriptEngine().runScriptFile(absoluteScriptPath); - - //@JK - //temporary solution to ensure that startup scripts may be syncrhonized over parallel connection - /* - std::ifstream scriptFile; - scriptFile.open(absoluteScriptPath.c_str()); - std::string line; - - while(getline(scriptFile,line)){ - //valid line and not a comment - if(line.size() > 0 && line.at(0) != '-'){ - std::string lib, func; - if(_engine->scriptEngine().parseLibraryAndFunctionNames(lib, func, line) && - _engine->scriptEngine().shouldScriptBeSent(lib, func)){ - _engine->scriptEngine().cacheScript(lib, func, line); - } - } - }*/ } } @@ -739,14 +755,18 @@ void OpenSpaceEngine::loadFonts() { LERROR("Error registering font '" << font << "' with key '" << key << "'"); } - bool initSuccess = ghoul::fontrendering::FontRenderer::initialize(); - if (!initSuccess) - LERROR("Error initializing default font renderer"); - - ghoul::fontrendering::FontRenderer::defaultRenderer().setFramebufferSize( - _renderEngine->fontResolution() - ); - + try { + bool initSuccess = ghoul::fontrendering::FontRenderer::initialize(); + if (!initSuccess) + LERROR("Error initializing default font renderer"); + + ghoul::fontrendering::FontRenderer::defaultRenderer().setFramebufferSize( + _renderEngine->fontResolution() + ); + } + catch (const ghoul::RuntimeError& err) { + LERRORC(err.component, err.message); + } } void OpenSpaceEngine::configureLogging() { @@ -888,9 +908,6 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { // Step the camera using the current mouse velocities which are synced //_interactionHandler->updateCamera(); - - - #ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED if (_isMaster && _gui->isEnabled() && _windowWrapper->isRegularRendering()) { glm::vec2 mousePosition = _windowWrapper->mousePosition(); @@ -898,21 +915,13 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { glm::ivec2 windowSize = _windowWrapper->currentWindowSize(); glm::ivec2 renderingSize = _windowWrapper->currentWindowResolution(); uint32_t mouseButtons = _windowWrapper->mouseButtons(2); - - //glm::vec2 windowBufferCorrectionFactor = glm::vec2( - // static_cast(drawBufferResolution.x) / static_cast(windowSize.x), - // static_cast(drawBufferResolution.y) / static_cast(windowSize.y) - //); - - //LINFO("DrawBufferResolution: " << std::to_string(drawBufferResolution)); - //LINFO("Window Size: " << std::to_string(windowSize)); double dt = _windowWrapper->averageDeltaTime(); _gui->startFrame( static_cast(dt), glm::vec2(windowSize), - glm::vec2(renderingSize), + _windowWrapper->dpiScaling(), mousePosition, mouseButtons ); diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp index 82e88c5ab2..cce533a69a 100644 --- a/src/engine/settingsengine.cpp +++ b/src/engine/settingsengine.cpp @@ -48,7 +48,7 @@ namespace openspace { SettingsEngine::SettingsEngine() : _eyeSeparation("eyeSeparation", "Eye Separation" , 0.f, 0.f, 10.f) - , _scenes("scenes", "Scene", properties::OptionProperty::DisplayType::DROPDOWN) + , _scenes("scenes", "Scene", properties::OptionProperty::DisplayType::Dropdown) , _showFrameNumber("showFrameNumber", "Show frame number", false) , _busyWaitForDecode("busyWaitForDecode", "Busy Wait for decode", false) , _logSGCTOutOfOrderErrors("logSGCTOutOfOrderErrors", "Log SGCT out-of-order", false) diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index 965ff9b184..d70db6044d 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -90,19 +90,27 @@ uint32_t SGCTWindowWrapper::mouseButtons(int maxNumber) const { } glm::ivec2 SGCTWindowWrapper::currentWindowSize() const { - //return glm::ivec2(sgct::Engine::instance()->getCurrentWindowPtr()->getXResolution(), - // sgct::Engine::instance()->getCurrentWindowPtr()->getYResolution()); - - return glm::ivec2(sgct::Engine::instance()->getCurrentWindowPtr()->getXResolution(), - sgct::Engine::instance()->getCurrentWindowPtr()->getYResolution()); + auto window = sgct::Engine::instance()->getCurrentWindowPtr(); + switch (window->getStereoMode()) { + case sgct::SGCTWindow::Side_By_Side_Stereo: + case sgct::SGCTWindow::Side_By_Side_Inverted_Stereo: + return glm::ivec2( + window->getXResolution() / 2, + window->getYResolution()); + case sgct::SGCTWindow::Top_Bottom_Stereo: + case sgct::SGCTWindow::Top_Bottom_Inverted_Stereo: + return glm::ivec2( + window->getXResolution(), + window->getYResolution() / 2); + default: + return glm::ivec2( + window->getXResolution(), + window->getYResolution()); + } } glm::ivec2 SGCTWindowWrapper::currentWindowResolution() const { - //int width, height; - //auto window = sgct::Engine::instance()->getCurrentWindowPtr()->getWindowHandle(); - //glfwGetFramebufferSize(window, &width, &height); - //return glm::ivec2(width, height); - + auto window = sgct::Engine::instance()->getCurrentWindowPtr(); int x, y; sgct::Engine::instance()->getCurrentWindowPtr()->getFinalFBODimensions(x, y); return glm::ivec2(x, y); @@ -120,6 +128,13 @@ glm::ivec2 SGCTWindowWrapper::currentDrawBufferResolution() const { } throw WindowWrapperException("No viewport available"); } + +glm::vec2 SGCTWindowWrapper::dpiScaling() const { + return glm::vec2( + sgct::Engine::instance()->getCurrentWindowPtr()->getXScale(), + sgct::Engine::instance()->getCurrentWindowPtr()->getYScale() + ); +} int SGCTWindowWrapper::currentNumberOfAaSamples() const { return sgct::Engine::instance()->getCurrentWindowPtr()->getNumberOfAASamples(); diff --git a/src/engine/wrapper/windowwrapper.cpp b/src/engine/wrapper/windowwrapper.cpp index 6a2ac79009..436c34d87f 100644 --- a/src/engine/wrapper/windowwrapper.cpp +++ b/src/engine/wrapper/windowwrapper.cpp @@ -108,6 +108,10 @@ glm::ivec2 WindowWrapper::currentWindowResolution() const { glm::ivec2 WindowWrapper::currentDrawBufferResolution() const { return currentWindowSize(); } + +glm::vec2 WindowWrapper::dpiScaling() const { + return glm::vec2(1.f); +} int WindowWrapper::currentNumberOfAaSamples() const { return 1; diff --git a/src/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index 242f6cf4d0..e9af75dead 100644 --- a/src/interaction/interactionhandler.cpp +++ b/src/interaction/interactionhandler.cpp @@ -265,10 +265,11 @@ void InteractionHandler::keyboardCallback(Key key, KeyModifier modifier, KeyActi // iterate over key bindings auto ret = _keyLua.equal_range({ key, modifier }); for (auto it = ret.first; it != ret.second; ++it) { - OsEng.scriptEngine().queueScript(it->second.first, - it->second.second ? + auto remote = it->second.synchronization ? scripting::ScriptEngine::RemoteScripting::Yes : - scripting::ScriptEngine::RemoteScripting::No); + scripting::ScriptEngine::RemoteScripting::No; + + OsEng.scriptEngine().queueScript(it->second.command, remote); } } } @@ -372,22 +373,27 @@ void InteractionHandler::resetKeyBindings() { _keyLua.clear(); } -void InteractionHandler::bindKeyLocal(Key key, KeyModifier modifier, std::string lua) { +void InteractionHandler::bindKeyLocal(Key key, KeyModifier modifier, + std::string luaCommand, std::string documentation) +{ _keyLua.insert({ { key, modifier }, - std::make_pair(lua, false) + { std::move(luaCommand), Synchronized::No, std::move(documentation) } }); } -void InteractionHandler::bindKey(Key key, KeyModifier modifier, std::string lua) { +void InteractionHandler::bindKey(Key key, KeyModifier modifier, + std::string luaCommand, std::string documentation) +{ _keyLua.insert({ { key, modifier }, - std::make_pair(lua, true) + { std::move(luaCommand), Synchronized::Yes, std::move(documentation) } }); } -void InteractionHandler::writeKeyboardDocumentation(const std::string& type, const std::string& file) +void InteractionHandler::writeKeyboardDocumentation(const std::string& type, + const std::string& file) { if (type == "text") { std::ofstream f; @@ -396,13 +402,14 @@ void InteractionHandler::writeKeyboardDocumentation(const std::string& type, con for (const auto& p : _keyLua) { std::string remoteScriptingInfo; - bool remoteScripting = p.second.second; + bool remoteScripting = p.second.synchronization; if (!remoteScripting) { remoteScriptingInfo = " (LOCAL)"; } - f << std::to_string(p.first) << ": " << - p.second.first << remoteScriptingInfo << std::endl; + f << std::to_string(p.first) << ": " + << p.second.command << remoteScriptingInfo << '\n' + << p.second.documentation << '\n'; } } else if (type == "html") { @@ -446,8 +453,9 @@ void InteractionHandler::writeKeyboardDocumentation(const std::string& type, con first = false; json << "{"; json << "\"key\": \"" << std::to_string(p.first) << "\","; - json << "\"script\": \"" << p.second.first << "\""; - json << "\"remoteScripting\": \"" << (p.second.second ? "true" : "false") << "\""; + json << "\"script\": \"" << p.second.command << "\","; + json << "\"remoteScripting\": " << (p.second.synchronization ? "true," : "false,"); + json << "\"documentation\": \"" << p.second.documentation << "\""; json << "}"; } json << "]"; @@ -520,15 +528,21 @@ scripting::LuaLibrary InteractionHandler::luaLibrary() { { "bindKey", &luascriptfunctions::bindKey, - "string, string", + "string, string [,string]", "Binds a key by name to a lua string command to execute both locally " - "and to broadcast to clients if this is the host of a parallel session" + "and to broadcast to clients if this is the host of a parallel session. " + "The first argument is the key, the second argument is the Lua command " + "that is to be executed, and the optional third argument is a human " + "readable description of the command for documentation purposes." }, { "bindKeyLocal", &luascriptfunctions::bindKeyLocal, - "string, string", - "Binds a key by name to a lua string command to execute only locally" + "string, string [,string]", + "Binds a key by name to a lua string command to execute only locally. " + "The first argument is the key, the second argument is the Lua command " + "that is to be executed, and the optional third argument is a human " + "readable description of the command for documentation purposes." }, { "setInteractionMode", diff --git a/src/interaction/interactionhandler_lua.inl b/src/interaction/interactionhandler_lua.inl index 7fb9388858..21ad7fc862 100644 --- a/src/interaction/interactionhandler_lua.inl +++ b/src/interaction/interactionhandler_lua.inl @@ -68,15 +68,20 @@ int bindKey(lua_State* L) { using ghoul::lua::luaTypeToString; int nArguments = lua_gettop(L); - if (nArguments != 2) - return luaL_error(L, "Expected %i arguments, got %i", 2, nArguments); + if (nArguments != 2 && nArguments != 3) { + return luaL_error(L, "Expected %i or %i arguments, got %i", 2, 3, nArguments); + } + int KeyLocation = nArguments == 3 ? -3 : -2; + int CommandLocation = nArguments == 3 ? -2 : -1; + int DocumentationLocation = -1; - std::string key = luaL_checkstring(L, -2); - std::string command = luaL_checkstring(L, -1); + std::string key = luaL_checkstring(L, KeyLocation); + std::string command = luaL_checkstring(L, CommandLocation); - if (command.empty()) + if (command.empty()) { return luaL_error(L, "Command string is empty"); + } openspace::KeyWithModifier iKey = openspace::stringToKey(key); @@ -85,11 +90,16 @@ int bindKey(lua_State* L) { return 0; } + std::string documentation; + if (nArguments == 3) { + documentation = luaL_checkstring(L, DocumentationLocation); + } OsEng.interactionHandler().bindKey( iKey.key, iKey.modifier, - command + std::move(command), + std::move(documentation) ); return 0; @@ -104,12 +114,17 @@ int bindKeyLocal(lua_State* L) { using ghoul::lua::luaTypeToString; int nArguments = lua_gettop(L); - if (nArguments != 2) - return luaL_error(L, "Expected %i arguments, got %i", 2, nArguments); + if (nArguments != 2 && nArguments != 3) { + return luaL_error(L, "Expected %i or %i arguments, got %i", 2, 3, nArguments); + } + int KeyLocation = nArguments == 3 ? -3 : -2; + int CommandLocation = nArguments == 3 ? -2 : -1; + int DocumentationLocation = -1; + + std::string key = luaL_checkstring(L, KeyLocation); + std::string command = luaL_checkstring(L, CommandLocation); - std::string key = luaL_checkstring(L, -2); - std::string command = luaL_checkstring(L, -1); if (command.empty()) return luaL_error(L, "Command string is empty"); @@ -121,10 +136,16 @@ int bindKeyLocal(lua_State* L) { return 0; } + std::string documentation; + if (nArguments == 3) { + documentation = luaL_checkstring(L, DocumentationLocation); + } + OsEng.interactionHandler().bindKeyLocal( iKey.key, iKey.modifier, - command + std::move(command), + std::move(documentation) ); return 0; diff --git a/src/network/parallelconnection.cpp b/src/network/parallelconnection.cpp index 02c64e2afb..9eb0a8d60c 100644 --- a/src/network/parallelconnection.cpp +++ b/src/network/parallelconnection.cpp @@ -52,6 +52,15 @@ #endif #endif +#ifdef WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#include +#include +#endif + //openspace includes #include #include diff --git a/src/performance/performancemanager.cpp b/src/performance/performancemanager.cpp index 6c0630f5e3..fae9acafbc 100644 --- a/src/performance/performancemanager.cpp +++ b/src/performance/performancemanager.cpp @@ -264,12 +264,26 @@ void PerformanceManager::storeScenePerformanceMeasurements( entry.renderTime[PerformanceLayout::NumberValues - 1] = r.renderTime / 1000.f; std::rotate( - std::begin(entry.updateEphemeris), - std::next(std::begin(entry.updateEphemeris)), - std::end(entry.updateEphemeris) + std::begin(entry.updateTranslation), + std::next(std::begin(entry.updateTranslation)), + std::end(entry.updateTranslation) ); - entry.updateEphemeris[PerformanceLayout::NumberValues - 1] = r.updateTimeEphemeris / 1000.f; - + entry.updateTranslation[PerformanceLayout::NumberValues - 1] = r.updateTimeTranslation / 1000.f; + + std::rotate( + std::begin(entry.updateRotation), + std::next(std::begin(entry.updateRotation)), + std::end(entry.updateRotation) + ); + entry.updateRotation[PerformanceLayout::NumberValues - 1] = r.updateTimeRotation / 1000.f; + + std::rotate( + std::begin(entry.updateScaling), + std::next(std::begin(entry.updateScaling)), + std::end(entry.updateScaling) + ); + entry.updateScaling[PerformanceLayout::NumberValues - 1] = r.updateTimeScaling / 1000.f; + std::rotate( std::begin(entry.updateRenderable), std::next(std::begin(entry.updateRenderable)), diff --git a/src/properties/optionproperty.cpp b/src/properties/optionproperty.cpp index b205a4e9fd..f3a6112f9c 100644 --- a/src/properties/optionproperty.cpp +++ b/src/properties/optionproperty.cpp @@ -35,7 +35,7 @@ const std::string OptionProperty::OptionsKey = "Options"; OptionProperty::OptionProperty(std::string identifier, std::string guiName) : IntProperty(std::move(identifier), std::move(guiName)) - , _displayType(DisplayType::RADIO) + , _displayType(DisplayType::Radio) {} OptionProperty::OptionProperty(std::string identifier, std::string guiName, DisplayType displayType) @@ -61,7 +61,7 @@ void OptionProperty::addOption(int value, std::string desc) { option.value = value; option.description = desc; - for (auto o : _options) { + for (const auto& o : _options) { if (o.value == option.value) { LWARNING("The value of option {" << o.value << " -> " << o.description << "} was already registered when trying to add option {" << option.value << diff --git a/src/rendering/abufferrenderer.cpp b/src/rendering/abufferrenderer.cpp index c38e3c9487..1d4fc632c1 100644 --- a/src/rendering/abufferrenderer.cpp +++ b/src/rendering/abufferrenderer.cpp @@ -561,8 +561,6 @@ void ABufferRenderer::updateRendererData() { PerfMeasure("ABufferRenderer::updateRendererData"); ghoul::Dictionary dict; - dict.setValue("windowWidth", _resolution.x); - dict.setValue("windowHeight", _resolution.y); dict.setValue("fragmentRendererPath", std::string(RenderFragmentShaderPath)); dict.setValue("postFragmentRendererPath", std::string(PostRenderFragmentShaderPath)); dict.setValue("maxLayers", MaxLayers); diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index af1c2c23c2..7b1dd34a93 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -125,8 +125,6 @@ void FramebufferRenderer::initialize() { } OsEng.renderEngine().raycasterManager().addListener(*this); - - } void FramebufferRenderer::deinitialize() { @@ -153,8 +151,6 @@ void FramebufferRenderer::raycastersChanged(VolumeRaycaster& raycaster, bool att } void FramebufferRenderer::update() { - PerfMeasure("FramebufferRenderer::update"); - if (_dirtyResolution) { updateResolution(); } @@ -206,14 +202,11 @@ void FramebufferRenderer::update() { } void FramebufferRenderer::updateResolution() { - int nSamples = _nAaSamples; - PerfMeasure("FramebufferRenderer::updateResolution"); - glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainColorTexture); glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, - nSamples, + _nAaSamples, GL_RGBA, GLsizei(_resolution.x), GLsizei(_resolution.y), @@ -222,7 +215,7 @@ void FramebufferRenderer::updateResolution() { glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _mainDepthTexture); glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, - nSamples, + _nAaSamples, GL_DEPTH_COMPONENT32F, GLsizei(_resolution.x), GLsizei(_resolution.y), @@ -263,8 +256,6 @@ void FramebufferRenderer::updateResolution() { } void FramebufferRenderer::updateRaycastData() { - PerfMeasure("FramebufferRenderer::updateRaycastData"); - _raycastData.clear(); _exitPrograms.clear(); _raycastPrograms.clear(); @@ -319,7 +310,13 @@ void FramebufferRenderer::updateRaycastData() { } void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasurements) { - PerfMeasure("FramebufferRenderer::render"); + std::unique_ptr perf; + if (doPerformanceMeasurements) { + perf = std::make_unique( + "FramebufferRenderer::render", + OsEng.renderEngine().performanceManager() + ); + } if (!_scene) return; @@ -401,6 +398,7 @@ void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasure raycastProgram->setUniform("mainDepthTexture", mainDepthTextureUnit); raycastProgram->setUniform("nAaSamples", _nAaSamples); + raycastProgram->setUniform("windowSize", glm::vec2(_resolution)); glDisable(GL_DEPTH_TEST); @@ -467,19 +465,13 @@ void FramebufferRenderer::setNAaSamples(int nAaSamples) { } void FramebufferRenderer::updateRendererData() { - PerfMeasure("FramebufferRenderer::updateRendererData"); - ghoul::Dictionary dict; dict.setValue("fragmentRendererPath", std::string(RenderFragmentShaderPath)); dict.setValue("postFragmentRendererPath", std::string(PostRenderFragmentShaderPath)); - dict.setValue("windowWidth", _resolution.x); - dict.setValue("windowHeight", _resolution.y); _rendererData = dict; OsEng.renderEngine().setRendererData(dict); } - } - diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 04667c4372..b6c4519025 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -114,6 +114,12 @@ const std::vector RenderEngine::FrametimeTypes({ RenderEngine::RenderEngine() : _mainCamera(nullptr) + , _performanceMeasurements("performanceMeasurements", "Performance Measurements") + , _frametimeType( + "frametimeType", + "Type of the frametime display", + properties::OptionProperty::DisplayType::Dropdown + ) , _sceneGraph(nullptr) , _renderer(nullptr) , _rendererImplementation(RendererImplementation::Invalid) @@ -128,14 +134,36 @@ RenderEngine::RenderEngine() , _currentFadeTime(0.f) , _fadeDirection(0) , _frameNumber(0) - , _frametimeType(FrametimeType::DtTimeAvg) - // , _sgctRenderStatisticsVisible(false) + //, _frametimeType(FrametimeType::DtTimeAvg) { - _onScreenInformation = { - glm::vec2(0.f), - 12, - -1 - }; + setName("RenderEngine"); + + _performanceMeasurements.onChange([this](){ + if (_performanceMeasurements) { + if (!_performanceManager) { + _performanceManager = std::make_unique(); + } + } + else { + _performanceManager = nullptr; + } + + }); + addProperty(_performanceMeasurements); + + _frametimeType.addOption( + static_cast(FrametimeType::DtTimeAvg), + "Average Deltatime" + ); + _frametimeType.addOption( + static_cast(FrametimeType::FPS), + "Frames per second" + ); + _frametimeType.addOption( + static_cast(FrametimeType::FPSAvg), + "Average frames per second" + ); + addProperty(_frametimeType); } RenderEngine::~RenderEngine() { @@ -339,8 +367,8 @@ void RenderEngine::updateSceneGraph() { glm::dmat3(1), 1, Time::ref().j2000Seconds(), - Time::ref().timeJumped(), Time::ref().deltaTime(), + Time::ref().timeJumped(), _performanceManager != nullptr }); @@ -516,21 +544,6 @@ void RenderEngine::toggleInfoText(bool b) { _showInfo = b; } -void RenderEngine::toggleFrametimeType(int t) { - std::vector::const_iterator it = std::find( - FrametimeTypes.begin(), FrametimeTypes.end(), _frametimeType); - - if (!t && it == FrametimeTypes.begin()) - it = FrametimeTypes.end(); - - t > 0 ? ++it : --it; - - if (t && it == FrametimeTypes.end()) - it = FrametimeTypes.begin(); - - _frametimeType = *it; -} - Scene* RenderEngine::scene() { ghoul_assert(_sceneGraph, "Scenegraph not initialized"); return _sceneGraph; @@ -760,18 +773,6 @@ scripting::LuaLibrary RenderEngine::luaLibrary() { "bool", "Toggles the showing of render information on-screen text" }, - { - "toggleFrametimeType", - &luascriptfunctions::toggleFrametimeType, - "int", - "Toggle showing FPS or Average Frametime in heads up info" - }, - { - "setPerformanceMeasurement", - &luascriptfunctions::setPerformanceMeasurement, - "bool", - "Sets the performance measurements" - }, { "toggleFade", &luascriptfunctions::toggleFade, @@ -807,17 +808,6 @@ scripting::LuaLibrary RenderEngine::luaLibrary() { }; } -void RenderEngine::setPerformanceMeasurements(bool performanceMeasurements) { - if (performanceMeasurements) { - if (!_performanceManager) { - _performanceManager = std::make_unique(); - } - } - else { - _performanceManager = nullptr; - } -} - bool RenderEngine::doesPerformanceMeasurements() const { return _performanceManager != nullptr; } @@ -1319,7 +1309,8 @@ void RenderEngine::renderInformation() { Time::ref().deltaTime() ); - switch (_frametimeType) { + FrametimeType frametimeType = FrametimeType(_frametimeType.value()); + switch (frametimeType) { case FrametimeType::DtTimeAvg: RenderFontCr(*_fontInfo, penPosition, @@ -1755,9 +1746,7 @@ void RenderEngine::renderScreenLog() { } std::vector RenderEngine::getSyncables(){ - std::vector syncables = _mainCamera->getSyncables(); - syncables.push_back(&_onScreenInformation); - return syncables; + return _mainCamera->getSyncables(); } void RenderEngine::sortScreenspaceRenderables() { diff --git a/src/rendering/renderengine_lua.inl b/src/rendering/renderengine_lua.inl index de2aa3b519..4134ce44fc 100644 --- a/src/rendering/renderengine_lua.inl +++ b/src/rendering/renderengine_lua.inl @@ -105,40 +105,6 @@ int showRenderInformation(lua_State* L) { return 0; } -/** -* \ingroup LuaScripts -* toggleFramerateType(bool): -* Cycle through showing FPS or Average Frametime in heads up info -*/ -int toggleFrametimeType(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 1) - return luaL_error(L, "Expected %i arguments, got %i", 1, nArguments); - - const int type = lua_type(L, -1); - if (type != LUA_TNUMBER) - return luaL_error(L, "Expected argument of type 'number'"); - int t = lua_tonumber(L, -1); - OsEng.renderEngine().toggleFrametimeType(t); - return 0; -} - -/** -* \ingroup LuaScripts -* visualizeABuffer(bool): -* Toggle the visualization of the ABuffer -*/ -int setPerformanceMeasurement(lua_State* L) { - int nArguments = lua_gettop(L); - if (nArguments != 1) { - return luaL_error(L, "Expected %i arguments, got %i", 1, nArguments); - } - - bool b = lua_toboolean(L, -1) != 0; - OsEng.renderEngine().setPerformanceMeasurements(b); - return 0; -} - /** * \ingroup LuaScripts * toggleFade(float): diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index a4d77d54ff..ac814c8ec2 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -69,7 +69,9 @@ Rotation* Rotation::createFromDictionary(const ghoul::Dictionary& dictionary) { return result; } -Rotation::Rotation() {} +Rotation::Rotation() { + setName("Rotation"); +} Rotation::Rotation(const ghoul::Dictionary& dictionary) {} @@ -79,6 +81,10 @@ bool Rotation::initialize() { return true; } +const glm::dmat3& Rotation::matrix() const { + return _matrix; +} + void Rotation::update(const UpdateData& data) {} } // namespace openspace \ No newline at end of file diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index c58c83ead6..ef43e0b4f6 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -64,6 +64,7 @@ Scale* Scale::createFromDictionary(const ghoul::Dictionary& dictionary) { auto factory = FactoryManager::ref().factory(); Scale* result = factory->create(scaleType, dictionary); + result->setName("Scale"); if (result == nullptr) { LERROR("Failed creating Scale object of type '" << scaleType << "'"); return nullptr; diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index a87e7a9b52..f02af89741 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -22,7 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -// open space includes #include #include @@ -31,7 +30,6 @@ #include #include -// ghoul includes #include #include #include @@ -77,13 +75,7 @@ SceneGraphNode* SceneGraphNode::createFromDictionary(const ghoul::Dictionary& di SceneGraphNode* result = new SceneGraphNode; - if (!dictionary.hasValue(KeyName)) { - LERROR("SceneGraphNode did not contain a '" << KeyName << "' key"); - delete result; - return nullptr; - } - std::string name; - dictionary.getValue(KeyName, name); + std::string name = dictionary.value(KeyName); result->setName(name); if (dictionary.hasValue(KeyRenderable)) { @@ -106,60 +98,48 @@ SceneGraphNode* SceneGraphNode::createFromDictionary(const ghoul::Dictionary& di if (dictionary.hasKey(keyTransformTranslation)) { ghoul::Dictionary translationDictionary; dictionary.getValue(keyTransformTranslation, translationDictionary); - result->_translation = - (Translation::createFromDictionary(translationDictionary)); - if (result->_translation == nullptr) { + result->_transform.translation = + std::unique_ptr(Translation::createFromDictionary(translationDictionary)); + if (result->_transform.translation == nullptr) { LERROR("Failed to create ephemeris for SceneGraphNode '" << result->name() << "'"); delete result; return nullptr; } + result->addPropertySubOwner(result->_transform.translation.get()); LDEBUG("Successfully created ephemeris for '" << result->name() << "'"); } if (dictionary.hasKey(keyTransformRotation)) { ghoul::Dictionary rotationDictionary; dictionary.getValue(keyTransformRotation, rotationDictionary); - result->_rotation = - (Rotation::createFromDictionary(rotationDictionary)); - if (result->_rotation == nullptr) { + result->_transform.rotation = + std::unique_ptr(Rotation::createFromDictionary(rotationDictionary)); + if (result->_transform.rotation == nullptr) { LERROR("Failed to create rotation for SceneGraphNode '" << result->name() << "'"); delete result; return nullptr; } + result->addPropertySubOwner(result->_transform.rotation.get()); LDEBUG("Successfully created rotation for '" << result->name() << "'"); } if (dictionary.hasKey(keyTransformScale)) { ghoul::Dictionary scaleDictionary; dictionary.getValue(keyTransformScale, scaleDictionary); - result->_scale = - (Scale::createFromDictionary(scaleDictionary)); - if (result->_scale == nullptr) { + result->_transform.scale = + std::unique_ptr(Scale::createFromDictionary(scaleDictionary)); + if (result->_transform.scale == nullptr) { LERROR("Failed to create scale for SceneGraphNode '" << result->name() << "'"); delete result; return nullptr; } + result->addPropertySubOwner(result->_transform.scale.get()); LDEBUG("Successfully created scale for '" << result->name() << "'"); } - //std::string parentName; - //if (!dictionary.getValue(KeyParentName, parentName)) { - // LWARNING("Could not find '" << KeyParentName << "' key, using 'Root'."); - // parentName = "Root"; - //} - - //SceneGraphNode* parentNode = sceneGraphNode(parentName); - //if (parentNode == nullptr) { - // LFATAL("Could not find parent named '" - // << parentName << "' for '" << result->name() << "'." - // << " Check module definition order. Skipping module."); - //} - - //parentNode->addNode(result); - LDEBUG("Successfully created SceneGraphNode '" << result->name() << "'"); return result; @@ -167,9 +147,11 @@ SceneGraphNode* SceneGraphNode::createFromDictionary(const ghoul::Dictionary& di SceneGraphNode::SceneGraphNode() : _parent(nullptr) - , _translation(new StaticTranslation()) - , _rotation(new StaticRotation()) - , _scale(new StaticScale()) + , _transform { + std::make_unique(), + std::make_unique(), + std::make_unique() + } , _performanceRecord({0, 0, 0}) , _renderable(nullptr) , _renderableVisible(false) @@ -182,15 +164,20 @@ SceneGraphNode::~SceneGraphNode() { } bool SceneGraphNode::initialize() { - if (_renderable) + if (_renderable) { _renderable->initialize(); + } - if (_translation) - _translation->initialize(); - if (_rotation) - _rotation->initialize(); - if (_scale) - _scale->initialize(); + if (_transform.translation) { + _transform.translation->initialize(); + } + + if (_transform.rotation) { + _transform.rotation->initialize(); + } + if (_transform.scale) { + _transform.scale->initialize(); + } return true; } @@ -203,26 +190,6 @@ bool SceneGraphNode::deinitialize() { delete _renderable; _renderable = nullptr; } - if (_translation) { - delete _translation; - _translation = nullptr; - } - if (_rotation) { - delete _rotation; - _rotation = nullptr; - } - if (_scale) { - delete _scale; - _scale = nullptr; - } - - //delete _ephemeris; - //_ephemeris = nullptr; - - // for (SceneGraphNode* child : _children) { - // child->deinitialize(); - // delete child; - //} _children.clear(); // reset variables @@ -235,49 +202,52 @@ bool SceneGraphNode::deinitialize() { } void SceneGraphNode::update(const UpdateData& data) { - if (_translation) { + if (_transform.translation) { if (data.doPerformanceMeasurement) { glFinish(); auto start = std::chrono::high_resolution_clock::now(); - _translation->update(data); + _transform.translation->update(data); glFinish(); auto end = std::chrono::high_resolution_clock::now(); - _performanceRecord.updateTimeEphemeris = (end - start).count(); + _performanceRecord.updateTimeTranslation = (end - start).count(); + } + else { + _transform.translation->update(data); } - else - _translation->update(data); } - if (_rotation) { + if (_transform.rotation) { if (data.doPerformanceMeasurement) { glFinish(); auto start = std::chrono::high_resolution_clock::now(); - _rotation->update(data); + _transform.rotation->update(data); glFinish(); auto end = std::chrono::high_resolution_clock::now(); - _performanceRecord.updateTimeEphemeris = (end - start).count(); + _performanceRecord.updateTimeRotation = (end - start).count(); + } + else { + _transform.rotation->update(data); } - else - _rotation->update(data); } - if (_scale) { + if (_transform.scale) { if (data.doPerformanceMeasurement) { glFinish(); auto start = std::chrono::high_resolution_clock::now(); - _scale->update(data); + _transform.scale->update(data); glFinish(); auto end = std::chrono::high_resolution_clock::now(); - _performanceRecord.updateTimeEphemeris = (end - start).count(); + _performanceRecord.updateTimeScaling = (end - start).count(); + } + else { + _transform.scale->update(data); } - else - _scale->update(data); } UpdateData newUpdateData = data; @@ -358,7 +328,7 @@ void SceneGraphNode::render(const RenderData& data, RendererTasks& tasks) { _worldRotationCached, _worldScaleCached}; - _performanceRecord.renderTime = 0; + //_performanceRecord.renderTime = 0; bool visible = _renderableVisible && _renderable->isVisible() && @@ -391,7 +361,7 @@ void SceneGraphNode::postRender(const RenderData& data) { const psc thisPosition = psc::CreatePowerScaledCoordinate(_worldPositionCached.x, _worldPositionCached.y, _worldPositionCached.z); RenderData newData = { data.camera, thisPosition, data.doPerformanceMeasurement, data.renderBinMask, _worldPositionCached}; - _performanceRecord.renderTime = 0; + //_performanceRecord.renderTime = 0; if (_renderableVisible && _renderable->isVisible() && _renderable->isReady() && _renderable->isEnabled()) { _renderable->postRender(newData); } @@ -431,17 +401,17 @@ void SceneGraphNode::addChild(SceneGraphNode* child) { glm::dvec3 SceneGraphNode::position() const { - return _translation->position(); + return _transform.translation->position(); } const glm::dmat3& SceneGraphNode::rotationMatrix() const { - return _rotation->matrix(); + return _transform.rotation->matrix(); } double SceneGraphNode::scale() const { - return _scale->scaleValue(); + return _transform.scale->scaleValue(); } glm::dvec3 SceneGraphNode::worldPosition() const diff --git a/src/scene/scenegraphnode_doc.inl b/src/scene/scenegraphnode_doc.inl index 27b6ba7293..ba183dd42f 100644 --- a/src/scene/scenegraphnode_doc.inl +++ b/src/scene/scenegraphnode_doc.inl @@ -39,7 +39,8 @@ Documentation SceneGraphNode::Documentation() { "The name of this scenegraph node. This name must be unique among all scene " "graph nodes that are loaded in a specific scene. If a duplicate is detected " "the loading of the node will fail, as will all childing that depend on the " - "node." + "node.", + Optional::No }, { "Parent", @@ -49,7 +50,8 @@ Documentation SceneGraphNode::Documentation() { "This names the parent of the currently specified scenegraph node. The " "parent must not have been defined earlier, but must exist at loading time, " "or the scenegraph node creation will fail. A special parent 'Root' is " - "available that denotes the root of the scenegraph." + "available that denotes the root of the scenegraph.", + Optional::No }, { "Renderable", diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index b355f50163..ad0cbcafef 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -39,7 +39,7 @@ namespace openspace { Documentation Translation::Documentation() { using namespace openspace::documentation; - return{ + return { "Transformation Translation", "core_transform_translation", { @@ -68,6 +68,7 @@ Translation* Translation::createFromDictionary(const ghoul::Dictionary& dictiona ghoul::TemplateFactory* factory = FactoryManager::ref().factory(); Translation* result = factory->create(translationType, dictionary); + result->setName("Translation"); if (result == nullptr) { LERROR("Failed creating Translation object of type '" << translationType << "'"); return nullptr; diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index dc61f1c014..c326e3256c 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -67,6 +67,12 @@ std::vector OpenSpaceModule::documentations() const { return {}; } +ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version +OpenSpaceModule::requiredOpenGLVersion() const +{ + return { 3, 3 }; +} + std::string OpenSpaceModule::modulePath() const { std::string moduleName = name(); std::transform(moduleName.begin(), moduleName.end(), moduleName.begin(), tolower); diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 04adf37437..b997b88fa6 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -124,6 +124,7 @@ function (add_external_dependencies) set(SGCT_TEXT OFF CACHE BOOL "" FORCE) set(SGCT_BUILD_CSHARP_PROJECTS OFF CACHE BOOL "" FORCE) set(SGCT_LIGHT_ONLY ON CACHE BOOL "" FORCE) + set(SGCT_CUSTOMOUTPUTDIRS OFF CACHE BOOL "" FORCE) add_subdirectory(${OPENSPACE_EXT_DIR}/sgct) target_include_directories(libOpenSpace SYSTEM PUBLIC ${OPENSPACE_EXT_DIR}/sgct/include) diff --git a/tests/test_documentation.inl b/tests/test_documentation.inl index da672ca414..c14af8d1df 100644 --- a/tests/test_documentation.inl +++ b/tests/test_documentation.inl @@ -336,6 +336,63 @@ TEST_F(DocumentationTest, TableVerifierType) { EXPECT_EQ(TestResult::Offense::Reason::MissingKey, negativeRes.offenses[0].reason); } +TEST_F(DocumentationTest, StringListVerifierType) { + using namespace openspace::documentation; + using namespace std::string_literals; + + Documentation doc { + { { "StringList", new StringListVerifier } } + }; + + ghoul::Dictionary positive { + { + "StringList", + ghoul::Dictionary { + { "1", "a"s }, + { "2", "b"s }, + { "3", "c"s } + } + } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "StringList", 0 } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("StringList", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { + "StringList", + ghoul::Dictionary { + { "1", "a"s }, + { "2", "b"s }, + { "3", 2.0 } + } + } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("StringList.3", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negativeExist { + { "StringList2", ghoul::Dictionary{} } + }; + negativeRes = testSpecification(doc, negativeExist); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("StringList", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::MissingKey, negativeRes.offenses[0].reason); +} + TEST_F(DocumentationTest, MixedVerifiers) { using namespace openspace::documentation; using namespace std::string_literals; @@ -2308,6 +2365,303 @@ TEST_F(DocumentationTest, DoubleVector4Verifier) { EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); } +TEST_F(DocumentationTest, DoubleMatrix2x2Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix2x2Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat2x2(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary { { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + +TEST_F(DocumentationTest, DoubleMatrix2x3Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix2x3Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat2x3(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary{ { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + +TEST_F(DocumentationTest, DoubleMatrix2x4Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix2x4Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat2x4(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary{ { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + +TEST_F(DocumentationTest, DoubleMatrix3x2Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix3x2Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat3x2(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary{ { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + +TEST_F(DocumentationTest, DoubleMatrix3x3Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix3x3Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat3x3(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary{ { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + +TEST_F(DocumentationTest, DoubleMatrix3x4Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix3x4Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat3x4(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary{ { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + +TEST_F(DocumentationTest, DoubleMatrix4x2Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix4x2Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat4x2(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary{ { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + +TEST_F(DocumentationTest, DoubleMatrix4x3Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix4x3Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat4x3(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary{ { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + +TEST_F(DocumentationTest, DoubleMatrix4x4Verifier) { + using namespace openspace::documentation; + + Documentation doc { + { { "a", new DoubleMatrix4x4Verifier } } + }; + + ghoul::Dictionary positive { + { "a", glm::dmat4x4(1.0) } + }; + TestResult positiveRes = testSpecification(doc, positive); + EXPECT_TRUE(positiveRes.success); + EXPECT_EQ(0, positiveRes.offenses.size()); + + ghoul::Dictionary negative { + { "a", ghoul::Dictionary{ { "1", true },{ "2", 1.0 },{ "3", "s" } } } + }; + TestResult negativeRes = testSpecification(doc, negative); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); + + ghoul::Dictionary negative2 { + { "a", true } + }; + negativeRes = testSpecification(doc, negative2); + EXPECT_FALSE(negativeRes.success); + ASSERT_EQ(1, negativeRes.offenses.size()); + EXPECT_EQ("a", negativeRes.offenses[0].offender); + EXPECT_EQ(TestResult::Offense::Reason::WrongType, negativeRes.offenses[0].reason); +} + TEST_F(DocumentationTest, DeprecatedVerifier) { using namespace openspace::documentation; using namespace std::string_literals;