diff --git a/.gitignore b/.gitignore index eed900b2fe..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,24 +45,38 @@ 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/dione/textures data/scene/saturn/enceladus/textures @@ -81,11 +86,6 @@ data/scene/saturn/rhea/textures data/scene/saturn/saturn/textures data/scene/saturn/tethys/textures data/scene/saturn/titan/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/stars/colorbv.cmap data/scene/stars/speck data/scene/stars/textures 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 62b0705b20..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 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 cd796cc1d4..d708b20500 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'), + "ssdasd" ) -- 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'), + "asdasd" ) + --[[ + -- 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 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/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/newhorizons/jupiter/callisto/callisto.data b/data/scene/missions/newhorizons/jupiter/callisto/callisto.data similarity index 100% rename from data/scene/newhorizons/jupiter/callisto/callisto.data rename to data/scene/missions/newhorizons/jupiter/callisto/callisto.data diff --git a/data/scene/newhorizons/jupiter/callisto/callisto.mod b/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod similarity index 100% rename from data/scene/newhorizons/jupiter/callisto/callisto.mod rename to data/scene/missions/newhorizons/jupiter/callisto/callisto.mod 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/newhorizons/jupiter/europa/europa.data b/data/scene/missions/newhorizons/jupiter/europa/europa.data similarity index 100% rename from data/scene/newhorizons/jupiter/europa/europa.data rename to data/scene/missions/newhorizons/jupiter/europa/europa.data diff --git a/data/scene/newhorizons/jupiter/europa/europa.mod b/data/scene/missions/newhorizons/jupiter/europa/europa.mod similarity index 100% rename from data/scene/newhorizons/jupiter/europa/europa.mod rename to data/scene/missions/newhorizons/jupiter/europa/europa.mod 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/newhorizons/jupiter/ganymede/ganymede.data b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.data similarity index 100% rename from data/scene/newhorizons/jupiter/ganymede/ganymede.data rename to data/scene/missions/newhorizons/jupiter/ganymede/ganymede.data diff --git a/data/scene/newhorizons/jupiter/ganymede/ganymede.mod b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod similarity index 100% rename from data/scene/newhorizons/jupiter/ganymede/ganymede.mod rename to data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod 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/newhorizons/jupiter/io/io.data b/data/scene/missions/newhorizons/jupiter/io/io.data similarity index 100% rename from data/scene/newhorizons/jupiter/io/io.data rename to data/scene/missions/newhorizons/jupiter/io/io.data diff --git a/data/scene/newhorizons/jupiter/io/io.mod b/data/scene/missions/newhorizons/jupiter/io/io.mod similarity index 100% rename from data/scene/newhorizons/jupiter/io/io.mod rename to data/scene/missions/newhorizons/jupiter/io/io.mod 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 97% rename from data/scene/newhorizons/jupiter/jupiter/jupiter.mod rename to data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod index 317ac79798..b1d3377eac 100644 --- a/data/scene/newhorizons/jupiter/jupiter/jupiter.mod +++ b/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod @@ -33,7 +33,7 @@ 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", 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/newhorizons/newhorizons/jup260.bsp.torrent b/data/scene/missions/newhorizons/newhorizons/jup260.bsp.torrent similarity index 100% rename from data/scene/newhorizons/newhorizons/jup260.bsp.torrent rename to data/scene/missions/newhorizons/newhorizons/jup260.bsp.torrent 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 99% rename from data/scene/newhorizons/newhorizons/newhorizons.mod rename to data/scene/missions/newhorizons/newhorizons/newhorizons.mod index e9935d5906..c683779d8f 100644 --- a/data/scene/newhorizons/newhorizons/newhorizons.mod +++ b/data/scene/missions/newhorizons/newhorizons/newhorizons.mod @@ -172,8 +172,7 @@ return { }, } }, - - { + { 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 100% rename from data/scene/newhorizons/pluto/charon/charon.mod rename to data/scene/missions/newhorizons/pluto/charon/charon.mod 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 97% rename from data/scene/newhorizons/pluto/pluto/pluto.mod rename to data/scene/missions/newhorizons/pluto/pluto/pluto.mod index 08eb750c1b..4434ec1cb0 100644 --- a/data/scene/newhorizons/pluto/pluto/pluto.mod +++ b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod @@ -46,8 +46,8 @@ return { Height = "textures/pluto_shenk_heightmap.jpg", }, 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", 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 99% rename from data/scene/osirisrex/bennu/bennu.mod rename to data/scene/missions/osirisrex/bennu/bennu.mod index cbbfc05ad3..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 = { 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 100% rename from data/scene/rosetta/67P/67P.mod rename to data/scene/missions/rosetta/67P/67P.mod 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 100% rename from data/scene/rosetta/rosetta/rosetta.mod rename to data/scene/missions/rosetta/rosetta/rosetta.mod 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 d8dded5250..0000000000 --- a/data/scene/osirisrex/osirisrex/osirisrex.mod +++ /dev/null @@ -1,270 +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 - }, - 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/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/saturn/saturn.mod b/data/scene/saturn/saturn/saturn.mod index 7b63c66cee..07884ab016 100644 --- a/data/scene/saturn/saturn/saturn.mod +++ b/data/scene/saturn/saturn/saturn.mod @@ -53,9 +53,8 @@ return { Parent = "Saturn", Renderable = { Type = "RenderableRings", - Frame = "IAU_SATURN", Texture = "textures/saturn_rings.png", - Size = { 0.140220, 9.0 }, + Size = 140220000, Offset = { 74500 / 140445.100671159, 1.0 } -- min / max extend }, 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/ext/ghoul b/ext/ghoul index 8fdd1127c2..e37387fbd5 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 8fdd1127c2127d59faad893e04d5f3e481da5255 +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/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/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/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/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/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 bc9ddc22e9..771253709e 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -140,6 +140,7 @@ std::vector BaseModule::documentations() const { StaticScale::Documentation(), StaticTranslation::Documentation(), SpiceTranslation::Documentation(), + RenderableRings::Documentation(), modelgeometry::ModelGeometry::Documentation(), planetgeometry::PlanetGeometry::Documentation() }; 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 4df4d419d2..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", @@ -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; } @@ -624,7 +358,6 @@ void RenderablePlanet::render(const RenderData& data) { "modelViewProjectionTransform", data.camera.projectionMatrix() * glm::mat4(modelViewTransform) ); - //_programObject->setUniform("ViewProjection", data.camera.viewProjectionMatrix()); _programObject->setUniform("ModelTransform", glm::mat4(modelTransform)); // Normal Transformation @@ -633,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 * glm::mat4(modelTransform); - if (_atmosphereEnabled) - _programObject->setUniform("NormalTransform", - glm::transpose(glm::inverse(ModelViewTrans))); - + setPscUniforms(*_programObject.get(), data.camera, data.position); _programObject->setUniform("_performShading", _performShading); @@ -750,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 * glm::mat4(modelTransform); - - 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 * glm::mat4(modelTransform)); - 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(); @@ -872,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) { @@ -892,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() != "") { @@ -930,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 8f2927af6f..6ee8ed363f 100644 --- a/modules/base/rendering/renderablerings.cpp +++ b/modules/base/rendering/renderablerings.cpp @@ -24,11 +24,10 @@ #include +#include #include #include -#include #include -#include #include #include @@ -37,24 +36,56 @@ #include namespace { - const std::string _loggerCat = "RenderableRings"; - - const std::string KeySize = "Size"; const std::string KeyTexture = "Texture"; - 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) @@ -65,55 +96,35 @@ RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary) , _vertexPositionBuffer(0) , _planeIsDirty(false) { - glm::vec2 size; - dictionary.getValue(KeySize, size); - _size = size; - - 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 { @@ -127,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(); @@ -154,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; } @@ -166,15 +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("_nightFactor", _nightFactor); - _shader->setUniform("sunPosition", _sunPosition); + _shader->setUniform( + "sunPosition", + _sunPosition + ); - setPscUniforms(*_shader.get(), data.camera, data.position); + setPscUniforms(*_shader, data.camera, data.position); ghoul::opengl::TextureUnit unit; unit.activate(); @@ -204,29 +220,26 @@ void RenderableRings::update(const UpdateData& data) { loadTexture(); _textureIsDirty = false; } - - if (!_frame.empty()) { - _state = SpiceManager::ref().positionTransformMatrix(_frame, "GALACTIC", data.time); - } - - _sunPosition = - OsEng.renderEngine().scene()->sceneGraphNode("Sun")->worldPosition() - + + _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; } @@ -236,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 ec063b1f22..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,11 +75,7 @@ private: GLuint _quad; GLuint _vertexPositionBuffer; bool _planeIsDirty; - - std::string _frame; - glm::mat3 _orientation; - glm::mat3 _state; - + glm::vec3 _sunPosition; }; 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/shaders/nighttexture_fs.glsl b/modules/base/shaders/nighttexture_fs.glsl index 2096028f8f..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); diff --git a/modules/base/shaders/renderableplanet_fs.glsl b/modules/base/shaders/renderableplanet_fs.glsl index 4304bb6b89..f275091d76 100644 --- a/modules/base/shaders/renderableplanet_fs.glsl +++ b/modules/base/shaders/renderableplanet_fs.glsl @@ -44,8 +44,6 @@ in vec4 vs_position; //#include "PowerScaling/powerScaling_vs.hglsl" Fragment getFragment() { - vec4 position = vs_position; - float depth = pscDepth(position); vec4 diffuse = texture(texture1, vs_st); Fragment frag; diff --git a/modules/base/shaders/renderableplanet_vs.glsl b/modules/base/shaders/renderableplanet_vs.glsl index 70873666b7..e726d0149a 100644 --- a/modules/base/shaders/renderableplanet_vs.glsl +++ b/modules/base/shaders/renderableplanet_vs.glsl @@ -48,7 +48,7 @@ void main() { 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); + vec4 position = vec4(tmp.xyz * pow(10, tmp.w), 1.0); position = modelViewProjectionTransform * position; vs_position = z_normalization(position); diff --git a/modules/base/shaders/rings_fs.glsl b/modules/base/shaders/rings_fs.glsl index 71ae638cf4..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; @@ -85,7 +82,7 @@ Fragment getFragment() { 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/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/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 aa29f631cb..eb7d419780 100644 --- a/modules/newhorizons/rendering/renderablefov.cpp +++ b/modules/newhorizons/rendering/renderablefov.cpp @@ -265,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; } @@ -519,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/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index 9ff4439010..d2e05d6dfa 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include namespace { 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/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/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 4e06d9dcef..e53fb1b464 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -199,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, @@ -211,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, @@ -292,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({ 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 f72da42708..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(); 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/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index 01411fd54d..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/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/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index f73dbd8361..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; @@ -468,8 +465,6 @@ 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)); @@ -479,6 +474,4 @@ void FramebufferRenderer::updateRendererData() { 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/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)