diff --git a/apps/OpenSpace/ext/launcher/include/launcherwindow.h b/apps/OpenSpace/ext/launcher/include/launcherwindow.h
index 2c1b17bb0c..508c0442cc 100644
--- a/apps/OpenSpace/ext/launcher/include/launcherwindow.h
+++ b/apps/OpenSpace/ext/launcher/include/launcherwindow.h
@@ -96,6 +96,7 @@ private:
bool _shouldLaunch = false;
int _userAssetCount = 0;
int _userConfigCount = 0;
+ const std::string _sgctConfigName;
QComboBox* _profileBox = nullptr;
QComboBox* _windowConfigBox = nullptr;
diff --git a/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h b/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h
index 6ca0c5b209..6533eff4ba 100644
--- a/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h
+++ b/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h
@@ -82,7 +82,7 @@ private:
QLineEdit* _loadedEdit = nullptr;
QLabel* _notLoadedLabel = nullptr;
QLineEdit* _notLoadedEdit = nullptr;
-
+
QPushButton* _buttonAdd = nullptr;
QPushButton* _buttonRemove = nullptr;
QPushButton* _buttonSave = nullptr;
diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp
index 7c9f2b0a27..99672c1d57 100644
--- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp
+++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp
@@ -150,6 +150,7 @@ LauncherWindow::LauncherWindow(bool profileEnabled,
absPath(globalConfig.pathTokens.at("USER_PROFILES")).string() + '/'
)
, _readOnlyProfiles(globalConfig.readOnlyProfiles)
+ , _sgctConfigName(sgctConfigName)
{
Q_INIT_RESOURCE(resources);
@@ -177,7 +178,7 @@ LauncherWindow::LauncherWindow(bool profileEnabled,
populateProfilesList(globalConfig.profile);
_profileBox->setEnabled(profileEnabled);
- populateWindowConfigsList(sgctConfigName);
+ populateWindowConfigsList(_sgctConfigName);
_windowConfigBox->setEnabled(sgctConfigEnabled);
@@ -458,7 +459,10 @@ std::string LauncherWindow::selectedProfile() const {
}
std::string LauncherWindow::selectedWindowConfig() const {
- if (_windowConfigBox->currentIndex() > _userAssetCount) {
+ int idx = _windowConfigBox->currentIndex();
+ if (idx == 0) {
+ return _sgctConfigName;
+ } else if (idx > _userAssetCount) {
return "${CONFIG}/" + _windowConfigBox->currentText().toStdString();
}
else {
diff --git a/apps/OpenSpace/ext/launcher/src/profile/keybindingsdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/keybindingsdialog.cpp
index baa366a879..273dde9ab6 100644
--- a/apps/OpenSpace/ext/launcher/src/profile/keybindingsdialog.cpp
+++ b/apps/OpenSpace/ext/launcher/src/profile/keybindingsdialog.cpp
@@ -460,9 +460,6 @@ void KeybindingsDialog::listItemRemove() {
}
void KeybindingsDialog::transitionToEditMode() {
- _list->setDisabled(true);
- _addButton->setDisabled(true);
- _removeButton->setDisabled(true);
_saveButton->setDisabled(true);
_cancelButton->setDisabled(true);
_buttonBox->setDisabled(true);
diff --git a/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp
index 5f7ad9f7f4..7359026d7e 100644
--- a/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp
+++ b/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp
@@ -297,9 +297,6 @@ void ModulesDialog::listItemRemove() {
}
void ModulesDialog::transitionToEditMode() {
- _list->setDisabled(true);
- _buttonAdd->setDisabled(true);
- _buttonRemove->setDisabled(true);
_buttonSave->setDisabled(true);
_buttonCancel->setDisabled(true);
_buttonBox->setDisabled(true);
diff --git a/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp
index 8e1f9477f9..3a9441154e 100644
--- a/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp
+++ b/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp
@@ -302,9 +302,6 @@ void PropertiesDialog::listItemRemove() {
}
void PropertiesDialog::transitionToEditMode() {
- _list->setDisabled(true);
- _addButton->setDisabled(true);
- _removeButton->setDisabled(true);
_saveButton->setDisabled(true);
_cancelButton->setDisabled(true);
_buttonBox->setDisabled(true);
diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp
index 65dbd607a0..dfd8b32c52 100644
--- a/apps/OpenSpace/main.cpp
+++ b/apps/OpenSpace/main.cpp
@@ -976,14 +976,6 @@ std::string setWindowConfigPresetForGui(const std::string labelFromCfgFile,
}
else {
preset = config.windowConfiguration;
- if (preset.find('/') != std::string::npos) {
- preset.erase(0, preset.find_last_of('/') + 1);
- }
- if (preset.length() >= xmlExt.length()) {
- if (preset.substr(preset.length() - xmlExt.length()) == xmlExt) {
- preset = preset.substr(0, preset.length() - xmlExt.length());
- }
- }
}
return preset;
}
@@ -1005,7 +997,14 @@ std::string selectedSgctProfileFromLauncher(LauncherWindow& lw, bool hasCliSGCTC
}
}
else {
- config += xmlExt;
+ if ( (config.length() >= xmlExt.length())
+ && (0 == config.compare(config.length() - xmlExt.length(), xmlExt.length(), xmlExt)) ) {
+ //user customzied sgct config
+ }
+ else {
+ config += xmlExt;
+ }
+
}
global::configuration->windowConfiguration = config;
}
diff --git a/data/assets/customization/globebrowsing.asset b/data/assets/customization/globebrowsing.asset
index f5ad4193cd..fe03f650af 100644
--- a/data/assets/customization/globebrowsing.asset
+++ b/data/assets/customization/globebrowsing.asset
@@ -4,6 +4,7 @@ local CreateFocusNodes = false
local AddMarsLayers = true
local AddMoonLayers = true
local AddMercuryLayers = true
+local DataFolder = openspace.absPath('${BASE}/../OpenSpaceData')
----------------------------------------
-- If you add layers for different planets than listed here, be sure to add an
@@ -25,11 +26,11 @@ local vrt_folders = {
-- example: 'C:/OpenSpace/GlobeBrowsingData/Mars/CTX'
-- We recommend using this folder for CTX
- openspace.absPath('${BASE}/../OpenSpaceData/Mars/CTX'),
+ DataFolder .. '/Mars/CTX',
-- if not and you have a custom path for CTX layers, enter it below
'',
-- We recommend using this folder for HiRISE
- openspace.absPath('${BASE}/../OpenSpaceData/Mars/HiRISE'),
+ DataFolder .. '/Mars/HiRISE',
-- if not and you have a custom path for HiRISE layers, enter it below
''
},
@@ -39,8 +40,8 @@ local vrt_folders = {
-- if areas overlap, images from the lower results will overwrite the images from former
-- results
-- example: 'C:/OpenSpace/GlobeBrowsingData/Moon'
- openspace.absPath('${BASE}/../OpenSpaceData/Moon'),
- openspace.absPath('${BASE}/../OpenSpaceData/Apollo'),
+ DataFolder .. '/Moon',
+ DataFolder .. '/Apollo',
''
},
Mercury = {
@@ -49,7 +50,7 @@ local vrt_folders = {
-- if areas overlap, images from the lower results will overwrite the images from former
-- results
-- example: 'C:/OpenSpace/GlobeBrowsingData/Mercury'
- openspace.absPath('${BASE}/../OpenSpaceData/Mercury'),
+ DataFolder .. '/Mercury',
''
}
}
diff --git a/data/assets/examples/grids.asset b/data/assets/examples/grids.asset
index 55468bd399..37ebad89e2 100644
--- a/data/assets/examples/grids.asset
+++ b/data/assets/examples/grids.asset
@@ -17,8 +17,7 @@ local radialGrid = {
Color = { 0.6, 1.0, 0.7 },
LineWidth = 3.0,
GridSegments = { 3, 4 },
- OuterRadius = 1.0,
- InnerRadius = 0.2,
+ Radii = { 0.2, 1.0 },
Enabled = false
},
GUI = {
diff --git a/data/assets/examples/primitives.asset b/data/assets/examples/primitives.asset
index d30014306d..23a64b1a0b 100644
--- a/data/assets/examples/primitives.asset
+++ b/data/assets/examples/primitives.asset
@@ -16,7 +16,7 @@ local circle = {
LineWidth = 3.0,
GridSegments = { 1, 1 },
CircleSegments = 64,
- OuterRadius = 1.0
+ Radii = { 0.0, 1.0 }
},
GUI = {
Name = "Example Circle",
@@ -29,7 +29,7 @@ local ellipse = {
Transform = {
Scale = {
Type = "NonUniformStaticScale",
- Scale = {1.5, 1.0, 1.0}
+ Scale = { 1.5, 1.0, 1.0 }
}
},
Renderable = {
@@ -38,7 +38,7 @@ local ellipse = {
LineWidth = 3.0,
GridSegments = { 1, 1 },
CircleSegments = 64,
- OuterRadius = scale
+ Radii = { 0.0, scale }
},
GUI = {
Name = "Example Ellipse",
diff --git a/data/assets/global/openspacebookmarks.asset b/data/assets/global/openspacebookmarks.asset
index 1f6e91e96f..2d3893d1a3 100644
--- a/data/assets/global/openspacebookmarks.asset
+++ b/data/assets/global/openspacebookmarks.asset
@@ -15,7 +15,7 @@ local bookmarksCSV = asset.syncedResource({
local nodes = {}
asset.onInitialize(function ()
- nodes = bookmarkHelper.getBookmarks('OpenSpace Bookmarks', bookmarksCSV .. '/bookmarks.csv.txt')
+ nodes = bookmarkHelper.getBookmarks('OpenSpace Bookmarks', bookmarksCSV .. '/bookmarks.csv')
for _, n in ipairs(nodes) do
openspace.addSceneGraphNode(n);
end
diff --git a/data/assets/scene/digitaluniverse/2dF.asset b/data/assets/scene/digitaluniverse/2dF.asset
index 23f44a447c..4c881fe192 100644
--- a/data/assets/scene/digitaluniverse/2dF.asset
+++ b/data/assets/scene/digitaluniverse/2dF.asset
@@ -24,13 +24,13 @@ local object = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 1.0,
File = speck .. "/2dF.speck",
+ Unit = "Mpc",
Texture = textures .. "/point3A.png",
ColorMap = speck .. "/2dF.cmap",
ColorOption = { "redshift", "proximity" },
ColorRange = { { 0.0, 0.075 }, { 1.0, 25.0 } },
- Unit = "Mpc",
ScaleFactor = 520.0,
- BillboardMaxSize = 4.7,
+ BillboardMinMaxSize = { 0.0, 4.7 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/2mass.asset b/data/assets/scene/digitaluniverse/2mass.asset
index f69905f48c..5e5cfa091d 100644
--- a/data/assets/scene/digitaluniverse/2mass.asset
+++ b/data/assets/scene/digitaluniverse/2mass.asset
@@ -24,15 +24,15 @@ local object = {
Color = { 1.0, 0.4, 0.2 },
Opacity = 1.0,
File = speck .. "/2MASS.speck",
+ Unit = "Mpc",
Texture = textures .. "/point3A.png",
ColorMap = speck .. "/lss.cmap",
ColorOption = { "redshift", "prox5Mpc" },
ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } },
- Unit = "Mpc",
CorrectionSizeEndDistance = 20.6,
CorrectionSizeFactor = 15.0,
ScaleFactor = 510.78,
- BillboardMaxSize = 11.15,
+ BillboardMinMaxSize = { 0.0, 11.15 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/6dF.asset b/data/assets/scene/digitaluniverse/6dF.asset
index 8e45fad8b5..90f9ed8634 100644
--- a/data/assets/scene/digitaluniverse/6dF.asset
+++ b/data/assets/scene/digitaluniverse/6dF.asset
@@ -24,14 +24,14 @@ local object = {
Color = { 1.0, 1.0, 0.0 },
Opacity = 1.0,
File = speck .. "/6dF.speck",
+ Unit = "Mpc",
Texture = textures .. "/point3A.png",
ColorMap = speck .. "/6dF.cmap",
ColorOption = { "redshift", "proximity" },
ColorRange = { { 0.0, 0.075 }, { 1.0, 10.0 } },
- Unit = "Mpc",
ScaleFactor = 534.0,
- BillboardMaxSize = 9.0,
- EnablePixelSizeControl = true,
+ BillboardMinMaxSize = { 0.0, 9.0 },
+ EnablePixelSizeControl = true
},
GUI = {
Name = "6dF Galaxies",
diff --git a/data/assets/scene/digitaluniverse/abell.asset b/data/assets/scene/digitaluniverse/abell.asset
index da0a05fd02..38863eba9d 100644
--- a/data/assets/scene/digitaluniverse/abell.asset
+++ b/data/assets/scene/digitaluniverse/abell.asset
@@ -27,10 +27,10 @@ local object = {
File = speck .. "/abell.speck",
Texture = textures .. "/point3A.png",
LabelFile = speck .. "/abell.label",
+ Unit = "Mpc",
TextColor = { 0.0, 0.8, 0.0 },
TextSize = 22,
- TextMinSize = 10.0,
- Unit = "Mpc",
+ TextMinMaxSize = { 10, 12 },
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
@@ -38,7 +38,7 @@ local object = {
0.0, 0.0, 0.0, 1.0
},
ScaleFactor = 520.0,
- BillboardMaxSize = 7.0,
+ BillboardMinMaxSize = { 0.0, 7.0 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/alternatestarlabels.asset b/data/assets/scene/digitaluniverse/alternatestarlabels.asset
index 2a58510736..5e19b98207 100644
--- a/data/assets/scene/digitaluniverse/alternatestarlabels.asset
+++ b/data/assets/scene/digitaluniverse/alternatestarlabels.asset
@@ -17,11 +17,11 @@ local object = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "/stars-altlbl.label",
+ Unit = "pc",
TextColor = { 0.4, 0.4, 0.4 },
DrawLabels = true,
TextSize = 14.7,
- TextMinSize = 6.0,
- Unit = "pc"
+ TextMinMaxSize = { 6, 20 }
},
GUI = {
Name = "Stars Labels - Alternate",
diff --git a/data/assets/scene/digitaluniverse/clusters.asset b/data/assets/scene/digitaluniverse/clusters.asset
index 6b8ef0e794..03c232a957 100644
--- a/data/assets/scene/digitaluniverse/clusters.asset
+++ b/data/assets/scene/digitaluniverse/clusters.asset
@@ -17,11 +17,11 @@ local object = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "/galclust.label",
+ Unit = "Mpc",
TextColor = { 1.0, 0.44, 0.0 },
DrawLabels = true,
TextSize = 22,
- TextMinSize = 8.0,
- Unit = "Mpc",
+ TextMinMaxSize = { 8, 20 },
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset
index e043c1734e..a96db07f75 100644
--- a/data/assets/scene/digitaluniverse/constellations.asset
+++ b/data/assets/scene/digitaluniverse/constellations.asset
@@ -20,8 +20,7 @@ local constellationsExtragalactic = {
TextColor = { 0.8, 0.8, 0.8 },
TextOpacity = 0.4,
TextSize = 20.0,
- TextMinSize = 20.0,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 20, 30 },
MeshColor = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
Unit = "Mpc"
},
@@ -42,8 +41,7 @@ local constellations = {
TextColor = { 0.8, 0.8, 0.8 },
TextOpacity = 0.3,
TextSize = 14.5,
- TextMaxSize = 170.0,
- TextMinSize = 8.0,
+ TextMinMaxSize = { 8, 170 },
MeshColor = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
Unit = "pc"
},
diff --git a/data/assets/scene/digitaluniverse/deepsky.asset b/data/assets/scene/digitaluniverse/deepsky.asset
index 7272af3a06..b8d91282b0 100644
--- a/data/assets/scene/digitaluniverse/deepsky.asset
+++ b/data/assets/scene/digitaluniverse/deepsky.asset
@@ -30,15 +30,12 @@ local deepSkyPoints = {
--ColorOption = { "prox5Mpc" },
--ColorRange = { { 1.0, 30.0 } },
LabelFile = speck .. "/dso.label",
+ Unit = "pc",
TextColor = { 0.1, 0.4, 0.6 },
TextSize = 20.50,
- TextMinSize = 16.0,
- Unit = "pc",
- -- Fade in value in the same unit as "Unit"
- --FadeInDistances = { 0.05, 1.0 },
- -- Max size in pixels
- BillboardMaxSize = 8.22,
- BillboardMinSize = 0.0,
+ TextMinMaxSize = { 16, 20 },
+ --FadeInDistances = { 0.05, 1.0 }, -- Fade in value in the same unit as "Unit"
+ BillboardMinMaxSize = { 0.0, 8.22 }, -- in pixels
--CorrectionSizeEndDistance = 22.0,
--CorrectionSizeFactor = 10.45
EnablePixelSizeControl = true
diff --git a/data/assets/scene/digitaluniverse/dwarfs.asset b/data/assets/scene/digitaluniverse/dwarfs.asset
index 7919dc2038..c4922feb04 100644
--- a/data/assets/scene/digitaluniverse/dwarfs.asset
+++ b/data/assets/scene/digitaluniverse/dwarfs.asset
@@ -26,18 +26,18 @@ local object = {
File = speck .. "/dwarfs.speck",
Texture = textures .. "/point3.png",
LabelFile = speck .. "/dwarfs.label",
+ Unit = "pc",
ColorMap = speck .. "/dwarfs.cmap",
ColorOption = { "typeindex" },
--ColorRange = { { 1.0, 4.0} },
TextColor = { 0.5, 0.1, 0.2 },
TextSize = 14.6,
- TextMinSize = 10.0,
+ TextMinMaxSize = { 10, 20 },
ScaleFactor = 372.1,
--CorrectionSizeEndDistance = 16.1,
--CorrectionSizeFactor = 7.75,
- BillboardMaxSize = 20.0,
- EnablePixelSizeControl = true,
- Unit = "pc"
+ BillboardMinMaxSize = { 0.0, 20.0 },
+ EnablePixelSizeControl = true
},
GUI = {
Name = "Brown Dwarfs",
diff --git a/data/assets/scene/digitaluniverse/exoplanets.asset b/data/assets/scene/digitaluniverse/exoplanets.asset
index 4fb990c4e4..27ccda1a29 100644
--- a/data/assets/scene/digitaluniverse/exoplanets.asset
+++ b/data/assets/scene/digitaluniverse/exoplanets.asset
@@ -27,15 +27,14 @@ local object = {
Texture = textures .. "/target-blue.png",
File = speck .. "/expl.speck",
LabelFile = speck .. "/expl.label",
+ Unit = "pc",
ScaleFactor = 388.67923,
TextColor = { 0.3, 0.3, 0.8 },
TextSize = 14.8,
- TextMaxSize = 200.0,
- TextMinSize = 10.0,
+ TextMinMaxSize = { 10, 100 },
CorrectionSizeEndDistance = 15.23,
CorrectionSizeFactor = 13.3,
- Unit = "pc",
- BillboardMaxSize = 75.0,
+ BillboardMinMaxSize = { 0.0, 75.0 },
EnablePixelSizeControl = true,
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/globularclusters.asset b/data/assets/scene/digitaluniverse/globularclusters.asset
index 179fe2cbc9..77e85d35c5 100644
--- a/data/assets/scene/digitaluniverse/globularclusters.asset
+++ b/data/assets/scene/digitaluniverse/globularclusters.asset
@@ -27,13 +27,12 @@ local object = {
Texture = textures .. "/point4.png",
PolygonSides = 5,
LabelFile = speck .. "/gc.label",
+ Unit = "pc",
TextColor = { 0.5, 0.5, 0.0 },
ScaleFactor = 431.0,
TextSize = 16.7,
- TextMinSize = 4.0,
- TextMaxSize = 20,
- Unit = "pc",
- BillboardMaxSize = 500,
+ TextMinMaxSize = { 4, 20 },
+ BillboardMinMaxSize = { 0.0, 500.0 },
EnablePixelSizeControl = true,
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset
index 56caaca447..9ba8ad9a53 100644
--- a/data/assets/scene/digitaluniverse/grids.asset
+++ b/data/assets/scene/digitaluniverse/grids.asset
@@ -110,12 +110,11 @@ local eclipticLabels = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "/eclip.label",
+ Unit = "pc",
DrawLabels = true,
TextColor = { 0.5, 0.5, 0.5 },
TextSize = 14.75,
- TextMinSize = 1.3,
- TextMaxSize = 50.0,
- Unit = "pc",
+ TextMinMaxSize = { 1, 50 },
TransformationMatrix = {
-0.05487554, 0.4941095, -0.8676661, 0.0,
-0.9938214 , -0.1109906, -0.0003515167, 0.0,
@@ -164,12 +163,11 @@ local equatorialLabels = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "/radec.label",
+ Unit = "pc",
DrawLabels = true,
TextColor = { 0.5, 0.5, 0.5 },
TextSize = 14.5,
- TextMinSize = 1.7,
- TextMaxSize = 70.0,
- Unit = "pc",
+ TextMinMaxSize = { 2, 70 },
TransformationMatrix = {
-0.05487554, 0.4941095, -0.8676661, 0.0,
-0.8734371 , -0.4448296, -0.1980764, 0.0,
@@ -214,12 +212,11 @@ local galacticLabels = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "/galac.label",
+ Unit = "pc",
DrawLabels = true,
TextColor = { 0.5, 0.5, 0.5 },
TextSize = 15.8,
- TextMinSize = 0.5,
- TextMaxSize = 100.0,
- Unit = "pc"
+ TextMinMaxSize = { 1, 100 }
},
GUI = {
Name = "Galactic Sphere Labels",
@@ -245,8 +242,7 @@ local plane1ld = {
LabelFile = speck .. "/1ld.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 10.3,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "Km"
},
GUI = {
@@ -273,8 +269,7 @@ local plane1lm = {
LabelFile = speck .. "/1lm.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 11.8,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -301,8 +296,7 @@ local plane1ly = {
LabelFile = speck .. "/1ly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 13.0,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -329,8 +323,7 @@ local plane10ly = {
LabelFile = speck .. "/10ly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 14.17,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -357,8 +350,7 @@ local plane100ly = {
LabelFile = speck .. "/100ly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 15.0,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -385,8 +377,7 @@ local plane1kly = {
LabelFile = speck .. "/1kly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 16.0,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -413,8 +404,7 @@ local plane10kly = {
LabelFile = speck .. "/10kly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 17.25,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -434,8 +424,7 @@ local plane100kly = {
LabelFile = speck .. "/100kly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 18.6,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
},
GUI = {
@@ -455,8 +444,7 @@ local plane1Mly = {
LabelFile = speck .. "/1Mly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 19.6,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
},
GUI = {
@@ -476,8 +464,7 @@ local plane10Mly = {
LabelFile = speck .. "/10Mly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 20.6,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
},
GUI = {
@@ -497,8 +484,7 @@ local plane100Mly = {
LabelFile = speck .. "/100Mly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 21.6,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
},
GUI = {
@@ -518,8 +504,7 @@ local plane20Gly = {
LabelFile = speck .. "/20Gly.label",
TextColor = { 0.0, 0.2, 0.5 },
TextSize = 23.6,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ TextMinMaxSize = { 0, 30 },
Unit = "Mpc"
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/groups.asset b/data/assets/scene/digitaluniverse/groups.asset
index 3653225819..ed426cbdd2 100644
--- a/data/assets/scene/digitaluniverse/groups.asset
+++ b/data/assets/scene/digitaluniverse/groups.asset
@@ -18,10 +18,10 @@ local object = {
Opacity = 0.65,
--ScaleFactor = 10.0,
LabelFile = speck .. "/groups.label",
+ Unit = "Mpc",
TextColor = { 0.1, 0.6, 0.2 },
TextSize = 21.5,
- TextMinSize = 8.0,
- Unit = "Mpc",
+ TextMinMaxSize = { 8, 20 },
DrawLabels = true,
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
diff --git a/data/assets/scene/digitaluniverse/h2regions.asset b/data/assets/scene/digitaluniverse/h2regions.asset
index 946c1fb9ca..9648f7d088 100644
--- a/data/assets/scene/digitaluniverse/h2regions.asset
+++ b/data/assets/scene/digitaluniverse/h2regions.asset
@@ -27,13 +27,12 @@ local object = {
Texture = textures .."/point4.png",
PolygonSides = 6,
LabelFile = speck .. "/h2.label",
+ Unit = "pc",
TextColor = { 0.5, 0.5, 0.5 },
ScaleFactor = 420,
TextSize = 16.24,
- TextMinSize = 4.0,
- TextMaxSize = 20.0,
- Unit = "pc",
- BillboardMaxSize = 300.0,
+ TextMinMaxSize = { 4, 20 },
+ BillboardMinMaxSize = { 0.0, 300.0 },
EnablePixelSizeControl = false
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/kepler.asset b/data/assets/scene/digitaluniverse/kepler.asset
index 38ce9309a9..d07868db17 100644
--- a/data/assets/scene/digitaluniverse/kepler.asset
+++ b/data/assets/scene/digitaluniverse/kepler.asset
@@ -25,11 +25,11 @@ local object = {
Opacity = 0.99,
ScaleFactor = 410.0,
File = speck .. "/kepler.speck",
+ Unit = "pc",
Texture = textures .. "/halo.png",
CorrectionSizeEndDistance = 15.86,
CorrectionSizeFactor = 8.59,
- Unit = "pc",
- BillboardMaxSize = 30.0,
+ BillboardMinMaxSize = { 0.0, 30.0 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/localdwarfs.asset b/data/assets/scene/digitaluniverse/localdwarfs.asset
index 8bd7fddce6..ac23ad0dc6 100644
--- a/data/assets/scene/digitaluniverse/localdwarfs.asset
+++ b/data/assets/scene/digitaluniverse/localdwarfs.asset
@@ -29,12 +29,12 @@ local object = {
Texture = textures .. "/point4.png",
PolygonSides = 12,
LabelFile = speck .. "/localgroup.label",
+ Unit = "Mpc",
TextColor = { 0.3, 0.3, 1.0 },
ScaleFactor = 465,
TextSize = 18.3,
- TextMinSize = 7.3,
- Unit = "Mpc",
- BillboardMaxSize = 20.0,
+ TextMinMaxSize = { 7, 20 },
+ BillboardMinMaxSize = { 0.0, 20.0 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/milkyway_label.asset b/data/assets/scene/digitaluniverse/milkyway_label.asset
index 20fb25276e..60908e0a35 100644
--- a/data/assets/scene/digitaluniverse/milkyway_label.asset
+++ b/data/assets/scene/digitaluniverse/milkyway_label.asset
@@ -20,19 +20,18 @@ local homeLabel = {
ScaleFactor = 500.0,
DrawLabels = true,
LabelFile = homespeck .. "/home.label",
+ Unit = "Mpc",
TextColor = { 0.8, 0.8, 0.8 },
TextSize = 20.50,
- TextMinSize = 16.0,
+ TextMinMaxSize = { 16, 20 },
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
0.67314530211, 0.73127116582, 0.11008126223, 0.0,
0.0, 0.0, 0.0, 1.0
},
- Unit = "Mpc",
FadeInDistances = { 0.05, 1.0 },
- BillboardMaxSize = 8.22,
- BillboardMinSize = 0.0,
+ BillboardMinMaxSize = { 0.0, 8.22 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/obassociations.asset b/data/assets/scene/digitaluniverse/obassociations.asset
index 3814638db9..1339706042 100644
--- a/data/assets/scene/digitaluniverse/obassociations.asset
+++ b/data/assets/scene/digitaluniverse/obassociations.asset
@@ -24,20 +24,19 @@ local object = {
Color = { 1.0, 1.0, 1.0 },
ColorMap = speck .. "/ob.cmap",
ColorOption = { "arm" },
- SizeOption = {"diameter"},
+ SizeOption = { "diameter" },
ExactColorMap = true,
Opacity = 0.7,
File = speck .. "/ob.speck",
+ Unit = "pc",
Texture = textures .. "/point4.png",
PolygonSides = 7,
LabelFile = speck .. "/ob.label",
TextColor = { 0.4, 0.5, 1.0 },
ScaleFactor = 390.0,
TextSize = 16.24,
- TextMinSize = 4.50,
- TextMaxSize = 25,
- Unit = "pc",
- BillboardMaxSize = 450.0,
+ TextMinMaxSize = { 4, 25 },
+ BillboardMinMaxSize = { 0.0, 450.0 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/openclusters.asset b/data/assets/scene/digitaluniverse/openclusters.asset
index 86bbc5b5c9..bb4ae711e5 100644
--- a/data/assets/scene/digitaluniverse/openclusters.asset
+++ b/data/assets/scene/digitaluniverse/openclusters.asset
@@ -24,16 +24,15 @@ local object = {
Color = { 0.1, 0.8, 0.4 },
Opacity = 0.5,
File = speck .. "/oc.speck",
+ Unit = "pc",
Texture = textures .. "/point4.png",
PolygonSides = 12,
TextColor = { 0.05, 0.4, 0.2 },
LabelFile = speck .. "/oc.label",
ScaleFactor = 405.75,
TextSize = 15.5,
- TextMinSize = 4.5,
- TextMaxSize = 30.0,
- Unit = "pc",
- BillboardMaxSize = 604,
+ TextMinMaxSize = { 4, 30 },
+ BillboardMinMaxSize = { 0.0, 604.0 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/planetarynebulae.asset b/data/assets/scene/digitaluniverse/planetarynebulae.asset
index 7fb7d217ad..c2a0c107d2 100644
--- a/data/assets/scene/digitaluniverse/planetarynebulae.asset
+++ b/data/assets/scene/digitaluniverse/planetarynebulae.asset
@@ -27,13 +27,12 @@ local object = {
Texture = textures .. "/point4.png",
PolygonSides = 3,
LabelFile = speck .. "/pn.label",
+ Unit = "pc",
TextColor = { 0.25, 0.25, 0.65 },
ScaleFactor = 425.0,
TextSize = 16.24,
- TextMinSize = 4.5,
- TextMaxSize = 25.0,
- Unit = "pc",
- BillboardMaxSize = 500,
+ TextMinMaxSize = { 4, 25 },
+ BillboardMinMaxSize = { 0.0, 500.0 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/pulsars.asset b/data/assets/scene/digitaluniverse/pulsars.asset
index 8defe08274..6e122a3336 100644
--- a/data/assets/scene/digitaluniverse/pulsars.asset
+++ b/data/assets/scene/digitaluniverse/pulsars.asset
@@ -27,13 +27,12 @@ local object = {
Texture = textures .. "/point4.png",
PolygonSides = 4,
LabelFile = speck .. "/pulsar.label",
+ Unit = "pc",
TextColor = { 0.7, 0.2, 0.2 },
ScaleFactor = 424,
TextSize = 15.77,
- TextMinSize = 4,
- TextMaxSize = 20.0,
- Unit = "pc",
- BillboardMaxSize = 500,
+ TextMinMaxSize = { 4, 20 },
+ BillboardMinMaxSize = { 0.0, 500.0 },
EnablePixelSizeControl = false
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/quasars.asset b/data/assets/scene/digitaluniverse/quasars.asset
index 69336ed468..3ec14ef05b 100644
--- a/data/assets/scene/digitaluniverse/quasars.asset
+++ b/data/assets/scene/digitaluniverse/quasars.asset
@@ -27,11 +27,8 @@ local object = {
Texture = textures .. "/point3A.png",
Unit = "Mpc",
ScaleFactor = 540.9,
- -- Fade in value in the same unit as "Unit"
- FadeInDistances = { 1000.0, 10000.0 },
- BillboardMaxSize = 30.0,
- BillboardMinSize = 0.0,
- BillboardMaxSize = 11.1,
+ FadeInDistances = { 1000.0, 10000.0 }, -- Fade in value in the same unit as "Unit"
+ BillboardMinMaxSize = { 0.0, 11.1 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/sdss.asset b/data/assets/scene/digitaluniverse/sdss.asset
index 61914b1951..de7391eba0 100644
--- a/data/assets/scene/digitaluniverse/sdss.asset
+++ b/data/assets/scene/digitaluniverse/sdss.asset
@@ -30,16 +30,12 @@ local object = {
ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } },
Texture = textures .. "/point3A.png",
Unit = "Mpc",
- -- Fade in value in the same unit as "Unit"
- FadeInDistances = { 220.0, 650.0 },
- BillboardMaxSize = 50.0,
- BillboardMinSize = 0.0,
+ FadeInDistances = { 220.0, 650.0 }, -- Fade in value in the same unit as "Unit"
+ BillboardMinMaxSize = { 0.0, 5.5 },
CorrectionSizeEndDistance = 20.65,
CorrectionSizeFactor = 10.41,
TextSize = 14.8,
- TextMinSize = 10.0,
- TextMaxSize = 50.0,
- BillboardMaxSize = 5.5,
+ TextMinMaxSize = { 10, 50 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/starlabels.asset b/data/assets/scene/digitaluniverse/starlabels.asset
index 8a8c99105f..387975abbd 100644
--- a/data/assets/scene/digitaluniverse/starlabels.asset
+++ b/data/assets/scene/digitaluniverse/starlabels.asset
@@ -17,12 +17,11 @@ local object = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "/stars.label",
+ Unit = "pc",
TextColor = { 0.4, 0.4, 0.4 },
DrawLabels = true,
TextSize = 14.7,
- TextMinSize = 6.0,
- TextMaxSize = 50.0,
- Unit = "pc"
+ TextMinMaxSize = { 6, 50 }
},
GUI = {
Name = "Stars Labels",
diff --git a/data/assets/scene/digitaluniverse/starorbits.asset b/data/assets/scene/digitaluniverse/starorbits.asset
index 4287107301..d79d96d2fa 100644
--- a/data/assets/scene/digitaluniverse/starorbits.asset
+++ b/data/assets/scene/digitaluniverse/starorbits.asset
@@ -20,10 +20,8 @@ local sunOrbit = {
File = speck .. "/starorbits-Sun.speck",
MeshColor = {{ 1.0, 0.65, 0.0 }},
--LabelFile = speck .. "/1ld.label",
- TextColor = { 0.0, 0.2, 0.5 },
- TextSize = 10.3,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ -- TextColor = { 0.0, 0.2, 0.5 },
+ -- TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -43,10 +41,9 @@ local barnardsOrbit = {
File = speck .. "/starorbits-BarnardsStar.speck",
MeshColor = {{0.39, 0.58, 0.93}},
--LabelFile = speck .. "/1ld.label",
- TextColor = { 0.0, 0.2, 0.5 },
- TextSize = 10.3,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ -- TextColor = { 0.0, 0.2, 0.5 },
+ -- TextSize = 10.3,
+ -- TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -66,10 +63,9 @@ local kapteynsOrbit = {
File = speck .. "/starorbits-KapteynsStar.speck",
MeshColor = {{0.6, 0.6, 0.6}},
--LabelFile = speck .. "/1ld.label",
- TextColor = { 0.0, 0.2, 0.5 },
- TextSize = 10.3,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ -- TextColor = { 0.0, 0.2, 0.5 },
+ -- TextSize = 10.3,
+ -- TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -89,10 +85,9 @@ local lacaille9352Orbit = {
File = speck .. "/starorbits-Lacaille9352.speck",
MeshColor = {{0.58, 0.0, 0.83}},
--LabelFile = speck .. "/1ld.label",
- TextColor = { 0.0, 0.2, 0.5 },
- TextSize = 10.3,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ -- TextColor = { 0.0, 0.2, 0.5 },
+ -- TextSize = 10.3,
+ -- TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -112,10 +107,9 @@ local lSR1826Orbit = {
File = speck .. "/starorbits-LSR1826+3014.speck",
MeshColor = {{0.0, 0.39, 0.0}},
--LabelFile = speck .. "/1ld.label",
- TextColor = { 0.0, 0.2, 0.5 },
- TextSize = 10.3,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ -- TextColor = { 0.0, 0.2, 0.5 },
+ -- TextSize = 10.3,
+ -- TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -135,10 +129,9 @@ local lSRJ0822Orbit = {
File = speck .. "/starorbits-LSRJ0822+1700.speck",
MeshColor = {{0.5, 1.0, 0.0}},
--LabelFile = speck .. "/1ld.label",
- TextColor = { 0.0, 0.2, 0.5 },
- TextSize = 10.3,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ -- TextColor = { 0.0, 0.2, 0.5 },
+ -- TextSize = 10.3,
+ -- TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
@@ -158,10 +151,9 @@ local pM_J13420Orbit = {
File = speck .. "/starorbits-PM_J13420-3415.speck",
MeshColor = {{0.70, 0.13, 0.13}},
--LabelFile = speck .. "/1ld.label",
- TextColor = { 0.0, 0.2, 0.5 },
- TextSize = 10.3,
- TextMinSize = 0.5,
- TextMaxSize = 30.0,
+ -- TextColor = { 0.0, 0.2, 0.5 },
+ -- TextSize = 10.3,
+ -- TextMinMaxSize = { 0, 30 },
Unit = "pc"
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/stars.asset b/data/assets/scene/digitaluniverse/stars.asset
index 35a3565535..db0ac4adb7 100644
--- a/data/assets/scene/digitaluniverse/stars.asset
+++ b/data/assets/scene/digitaluniverse/stars.asset
@@ -1,13 +1,7 @@
local assetHelper = asset.require('util/asset_helper')
local colormaps = asset.require('./stars_colormap').ColorMaps
-
-local textures = asset.syncedResource({
- Name = "Stars Textures",
- Type = "HttpSynchronization",
- Identifier = "stars_textures",
- Version = 1
-})
+local textures = asset.require('./stars_textures').textures
local speck = asset.syncedResource({
Name = "Stars Speck Files",
diff --git a/data/assets/scene/digitaluniverse/stars_textures.asset b/data/assets/scene/digitaluniverse/stars_textures.asset
new file mode 100644
index 0000000000..d57f6d0907
--- /dev/null
+++ b/data/assets/scene/digitaluniverse/stars_textures.asset
@@ -0,0 +1,20 @@
+local assetHelper = asset.require('util/asset_helper')
+
+local textures = asset.syncedResource({
+ Name = "Stars Textures",
+ Type = "HttpSynchronization",
+ Identifier = "stars_textures",
+ Version = 1
+})
+
+asset.export("textures", textures)
+
+asset.meta = {
+ Name = "Star Textures",
+ Version = "1.0",
+ Description = [[Square textures used to represent stars when applied to camera-facing bil;board]],
+ Author = "OpenSpace Team",
+ URL = "http://openspaceproject.com",
+ License = "MIT License"
+}
+
diff --git a/data/assets/scene/digitaluniverse/superclusters.asset b/data/assets/scene/digitaluniverse/superclusters.asset
index 85546e608e..facc29d313 100644
--- a/data/assets/scene/digitaluniverse/superclusters.asset
+++ b/data/assets/scene/digitaluniverse/superclusters.asset
@@ -27,13 +27,13 @@ local object = {
File = speck .. "/superclust.speck",
Texture = textures .. "/point3A.png",
LabelFile = speck .. "/superclust.label",
+ Unit = "Mpc",
TextColor = { 0.9, 0.9, 0.9 },
ScaleFactor = 531.0,
TextSize = 22.44,
- TextMinSize = 8.0,
- Unit = "Mpc",
+ TextMinMaxSize = { 8, 20 },
DrawLabels = true,
- --BillboardMaxSize = 7.2,
+ --BillboardMinMaxSize = { 0.0, 7.2 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/supernovaremnants.asset b/data/assets/scene/digitaluniverse/supernovaremnants.asset
index 20a4f8f557..efa2c2844f 100644
--- a/data/assets/scene/digitaluniverse/supernovaremnants.asset
+++ b/data/assets/scene/digitaluniverse/supernovaremnants.asset
@@ -27,15 +27,14 @@ local object = {
Texture = textures .. "/point4.png",
PolygonSides = 7,
LabelFile = speck .. "/snr.label",
+ Unit = "pc",
TextColor = { 0.6, 0.46, 0.0 },
ScaleFactor = 424,
TextSize = 16.44,
- TextMinSize = 4.0,
- TextMaxSize = 200.0,
+ TextMinMaxSize = { 4, 100 },
--CorrectionSizeEndDistance = 17.5,
--CorrectionSizeFactor = 13.96,
- Unit = "pc",
- BillboardMaxSize = 500,
+ BillboardMinMaxSize = { 0.0, 500.0 },
EnablePixelSizeControl = true
},
GUI = {
diff --git a/data/assets/scene/digitaluniverse/tully.asset b/data/assets/scene/digitaluniverse/tully.asset
index 21e65f5ed5..d06deb8a4c 100644
--- a/data/assets/scene/digitaluniverse/tully.asset
+++ b/data/assets/scene/digitaluniverse/tully.asset
@@ -33,21 +33,18 @@ local tullyPoints = {
ColorRange = { { 1.0, 30.0 } },
LabelFile = speck .. "/tully.label",
DrawLabels = false,
+ Unit = "Mpc",
TextColor = { 0.7, 0.7, 0.7 },
TextSize = 19.36,
- TextMinSize = 8.2,
+ TextMinMaxSize = { 8, 20 },
TransformationMatrix = {
-0.7357425748, 0.67726129641, 0.0, 0.0,
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
0.67314530211, 0.73127116582, 0.11008126223, 0.0,
0.0, 0.0, 0.0, 1.0
},
- Unit = "Mpc",
- -- Fade in value in the same unit as "Unit"
- FadeInDistances = { 0.001, 1.0 },
- -- Max size in pixels
- BillboardMaxSize = 7,
- BillboardMinSize = 0,
+ FadeInDistances = { 0.001, 1.0 }, -- Fade in value in the same unit as "Unit"
+ BillboardMinMaxSize = { 0.0, 7.0 }, -- in pixels
--CorrectionSizeEndDistance = 22.0,
--CorrectionSizeFactor = 10.45
EnablePixelSizeControl = true
diff --git a/data/assets/scene/digitaluniverse/voids.asset b/data/assets/scene/digitaluniverse/voids.asset
index 20538ee161..269ae7c7e7 100644
--- a/data/assets/scene/digitaluniverse/voids.asset
+++ b/data/assets/scene/digitaluniverse/voids.asset
@@ -19,10 +19,10 @@ local object = {
Color = { 1.0, 1.0, 1.0 },
Opacity = 0.65,
LabelFile = speck .. "/voids.label",
+ Unit = "Mpc",
TextColor = { 0.296, 0.629, 1.0 },
TextSize = 20.9,
- TextMinSize = 8.0,
- Unit = "Mpc"
+ TextMinMaxSize = { 8, 20 }
},
GUI = {
Name = "Voids",
diff --git a/data/assets/scene/milkyway/gaia/apogee.asset b/data/assets/scene/milkyway/gaia/apogee.asset
index 12c495264a..b6abe3159a 100644
--- a/data/assets/scene/milkyway/gaia/apogee.asset
+++ b/data/assets/scene/milkyway/gaia/apogee.asset
@@ -1,14 +1,9 @@
local assetHelper = asset.require('util/asset_helper')
+local colorLUT = asset.require('scene/digitaluniverse/stars_colormap').ColorMaps
+local textures = asset.require('scene/digitaluniverse/stars_textures').textures
-local textures = asset.syncedResource({
- Name = "Stars Textures",
- Type = "HttpSynchronization",
- Identifier = "stars_textures",
- Version = 1
-})
-
local speck = asset.syncedResource({
Name = "Apogee Speck Files",
Type = "HttpSynchronization",
@@ -16,13 +11,6 @@ local speck = asset.syncedResource({
Version = 1
})
-local colorLUT = asset.syncedResource({
- Name = "Stars Color Table",
- Type = "HttpSynchronization",
- Identifier = "stars_colormap",
- Version = 2
-})
-
local gaia_abundance_apogee = {
Identifier = "Gaia Abundance Apogee",
Renderable = {
diff --git a/data/assets/scene/milkyway/gaia/gaiastars.asset b/data/assets/scene/milkyway/gaia/gaiastars.asset
index 997eaa55e5..5eeeb15162 100644
--- a/data/assets/scene/milkyway/gaia/gaiastars.asset
+++ b/data/assets/scene/milkyway/gaia/gaiastars.asset
@@ -1,18 +1,7 @@
local assetHelper = asset.require("util/asset_helper")
-local textures = asset.syncedResource({
- Name = "Stars Textures",
- Type = "HttpSynchronization",
- Identifier = "stars_textures",
- Version = 1
-})
-
-local colorLUT = asset.syncedResource({
- Name = "Stars Color Table",
- Type = "HttpSynchronization",
- Identifier = "stars_colormap",
- Version = 1
-})
+local colorLUT = asset.require('scene/digitaluniverse/stars_colormap').ColorMaps
+local textures = asset.require('scene/digitaluniverse/stars_textures').textures
-- Download a preprocessed binary octree of Radial Velocity subset values per star (preprocessed into 8 binary files).
local starsFolder = asset.syncedResource({
diff --git a/data/assets/scene/milkyway/gaia/galah.asset b/data/assets/scene/milkyway/gaia/galah.asset
index 121ee8f510..f4c814c20a 100644
--- a/data/assets/scene/milkyway/gaia/galah.asset
+++ b/data/assets/scene/milkyway/gaia/galah.asset
@@ -1,13 +1,7 @@
local assetHelper = asset.require('util/asset_helper')
-
-
-local textures = asset.syncedResource({
- Name = "Stars Textures",
- Type = "HttpSynchronization",
- Identifier = "stars_textures",
- Version = 1
-})
+local colorLUT = asset.require('scene/digitaluniverse/stars_colormap').ColorMaps
+local textures = asset.require('scene/digitaluniverse/stars_textures').textures
local speck = asset.syncedResource({
Name = "Galah Speck Files",
@@ -16,12 +10,6 @@ local speck = asset.syncedResource({
Version = 1
})
-local colorLUT = asset.syncedResource({
- Name = "Stars Color Table",
- Type = "HttpSynchronization",
- Identifier = "stars_colormap",
- Version = 2
-})
local gaia_abundance_galah = {
Identifier = "Gaia Abundance Galah",
diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset
index fdf60a27e6..e2411ef264 100644
--- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset
+++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset
@@ -27,21 +27,16 @@ local Charon = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/charon.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 40.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 2000000.0,
- FadeOutStartingDistance = 800000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 250000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 9.0,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ Distances = { 800000.0, 2000000.0 },
+ DistanceEPS = 250000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset
index ee44ed93de..947b762858 100644
--- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset
+++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset
@@ -27,21 +27,16 @@ local Pluto = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/pluto.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 28.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 4000000.0,
- FadeOutStartingDistance = 650000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 500000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 8.5,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 650000.0, 4000000.0 },
+ DistanceEPS = 500000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
@@ -56,13 +51,12 @@ local PlutoLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Pluto",
- FontSize = 100.0,
- LabelSize = 8.9,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
+ Text = "Pluto",
+ FontSize = 70.0,
+ Size = 9.05,
+ MinMaxSize = { 1, 100 },
BlendMode = "Additive",
- LabelOrientationOption = "Camera View Direction"
+ OrientationOption = "Camera View Direction"
},
Tag = { "solarsystem_labels" },
GUI = {
diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset
index fc9f456e51..d05e9abe84 100644
--- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset
+++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset
@@ -20,7 +20,8 @@ local PlutoTrailBarycentric = {
Tag = { "planetTrail_solarSystem", "planetTrail_dwarf" },
GUI = {
Name = "Pluto Barycentric Trail",
- Path = "/Solar System/Dwarf Planets/Pluto"
+ Path = "/Solar System/Dwarf Planets/Pluto",
+ Description = [[Orbit of Pluto around it's Barrycenter.]]
}
}
@@ -34,5 +35,6 @@ asset.meta = {
NASA Spice (see base spice asset)]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
- License = "MIT license"
+ License = "MIT license",
+ Identifiers = {"PlutoBarycentricTrail"}
}
diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset
new file mode 100644
index 0000000000..eaa79f8c36
--- /dev/null
+++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset
@@ -0,0 +1,62 @@
+local assetHelper = asset.require('util/asset_helper')
+local transforms = asset.require('scene/solarsystem/sun/transforms')
+asset.require("spice/base")
+local kernels = asset.require('./kernels').PlutoKernels
+local OneAU = 1.496e+8
+local PlutoKeplerianTrail = {
+ Identifier = "PlutoKeplerianTrail",
+ Parent = transforms.SunECLIPJ2000.Identifier,
+ Renderable = {
+ Type = "RenderableTrailOrbit",
+ Translation = {
+ Type = "KeplerTranslation",
+ Eccentricity = 2.543033082909471E-01,
+ SemiMajorAxis = 3.974407237841206E+01 * OneAU,
+ Inclination = 1.736609481151430E+01,
+ AscendingNode = 1.102099981996057E+02,
+ ArgumentOfPeriapsis = 1.142248569189779E+02,
+ MeanAnomaly = 14.53,
+ Epoch = '2000 01 01 00:00',
+ Period = 7.82438e+9
+ },
+ Color = { 0.2, 0.8, 0.3 },
+ Period = 90487.27692706819,
+ Resolution = 1000,
+ Enabled = false
+ },
+ Tag = { "planetTrail_solarSystem", "planetTrail_dwarf" },
+ GUI = {
+ Name = "Pluto Keplerian Trail",
+ Path = "/Solar System/Dwarf Planets/Pluto",
+ Description = "Keplerian trail of Pluto. Contains full orbit."
+ }
+}
+assetHelper.registerSceneGraphNodesAndExport(asset, { PlutoKeplerianTrail })
+
+
+asset.meta = {
+ Name = "Pluto Keplerian Trail",
+ Version = "1.0",
+ Description = [[ Full Keplerian trail of Pluto as observed by the Sun. Data from
+ JPL Horizons.]],
+ Author = "OpenSpace Team",
+ URL = "https://ssd.jpl.nasa.gov/sbdb.cgi?sstr=pluto",
+ License = "JPL/NASA",
+ Identifiers = {"PlutoKeplerianTrail"}
+}
+
+
+
+-- Double AscendingNode
+-- In range: ( 0.000000,360.000000 )
+-- This value determines the right ascension of the ascending node in degrees, that is the location of position along the orbit where the inclined plane and the horizonal reference plane intersect.
+-- Double ArgumentOfPeriapsis
+-- In range: ( 0.000000,360.000000 )
+-- This value determines the argument of periapsis in degrees, that is the position on the orbit that is closest to the orbiting body.
+-- Double MeanAnomaly
+-- In range: ( 0.000000,360.000000 )
+-- This value determines the mean anomaly at the epoch in degrees, which determines the initial location of the object along the orbit at epoch.
+-- EPOCH= 2457217.500000000 ! 2015-Jul-14 00:00 (TDB)
+-- EC= 2.543033082909471E-01 QR= 2.963702328762702E+01 IN= 1.736609481151430E+01
+-- OM= 1.102099981996057E+02 W = 1.142248569189779E+02 Tp= 2447885.610187903512
+-- A = 3.974407237841206E+01 AD= 4.985112146919710E+01 PR= 9.151809533192721E+04
\ No newline at end of file
diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset
index 0a99b94527..0df3c771b8 100644
--- a/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset
+++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset
@@ -1,6 +1,7 @@
asset.require('./trail')
asset.require('./pluto')
asset.require('./pluto_trail')
+asset.require('./pluto_trail_kepler')
asset.require('./charon/charon')
asset.require('./charon/charon_trail')
asset.require('./minor/hydra')
diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/trail.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/trail.asset
index 689500df90..c309dce11b 100644
--- a/data/assets/scene/solarsystem/dwarf_planets/pluto/trail.asset
+++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/trail.asset
@@ -23,7 +23,9 @@ local PlutoBarycenterTrail = {
Tag = { "planetTrail_solarSystem", "planetTrail_dwarf" },
GUI = {
Name = "Pluto Barycenter Trail",
- Path = "/Solar System/Dwarf Planets/Pluto"
+ Path = "/Solar System/Dwarf Planets/Pluto",
+ Description = [[Precise trail of Pluto from NASA SPICE data. Not
+ containing full orbit.]]
}
}
diff --git a/data/assets/scene/solarsystem/missions/insight/edl.asset b/data/assets/scene/solarsystem/missions/insight/edl.asset
index 6a2b046a66..8231084142 100644
--- a/data/assets/scene/solarsystem/missions/insight/edl.asset
+++ b/data/assets/scene/solarsystem/missions/insight/edl.asset
@@ -60,33 +60,118 @@ local legDeployTime = "2018 NOV 26 19:43:06.68" -- entry + 243s
local landerSeperationTime = "2018 NOV 26 19:44:51.68" -- entry + 348s
local touchdownTime = "2018 NOV 26 19:45:32.68" -- entry + 389s
local panelDeployTime = "2018 NOV 26 19:45:33.68" -- entry + 390s
-local foreverTime = "2018 NOV 26 20:17:50.68" -- entry + 2327s
local kernelTouchdownTime = "2018 NOV 26 19:45:32.3"
local spiceRotationEndTime = "2018 NOV 26 19:51:39"
-local InsightParent = {
- Identifier = "InsightParent",
- Parent = "MarsBarycenter",
- Transform = {
- Translation = {
+local TranslationKeyframes = {
+ ['1850 JAN 01 00:00:00'] = {
Type = "SpiceTranslation",
Target = "INSIGHT",
Observer = "MARS",
- Frame = "GALACTIC",
- Kernels = iKernels
+ Frame = "IAU_MARS",
+ Kernels = iKernels,
+ FixedDate = '2018 NOV 26 19:39:03'
+ },
+ ['2018 NOV 26 19:39:02'] = {
+ Type = "SpiceTranslation",
+ Target = "INSIGHT",
+ Observer = "MARS",
+ Frame = "IAU_MARS",
+ Kernels = iKernels,
+ FixedDate = '2018 NOV 26 19:39:03'
+ },
+ ['2018 NOV 26 19:39:03'] = {
+ Type = "SpiceTranslation",
+ Target = "INSIGHT",
+ Observer = "MARS",
+ Frame = "IAU_MARS",
+ Kernels = iKernels
+ },
+ ['2018 NOV 26 19:39:04'] = {
+ Type = "SpiceTranslation",
+ Target = "INSIGHT",
+ Observer = "MARS",
+ Frame = "IAU_MARS",
+ Kernels = iKernels
+ },
+ ['2018 NOV 26 19:45:34'] = {
+ Type = "SpiceTranslation",
+ Target = "INSIGHT",
+ Observer = "MARS",
+ Frame = "IAU_MARS",
+ Kernels = iKernels
+ },
+ ['2018 NOV 26 19:45:35'] = {
+ Type = "SpiceTranslation",
+ Target = "INSIGHT",
+ Observer = "MARS",
+ Frame = "IAU_MARS",
+ Kernels = iKernels,
+ FixedDate = '2018 NOV 26 19:45:34'
+ },
+}
+
+local RotationKeyframes = {
+ ['1850 JAN 01 00:00:00'] = {
+ Type = "SpiceRotation",
+ SourceFrame = "INSIGHT_LANDER_CRUISE",
+ DestinationFrame = "IAU_MARS",
+ FixedDate = '2018 NOV 26 19:39:02',
+ Kernels = iKernels
+ },
+ ['2018 NOV 26 19:39:02'] = {
+ Type = "SpiceRotation",
+ SourceFrame = "INSIGHT_LANDER_CRUISE",
+ DestinationFrame = "IAU_MARS",
+ FixedDate = '2018 NOV 26 19:39:02',
+ Kernels = iKernels
+ },
+ ['2018 NOV 26 19:39:03'] = {
+ Type = "SpiceRotation",
+ SourceFrame = "INSIGHT_LANDER_CRUISE",
+ DestinationFrame = "IAU_MARS",
+ Kernels = iKernels
+ },
+ ['2018 NOV 26 19:39:04'] = {
+ Type = "SpiceRotation",
+ SourceFrame = "INSIGHT_LANDER_CRUISE",
+ DestinationFrame = "IAU_MARS",
+ Kernels = iKernels
+ },
+ ['2018 NOV 26 19:45:34'] = {
+ Type = "SpiceRotation",
+ SourceFrame = "INSIGHT_LANDER_CRUISE",
+ DestinationFrame = "IAU_MARS",
+ Kernels = iKernels
+ },
+ ['2018 NOV 26 19:45:35'] = {
+ Type = "SpiceRotation",
+ SourceFrame = "INSIGHT_LANDER_CRUISE",
+ DestinationFrame = "IAU_MARS",
+ FixedDate = '2018 NOV 26 19:45:34'
+ },
+}
+
+
+local InsightParent = {
+ Identifier = "InsightParent",
+ Parent = "Mars",
+ Transform = {
+ Translation ={
+ Type = "TimelineTranslation",
+ Keyframes = TranslationKeyframes,
},
Rotation = {
- Type = "SpiceRotation",
- SourceFrame = "INSIGHT_LANDER_CRUISE",
- DestinationFrame = "GALACTIC"
+ Type = "TimelineRotation",
+ Keyframes = RotationKeyframes,
}
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = spiceRotationEndTime
- },
+ -- TimeFrame = {
+ -- Type = "TimeFrameInterval",
+ -- Start = entryTimeStart,
+ -- End = spiceRotationEndTime
+ -- },
GUI = {
Hidden = true,
Name = "InsightParent",
@@ -121,7 +206,6 @@ local Insight_Entry_CapsuleA = {
},
TimeFrame = {
Type = "TimeFrameInterval",
- Start = entryTimeStart,
End = landerSeperationTime
},
GUI = {
@@ -142,7 +226,6 @@ local Insight_Entry_Capsule_Ring = {
},
TimeFrame = {
Type = "TimeFrameInterval",
- Start = entryTimeStart,
End = landerSeperationTime
},
GUI = {
@@ -163,7 +246,6 @@ local Insight_Entry_Capsule_Plugs = {
},
TimeFrame = {
Type = "TimeFrameInterval",
- Start = entryTimeStart,
End = landerSeperationTime
},
GUI = {
@@ -184,7 +266,6 @@ local Insight_Entry_Heatshield = {
},
TimeFrame = {
Type = "TimeFrameInterval",
- Start = entryTimeStart,
End = heatShieldSeperationTime
},
GUI = {
@@ -329,11 +410,6 @@ local Insight_Lander_A001 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander A001",
@@ -350,11 +426,6 @@ local Insight_Lander_A002 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander A002",
@@ -371,11 +442,6 @@ local Insight_Lander_A003 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander A003",
@@ -392,11 +458,6 @@ local Insight_Lander_A004 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander A004",
@@ -413,11 +474,6 @@ local Insight_Lander_A005 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander A005",
@@ -434,11 +490,6 @@ local Insight_Lander_A006 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander A006",
@@ -455,11 +506,6 @@ local Insight_Lander_A007 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander A007",
@@ -476,11 +522,6 @@ local Insight_Lander_A008 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander A008",
@@ -497,11 +538,6 @@ local Insight_Lander_foil1 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander foil",
@@ -518,11 +554,6 @@ local Insight_Lander_Tex01 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander Tex01",
@@ -539,11 +570,6 @@ local Insight_Lander_Tex02 = {
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight Lander Tex02",
@@ -605,7 +631,6 @@ local Insight_Legs_Deployed_tex = {
TimeFrame = {
Type = "TimeFrameInterval",
Start = legDeployTime,
- End = foreverTime
},
GUI = {
Hidden = true,
@@ -626,7 +651,6 @@ local Insight_Legs_Deployed_AO06 = {
TimeFrame = {
Type = "TimeFrameInterval",
Start = legDeployTime,
- End = foreverTime
},
GUI = {
Hidden = true,
@@ -644,11 +668,6 @@ local Insight_Panels_Stowed_tex = {
ModelTransform = RotationMatrix,
LightSources = LightSources
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight panels_stow_tex",
@@ -665,11 +684,6 @@ local Insight_Panels_Stowed_tex2 = {
ModelTransform = RotationMatrix,
LightSources = LightSources
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight panels_stow_tex2",
@@ -686,11 +700,6 @@ local Insight_Panels_Stowed_AO01 = {
ModelTransform = RotationMatrix,
LightSources = LightSources
},
- TimeFrame = {
- Type = "TimeFrameInterval",
- Start = entryTimeStart,
- End = foreverTime
- },
GUI = {
Hidden = true,
Name = "Insight panels_stow_AO",
@@ -710,7 +719,6 @@ local Insight_Panels_Deployed_tex = {
TimeFrame = {
Type = "TimeFrameInterval",
Start = panelDeployTime,
- End = foreverTime
},
GUI = {
Hidden = true,
@@ -731,7 +739,6 @@ local Insight_Panels_Deployed_tex2 = {
TimeFrame = {
Type = "TimeFrameInterval",
Start = panelDeployTime,
- End = foreverTime
},
GUI = {
Hidden = true,
@@ -752,7 +759,6 @@ local Insight_Panels_Deployed_AO06 = {
TimeFrame = {
Type = "TimeFrameInterval",
Start = panelDeployTime,
- End = foreverTime
},
GUI = {
Hidden = true,
diff --git a/data/assets/scene/solarsystem/missions/perseverance/model.asset b/data/assets/scene/solarsystem/missions/perseverance/model.asset
index f11c247d21..cbe8099d9f 100644
--- a/data/assets/scene/solarsystem/missions/perseverance/model.asset
+++ b/data/assets/scene/solarsystem/missions/perseverance/model.asset
@@ -1,6 +1,6 @@
--perseverance/model.asset
local assetHelper = asset.require('util/asset_helper')
-local transforms = asset.require('./transforms')
+local trail = asset.require('./trail')
local marsTransforms = asset.require('scene/solarsystem/planets/mars/transforms')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
-- asset.require('./fov')
@@ -29,7 +29,7 @@ local models = asset.syncedResource({
-- Perseverance Model --
local Perseverance = {
Identifier = "Perseverance",
- Parent = transforms.MSL_Body.Identifier,
+ Parent = trail.PerseveranceNode.Identifier,
GUI = {
Name = "Perseverance",
Path = "/Solar System/Missions/Perseverance"
@@ -56,7 +56,8 @@ local Body = {
Body = "MARS SCIENCE LABORATORY",
GeometryFile = models .. "/Perseverance.obj",
LightSources = LightSources,
- PerformShading = false
+ PerformShading = false,
+ RotationVector = {65.940000,201.389999,263.980011}
},
GUI = {
Name = "Perseverance Model Body",
diff --git a/data/assets/scene/solarsystem/missions/perseverance/trail.asset b/data/assets/scene/solarsystem/missions/perseverance/trail.asset
index 79ccffb602..10c76a45eb 100644
--- a/data/assets/scene/solarsystem/missions/perseverance/trail.asset
+++ b/data/assets/scene/solarsystem/missions/perseverance/trail.asset
@@ -60,10 +60,11 @@ local PerseveranceTrailSun = {
Color = { 0.2, 0.7, 0.1 },
StartTime = startTime,
EndTime = endTime,
- SampleInterval = 100
+ SampleInterval = 100,
+ Enabled = false
},
GUI = {
- Name = "Perseverance Trail",
+ Name = "Perseverance Trail (Sun)",
Path = "/Solar System/Missions/Perseverance"
}
}
@@ -82,7 +83,8 @@ local PerseveranceTrailMars = {
Color = { 0.7, 0.9, 0.6 },
StartTime = approachMars,
EndTime = endTime,
- SampleInterval = 100
+ SampleInterval = 100,
+ Enabled = false
},
GUI = {
Name = "Perseverance Trail (Mars)",
diff --git a/data/assets/scene/solarsystem/missions/perseverance/transforms.asset b/data/assets/scene/solarsystem/missions/perseverance/transforms.asset
deleted file mode 100644
index c4caed35ac..0000000000
--- a/data/assets/scene/solarsystem/missions/perseverance/transforms.asset
+++ /dev/null
@@ -1,503 +0,0 @@
-local assetHelper = asset.require('util/asset_helper')
-local marsTransforms = asset.require('scene/solarsystem/planets/mars/transforms')
-local marsAsset = asset.require('scene/solarsystem/planets/mars/mars')
-local trailAsset = asset.require('./trail')
-
-
-local MSL_Body = {
- Identifier = "MSL_Body",
- Parent = trailAsset.PerseveranceNode.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0, 0.0, 2.8 }
- },
- Rotation = {
- Type = "StaticRotation",
- Rotation = { -0.521593,0.648407,2.888407 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
----- ROBOTIC ARM RA ----
-local RA_Base_Location = {
- Identifier = "RA_Base_Location",
- Parent = MSL_Body.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 1.111, -0.4525, -0.106 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
---AZ
-local RA_Shoulder_AZ_Location = {
- Identifier = "RA_Shoulder_AZ_Location",
- Parent = RA_Base_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.0, 0.0, -0.08 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-----EL
-local RA_Shoulder_EL_Location = {
- Identifier = "RA_Shoulder_EL_Location",
- Parent = RA_Shoulder_AZ_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.17, 0.2, -0.005 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
---ELBOW
-local RA_Elbow_Location = {
- Identifier = "RA_Elbow_Location",
- Parent = RA_Shoulder_EL_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.83, -0.2, 0.0 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
---WRIST
-local RA_Wrist_Location = {
- Identifier = "RA_Wrist_Location",
- Parent = RA_Elbow_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.77, 0.13, 0.035 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
---TURRET
-local RA_Turret_Location = {
- Identifier = "RA_Turret_Location",
- Parent = RA_Wrist_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.0, 0.04, -0.15 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
---MAHLI
-local RA_Mahli_Location = {
- Identifier = "RA_Mahli_Location",
- Parent = RA_Turret_Location.Identifier
-}
-
----- MASTCAM RSM ----
-local RSM_ROOT_Location = {
- Identifier = "RSM_ROOT_Location",
- Parent = MSL_Body.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.7039, 0.5769, -0.563 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local RSM_AZ_Location = {
- Identifier = "RSM_AZ_Location",
- Parent = RSM_ROOT_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.0, 0.008, 0.0 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local RSM_ZERO_EL_Location = {
- Identifier = "RSM_ZERO_EL_Location",
- Parent = RSM_AZ_Location.Identifier,
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local RSM_EL_Location = {
- Identifier = "RSM_EL_Location",
- Parent = RSM_AZ_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- --Position = {0.0, 0.0, -0.664}
- Position = { 0.002, 0.007, -0.688 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
----- HIGH GAIN ANTENNA HGA ----
-local HGA_AZ_Location = {
- Identifier = "HGA_AZ_Location",
- Parent = MSL_Body.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { -0.46, -0.47, -0.55 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local HGA_EL_Location = {
- Identifier = "HGA_EL_Location",
- Parent = HGA_AZ_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.0, 0.0, -0.17 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
----- SAM & HEMIN ----
-local SAM_Cover_1_Location = {
- Identifier = "SAM_Cover_1_Location",
- Parent = MSL_Body.Identifier,
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local SAM_Cover_2_Location = {
- Identifier = "SAM_Cover_2_Location",
- Parent = MSL_Body.Identifier,
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local CHEMIN_Location = {
- Identifier = "CHEMIN_Location",
- Parent = MSL_Body.Identifier,
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
----- Wheels ----
-local Wheel_base_Location = {
- Identifier = "Wheel_base_Location",
- Parent = MSL_Body.Identifier,
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
--- Left side --
-local Leg_1_L_Location = {
- Identifier = "Leg_1_L_Location",
- Parent = Wheel_base_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.217, -0.812, -0.215 } --for the right side
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Leg_2_L_Location = {
- Identifier = "Leg_2_L_Location",
- Parent = Leg_1_L_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { -0.74, -0.00380, 0.223 } --CORRECT, DONT CHANGE
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wrist_F_L_Location = {
- Identifier = "Wrist_F_L_Location",
- Parent = Leg_1_L_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.8839, -0.2659, 0.2 } --CORRECT, DONT TOUCH
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wheel_F_L_Location = {
- Identifier = "Wheel_F_L_Location",
- Parent = Wrist_F_L_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.0, 0.0, 0.426 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wheel_C_L_Location = {
- Identifier = "Wheel_C_L_Location",
- Parent = Leg_2_L_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.45, -0.4, 0.403 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wrist_B_L_Location = {
- Identifier = "Wrist_B_L_Location",
- Parent = Leg_2_L_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { -0.627, -0.2635, -0.022 } --CORRECT, DONT CHANGE
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wheel_B_L_Location = {
- Identifier = "Wheel_B_L_Location",
- Parent = Wrist_B_L_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.0, -0.0, 0.426 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
--- wheels, Right Side --
-local Leg_1_R_Location = {
- Identifier = "Leg_1_R_Location",
- Parent = Wheel_base_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.217, 0.812, -0.215 } --Check with caroline!!!
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Leg_2_R_Location = {
- Identifier = "Leg_2_R_Location",
- Parent = Leg_1_R_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- --Position = {-0.74, 0.0, 0.24}
- Position = { -0.74, 0.00380, 0.223 } --want to use this one, once the center point is changed in maya
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wrist_F_R_Location = {
- Identifier = "Wrist_F_R_Location",
- Parent = Leg_1_R_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.882, 0.259, 0.215 }
- --Position = {0.8839, 0.2659, 0.2} --position for the Wrist_F_L
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wheel_F_R_Location = {
- Identifier = "Wheel_F_R_Location",
- Parent = Wrist_F_R_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.0, 0.0, 0.426 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wheel_C_R_Location = {
- Identifier = "Wheel_C_R_Location",
- Parent = Leg_2_R_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.45, 0.4, 0.403 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wrist_B_R_Location = {
- Identifier = "Wrist_B_R_Location",
- Parent = Leg_2_R_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { -0.6208, 0.2759, -0.025 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-local Wheel_B_R_Location = {
- Identifier = "Wheel_B_R_Location",
- Parent = Wrist_B_R_Location.Identifier,
- Transform = {
- Translation = {
- Type = "StaticTranslation",
- Position = { 0.0, -0.0005, 0.426 }
- }
- },
- GUI = {
- Path = "/Solar System/Missions/Perseverance/Transforms",
- Hidden = true
- }
-}
-
-assetHelper.registerSceneGraphNodesAndExport(asset, {
- MSL_Body,
- RA_Base_Location,
- RA_Shoulder_AZ_Location,
- RA_Shoulder_EL_Location,
- RA_Elbow_Location,
- RA_Wrist_Location,
- RA_Turret_Location,
- RA_Mahli_Location,
- RSM_ROOT_Location,
- RSM_AZ_Location,
- RSM_ZERO_EL_Location,
- RSM_EL_Location,
-
- HGA_AZ_Location,
- HGA_EL_Location,
- SAM_Cover_1_Location,
- SAM_Cover_2_Location,
- CHEMIN_Location,
-
- Wheel_base_Location,
- Leg_1_L_Location,
- Leg_2_L_Location,
- Wrist_F_L_Location,
- Wheel_F_L_Location,
- Wheel_C_L_Location,
- Wrist_B_L_Location,
- Wheel_B_L_Location,
-
- Leg_1_R_Location,
- Leg_2_R_Location,
- Wrist_F_R_Location,
- Wheel_F_R_Location,
- Wheel_C_R_Location,
- Wrist_B_R_Location,
- Wheel_B_R_Location
-})
diff --git a/data/assets/scene/solarsystem/missions/voyager/voyager2.asset b/data/assets/scene/solarsystem/missions/voyager/voyager2.asset
index 8cbe9dcbac..78fb068769 100644
--- a/data/assets/scene/solarsystem/missions/voyager/voyager2.asset
+++ b/data/assets/scene/solarsystem/missions/voyager/voyager2.asset
@@ -116,7 +116,7 @@ local VoyagerTrailCruiseEarthJupiter = {
Kernels = Kernels
},
Color = { 0.70, 0.50, 0.20 },
- StartTime = "1977 SEP 05",
+ StartTime = "1977-AUG-20 16:07:06.535",
EndTime = "1979 JUL 06",
SampleInterval = 669 * 2 -- 669 is the number of days between the Start and End time
},
diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset
index fb34cd82d1..ef29f8c1f3 100644
--- a/data/assets/scene/solarsystem/planets/earth/earth.asset
+++ b/data/assets/scene/solarsystem/planets/earth/earth.asset
@@ -23,21 +23,16 @@ local Earth = {
}
},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/Earth.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 40.0,
- LabelsSize = 4.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 300000.0,
- FadeOutStartingDistance = 10000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 1500000.0,
- LabelsColor = { 1.0, 0.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 5.0,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 10000.0, 300000.0 },
+ DistanceEPS = 1500000.0,
+ Color = { 1.0, 0.0, 0.0 }
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
@@ -54,20 +49,16 @@ local EarthLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Earth",
- FontSize = 100.0,
- LabelSize = 8.6,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
+ Text = "Earth",
+ FontSize = 70.0,
+ Size = 8.77,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
BlendMode = "Additive",
EnableFading = true,
- FadeStartUnit = "au",
- FadeStartDistance = 1.5,
- FadeStartSpeed = 1.0,
- FadeEndUnit = "au",
- FadeEndDistance = 15.0,
- FadeEndSpeed = 25.0
+ FadeUnit = "au",
+ FadeDistances = { 1.5, 15.0 },
+ FadeWidths = { 1.0, 25.0 }
},
Tag = { "solarsystem_labels" },
GUI = {
diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset
index f24995d8bd..f3cd2cea9a 100644
--- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset
+++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset
@@ -34,21 +34,16 @@ local Moon = {
}
},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/moon.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 14.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 500000.0,
- FadeOutStartingDistance = 100000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 1350000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 7.6,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 100000.0, 500000.0 },
+ DistanceEPS = 1350000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
GUI = {
diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset
index 2012885e73..3c12782da0 100644
--- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset
+++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset
@@ -103,34 +103,29 @@ local initializeAndAddNodes = function()
}
}
+ -- @TODO (emmbr, 2021-05-27) add to scene when label rendering issues have been fixed
local IssLabel = {
Identifier = "IssLabel",
Parent = iss.Identifier,
-
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "ISS",
- FontSize = 100.0,
- LabelSize = 3.4,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
+ Text = "ISS",
+ FontSize = 70.0,
+ Size = 3.4,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
BlendMode = "Additive",
EnableFading = true,
- FadeStartUnit = "au",
- FadeStartDistance = 0.15,
- FadeStartSpeed = 1.0,
- FadeEndUnit = "au",
- FadeEndDistance = 15.0,
- FadeEndSpeed = 25.0
+ FadeDistances = { 0.15, 15.0 },
+ FadeWidths = { 1.0, 25.0 }
},
Tag = { "solarsystem_labels" },
GUI = {
Name = "ISS Label",
Path = "/Solar System/Planets/Earth/Satellites"
}
-}
+ }
return { iss, parentNode, issTrail }
end
diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset
index 96c6e5561b..0713514a18 100644
--- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset
+++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset
@@ -59,38 +59,35 @@ asset.onInitialize(function ()
},
Tag = { "earth_satellite", "Aqua" },
GUI = {
- Name = "Terra Trail",
+ Name = "Aqua Trail",
Path = "/Solar System/Planets/Earth/Satellites/Aqua"
}
}
+ -- @TODO (emmbr, 2021-05-27) this label is not visible. Too large fade distances?
+ -- Might also be affected by the rendering issues for labels
local AquaLabel = {
- Identifier = "AquaLabel",
- Parent = Aqua.Identifier,
-
- Renderable = {
- Enabled = false,
- Type = "RenderableLabels",
- LabelText = "SNPP",
- FontSize = 100.0,
- LabelSize = 4.0,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
- BlendMode = "Additive",
- EnableFading = true,
- FadeStartUnit = "au",
- FadeStartDistance = 0.15,
- FadeStartSpeed = 1.0,
- FadeEndUnit = "au",
- FadeEndDistance = 15.0,
- FadeEndSpeed = 25.0
- },
- Tag = { "solarsystem_labels" },
- GUI = {
- Name = "Aqua Label",
- Path = "/Solar System/Planets/Earth"
- }
+ Identifier = "AquaLabel",
+ Parent = Aqua.Identifier,
+ Renderable = {
+ Enabled = false,
+ Type = "RenderableLabels",
+ Text = "Aqua",
+ FontSize = 70.0,
+ Size = 4.0,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
+ BlendMode = "Additive",
+ EnableFading = true,
+ FadeUnit = "au",
+ FadeDistances = { 1.5, 15.0 },
+ FadeWidths = { 1.0, 25.0 }
+ },
+ Tag = { "solarsystem_labels" },
+ GUI = {
+ Name = "Aqua Label",
+ Path = "/Solar System/Planets/Earth"
+ }
}
table.insert(nodes, Aqua)
diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset
index 9564cd31d6..56a3146324 100644
--- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset
+++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset
@@ -67,32 +67,28 @@ asset.onInitialize(function ()
}
local SNPPLabel = {
- Identifier = "SNPPLabel",
- Parent = SNPP.Identifier,
+ Identifier = "SNPPLabel",
+ Parent = SNPP.Identifier,
- Renderable = {
- Enabled = false,
- Type = "RenderableLabels",
- LabelText = "SNPP",
- FontSize = 100.0,
- LabelSize = 4.0,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
- BlendMode = "Additive",
- EnableFading = true,
- FadeStartUnit = "au",
- FadeStartDistance = 0.15,
- FadeStartSpeed = 1.0,
- FadeEndUnit = "au",
- FadeEndDistance = 15.0,
- FadeEndSpeed = 25.0
- },
- Tag = { "solarsystem_labels" },
- GUI = {
- Name = "SNPP Label",
- Path = "/Solar System/Planets/Earth"
- }
+ Renderable = {
+ Enabled = false,
+ Type = "RenderableLabels",
+ Text = "SNPP",
+ FontSize = 70.0,
+ Size = 4.0,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
+ BlendMode = "Additive",
+ EnableFading = true,
+ FadeUnit = "au",
+ FadeDistances = { 1.5, 15.0 },
+ FadeWidths = { 1.0, 25.0 }
+ },
+ Tag = { "solarsystem_labels" },
+ GUI = {
+ Name = "SNPP Label",
+ Path = "/Solar System/Planets/Earth"
+ }
}
table.insert(nodes, SNPP)
diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset
index 9065e44536..49c0fc93d1 100644
--- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset
+++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset
@@ -66,33 +66,30 @@ asset.onInitialize(function ()
}
}
+ -- @TODO (emmbr, 2021-05-27) this label is not visible. Too large fade distances?
+ -- Might also be affected by the rendering issues for labels
local TerraLabel = {
- Identifier = "TerraLabel",
- Parent = Terra.Identifier,
-
- Renderable = {
- Enabled = false,
- Type = "RenderableLabels",
- LabelText = "SNPP",
- FontSize = 100.0,
- LabelSize = 4.0,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
- BlendMode = "Additive",
- EnableFading = true,
- FadeStartUnit = "au",
- FadeStartDistance = 0.15,
- FadeStartSpeed = 1.0,
- FadeEndUnit = "au",
- FadeEndDistance = 15.0,
- FadeEndSpeed = 25.0
- },
- Tag = { "solarsystem_labels" },
- GUI = {
- Name = "Terra Label",
- Path = "/Solar System/Planets/Earth"
- }
+ Identifier = "TerraLabel",
+ Parent = Terra.Identifier,
+ Renderable = {
+ Enabled = false,
+ Type = "RenderableLabels",
+ Text = "Terra",
+ FontSize = 70.0,
+ Size = 4.0,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
+ BlendMode = "Additive",
+ EnableFading = true,
+ FadeUnit = "au",
+ FadeDistances = { 1.5, 15.0 },
+ FadeWidths = { 1.0, 25.0 }
+ },
+ Tag = { "solarsystem_labels" },
+ GUI = {
+ Name = "Terra Label",
+ Path = "/Solar System/Planets/Earth"
+ }
}
table.insert(nodes, Terra)
diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset
index f62b20513d..c4503abea0 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset
@@ -28,21 +28,17 @@ local Callisto = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/callisto.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 40.0,
- LabelsSize = 10.5,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 15000000.0,
- FadeOutStartingDistance = 5000000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 1350000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 11.5,
+ MinMaxSize = { 1, 100 },
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 5000000.0, 15000000.0 },
+ DistanceEPS = 1350000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" },
diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto_textures.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto_textures.asset
index 80621e6bee..c6cc74bb68 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto_textures.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto_textures.asset
@@ -2,6 +2,6 @@ local TexturesPath = asset.syncedResource({
Name = "Callisto Textures",
Type = "HttpSynchronization",
Identifier = "callisto_textures",
- Version = 1
+ Version = 2
})
asset.export("TexturesPath", TexturesPath)
diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset
index 9cd2d1cf52..21653cde87 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset
@@ -3,7 +3,7 @@ local globeIdentifier = asset.require("./../../callisto").Callisto.Identifier
local layer = {
Identifier = "Texture",
- FilePath = texturesPath .. "/callisto.jpg",
+ FilePath = texturesPath .. "/callisto_os.tif",
}
asset.onInitialize(function ()
@@ -15,8 +15,8 @@ asset.export("layer", layer)
asset.meta = {
Name = "Callisto Texutre",
- Version = "1.0",
- Description = [[ Default jpg texture for Callisto]],
+ Version = "2.0",
+ Description = [[ Default texture for Callisto]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license",
diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/default_layers.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/default_layers.asset
index 926c4cc1fa..efb6a7510b 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/europa/default_layers.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/europa/default_layers.asset
@@ -1,7 +1,7 @@
local colorLayersPath = "./layers/colorlayers"
asset.require(colorLayersPath .. "/europa_texture")
-local colorLayer = asset.require(colorLayersPath .. "/voyager_global_mosaic")
+local colorLayer = asset.require(colorLayersPath .. "/voyager_global_mosaic_local")
-- Set enabled layers (temporary solution)
-- @TODO: do this using a boolean that's passed to the 'asset.require' instead
diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset
index 670ee9c7c8..1ecfb93b34 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset
@@ -28,21 +28,16 @@ local Europa = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/europa.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 40.0,
- LabelsSize = 10.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 8000000.0,
- FadeOutStartingDistance = 5000000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 700000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 11.0,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 500000.0, 8000000.0 },
+ DistanceEPS = 700000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" },
diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa_textures.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa_textures.asset
index a1eb48b59e..259bec7da5 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa_textures.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa_textures.asset
@@ -2,6 +2,6 @@ local TexturesPath = asset.syncedResource({
Name = "Europa Textures",
Type = "HttpSynchronization",
Identifier = "europa_textures",
- Version = 1
+ Version = 2
})
asset.export("TexturesPath", TexturesPath)
diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset
index ed5e691509..1e690211b2 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset
@@ -3,7 +3,8 @@ local globeIdentifier = asset.require("./../../europa").Europa.Identifier
local layer = {
Identifier = "Texture",
- FilePath = texturesPath .. "/europa.jpg",
+ FilePath = texturesPath .. "/europa_os.tif",
+ Enabled = true
}
asset.onInitialize(function ()
@@ -15,8 +16,8 @@ asset.export("layer", layer)
asset.meta = {
Name = "Europa Texutre",
- Version = "1.0",
- Description = [[ Default jpg texture for Europa]],
+ Version = "2.0",
+ Description = [[ Default texture for Europa]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset
new file mode 100644
index 0000000000..36e08d3c16
--- /dev/null
+++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset
@@ -0,0 +1,36 @@
+local texturesPath = asset.require("./../../europa_textures").TexturesPath
+local globeIdentifier = asset.require("./../../europa").Europa.Identifier
+
+local layer = {
+ Identifier = "Voyager_Global_Mosaic_Local",
+ Name = "Voyager Global Mosaic [Local]",
+ FilePath = texturesPath .. "/evgos.vrt",
+ BlendMode = "Color"
+}
+
+asset.onInitialize(function ()
+ openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer)
+end)
+
+asset.export("layer", layer)
+
+
+asset.meta = {
+ Name = "Voyager Global Mosaic",
+ Version = "1.0",
+ Description = [[ Europa Voyager - Galileo SSI Global Mosaic 500m v2. This global map
+ base of Europa utilizes the best image quality and moderate resolution coverage
+ supplied by the Galileo SSI (Solid-State Imaging) instrument and Voyager 1 and 2.
+ The image data was selected on the basis of overall image quality, reasonable
+ input resolution (from 20 km/pixel for gap fill to as high as 200 meters per
+ pixel[m]), and availability of moderate viewing and sun angles for topography.
+ The map projections are based on a sphere having a radius of 1,562.09 kilometers.
+ A Simple Cylindrical projection was used at a resolution of 500 m. (Description
+ from URL)]],
+ Author = "USGS",
+ URL = "https://astrogeology.usgs.gov/search/map/Europa/Voyager-Galileo/" ..
+ "Europa_Voyager_GalileoSSI_global_mosaic_500m",
+ License = "NASA/PDS",
+ Identifiers = {"Voyager_Global_Mosaic_Local"}
+}
+
diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset
index 182b8751e9..ccda9c129a 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset
@@ -28,21 +28,16 @@ local Ganymede = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/ganymede.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 40.0,
- LabelsSize = 10.5,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 8000000.0,
- FadeOutStartingDistance = 2250000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 1750000.0,
- LabelsColor = {1.0, 1.0, 0.0}
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 11.5,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 2250000.0, 8000000.0 },
+ DistanceEPS = 1750000.0,
+ Color = {1.0, 1.0, 0.0}
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" },
diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset
index 50e84eaa6a..641cf411f6 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset
@@ -28,21 +28,16 @@ local Io = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/io.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 40.0,
- LabelsSize = 10.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 8500000.0,
- FadeOutStartingDistance = 4000000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 1000000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 11.0,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 4000000.0, 8500000.0 },
+ DistanceEPS = 1000000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" },
diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset
index c24a8d9789..29a7d0495e 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset
@@ -42,12 +42,11 @@ local JupiterLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Jupiter",
- FontSize = 100.0,
- LabelSize = 8.6,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
+ Text = "Jupiter",
+ FontSize = 70.0,
+ Size = 8.77,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
BlendMode = "Additive"
},
Tag = { "solarsystem_labels" },
diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter_textures.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter_textures.asset
index c82f34e5a6..c310a1906b 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/jupiter_textures.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/jupiter_textures.asset
@@ -2,6 +2,6 @@ local TexturesPath = asset.syncedResource({
Name = "Jupiter Textures",
Type = "HttpSynchronization",
Identifier = "jupiter_textures",
- Version = 1
+ Version = 2
})
asset.export("TexturesPath", TexturesPath)
diff --git a/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset
index 0a9de27073..98b2d1543d 100644
--- a/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset
+++ b/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset
@@ -3,7 +3,7 @@ local globeIdentifier = asset.require("./../../jupiter").Jupiter.Identifier
local layer = {
Identifier = "Texture",
- FilePath = texturesPath .. "/jupiter.jpg",
+ FilePath = texturesPath .. "/jupiter_os.tif",
}
asset.onInitialize(function ()
@@ -15,8 +15,8 @@ asset.export("layer", layer)
asset.meta = {
Name = "Jupiter Texutre",
- Version = "1.0",
- Description = [[ Default jpg texture for Jupiter]],
+ Version = "2.0",
+ Description = [[ Default texture for Jupiter]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
diff --git a/data/assets/scene/solarsystem/planets/mars/default_layers.asset b/data/assets/scene/solarsystem/planets/mars/default_layers.asset
index db06a922b2..54354cbafd 100644
--- a/data/assets/scene/solarsystem/planets/mars/default_layers.asset
+++ b/data/assets/scene/solarsystem/planets/mars/default_layers.asset
@@ -23,7 +23,8 @@ asset.require(colorLayersPath .. "/hirisels")
-- Height layers
asset.require(heightLayersPath .. "/mola_europe")
-local heightLayer = asset.require(heightLayersPath .. "/mola_utah")
+asset.require(heightLayersPath .. "/mola_utah")
+local heightLayer = asset.require(heightLayersPath .. "/MDEM200M")
asset.require(heightLayersPath .. "/hirisels")
-- Overlays
diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/MDEM200M.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/MDEM200M.asset
new file mode 100644
index 0000000000..fefc177186
--- /dev/null
+++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/MDEM200M.asset
@@ -0,0 +1,35 @@
+local mapServiceConfigs = asset.localResource("./../../map_service_configs")
+local globeIdentifier = asset.require("./../../mars").Mars.Identifier
+
+local layer = {
+ Identifier = "MDEM200M",
+ Name = "HRSC MOLA Blended DEM Global 200m v2",
+ FilePath = mapServiceConfigs .. "/ESRI/MDEM200M.tif",
+ Description = [[ Blend of data derived from the Mars Orbiter Laser Altimeter
+ (MOLA, an instrument aboard NASA’s
+ Mars Global Surveyor spacecraft), and data derived from the High-Resolution
+ Stereo Camera (HRSC, an instrument aboard the European Space Agency’s Mars
+ Express spacecraft). The average accuracy is ~100 meters in horizontal
+ position and the elevation uncertainty is at least ±3 m. This
+ tiled elevation layer, hosted by Esri, is made available using
+ lossless LERC compression.(Description from URL).]],
+}
+
+asset.onInitialize(function ()
+ openspace.globebrowsing.addLayer(globeIdentifier, "HeightLayers", layer)
+end)
+
+asset.export("layer", layer)
+
+
+asset.meta = {
+ Name = "Mars HRSC MOLA Blended DEM Global 200m v2",
+ Version = "1.0",
+ Description = [[ESRI Hosted ars HRSC MOLA Blended DEM.]],
+ Author = "esri_astro",
+ URL = "https://www.arcgis.com/home/item.html?id=225adad86379474ebc3d51a74573c99b",
+ License = "Esri Master License Agreement",
+ Identifiers = {"MDEM200M"}
+}
+
+
diff --git a/data/assets/scene/solarsystem/planets/mars/map_service_configs/ESRI/MDEM200M.tif b/data/assets/scene/solarsystem/planets/mars/map_service_configs/ESRI/MDEM200M.tif
new file mode 100644
index 0000000000..11e11e6d3e
--- /dev/null
+++ b/data/assets/scene/solarsystem/planets/mars/map_service_configs/ESRI/MDEM200M.tif
@@ -0,0 +1,17 @@
+
+
+ http://astro.arcgis.com/arcgis/rest/services/OnMars/MDEM200M/ImageServer/tile/${z}/${y}/${x}
+
+
+ -180.0 90.0
+ 180.0 -90.0
+ 131328 65664
+ 7 top
+
+ GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]
+ 513 513
+ 1 Int16
+
+ 5
+ 404,400
+
diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset
index c169c8a568..977d986e99 100644
--- a/data/assets/scene/solarsystem/planets/mars/mars.asset
+++ b/data/assets/scene/solarsystem/planets/mars/mars.asset
@@ -23,21 +23,16 @@ local Mars = {
SegmentsPerPatch = 90,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/mars.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 14.0,
- LabelsSize = 9.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 2000000.0,
- FadeOutStartingDistance = 750000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 2500000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 8.7,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 750000.0, 2000000.0 },
+ DistanceEPS = 2500000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
@@ -54,12 +49,11 @@ local MarsLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Mars",
- FontSize = 100.0,
- LabelSize = 8.5,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
+ Text = "Mars",
+ FontSize = 70.0,
+ Size = 8.66,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
BlendMode = "Additive",
TransformationMatrix = {
1.0, 0.0, 0.0, -8.0E6,
diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset
index f1ea2d6c06..ceb774f5ac 100644
--- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset
+++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset
@@ -24,21 +24,16 @@ local Mercury = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/Mercury.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 22.0,
- LabelsSize = 10.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 5000000.0,
- FadeOutStartingDistance = 1800000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 1500000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 10.1,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 1800000.0, 5000000.0 },
+ DistanceEPS = 1500000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
@@ -53,12 +48,11 @@ local MercuryLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Mercury",
- FontSize = 100.0,
- LabelSize = 8.3,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
+ Text = "Mercury",
+ FontSize = 70.0,
+ Size = 8.46,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
BlendMode = "Additive"
},
Tag = { "solarsystem_labels" },
diff --git a/data/assets/scene/solarsystem/planets/neptune/neptune.asset b/data/assets/scene/solarsystem/planets/neptune/neptune.asset
index 1b53920d46..5700797e14 100644
--- a/data/assets/scene/solarsystem/planets/neptune/neptune.asset
+++ b/data/assets/scene/solarsystem/planets/neptune/neptune.asset
@@ -33,12 +33,11 @@ local NeptuneLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Neptune",
- FontSize = 100.0,
- LabelSize = 8.8,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
+ Text = "Neptune",
+ FontSize = 70.0,
+ Size = 8.96,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
BlendMode = "Additive"
},
Tag = { "solarsystem_labels" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset
index 1cce3d7e20..f91edea8ed 100644
--- a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset
@@ -26,21 +26,16 @@ local Dione = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/dione.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 32.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 3500000.0,
- FadeOutStartingDistance = 1000000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 200000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 8.7,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 500000.0, 3500000.0 },
+ DistanceEPS = 200000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset
index 1f16f3f0bb..87d416faea 100644
--- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset
@@ -26,21 +26,16 @@ local Enceladus = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/enceladus.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 22.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 1000000.0,
- FadeOutStartingDistance = 500000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 100000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 8.1,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 300000.0, 1000000.0 },
+ DistanceEPS = 100000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset
index 77fe207be1..763123733a 100644
--- a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset
@@ -26,20 +26,16 @@ local Hyperion = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ -- @TODO (2021-05-21, emmbr26) These labels do not seem to be visible
+ Enabled = false,
FileName = labelsPath .. "/hyperion.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 14.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- FadeInStartingDistance = 500000.0,
- FadeOutStartingDistance = 1000000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 1350000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 8.6,
+ FadeInEnabled = true,
+ FadeDistances = { 500000.0, 1000000.0 },
+ DistanceEPS = 1350000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset
index 5a33262237..17c3c89c4b 100644
--- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset
@@ -26,21 +26,16 @@ local Iapetus = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/iapetus.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 30.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 3500000.0,
- FadeOutStartingDistance = 600000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 250000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 8.7,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 600000.0, 3500000.0 },
+ DistanceEPS = 250000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset
index 0b9e83521a..a54c8bc981 100644
--- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset
@@ -26,21 +26,16 @@ local Mimas = {
SegmentsPerPatch = 64,
Layers = { },
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/mimas.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 14.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 1000000.0,
- FadeOutStartingDistance = 400000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 25000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 7.7,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 400000.0, 1000000.0 },
+ DistanceEPS = 25000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset
index 0c2d323efe..48926b0140 100644
--- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset
@@ -26,21 +26,16 @@ local Rhea = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/rhea.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 40.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 2500000.0,
- FadeOutStartingDistance = 1000000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 250000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 9.0,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 500000.0, 2500000.0 },
+ DistanceEPS = 250000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset
index 555ac5fc63..8a92299d59 100644
--- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset
@@ -56,13 +56,12 @@ local SaturnLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Saturn",
- FontSize = 100.0,
- LabelSize = 8.7,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
+ Text = "Saturn",
+ FontSize = 70.0,
+ Size = 8.85,
+ MinMaxSize = { 1, 100 },
BlendMode = "Additive",
- LabelOrientationOption = "Camera View Direction"
+ OrientationOption = "Camera View Direction"
},
Tag = { "solarsystem_labels" },
GUI = {
diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset
index 636081f8af..a87015d37d 100644
--- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset
@@ -26,21 +26,16 @@ local Tethys = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/tethys.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 24.0,
- LabelsSize = 8.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 1500000.0,
- FadeOutStartingDistance = 500000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 200000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 8.3,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 500000.0, 1500000.0 },
+ DistanceEPS = 200000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/titan/default_layers.asset
index 9159115f6a..faae518b07 100644
--- a/data/assets/scene/solarsystem/planets/saturn/titan/default_layers.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/titan/default_layers.asset
@@ -1,7 +1,6 @@
local colorLayersPath = "./layers/colorlayers"
-colorLayer = asset.require(colorLayersPath .. "/titan_texture")
-local colorLayer = asset.require(colorLayersPath .. "/cassini_iss_global_mosaic_4km_liu")
+local colorLayer = asset.require(colorLayersPath .. "/cassini_iss_global_mosaic_4km_local")
-- Set enabled layers (temporary solution)
-- @TODO: do this using a boolean that's passed to the 'asset.require' instead
@@ -14,7 +13,7 @@ end)
asset.meta = {
Name = "Default Titan Layers",
Version = "1.0",
- Description = [[ Default Titan layers are: Titan Texture and Cassini ISS Global
+ Description = [[ Default Titan layers are: Cassini ISS Global
Mosaic]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset
new file mode 100644
index 0000000000..0356317b58
--- /dev/null
+++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset
@@ -0,0 +1,34 @@
+local texturesPath = asset.require("./../../titan_textures").TexturesPath
+local globeIdentifier = asset.require("./../../titan").Titan.Identifier
+
+local layer = {
+ Identifier = "Cassini_ISS_Global_Mosaic_4km_Local",
+ Name = "Cassini ISS Global Mosaic 4km",
+ FilePath = texturesPath .. "/Titan_ISS_P19658_Mosaic_Global_4km_os.tif",
+ Description = [[ This global digital map of Saturn's moon Titan was created using
+ images taken by the Cassini spacecraft's Imaging Science Subsystem (ISS). The map
+ was produced in June 2015 using data collected through Cassini's flyby on April 7,
+ 2014, known as "T100". The mean radius of Titan used for projection of this map is
+ 1,600 miles (2,575 kilometers). Pixel resolution is 4005 meters per pixel (m).
+ Titan is assumed to be spherical until a control network -- a model of the moon's
+ shape based on multiple images tied together at defined points on the surface --
+ is created at some point in the future. (Description from URL)]]
+}
+
+asset.onInitialize(function ()
+ openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer)
+end)
+
+asset.export("layer", layer)
+
+
+asset.meta = {
+ Name = "Cassini ISS Global Mosaic",
+ Version = "1.0",
+ Description = [[ Cassini global image layer for Titan]],
+ Author = "USGS",
+ URL = "https://astrogeology.usgs.gov/search/map/Titan/Cassini/Global-Mosaic/" ..
+ "Titan_ISS_P19658_Mosaic_Global_4km",
+ License = "NASA/PDS",
+ Identifiers = {"Cassini_ISS_Global_Mosaic_4km_Local"}
+}
diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/titan_texture.asset b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/titan_texture.asset
deleted file mode 100644
index b9730b43eb..0000000000
--- a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/titan_texture.asset
+++ /dev/null
@@ -1,23 +0,0 @@
-local texturesPath = asset.require("./../../titan_textures").TexturesPath
-local globeIdentifier = asset.require("./../../titan").Titan.Identifier
-
-local layer = {
- Identifier = "Texture",
- FilePath = texturesPath .. "/titan.jpg",
-}
-
-asset.onInitialize(function ()
- openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer)
-end)
-
-asset.export("layer", layer)
-
-
-asset.meta = {
- Name = "Titan Texutre",
- Version = "1.0",
- Description = [[ Default jpg texture for Titan]],
- Author = "OpenSpace Team",
- URL = "http://openspaceproject.com",
- License = "MIT license"
-}
diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset
index fb52863ec2..25e701052e 100644
--- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset
@@ -26,21 +26,16 @@ local Titan = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/titan.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 14.0,
- LabelsSize = 10.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 7500000.0,
- FadeOutStartingDistance = 6000000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 1350000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 9.6,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 5000000.0, 7500000.0 },
+ DistanceEPS = 1350000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan_textures.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan_textures.asset
index 6083943b65..d64bdd04f3 100644
--- a/data/assets/scene/solarsystem/planets/saturn/titan/titan_textures.asset
+++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan_textures.asset
@@ -2,6 +2,6 @@ local TexturesPath = asset.syncedResource({
Type = "HttpSynchronization",
Name = "Titan textures",
Identifier = "titan_textures",
- Version = 1
+ Version = 2
})
asset.export("TexturesPath", TexturesPath)
diff --git a/data/assets/scene/solarsystem/planets/uranus/uranus.asset b/data/assets/scene/solarsystem/planets/uranus/uranus.asset
index c08924fd96..80d6add8f7 100644
--- a/data/assets/scene/solarsystem/planets/uranus/uranus.asset
+++ b/data/assets/scene/solarsystem/planets/uranus/uranus.asset
@@ -33,12 +33,11 @@ local UranusLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Uranus",
- FontSize = 100.0,
- LabelSize = 8.7,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
+ Text = "Uranus",
+ FontSize = 70.0,
+ Size = 8.86,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
BlendMode = "Additive"
},
Tag = { "solarsystem_labels" },
diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset
index b07ce04f0c..2e1c74df2a 100644
--- a/data/assets/scene/solarsystem/planets/venus/venus.asset
+++ b/data/assets/scene/solarsystem/planets/venus/venus.asset
@@ -26,22 +26,16 @@ local Venus = {
SegmentsPerPatch = 64,
Layers = {},
Labels = {
- Enable = false,
+ Enabled = false,
FileName = labelsPath .. "/venus.labels",
- LabelAlignmentOption = "Horizontally", -- or Circularly
- LabelsFontSize = 40.0,
- LabelsSize = 10.0,
- LabelsMinSize = 1.0,
- LabelsMaxSize = 1500.0,
- ProximityEnabled = false,
- LabelsFadeInEnabled = true,
- LabelsFadeInEnabled = true,
- LabelsFadeOutEnabled = true,
- FadeInStartingDistance = 7000000.0,
- FadeOutStartingDistance = 2000000.0,
- LabelsForceDomeRendering = true,
- LabelsDistanceEPS = 4000000.0,
- LabelsColor = { 1.0, 1.0, 0.0 }
+ AlignmentOption = "Horizontally", -- or Circularly
+ FontSize = 20.0,
+ Size = 11.0,
+ FadeInEnabled = true,
+ FadeOutEnabled = true,
+ FadeDistances = { 2000000.0, 7000000.0 },
+ DistanceEPS = 4000000.0,
+ Color = { 1.0, 1.0, 0.0 }
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
@@ -53,25 +47,24 @@ local Venus = {
}
local VenusLabel = {
- Identifier = "VenusLabel",
- Parent = Venus.Identifier,
- Renderable = {
- Enabled = false,
- Type = "RenderableLabels",
- LabelText = "Venus",
- FontSize = 100.0,
- LabelSize = 8.4,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
- BlendMode = "Additive"
- },
- Tag = { "solarsystem_labels" },
- GUI = {
- Name = "Venus Label",
- Path = "/Solar System/Planets/Venus",
- Description = "Label for Venus, viewable within the solar system."
- }
+ Identifier = "VenusLabel",
+ Parent = Venus.Identifier,
+ Renderable = {
+ Enabled = false,
+ Type = "RenderableLabels",
+ Text = "Venus",
+ FontSize = 70.0,
+ Size = 8.54,
+ MinMaxSize = { 1, 100 },
+ OrientationOption = "Camera View Direction",
+ BlendMode = "Additive"
+ },
+ Tag = { "solarsystem_labels" },
+ GUI = {
+ Name = "Venus Label",
+ Path = "/Solar System/Planets/Venus",
+ Description = "Label for Venus, viewable within the solar system."
+ }
}
assetHelper.registerSceneGraphNodesAndExport(asset, { Venus, VenusLabel })
diff --git a/data/assets/scene/solarsystem/sun/sun.asset b/data/assets/scene/solarsystem/sun/sun.asset
index 7eae833e2d..de53d4aa1b 100644
--- a/data/assets/scene/solarsystem/sun/sun.asset
+++ b/data/assets/scene/solarsystem/sun/sun.asset
@@ -26,20 +26,16 @@ local SunLabel = {
Renderable = {
Enabled = false,
Type = "RenderableLabels",
- LabelText = "Sun",
- FontSize = 100.0,
- LabelSize = 13.127,
- LabelMaxSize = 100.0,
- LabelMinSize = 1.0,
- LabelOrientationOption = "Camera View Direction",
+ Text = "Sun",
+ FontSize = 70.0,
+ Size = 14.17,
+ MinMaxSize = { 1, 50 },
+ OrientationOption = "Camera View Direction",
BlendMode = "Additive",
EnableFading = true,
- FadeStartUnit = "Pm",
- FadeStartDistance = 2.841,
- FadeStartSpeed = 1.375,
- FadeEndUnit = "pc",
- FadeEndDistance = 1.326,
- FadeEndSpeed = 1.0
+ FadeUnit = "pc",
+ FadeDistances = { 1.33, 15.0 },
+ FadeWidths = { 1.0, 20.0 }
},
Tag = { "solarsystem_labels" },
GUI = {
diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset
index fbf66f683c..85263c7e8b 100644
--- a/data/assets/util/webgui.asset
+++ b/data/assets/util/webgui.asset
@@ -3,7 +3,7 @@ asset.require('./static_server')
local guiCustomization = asset.require('customization/gui')
-- Select which commit hashes to use for the frontend and backend
-local frontendHash = "17b69f29a4a596d488ba8c9de953cc22fb0dce5c"
+local frontendHash = "7fed95043e967c632b446ae1c98c6390f3fb7edc"
local dataProvider = "data.openspaceproject.com/files/webgui"
local frontend = asset.syncedResource({
diff --git a/data/profiles/mars.profile b/data/profiles/mars.profile
index 87493a7562..eb730ff151 100644
--- a/data/profiles/mars.profile
+++ b/data/profiles/mars.profile
@@ -39,7 +39,7 @@
"is_local": false,
"key": "I",
"name": "Setup scene for insight EDL",
- "script": "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Settings.Offset', -470.800006);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Enabled', true);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.HiRISE-LS.Enabled', true);openspace.time.setPause(true);openspace.time.setTime('2018 NOV 26 19:39:03.68');openspace.navigation.setNavigationState({Anchor = 'Insight',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});"
+ "script": "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Settings.Offset', -470.800006);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Enabled', true);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.HiRISE-LS.Enabled', true);openspace.time.setPause(true);openspace.time.setTime('2018 NOV 26 19:39:01.68');openspace.navigation.setNavigationState({Anchor = 'Insight',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});"
},
{
"documentation": "Disable Mars layer settings used for insight EDL",
@@ -55,7 +55,7 @@
"is_local": false,
"key": "P",
"name": "Setup and Goto Perseverance",
- "script": "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -1677.088867);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Settings.Offset', -1677.088867);openspace.time.setPause(true);openspace.time.setTime('2021 FEB 18 20:32:16');openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Enabled', true);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.HiRISE-LS.Enabled', true);openspace.navigation.setNavigationState({Anchor = 'Perseverance',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});"
+ "script": "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -1674.0);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Settings.Offset', -1674.0);openspace.time.setPause(true);openspace.time.setTime('2021 FEB 18 20:32:16');openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.HiRISE-LS-DEM.Enabled', true);openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.HiRISE-LS.Enabled', true);openspace.navigation.setNavigationState({Anchor = 'Perseverance',Pitch = 0.567457E-4,Position = { 1.240506E1,-1.369270E1,-2.423553E0 },ReferenceFrame = 'Root',Up = { 0.441211E0,0.247019E0,0.862737E0 },Yaw = -0.446853E-4});"
}
],
"mark_nodes": [
@@ -77,6 +77,6 @@
},
"version": {
"major": 1,
- "minor": 1
+ "minor": 2
}
}
\ No newline at end of file
diff --git a/ext/ghoul b/ext/ghoul
index e13db04716..c53587702c 160000
--- a/ext/ghoul
+++ b/ext/ghoul
@@ -1 +1 @@
-Subproject commit e13db04716a00f698d01064e9cda623488bc38cb
+Subproject commit c53587702ce1909137c86df3271ed9898511efda
diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl
index 6540ddf9f3..3f5696f17a 100644
--- a/include/openspace/properties/numericalproperty.inl
+++ b/include/openspace/properties/numericalproperty.inl
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
namespace openspace::properties {
@@ -88,6 +89,7 @@ float NumericalProperty::exponent() const {
template
void NumericalProperty::setExponent(float exponent) {
+ ghoul_assert(std::abs(exponent) > 0.f, "Exponent for property input cannot be zero");
_exponent = exponent;
}
diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h
index b900cf8335..52de1629f9 100644
--- a/include/openspace/properties/property.h
+++ b/include/openspace/properties/property.h
@@ -381,12 +381,13 @@ public:
/**
* Default view options that can be used in the Property::setViewOption method. The
- * values are: Property::ViewOptions::Color = \c Color,
- * Property::ViewOptions::Logarithmic = \c Logarithmic
+ * values are:
+ * - Property::ViewOptions::Color = \c Color (Intended for Vec3 and Vec4),
+ * - Property::ViewOptions::MinMaxRange = \c MinMaxRange (Intended for Vec2)
*/
struct ViewOptions {
static const char* Color;
- static const char* Logarithmic;
+ static const char* MinMaxRange;
};
/**
diff --git a/include/openspace/rendering/framebufferrenderer.h b/include/openspace/rendering/framebufferrenderer.h
index ce4c00fb86..d76c2c5d88 100644
--- a/include/openspace/rendering/framebufferrenderer.h
+++ b/include/openspace/rendering/framebufferrenderer.h
@@ -83,8 +83,10 @@ public:
void setDisableHDR(bool disable) override;
void update() override;
- void performRaycasterTasks(const std::vector& tasks);
- void performDeferredTasks(const std::vector& tasks);
+ void performRaycasterTasks(const std::vector& tasks,
+ const glm::ivec4& viewport);
+ void performDeferredTasks(const std::vector& tasks,
+ const glm::ivec4& viewport);
void render(Scene* scene, Camera* camera, float blackoutFactor) override;
/**
@@ -109,11 +111,11 @@ private:
>;
void resolveMSAA(float blackoutFactor);
- void applyTMO(float blackoutFactor);
- void applyFXAA();
+ void applyTMO(float blackoutFactor, const glm::ivec4& viewport);
+ void applyFXAA(const glm::ivec4& viewport);
void updateDownscaleTextures();
void updateExitVolumeTextures();
- void writeDownscaledVolume();
+ void writeDownscaledVolume(const glm::ivec4& viewport);
std::map _raycastData;
RaycasterProgObjMap _exitPrograms;
@@ -129,10 +131,11 @@ private:
std::unique_ptr _downscaledVolumeProgram;
UniformCache(hdrFeedingTexture, blackoutFactor, hdrExposure, gamma,
- Hue, Saturation, Value) _hdrUniformCache;
- UniformCache(renderedTexture, inverseScreenSize) _fxaaUniformCache;
- UniformCache(downscaledRenderedVolume, downscaledRenderedVolumeDepth)
- _writeDownscaledVolumeUniformCache;
+ Hue, Saturation, Value, Viewport, Resolution) _hdrUniformCache;
+ UniformCache(renderedTexture, inverseScreenSize, Viewport,
+ Resolution) _fxaaUniformCache;
+ UniformCache(downscaledRenderedVolume, downscaledRenderedVolumeDepth, viewport,
+ resolution) _writeDownscaledVolumeUniformCache;
GLint _defaultFBO;
GLuint _screenQuad;
diff --git a/include/openspace/scene/profile.h b/include/openspace/scene/profile.h
index e1565b1dc7..28a3a360eb 100644
--- a/include/openspace/scene/profile.h
+++ b/include/openspace/scene/profile.h
@@ -92,7 +92,7 @@ public:
Relative
};
- Type type = Type::Absolute;
+ Type type;
std::string value;
};
struct CameraNavState {
diff --git a/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl b/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl
index 22e861c107..9be329d940 100644
--- a/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl
+++ b/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl
@@ -76,6 +76,9 @@ uniform dmat4 dModelTransformMatrix;
uniform dmat4 dSGCTViewToWorldMatrix;
uniform dmat4 dSgctProjectionToModelTransformMatrix;
+uniform vec4 viewport;
+uniform vec2 resolution;
+
uniform dvec4 dCamPosObj;
uniform dvec3 sunDirectionObj;
@@ -207,8 +210,8 @@ bool atmosphereIntersection(Ray ray, double atmRadius, out double offset,
* NDC from the interpolated positions from the screen quad. This method avoids matrices
* multiplications wherever is possible.
*/
-Ray calculateRayRenderableGlobe() {
- vec2 interpolatedNDCPos = (texCoord - 0.5) * 2.0;
+Ray calculateRayRenderableGlobe(vec2 st) {
+ vec2 interpolatedNDCPos = (st - 0.5) * 2.0;
dvec4 clipCoords = dvec4(interpolatedNDCPos, 1.0, 1.0);
// Clip to Object Coords
@@ -467,8 +470,19 @@ vec3 sunColor(vec3 v, vec3 s, float r, float mu, float irradianceFactor) {
}
void main() {
+ // Modify the texCoord based on the Viewport and Resolution. This modification is
+ // necessary in case of side-by-side stereo as we only want to access the part of the
+ // feeding texture that we are currently responsible for. Otherwise we would map the
+ // entire feeding texture into our half of the result texture, leading to a doubling
+ // of the "missing" half. If you don't believe me, load a configuration file with the
+ // side_by_side stereo mode enabled, disable FXAA, and remove this modification.
+ // The same calculation is done in the FXAA shader and the HDR resolving
+ vec2 st = texCoord;
+ st.x = st.x / (resolution.x / viewport[2]) + (viewport[0] / resolution.x);
+ st.y = st.y / (resolution.y / viewport[3]) + (viewport[1] / resolution.y);
+
if (cullAtmosphere == 1) {
- renderTarget = texture(mainColorTexture, texCoord);
+ renderTarget = texture(mainColorTexture, st);
return;
}
@@ -476,10 +490,10 @@ void main() {
int nSamples = 1;
// Color from G-Buffer
- vec4 color = texture(mainColorTexture, texCoord);
+ vec4 color = texture(mainColorTexture, st);
// Get the ray from camera to atm in object space
- Ray ray = calculateRayRenderableGlobe();
+ Ray ray = calculateRayRenderableGlobe(texCoord);
double offset = 0.0; // in KM
double maxLength = 0.0; // in KM
@@ -499,7 +513,7 @@ void main() {
// Get data from G-Buffer
// Normal is stored in SGCT View Space and transformed to the current object space
- vec4 normalViewSpaceAndWaterReflectance = texture(mainNormalTexture, texCoord);
+ vec4 normalViewSpaceAndWaterReflectance = texture(mainNormalTexture, st);
dvec4 normalViewSpace = vec4(normalViewSpaceAndWaterReflectance.xyz, 0.0);
dvec4 normalWorldSpace = dSGCTViewToWorldMatrix * normalViewSpace;
vec4 normal = vec4(dInverseModelTransformMatrix * normalWorldSpace);
@@ -507,7 +521,7 @@ void main() {
normal.w = normalViewSpaceAndWaterReflectance.w;
// Data in the mainPositionTexture are written in view space (view plus camera rig)
- vec4 position = texture(mainPositionTexture, texCoord);
+ vec4 position = texture(mainPositionTexture, st);
// OS Eye to World coords
dvec4 positionWorldCoords = dSGCTViewToWorldMatrix * position;
diff --git a/modules/base/rendering/grids/renderablegrid.cpp b/modules/base/rendering/grids/renderablegrid.cpp
index 6162afc5a6..a3065666cf 100644
--- a/modules/base/rendering/grids/renderablegrid.cpp
+++ b/modules/base/rendering/grids/renderablegrid.cpp
@@ -90,7 +90,7 @@ RenderableGrid::RenderableGrid(const ghoul::Dictionary& dictionary)
, _color(ColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f))
, _segments(SegmentsInfo, glm::uvec2(10), glm::uvec2(1), glm::uvec2(200))
, _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f)
- , _size(SizeInfo, glm::vec2(1e10f), glm::vec2(1.f), glm::vec2(1e20f))
+ , _size(SizeInfo, glm::vec2(1.f), glm::vec2(1.f), glm::vec2(1e11f))
{
const Parameters p = codegen::bake(dictionary);
@@ -108,7 +108,7 @@ RenderableGrid::RenderableGrid(const ghoul::Dictionary& dictionary)
_lineWidth = p.lineWidth.value_or(_lineWidth);
addProperty(_lineWidth);
- _size.setViewOption(properties::Property::ViewOptions::Logarithmic);
+ _size.setExponent(10.f);
_size = p.size.value_or(_size);
_size.onChange([&]() { _gridIsDirty = true; });
addProperty(_size);
diff --git a/modules/base/rendering/grids/renderableradialgrid.cpp b/modules/base/rendering/grids/renderableradialgrid.cpp
index d5d4dac54d..eda326d974 100644
--- a/modules/base/rendering/grids/renderableradialgrid.cpp
+++ b/modules/base/rendering/grids/renderableradialgrid.cpp
@@ -65,17 +65,12 @@ namespace {
"This value specifies the line width of the spherical grid."
};
- constexpr openspace::properties::Property::PropertyInfo OuterRadiusInfo = {
- "OuterRadius",
- "Outer Radius",
- "The outer radius of the circular grid, i.e. its size."
- };
-
- constexpr openspace::properties::Property::PropertyInfo InnerRadiusInfo = {
- "InnerRadius",
- "Inner Radius",
- "The inner radius of the circular grid, that is the radius of the inmost ring. "
- "Must be smaller than the outer radius."
+ constexpr openspace::properties::Property::PropertyInfo RadiiInfo = {
+ "Radii",
+ "Inner and Outer Radius",
+ "The radii values that determine the size of the circular grid. The first value "
+ "is the radius of the inmost ring and the second is the radius of the outmost "
+ "ring."
};
struct [[codegen::Dictionary(RenderableRadialGrid)]] Parameters {
@@ -91,11 +86,8 @@ namespace {
// [[codegen::verbatim(LineWidthInfo.description)]]
std::optional lineWidth;
- // [[codegen::verbatim(OuterRadiusInfo.description)]]
- std::optional outerRadius;
-
- // [[codegen::verbatim(InnerRadiusInfo.description)]]
- std::optional innerRadius;
+ // [[codegen::verbatim(RadiiInfo.description)]]
+ std::optional radii;
};
#include "renderableradialgrid_codegen.cpp"
} // namespace
@@ -112,8 +104,7 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
, _gridSegments(GridSegmentsInfo, glm::ivec2(1), glm::ivec2(1), glm::ivec2(200))
, _circleSegments(CircleSegmentsInfo, 36, 4, 200)
, _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f)
- , _maxRadius(OuterRadiusInfo, 1.f, 0.f, 20.f)
- , _minRadius(InnerRadiusInfo, 0.f, 0.f, 20.f)
+ , _radii(RadiiInfo, glm::vec2(0.f, 1.f), glm::vec2(0.f), glm::vec2(20.f))
{
const Parameters p = codegen::bake(dictionary);
@@ -140,24 +131,11 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
_lineWidth = p.lineWidth.value_or(_lineWidth);
addProperty(_lineWidth);
- _minRadius = p.innerRadius.value_or(_minRadius);
- _maxRadius = p.outerRadius.value_or(_maxRadius);
+ _radii = p.radii.value_or(_radii);
+ _radii.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ _radii.onChange([&]() { _gridIsDirty = true; });
- _maxRadius.setMinValue(_minRadius);
- _minRadius.setMaxValue(_maxRadius);
-
- _maxRadius.onChange([&]() {
- _gridIsDirty = true;
- _minRadius.setMaxValue(_maxRadius);
- });
-
- _minRadius.onChange([&]() {
- _gridIsDirty = true;
- _maxRadius.setMinValue(_minRadius);
- });
-
- addProperty(_maxRadius);
- addProperty(_minRadius);
+ addProperty(_radii);
}
bool RenderableRadialGrid::isReady() const {
@@ -236,12 +214,15 @@ void RenderableRadialGrid::update(const UpdateData&) {
return;
}
+ const float innerRadius = _radii.value().x;
+ const float outerRadius = _radii.value().y;
+
// Circles
const int nRadialSegments = _gridSegments.value()[0];
const float fnCircles = static_cast(nRadialSegments);
- const float deltaRadius = (_maxRadius - _minRadius) / fnCircles;
+ const float deltaRadius = (outerRadius - innerRadius) / fnCircles;
- const bool hasInnerRadius = _minRadius > 0;
+ const bool hasInnerRadius = innerRadius > 0.f;
const int nCircles = hasInnerRadius ? nRadialSegments : nRadialSegments + 1;
_circles.clear();
@@ -258,11 +239,11 @@ void RenderableRadialGrid::update(const UpdateData&) {
// add an extra inmost circle
if (hasInnerRadius) {
- addRing(_circleSegments, _minRadius);
+ addRing(_circleSegments, innerRadius);
}
for (int i = 0; i < nRadialSegments; ++i) {
- const float ri = static_cast(i + 1) * deltaRadius + _minRadius;
+ const float ri = static_cast(i + 1) * deltaRadius + innerRadius;
addRing(_circleSegments, ri);
}
@@ -275,10 +256,10 @@ void RenderableRadialGrid::update(const UpdateData&) {
if (nLines > 1) {
std::vector outerVertices =
- rendering::helper::createRing(nLines, _maxRadius);
+ rendering::helper::createRing(nLines, outerRadius);
std::vector innerVertices =
- rendering::helper::createRing(nLines, _minRadius);
+ rendering::helper::createRing(nLines, innerRadius);
for (int i = 0; i < nLines; ++i) {
const rendering::helper::VertexXYZ vOut =
diff --git a/modules/base/rendering/grids/renderableradialgrid.h b/modules/base/rendering/grids/renderableradialgrid.h
index f719808f3d..0c5b1270e3 100644
--- a/modules/base/rendering/grids/renderableradialgrid.h
+++ b/modules/base/rendering/grids/renderableradialgrid.h
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -78,8 +79,7 @@ protected:
properties::IVec2Property _gridSegments;
properties::IntProperty _circleSegments;
properties::FloatProperty _lineWidth;
- properties::FloatProperty _maxRadius;
- properties::FloatProperty _minRadius;
+ properties::Vec2Property _radii;
bool _gridIsDirty = true;
diff --git a/modules/base/rendering/renderabledisc.cpp b/modules/base/rendering/renderabledisc.cpp
index 37d1e4b116..52a733131c 100644
--- a/modules/base/rendering/renderabledisc.cpp
+++ b/modules/base/rendering/renderabledisc.cpp
@@ -97,7 +97,7 @@ RenderableDisc::RenderableDisc(const ghoul::Dictionary& dictionary)
_texturePath.onChange([&]() { _texture->loadFromFile(_texturePath.value()); });
addProperty(_texturePath);
- _size.setViewOption(properties::Property::ViewOptions::Logarithmic);
+ _size.setExponent(13.f);
_size = p.size.value_or(_size);
setBoundingSphere(_size);
_size.onChange([&]() { _planeIsDirty = true; });
diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp
index 8c4b483efc..5125e2bed7 100644
--- a/modules/base/rendering/renderablelabels.cpp
+++ b/modules/base/rendering/renderablelabels.cpp
@@ -75,105 +75,78 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo BlendModeInfo = {
"BlendMode",
"Blending Mode",
- "This determines the blending mode that is applied to this plane."
+ "This determines the blending mode that is applied to the renderable."
};
- constexpr openspace::properties::Property::PropertyInfo LabelColorInfo = {
- "LabelColor",
- "Label Color",
- "The label color for the astronomical object."
+ constexpr openspace::properties::Property::PropertyInfo ColorInfo = {
+ "Color",
+ "Color",
+ "The label text color."
};
constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = {
"FontSize",
"Font Size",
- "The font size for the astronomical object labels."
+ "The font size (in points) for the label."
};
- constexpr openspace::properties::Property::PropertyInfo LabelSizeInfo = {
- "LabelSize",
- "Label Size",
- "The label size for the astronomical object labels."
+ constexpr openspace::properties::Property::PropertyInfo SizeInfo = {
+ "Size",
+ "Size",
+ "This value affects the size scale of the label."
};
- constexpr openspace::properties::Property::PropertyInfo LabelTextInfo = {
- "LabelText",
- "Label Text",
+ constexpr openspace::properties::Property::PropertyInfo TextInfo = {
+ "Text",
+ "Text",
"The text that will be displayed on screen."
};
- constexpr openspace::properties::Property::PropertyInfo LabelMinSizeInfo = {
- "LabelMinSize",
- "Label Min Size",
- "The minimal size (in pixels) of the labels for the astronomical "
- "objects being rendered."
- };
-
- constexpr openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
- "LabelMaxSize",
- "Label Max Size",
- "The maximum size (in pixels) of the labels for the astronomical "
- "objects being rendered."
+ constexpr openspace::properties::Property::PropertyInfo MinMaxSizeInfo = {
+ "MinMaxSize",
+ "Min and Max Size",
+ "The minimum and maximum size (in pixels) of the label."
};
constexpr openspace::properties::Property::PropertyInfo TransformationMatrixInfo = {
"TransformationMatrix",
"Transformation Matrix",
- "Transformation matrix to be applied to each astronomical object."
+ "Transformation matrix to be applied to the label."
};
- constexpr openspace::properties::Property::PropertyInfo LabelOrientationOptionInfo = {
- "LabelOrientationOption",
- "Label Orientation Option",
+ constexpr openspace::properties::Property::PropertyInfo OrientationOptionInfo = {
+ "OrientationOption",
+ "Orientation Option",
"Label orientation rendering mode."
};
constexpr openspace::properties::Property::PropertyInfo EnableFadingEffectInfo = {
"EnableFading",
- "Enable/Disable Fade-in effect",
+ "Enable/Disable Fade-in Effect",
"Enable/Disable the Fade-in effect."
};
- constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = {
- "EnablePixelSizeControl",
- "Enable pixel size control.",
- "Enable pixel size control for rectangular projections."
+ constexpr openspace::properties::Property::PropertyInfo FadeWidthsInfo = {
+ "FadeWidths",
+ "Fade Widths",
+ "The distances over which the fading takes place, given in the specified unit. "
+ "The first value is the distance before the closest distance and the second "
+ "the one after the furthest distance. For example, with the unit Parsec (pc), "
+ "a value of {1, 2} will make the label being fully faded out 1 Parsec before "
+ "the closest distance and 2 Parsec away from the furthest distance."
};
- constexpr openspace::properties::Property::PropertyInfo FadeStartUnitOptionInfo = {
- "FadeStartUnit",
- "Fade-In/-Out Start Unit.",
- "Unit for fade-in/-out starting position calculation."
+ constexpr openspace::properties::Property::PropertyInfo FadeDistancesInfo = {
+ "FadeDistances",
+ "Fade Distances",
+ "The distance range in which the labels should be fully opaque, specified in "
+ "the chosen unit. The distance from the position of the label to the camera."
};
- constexpr openspace::properties::Property::PropertyInfo FadeEndUnitOptionInfo = {
- "FadeEndUnit",
- "Fade-In/-Out End Unit.",
- "Unit for fade-in/-out ending position calculation."
- };
-
- constexpr openspace::properties::Property::PropertyInfo FadeStartDistInfo = {
- "FadeStartDistance",
- "Fade-In/-Out starting distance.",
- "Fade-In/-Out starting distance."
- };
-
- constexpr openspace::properties::Property::PropertyInfo FadeEndDistInfo = {
- "FadeEndDistance",
- "Fade-In/-Out ending distance.",
- "Fade-In/-Out ending distance."
- };
-
- constexpr openspace::properties::Property::PropertyInfo FadeStartSpeedInfo = {
- "FadeStartSpeed",
- "Fade-In/-Out starting speed.",
- "Fade-In/-Out starting speed."
- };
-
- constexpr openspace::properties::Property::PropertyInfo FadeEndSpeedInfo = {
- "FadeEndSpeed",
- "Fade-In/-Out ending speed.",
- "Fade-In/-Out ending speed."
+ constexpr openspace::properties::Property::PropertyInfo FadeUnitOptionInfo = {
+ "FadeUnit",
+ "Fade Distance Unit",
+ "Distance unit for fade-in/-out distance calculations. Defaults to \"au\"."
};
struct [[codegen::Dictionary(RenderableLabels)]] Parameters {
@@ -190,33 +163,27 @@ namespace {
PositionNormal [[codegen::key("Camera Position Normal")]]
};
- // [[codegen::verbatim(LabelOrientationOptionInfo.description)]]
- std::optional labelOrientationOption;
+ // [[codegen::verbatim(OrientationOptionInfo.description)]]
+ std::optional orientationOption;
- // [[codegen::verbatim(LabelColorInfo.description)]]
- std::optional labelColor [[codegen::color()]];
+ // [[codegen::verbatim(ColorInfo.description)]]
+ std::optional color [[codegen::color()]];
- // [[codegen::verbatim(LabelTextInfo.description)]]
- std::optional labelText;
+ // [[codegen::verbatim(TextInfo.description)]]
+ std::optional text;
// [[codegen::verbatim(FontSizeInfo.description)]]
std::optional fontSize;
- // [[codegen::verbatim(LabelSizeInfo.description)]]
- std::optional labelSize;
+ // [[codegen::verbatim(SizeInfo.description)]]
+ std::optional size;
- // [[codegen::verbatim(LabelMinSizeInfo.description)]]
- std::optional labelMinSize;
-
- // [[codegen::verbatim(LabelMaxSizeInfo.description)]]
- std::optional labelMaxSize;
+ // [[codegen::verbatim(MinMaxSizeInfo.description)]]
+ std::optional minMaxSize;
// [[codegen::verbatim(EnableFadingEffectInfo.description)]]
std::optional enableFading;
- // [[codegen::verbatim(PixelSizeControlInfo.description)]]
- std::optional enablePixelControl;
-
// [[codegen::verbatim(TransformationMatrixInfo.description)]]
std::optional transformationMatrix;
@@ -230,28 +197,19 @@ namespace {
AstronomicalUnit [[codegen::key("au")]],
Parsec [[codegen::key("pc")]],
KiloParsec [[codegen::key("Kpc")]],
- MegaParsec [[codgen::key("Mpc")]],
+ MegaParsec [[codegen::key("Mpc")]],
GigaParsec [[codegen::key("Gpc")]],
GigaLightyear [[codegen::key("Gly")]]
};
- // [[codegen::verbatim(FadeStartUnitOptionInfo.description)]]
- std::optional fadeStartUnit;
+ // [[codegen::verbatim(FadeUnitOptionInfo.description)]]
+ std::optional fadeUnit;
- // [[codegen::verbatim(FadeEndUnitOptionInfo.description)]]
- std::optional fadeEndUnit;
+ // [[codegen::verbatim(FadeDistancesInfo.description)]]
+ std::optional fadeDistances;
- // [[codegen::verbatim(FadeStartDistInfo.description)]]
- std::optional fadeStartDistance;
-
- // [[codegen::verbatim(FadeEndDistInfo.description)]]
- std::optional fadeEndDistance;
-
- // [[codegen::verbatim(FadeStartSpeedInfo.description)]]
- std::optional fadeStartSpeed;
-
- // [[codegen::verbatim(FadeEndSpeedInfo.description)]]
- std::optional fadeEndSpeed;
+ // [[codegen::verbatim(FadeWidthsInfo.description)]]
+ std::optional fadeWidths;
};
#include "renderablelabels_codegen.cpp"
} // namespace
@@ -265,33 +223,20 @@ documentation::Documentation RenderableLabels::Documentation() {
RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
- , _labelColor(
- LabelColorInfo,
- glm::vec3(1.f, 1.f, 1.f),
- glm::vec3(0.f),
- glm::vec3(1.f)
- )
- , _labelSize(LabelSizeInfo, 8.f, 0.5f, 30.f)
+ , _color(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
+ , _size(SizeInfo, 8.f, 0.5f, 30.f)
, _fontSize(FontSizeInfo, 50.f, 1.f, 100.f)
- , _labelMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
- , _labelMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f)
- , _pixelSizeControl(PixelSizeControlInfo, false)
+ , _minMaxSize(MinMaxSizeInfo, glm::ivec2(8, 20), glm::ivec2(0), glm::ivec2(100))
, _enableFadingEffect(EnableFadingEffectInfo, false)
- , _labelText(LabelTextInfo, "")
- , _fadeStartDistance(FadeStartDistInfo, 1.f, 0.f, 100.f)
- , _fadeEndDistance(FadeEndDistInfo, 1.f, 0.f, 100.f)
- , _fadeStartSpeed(FadeStartSpeedInfo, 1.f, 1.f, 100.f)
- , _fadeEndSpeed(FadeEndSpeedInfo, 1.f, 1.f, 100.f)
- , _labelOrientationOption(
- LabelOrientationOptionInfo,
+ , _text(TextInfo, "")
+ , _fadeDistances(FadeDistancesInfo, glm::vec2(1.f), glm::vec2(0.f), glm::vec2(100.f))
+ , _fadeWidths(FadeWidthsInfo, glm::vec2(1.f), glm::vec2(0.f), glm::vec2(100.f))
+ , _orientationOption(
+ OrientationOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
- , _fadeStartUnitOption(
- FadeStartUnitOptionInfo,
- properties::OptionProperty::DisplayType::Dropdown
- )
- , _fadeEndUnitOption(
- FadeEndUnitOptionInfo,
+ , _fadeUnitOption(
+ FadeUnitOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
{
@@ -330,28 +275,28 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
addProperty(_blendMode);
- _labelOrientationOption.addOption(ViewDirection, "Camera View Direction");
- _labelOrientationOption.addOption(NormalDirection, "Camera Position Normal");
+ _orientationOption.addOption(ViewDirection, "Camera View Direction");
+ _orientationOption.addOption(NormalDirection, "Camera Position Normal");
- _labelOrientationOption = NormalDirection;
- if (p.labelOrientationOption.has_value()) {
- switch (*p.labelOrientationOption) {
+ _orientationOption = NormalDirection;
+ if (p.orientationOption.has_value()) {
+ switch (*p.orientationOption) {
case Parameters::Orientation::ViewDirection:
- _labelOrientationOption = ViewDirection;
+ _orientationOption = ViewDirection;
break;
case Parameters::Orientation::PositionNormal:
- _labelOrientationOption = NormalDirection;
+ _orientationOption = NormalDirection;
break;
}
}
- addProperty(_labelOrientationOption);
+ addProperty(_orientationOption);
- _labelText = p.labelText.value_or(_labelText);
- addProperty(_labelText);
+ _text = p.text.value_or(_text);
+ addProperty(_text);
- _labelColor = p.labelColor.value_or(_labelColor);
- _labelColor.setViewOption(properties::Property::ViewOptions::Color);
- addProperty(_labelColor);
+ _color = p.color.value_or(_color);
+ _color.setViewOption(properties::Property::ViewOptions::Color);
+ addProperty(_color);
_fontSize = p.fontSize.value_or(_fontSize);
_fontSize.onChange([&]() {
@@ -364,156 +309,86 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
});
addProperty(_fontSize);
- _labelSize = p.labelSize.value_or(_labelSize);
- addProperty(_labelSize);
+ // @TODO (emmbr, 2021-05-31): Temporarily set as read only, to avoid errors from font
+ // rendering/loading
+ _fontSize.setReadOnly(true);
- _labelMinSize = p.labelMinSize.value_or(_labelMinSize);
- addProperty(_labelMinSize);
+ _size = p.size.value_or(_size);
+ addProperty(_size);
- _labelMaxSize = p.labelMaxSize.value_or(_labelMaxSize);
- addProperty(_labelMaxSize);
+ _minMaxSize = p.minMaxSize.value_or(_minMaxSize);
+ _minMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_minMaxSize);
_transformationMatrix = p.transformationMatrix.value_or(_transformationMatrix);
- _pixelSizeControl = p.enablePixelControl.value_or(_pixelSizeControl);
- if (_pixelSizeControl) {
- // @TODO (abock, 2021-01-28) I don't know why we only add the property if the
- // pixel control is enabled, but I think this is an error
- addProperty(_pixelSizeControl);
- }
-
_enableFadingEffect = p.enableFading.value_or(_enableFadingEffect);
addProperty(_enableFadingEffect);
- _fadeStartDistance = p.fadeStartDistance.value_or(_fadeStartDistance);
- addProperty(_fadeStartDistance);
+ _fadeUnitOption.addOption(Meter, MeterUnit);
+ _fadeUnitOption.addOption(Kilometer, KilometerUnit);
+ _fadeUnitOption.addOption(Megameter, MegameterUnit);
+ _fadeUnitOption.addOption(Gigameter, GigameterUnit);
+ _fadeUnitOption.addOption(AU, AstronomicalUnit);
+ _fadeUnitOption.addOption(Terameter, TerameterUnit);
+ _fadeUnitOption.addOption(Petameter, PetameterUnit);
+ _fadeUnitOption.addOption(Parsec, ParsecUnit);
+ _fadeUnitOption.addOption(Kiloparsec, KiloparsecUnit);
+ _fadeUnitOption.addOption(Megaparsec, MegaparsecUnit);
+ _fadeUnitOption.addOption(Gigaparsec, GigaparsecUnit);
+ _fadeUnitOption.addOption(GigalightYears, GigalightyearUnit);
- _fadeStartUnitOption.addOption(Meter, MeterUnit);
- _fadeStartUnitOption.addOption(Kilometer, KilometerUnit);
- _fadeStartUnitOption.addOption(Megameter, MegameterUnit);
- _fadeStartUnitOption.addOption(Gigameter, GigameterUnit);
- _fadeStartUnitOption.addOption(AU, AstronomicalUnit);
- _fadeStartUnitOption.addOption(Terameter, TerameterUnit);
- _fadeStartUnitOption.addOption(Petameter, PetameterUnit);
- _fadeStartUnitOption.addOption(Parsec, ParsecUnit);
- _fadeStartUnitOption.addOption(Kiloparsec, KiloparsecUnit);
- _fadeStartUnitOption.addOption(Megaparsec, MegaparsecUnit);
- _fadeStartUnitOption.addOption(Gigaparsec, GigaparsecUnit);
- _fadeStartUnitOption.addOption(GigalightYears, GigalightyearUnit);
-
-
- if (p.fadeStartUnit.has_value()) {
- switch (*p.fadeStartUnit) {
+ if (p.fadeUnit.has_value()) {
+ switch (*p.fadeUnit) {
case Parameters::Unit::Meter:
- _fadeStartUnitOption = Meter;
+ _fadeUnitOption = Meter;
break;
case Parameters::Unit::Kilometer:
- _fadeStartUnitOption = Kilometer;
+ _fadeUnitOption = Kilometer;
break;
case Parameters::Unit::Megameter:
- _fadeStartUnitOption = Megameter;
+ _fadeUnitOption = Megameter;
break;
case Parameters::Unit::Gigameter:
- _fadeStartUnitOption = Gigameter;
+ _fadeUnitOption = Gigameter;
break;
case Parameters::Unit::Terameter:
- _fadeStartUnitOption = Terameter;
+ _fadeUnitOption = Terameter;
break;
case Parameters::Unit::Petameter:
- _fadeStartUnitOption = Petameter;
+ _fadeUnitOption = Petameter;
break;
case Parameters::Unit::AstronomicalUnit:
- _fadeStartUnitOption = AU;
+ _fadeUnitOption = AU;
break;
case Parameters::Unit::Parsec:
- _fadeStartUnitOption = Parsec;
+ _fadeUnitOption = Parsec;
break;
case Parameters::Unit::KiloParsec:
- _fadeStartUnitOption = Kiloparsec;
+ _fadeUnitOption = Kiloparsec;
break;
case Parameters::Unit::MegaParsec:
- _fadeStartUnitOption = Megaparsec;
+ _fadeUnitOption = Megaparsec;
break;
case Parameters::Unit::GigaParsec:
- _fadeStartUnitOption = Gigaparsec;
+ _fadeUnitOption = Gigaparsec;
break;
case Parameters::Unit::GigaLightyear:
- _fadeStartUnitOption = GigalightYears;
+ _fadeUnitOption = GigalightYears;
break;
}
}
else {
- _fadeStartUnitOption = AU;
+ _fadeUnitOption = AU;
}
- addProperty(_fadeStartUnitOption);
+ addProperty(_fadeUnitOption);
- _fadeStartSpeed = p.fadeStartSpeed.value_or(_fadeStartSpeed);
- addProperty(_fadeStartSpeed);
+ _fadeDistances = p.fadeDistances.value_or(_fadeDistances);
+ _fadeDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_fadeDistances);
- _fadeEndDistance = p.fadeEndDistance.value_or(_fadeEndDistance);
- addProperty(_fadeEndDistance);
-
- _fadeEndUnitOption.addOption(Meter, MeterUnit);
- _fadeEndUnitOption.addOption(Kilometer, KilometerUnit);
- _fadeEndUnitOption.addOption(Megameter, MegameterUnit);
- _fadeEndUnitOption.addOption(Gigameter, GigameterUnit);
- _fadeEndUnitOption.addOption(AU, AstronomicalUnit);
- _fadeEndUnitOption.addOption(Terameter, TerameterUnit);
- _fadeEndUnitOption.addOption(Petameter, PetameterUnit);
- _fadeEndUnitOption.addOption(Parsec, ParsecUnit);
- _fadeEndUnitOption.addOption(Kiloparsec, KiloparsecUnit);
- _fadeEndUnitOption.addOption(Megaparsec, MegaparsecUnit);
- _fadeEndUnitOption.addOption(Gigaparsec, GigaparsecUnit);
- _fadeEndUnitOption.addOption(GigalightYears, GigalightyearUnit);
-
-
- if (p.fadeEndUnit.has_value()) {
- switch (*p.fadeEndUnit) {
- case Parameters::Unit::Meter:
- _fadeStartUnitOption = Meter;
- break;
- case Parameters::Unit::Kilometer:
- _fadeStartUnitOption = Kilometer;
- break;
- case Parameters::Unit::Megameter:
- _fadeStartUnitOption = Megameter;
- break;
- case Parameters::Unit::Gigameter:
- _fadeStartUnitOption = Gigameter;
- break;
- case Parameters::Unit::Terameter:
- _fadeStartUnitOption = Terameter;
- break;
- case Parameters::Unit::Petameter:
- _fadeStartUnitOption = Petameter;
- break;
- case Parameters::Unit::AstronomicalUnit:
- _fadeStartUnitOption = AU;
- break;
- case Parameters::Unit::Parsec:
- _fadeStartUnitOption = Parsec;
- break;
- case Parameters::Unit::KiloParsec:
- _fadeEndUnitOption = Kiloparsec;
- break;
- case Parameters::Unit::MegaParsec:
- _fadeEndUnitOption = Megaparsec;
- break;
- case Parameters::Unit::GigaParsec:
- _fadeEndUnitOption = Gigaparsec;
- break;
- case Parameters::Unit::GigaLightyear:
- _fadeEndUnitOption = GigalightYears;
- break;
- }
- }
- else {
- _fadeEndUnitOption = AU;
- }
- addProperty(_fadeEndUnitOption);
-
- _fadeEndSpeed = p.fadeEndSpeed.value_or(_fadeEndSpeed);
- addProperty(_fadeEndSpeed);
+ _fadeWidths = p.fadeWidths.value_or(_fadeWidths);
+ addProperty(_fadeWidths);
}
bool RenderableLabels::isReady() const {
@@ -528,7 +403,6 @@ void RenderableLabels::initialize() {
void RenderableLabels::initializeGL() {
if (_font == nullptr) {
- //size_t _fontSize = 50;
_font = global::fontManager->font(
"Mono",
_fontSize,
@@ -554,17 +428,7 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
float distanceNodeToCamera = static_cast(
glm::distance(data.camera.positionVec3(), data.modelTransform.translation)
);
- float sUnit = unit(_fadeStartUnitOption);
- float eUnit = unit(_fadeEndUnitOption);
- float startX = _fadeStartDistance * sUnit;
- float endX = _fadeEndDistance * eUnit;
- fadeInVariable = linearSmoothStepFunc(
- distanceNodeToCamera,
- startX,
- endX,
- sUnit,
- eUnit
- );
+ fadeInVariable = computeFadeFactor(distanceNodeToCamera);
}
glm::dmat4 modelMatrix(1.0);
@@ -598,7 +462,7 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
void RenderableLabels::setLabelText(const std::string & newText) {
- _labelText = newText;
+ _text = newText;
}
void RenderableLabels::renderLabels(const RenderData& data,
@@ -606,23 +470,23 @@ void RenderableLabels::renderLabels(const RenderData& data,
const glm::dvec3& orthoRight,
const glm::dvec3& orthoUp, float fadeInVariable)
{
- glm::vec4 textColor = glm::vec4(glm::vec3(_labelColor), 1.f);
+ glm::vec4 textColor = glm::vec4(glm::vec3(_color), 1.f);
textColor.a *= fadeInVariable;
textColor.a *= _opacity;
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
- labelInfo.orthoRight = orthoRight;
- labelInfo.orthoUp = orthoUp;
- labelInfo.minSize = static_cast(_labelMinSize);
- labelInfo.maxSize = static_cast(_labelMaxSize);
- labelInfo.cameraPos = data.camera.positionVec3();
- labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
- labelInfo.renderType = _labelOrientationOption;
- labelInfo.mvpMatrix = modelViewProjectionMatrix;
- labelInfo.scale = powf(10.f, _labelSize);
- labelInfo.enableDepth = true;
+ labelInfo.orthoRight = orthoRight;
+ labelInfo.orthoUp = orthoUp;
+ labelInfo.minSize = _minMaxSize.value().x;
+ labelInfo.maxSize = _minMaxSize.value().y;
+ labelInfo.cameraPos = data.camera.positionVec3();
+ labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
+ labelInfo.renderType = _orientationOption;
+ labelInfo.mvpMatrix = modelViewProjectionMatrix;
+ labelInfo.scale = powf(10.f, _size);
+ labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
// We don't use spice rotation and scale
@@ -633,52 +497,34 @@ void RenderableLabels::renderLabels(const RenderData& data,
ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render(
*_font,
transformedPos,
- _labelText.value(),
+ _text.value(),
textColor,
labelInfo
);
}
-float RenderableLabels::changedPerlinSmoothStepFunc(float x, float startX,
- float endX) const
-{
- float f1 = 6.f * powf((x - startX), 5.f) - 15.f * powf((x - startX), 4.f) +
- 10.f * powf((x - startX), 3.f);
- float f2 = -6.f * powf((x - endX), 5.f) + 15.f * powf((x - endX), 4.f) -
- 10.f * powf((x - endX), 3.f) + 1.f;
- float f3 = 1.f;
+float RenderableLabels::computeFadeFactor(float distanceNodeToCamera) const {
+ float distanceUnit = unit(_fadeUnitOption);
+
+ float x = distanceNodeToCamera;
+ float startX = _fadeDistances.value().x * distanceUnit;
+ float endX = _fadeDistances.value().y * distanceUnit;
+
+ // The distances over which the fading should happen
+ float fadingStartDistance = _fadeWidths.value().x * distanceUnit;
+ float fadingEndDistance = _fadeWidths.value().y * distanceUnit;
if (x <= startX) {
+ float f1 = 1.f - (startX - x) / fadingStartDistance;
return std::clamp(f1, 0.f, 1.f);
}
else if (x > startX && x < endX) {
- return f3;
+ return 1.f; // not faded
}
- else if (x >= endX) {
+ else { // x >= endX
+ float f2 = 1.f - (x - endX) / fadingEndDistance;
return std::clamp(f2, 0.f, 1.f);
}
- return x;
-}
-
-float RenderableLabels::linearSmoothStepFunc(float x, float startX, float endX,
- float sUnit, float eUnit) const
-{
- float sdiv = 1.f / (sUnit * _fadeStartSpeed);
- float ediv = -1.f / (eUnit * _fadeEndSpeed);
- float f1 = sdiv * (x - startX) + 1.f;
- float f2 = ediv * (x - endX) + 1.f;
- float f3 = 1.f;
-
- if (x <= startX) {
- return std::clamp(f1, 0.f, 1.f);
- }
- else if (x > startX && x < endX) {
- return f3;
- }
- else if (x >= endX) {
- return std::clamp(f2, 0.f, 1.f);
- }
- return x;
}
float RenderableLabels::unit(int unit) const {
diff --git a/modules/base/rendering/renderablelabels.h b/modules/base/rendering/renderablelabels.h
index cdc29dad88..d1cff72716 100644
--- a/modules/base/rendering/renderablelabels.h
+++ b/modules/base/rendering/renderablelabels.h
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
#include
#include
@@ -77,7 +78,7 @@ protected:
std::string toString(int unit) const;
// Data may require some type of transformation prior the spice transformation being
- // applied.
+ // applied
glm::dmat4 _transformationMatrix = glm::dmat4(1.0);
enum Unit {
@@ -99,27 +100,21 @@ private:
void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix,
const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable);
- float changedPerlinSmoothStepFunc(float x, float startX, float endX) const;
+ float computeFadeFactor(float distanceNodeToCamera) const;
- float linearSmoothStepFunc(float x, float startX, float endX, float sUnit,
- float eUnit) const;
-
- properties::Vec3Property _labelColor;
- properties::FloatProperty _labelSize;
+ properties::Vec3Property _color;
properties::FloatProperty _fontSize;
- properties::FloatProperty _labelMinSize;
- properties::FloatProperty _labelMaxSize;
- properties::BoolProperty _pixelSizeControl;
- properties::BoolProperty _enableFadingEffect;
- properties::StringProperty _labelText;
- properties::FloatProperty _fadeStartDistance;
- properties::FloatProperty _fadeEndDistance;
- properties::FloatProperty _fadeStartSpeed;
- properties::FloatProperty _fadeEndSpeed;
+ properties::FloatProperty _size;
+ properties::IVec2Property _minMaxSize;
- properties::OptionProperty _labelOrientationOption;
- properties::OptionProperty _fadeStartUnitOption;
- properties::OptionProperty _fadeEndUnitOption;
+ properties::StringProperty _text;
+
+ properties::BoolProperty _enableFadingEffect;
+ properties::Vec2Property _fadeWidths;
+ properties::Vec2Property _fadeDistances;
+ properties::OptionProperty _fadeUnitOption;
+
+ properties::OptionProperty _orientationOption;
std::shared_ptr _font;
diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp
index 568092ac23..86401eb031 100644
--- a/modules/base/rendering/renderableplane.cpp
+++ b/modules/base/rendering/renderableplane.cpp
@@ -155,7 +155,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
addProperty(_billboard);
- _size.setViewOption(properties::Property::ViewOptions::Logarithmic);
+ _size.setExponent(15.f);
addProperty(_size);
_size.onChange([this](){ _planeIsDirty = true; });
diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp
index 0aebf68d93..e6b32389be 100644
--- a/modules/base/rendering/renderablesphere.cpp
+++ b/modules/base/rendering/renderablesphere.cpp
@@ -169,7 +169,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _texturePath(TextureInfo)
, _orientation(OrientationInfo, properties::OptionProperty::DisplayType::Dropdown)
- , _size(SizeInfo, 1.f, 0.f, 1e35f)
+ , _size(SizeInfo, 1.f, 0.f, 1e25f)
, _segments(SegmentsInfo, 8, 4, 1000)
, _mirrorTexture(MirrorTextureInfo, false)
, _useAdditiveBlending(UseAdditiveBlendingInfo, false)
@@ -213,7 +213,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
}
addProperty(_orientation);
- _size.setViewOption(properties::Property::ViewOptions::Logarithmic);
+ _size.setExponent(15.f);
_size.onChange([this]() {
setBoundingSphere(_size);
_sphereIsDirty = true;
diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp
index 44d04d553e..63e7d99764 100644
--- a/modules/base/rendering/renderabletrail.cpp
+++ b/modules/base/rendering/renderabletrail.cpp
@@ -33,6 +33,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -51,7 +52,7 @@ namespace {
constexpr const std::array UniformNames = {
"opacity", "modelViewTransform", "projectionTransform", "color", "useLineFade",
"lineFade", "vertexSortingMethod", "idOffset", "nVertices", "stride", "pointSize",
- "renderPhase", "resolution", "lineWidth"
+ "renderPhase", "viewport", "lineWidth"
};
#endif
@@ -338,12 +339,20 @@ void RenderableTrail::internalRender(bool renderLines, bool renderPoints,
#if !defined(__APPLE__)
glm::ivec2 resolution = global::renderEngine->renderingResolution();
- _programObject->setUniform(_uniformCache.resolution, resolution);
+ GLint viewport[4];
+ global::renderEngine->openglStateCache().viewport(viewport);
+ _programObject->setUniform(
+ _uniformCache.viewport,
+ static_cast(viewport[0]),
+ static_cast(viewport[1]),
+ static_cast(viewport[2]),
+ static_cast(viewport[3])
+ );
_programObject->setUniform(
_uniformCache.lineWidth,
std::ceil((2.f * 1.f + _appearance.lineWidth) * std::sqrt(2.f))
);
-#endif
+#endif // !defined(__APPLE__)
if (renderPoints) {
// The stride parameter determines the distance between larger points and
diff --git a/modules/base/rendering/renderabletrail.h b/modules/base/rendering/renderabletrail.h
index a65fc7fa18..6d9a6450c4 100644
--- a/modules/base/rendering/renderabletrail.h
+++ b/modules/base/rendering/renderabletrail.h
@@ -178,8 +178,8 @@ private:
pointSize, renderPhase) _uniformCache;
#else
UniformCache(opacity, modelView, projection, color, useLineFade, lineFade,
- vertexSorting, idOffset, nVertices, stride, pointSize, renderPhase,
- resolution, lineWidth) _uniformCache;
+ vertexSorting, idOffset, nVertices, stride, pointSize, renderPhase, viewport,
+ lineWidth) _uniformCache;
#endif
};
diff --git a/modules/base/shaders/renderabletrail_fs.glsl b/modules/base/shaders/renderabletrail_fs.glsl
index 27e1402b06..c5c370c108 100644
--- a/modules/base/shaders/renderabletrail_fs.glsl
+++ b/modules/base/shaders/renderabletrail_fs.glsl
@@ -34,12 +34,13 @@ uniform int renderPhase;
uniform float opacity = 1.0;
uniform float lineWidth;
+uniform vec4 viewport;
+
// Fragile! Keep in sync with RenderableTrail::render::RenderPhase
-#define RenderPhaseLines 0
-#define RenderPhasePoints 1
-
-#define Delta 0.25
+const int RenderPhaseLines = 0;
+const int RenderPhasePoints = 1;
+const float Delta = 0.25;
Fragment getFragment() {
Fragment frag;
@@ -61,18 +62,21 @@ Fragment getFragment() {
frag.color.a = transparencyCorrection;
}
- double distanceCenter = length(mathLine - vec2(gl_FragCoord.xy));
+ // We can't expect a viewport of the form (0, 0, res.x, res.y) used to convert the
+ // window coordinates from gl_FragCoord into [0, 1] coordinates, so we need to use
+ // this more complicated method that is also used in the FXAA and HDR rendering steps
+ vec2 xy = vec2(gl_FragCoord.xy);
+ xy -= viewport.xy;
+
+ double distanceCenter = length(mathLine - xy);
double dLW = double(lineWidth);
- float blendFactor = 20;
+ const float blendFactor = 20.0;
if (distanceCenter > dLW) {
frag.color.a = 0.0;
- //discard;
}
else {
frag.color.a *= pow(float((dLW - distanceCenter) / dLW), blendFactor);
- // if (frag.color.a < 0.4)
- // discard;
}
frag.gPosition = vs_gPosition;
diff --git a/modules/base/shaders/renderabletrail_vs.glsl b/modules/base/shaders/renderabletrail_vs.glsl
index 3a6b56ce62..f2615fa74c 100644
--- a/modules/base/shaders/renderabletrail_vs.glsl
+++ b/modules/base/shaders/renderabletrail_vs.glsl
@@ -43,14 +43,13 @@ uniform int vertexSortingMethod;
uniform int pointSize;
uniform int stride;
-uniform ivec2 resolution;
+uniform vec4 viewport;
// Fragile! Keep in sync with RenderableTrail::render
#define VERTEX_SORTING_NEWESTFIRST 0
#define VERTEX_SORTING_OLDESTFIRST 1
#define VERTEX_SORTING_NOSORTING 2
-
void main() {
int modId = gl_VertexID;
@@ -83,5 +82,5 @@ void main() {
float(pointSize) : float(pointSize) / 2;
gl_Position = z_normalization(vs_positionClipSpace);
- mathLine = 0.5 * (vs_positionNDC.xy + vec2(1.0)) * vec2(resolution);
+ mathLine = 0.5 * (vs_positionNDC.xy + vec2(1.0)) * viewport.zw;
}
diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp
index 54c8513dcf..228d6a7d62 100644
--- a/modules/base/translation/statictranslation.cpp
+++ b/modules/base/translation/statictranslation.cpp
@@ -56,7 +56,7 @@ StaticTranslation::StaticTranslation()
glm::dvec3(std::numeric_limits::max())
)
{
- _position.setViewOption(properties::Property::ViewOptions::Logarithmic);
+ _position.setExponent(20.f);
addProperty(_position);
_position.onChange([this]() {
diff --git a/modules/debugging/rendering/renderabledebugplane.cpp b/modules/debugging/rendering/renderabledebugplane.cpp
index f2308c7ecd..57f6958257 100644
--- a/modules/debugging/rendering/renderabledebugplane.cpp
+++ b/modules/debugging/rendering/renderabledebugplane.cpp
@@ -115,7 +115,7 @@ RenderableDebugPlane::RenderableDebugPlane(const ghoul::Dictionary& dictionary)
_texture = p.texture.value_or(_texture);
addProperty(_texture);
- _size.setViewOption(properties::Property::ViewOptions::Logarithmic);
+ _size.setExponent(15.f);
_size.onChange([this](){ _planeIsDirty = true; });
_size = p.size.value_or(_size);
setBoundingSphere(_size);
diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp
index bc9df03ce1..a0aa0c4f33 100644
--- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp
+++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp
@@ -33,23 +33,23 @@
#include
#include
#include
-#include
-#include
+#include
+#include
+#include
#include
#include
+#include
+#include
#include
#include
#include
#include
#include
-#include
-#include
-#include
#include
#include
+#include
#include
#include
-#include
#include
#include
#include
@@ -116,18 +116,11 @@ namespace {
"The text size for the astronomical object labels."
};
- constexpr openspace::properties::Property::PropertyInfo LabelMinSizeInfo = {
- "TextMinSize",
- "Text Min Size",
- "The minimal size (in pixels) of the text for the labels for the astronomical "
- "objects being rendered."
- };
-
- constexpr openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
- "TextMaxSize",
- "Text Max Size",
- "The maximum size (in pixels) of the text for the labels for the astronomical "
- "objects being rendered."
+ constexpr openspace::properties::Property::PropertyInfo LabelMinMaxSizeInfo = {
+ "TextMinMaxSize",
+ "Text Min/Max Size",
+ "The minimal and maximal size (in pixels) of the text for the labels for the "
+ "astronomical objects being rendered."
};
constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = {
@@ -178,48 +171,43 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo DisableFadeInInfo = {
"DisableFadeIn",
- "Disable Fade-in effect",
+ "Disable Fade-in Effect",
"Enables/Disables the Fade-in effect."
};
- constexpr openspace::properties::Property::PropertyInfo BillboardMaxSizeInfo = {
- "BillboardMaxSize",
- "Billboard Max Size in Pixels",
- "The max size (in pixels) for the billboard representing the astronomical "
- "object."
+ constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = {
+ "EnablePixelSizeControl",
+ "Enable Pixel Size Control",
+ "Enable pixel size control for rectangular projections. If set to true, the "
+ "billboard size is restricted by the min/max size in pixels property."
};
- constexpr openspace::properties::Property::PropertyInfo BillboardMinSizeInfo = {
- "BillboardMinSize",
- "Billboard Min Size in Pixels",
- "The min size (in pixels) for the billboard representing the astronomical "
- "object."
+ constexpr openspace::properties::Property::PropertyInfo BillboardMinMaxSizeInfo = {
+ "BillboardMinMaxSize",
+ "Billboard Min/Max Size in Pixels",
+ "The minimum and maximum size (in pixels) for the billboard representing the "
+ "astronomical object."
};
constexpr openspace::properties::Property::PropertyInfo
- CorrectionSizeEndDistanceInfo = {
+ CorrectionSizeEndDistanceInfo =
+ {
"CorrectionSizeEndDistance",
- "Distance in 10^X meters where correction size stops acting.",
+ "Distance in 10^X meters where correction size stops acting",
"Distance in 10^X meters where correction size stops acting."
};
constexpr openspace::properties::Property::PropertyInfo CorrectionSizeFactorInfo = {
"CorrectionSizeFactor",
- "Control variable for distance size.",
+ "Control variable for distance size",
""
};
- constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = {
- "EnablePixelSizeControl",
- "Enable pixel size control.",
- "Enable pixel size control for rectangular projections."
- };
-
constexpr openspace::properties::Property::PropertyInfo UseLinearFiltering = {
"UseLinearFiltering",
"Use Linear Filtering",
"Determines whether the provided color map should be sampled nearest neighbor "
- "(=off) or linearly (=on"
+ "(=off) or linearly (=on)"
};
constexpr openspace::properties::Property::PropertyInfo SetRangeFromData = {
@@ -258,6 +246,8 @@ namespace {
Gigaparsec [[codegen::key("Gpc")]],
GigalightYears [[codegen::key("Gly")]]
};
+ // The unit used for all distances. Must match the unit of any
+ // distances/positions in the data files
std::optional unit;
// [[codegen::verbatim(ScaleFactorInfo.description)]]
@@ -289,11 +279,8 @@ namespace {
// objects being rendered
std::optional labelFile;
- // [[codegen::verbatim(LabelMinSizeInfo.description)]]
- std::optional textMinSize;
-
- // [[codegen::verbatim(LabelMaxSizeInfo.description)]]
- std::optional textMaxSize;
+ // [[codegen::verbatim(LabelMinMaxSizeInfo.description)]]
+ std::optional textMinMaxSize;
// [[codegen::verbatim(ColorOptionInfo.description)]]
std::optional> colorOption;
@@ -314,11 +301,8 @@ namespace {
// [[codegen::verbatim(DisableFadeInInfo.description)]]
std::optional disableFadeIn;
- // [[codegen::verbatim(BillboardMaxSizeInfo.description)]]
- std::optional billboardMaxSize;
-
- // [[codegen::verbatim(BillboardMinSizeInfo.description)]]
- std::optional billboardMinSize;
+ // [[codegen::verbatim(BillboardMinMaxSizeInfo.description)]]
+ std::optional billboardMinMaxSize;
// [[codegen::verbatim(CorrectionSizeEndDistanceInfo.description)]]
std::optional correctionSizeEndDistance;
@@ -349,27 +333,34 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
, _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
, _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f)
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
- , _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
- , _textMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f)
+ , _textMinMaxSize(
+ LabelMinMaxSizeInfo,
+ glm::ivec2(8, 20),
+ glm::ivec2(0),
+ glm::ivec2(100)
+ )
, _drawElements(DrawElementsInfo, true)
, _drawLabels(DrawLabelInfo, false)
, _pixelSizeControl(PixelSizeControlInfo, false)
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
, _optionColorRangeData(OptionColorRangeInfo, glm::vec2(0.f))
-
, _datavarSizeOption(
SizeOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
- , _fadeInDistance(
+ , _fadeInDistances(
FadeInDistancesInfo,
glm::vec2(0.f),
glm::vec2(0.f),
glm::vec2(100.f)
)
, _disableFadeInDistance(DisableFadeInInfo, true)
- , _billboardMaxSize(BillboardMaxSizeInfo, 400.f, 0.f, 1000.f)
- , _billboardMinSize(BillboardMinSizeInfo, 0.f, 0.f, 100.f)
+ , _billboardMinMaxSize(
+ BillboardMinMaxSizeInfo,
+ glm::vec2(0.f, 400.f),
+ glm::vec2(0.f),
+ glm::vec2(1000.f)
+ )
, _correctionSizeEndDistance(CorrectionSizeEndDistanceInfo, 17.f, 12.f, 25.f)
, _correctionSizeFactor(CorrectionSizeFactorInfo, 8.f, 0.f, 20.f)
, _useLinearFiltering(UseLinearFiltering, false)
@@ -441,6 +432,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
// @TODO (abock, 2021-01-31) I don't know why we only add this property if the
// texture is given, but I think it's a bug
+ // @TODO (emmbr, 2021-05-24) This goes for several properties in this renderable
addProperty(_spriteTexturePath);
}
_hasSpriteTexture = p.texture.has_value();
@@ -528,28 +520,28 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
_textSize = p.textSize.value_or(_textSize);
addProperty(_textSize);
- _textMinSize = p.textMinSize.value_or(_textMinSize);
- addProperty(_textMinSize);
-
- _textMaxSize = p.textMaxSize.value_or(_textMaxSize);
- addProperty(_textMaxSize);
+ _textMinMaxSize = p.textMinMaxSize.value_or(_textMinMaxSize);
+ _textMinMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_textMinMaxSize);
}
_transformationMatrix = p.transformationMatrix.value_or(_transformationMatrix);
if (p.fadeInDistances.has_value()) {
- _fadeInDistance = *p.fadeInDistances;
- addProperty(_fadeInDistance);
+ _fadeInDistances = *p.fadeInDistances;
+ _fadeInDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_fadeInDistances);
_disableFadeInDistance = false;
addProperty(_disableFadeInDistance);
}
- _billboardMaxSize = p.billboardMaxSize.value_or(_billboardMaxSize);
- addProperty(_billboardMaxSize);
+ _pixelSizeControl = p.enablePixelSizeControl.value_or(_pixelSizeControl);
+ addProperty(_pixelSizeControl);
- _billboardMinSize = p.billboardMinSize.value_or(_billboardMinSize);
- addProperty(_billboardMinSize);
+ _billboardMinMaxSize = p.billboardMinMaxSize.value_or(_billboardMinMaxSize);
+ _billboardMinMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_billboardMinMaxSize);
_correctionSizeEndDistance =
p.correctionSizeEndDistance.value_or(_correctionSizeEndDistance);
@@ -560,11 +552,6 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
addProperty(_correctionSizeFactor);
}
- _pixelSizeControl = p.enablePixelSizeControl.value_or(_pixelSizeControl);
- if (p.enablePixelSizeControl.has_value()) {
- addProperty(_pixelSizeControl);
- }
-
_setRangeFromData.onChange([this]() {
const int colorMapInUse =
_hasColorMapFile ? _dataset.index(_colorOptionString) : 0;
@@ -720,8 +707,11 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix()
)
);
- _program->setUniform(_uniformCache.minBillboardSize, _billboardMinSize); // in pixels
- _program->setUniform(_uniformCache.maxBillboardSize, _billboardMaxSize); // in pixels
+
+ const float minBillboardSize = _billboardMinMaxSize.value().x; // in pixels
+ const float maxBillboardSize = _billboardMinMaxSize.value().y; // in pixels
+ _program->setUniform(_uniformCache.minBillboardSize, minBillboardSize);
+ _program->setUniform(_uniformCache.maxBillboardSize, maxBillboardSize);
_program->setUniform(_uniformCache.color, _pointColor);
_program->setUniform(_uniformCache.alphaValue, _opacity);
_program->setUniform(_uniformCache.scaleFactor, _scaleFactor);
@@ -774,8 +764,8 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data,
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
- labelInfo.minSize = static_cast(_textMinSize);
- labelInfo.maxSize = static_cast(_textMaxSize);
+ labelInfo.minSize = _textMinMaxSize.value().x;
+ labelInfo.maxSize = _textMinMaxSize.value().y;
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
@@ -801,7 +791,7 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
float fadeInVar = 1.f;
if (!_disableFadeInDistance) {
float distCamera = static_cast(glm::length(data.camera.positionVec3()));
- const glm::vec2 fadeRange = _fadeInDistance;
+ const glm::vec2 fadeRange = _fadeInDistances;
const float a = static_cast(
1.f / ((fadeRange.y - fadeRange.x) * unitToMeter(_unit))
);
@@ -1136,7 +1126,7 @@ std::vector RenderableBillboardsCloud::createDataSlice() {
}
}
setBoundingSphere(maxRadius);
- _fadeInDistance.setMaxValue(glm::vec2(10.f * biggestCoord));
+ _fadeInDistances.setMaxValue(glm::vec2(10.f * biggestCoord));
return result;
}
diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.h b/modules/digitaluniverse/rendering/renderablebillboardscloud.h
index 2d0ab0582f..abc3d5d30f 100644
--- a/modules/digitaluniverse/rendering/renderablebillboardscloud.h
+++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.h
@@ -33,6 +33,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -111,18 +112,16 @@ private:
properties::Vec3Property _textColor;
properties::FloatProperty _textOpacity;
properties::FloatProperty _textSize;
- properties::FloatProperty _textMinSize;
- properties::FloatProperty _textMaxSize;
+ properties::IVec2Property _textMinMaxSize;
properties::BoolProperty _drawElements;
properties::BoolProperty _drawLabels;
properties::BoolProperty _pixelSizeControl;
properties::OptionProperty _colorOption;
properties::Vec2Property _optionColorRangeData;
properties::OptionProperty _datavarSizeOption;
- properties::Vec2Property _fadeInDistance;
+ properties::Vec2Property _fadeInDistances;
properties::BoolProperty _disableFadeInDistance;
- properties::FloatProperty _billboardMaxSize;
- properties::FloatProperty _billboardMinSize;
+ properties::Vec2Property _billboardMinMaxSize;
properties::FloatProperty _correctionSizeEndDistance;
properties::FloatProperty _correctionSizeFactor;
properties::BoolProperty _useLinearFiltering;
@@ -135,7 +134,7 @@ private:
ghoul::opengl::ProgramObject* _renderToPolygonProgram = nullptr;
UniformCache(
- cameraViewProjectionMatrix, modelMatrix, cameraPos, cameraLookup, renderOption,
+ cameraViewProjectionMatrix, modelMatrix, cameraPos, cameraLookup, renderOption,
minBillboardSize, maxBillboardSize, correctionSizeEndDistance,
correctionSizeFactor, color, alphaValue, scaleFactor, up, right, fadeInValue,
screenSize, spriteTexture, hasColormap, enabledRectSizeControl, hasDvarScaling
diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp
index 14f3742c86..b7e0a708df 100644
--- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp
+++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp
@@ -87,18 +87,11 @@ namespace {
"objects being rendered."
};
- constexpr openspace::properties::Property::PropertyInfo LabelMinSizeInfo = {
- "TextMinSize",
- "Text Min Size",
- "The minimal size (in pixels) of the text for the labels for the astronomical "
- "objects being rendered."
- };
-
- constexpr openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
- "TextMaxSize",
- "Text Max Size",
- "The maximum size (in pixels) of the text for the labels for the astronomical "
- "objects being rendered."
+ constexpr openspace::properties::Property::PropertyInfo LabelMinMaxSizeInfo = {
+ "TextMinMaxSize",
+ "Text Min/Max Size",
+ "The minimum and maximum size (in pixels) of the text for the labels for the "
+ "astronomical objects being rendered."
};
constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = {
@@ -162,11 +155,8 @@ namespace {
// [[codegen::verbatim(LabelFileInfo.description)]]
std::optional labelFile;
- // [[codegen::verbatim(LabelMinSizeInfo.description)]]
- std::optional textMinSize;
-
- // [[codegen::verbatim(LabelMaxSizeInfo.description)]]
- std::optional textMaxSize;
+ // [[codegen::verbatim(LabelMinMaxSizeInfo.description)]]
+ std::optional textMinMaxSize;
// [[codegen::verbatim(LineWidthInfo.description)]]
std::optional lineWidth;
@@ -190,8 +180,12 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
, _drawElements(DrawElementsInfo, true)
, _drawLabels(DrawLabelInfo, false)
- , _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
- , _textMaxSize(LabelMaxSizeInfo, 500.f, 0.f, 1000.f)
+ , _textMinMaxSize(
+ LabelMinMaxSizeInfo,
+ glm::ivec2(8, 500),
+ glm::ivec2(0),
+ glm::ivec2(1000)
+ )
, _lineWidth(LineWidthInfo, 2.f, 1.f, 16.f)
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
{
@@ -250,13 +244,13 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
_lineWidth = p.lineWidth.value_or(_lineWidth);
addProperty(_lineWidth);
- _drawLabels = p.drawLabels.value_or(_drawLabels);
- addProperty(_drawLabels);
-
if (p.labelFile.has_value()) {
_labelFile = absPath(*p.labelFile).string();
_hasLabel = true;
+ _drawLabels = p.drawLabels.value_or(_drawLabels);
+ addProperty(_drawLabels);
+
_textColor = p.textColor.value_or(_textColor);
_hasLabel = p.textColor.has_value();
_textColor.setViewOption(properties::Property::ViewOptions::Color);
@@ -269,11 +263,9 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
_textSize = p.textSize.value_or(_textSize);
addProperty(_textSize);
- _textMinSize = p.textMinSize.value_or(_textMinSize);
- addProperty(_textMinSize);
-
- _textMaxSize = p.textMaxSize.value_or(_textMaxSize);
- addProperty(_textMaxSize);
+ _textMinMaxSize = p.textMinMaxSize.value_or(_textMinMaxSize);
+ _textMinMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_textMinMaxSize);
}
if (p.meshColor.has_value()) {
@@ -417,8 +409,8 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
- labelInfo.minSize = static_cast(_textMinSize);
- labelInfo.maxSize = static_cast(_textMaxSize);
+ labelInfo.minSize = _textMinMaxSize.value().x;
+ labelInfo.maxSize = _textMinMaxSize.value().y;
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h
index f159488469..b397eb3a14 100644
--- a/modules/digitaluniverse/rendering/renderabledumeshes.h
+++ b/modules/digitaluniverse/rendering/renderabledumeshes.h
@@ -32,6 +32,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -120,8 +121,7 @@ private:
properties::FloatProperty _textSize;
properties::BoolProperty _drawElements;
properties::BoolProperty _drawLabels;
- properties::FloatProperty _textMinSize;
- properties::FloatProperty _textMaxSize;
+ properties::IVec2Property _textMinMaxSize;
properties::FloatProperty _lineWidth;
// DEBUG:
diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp
index f7c44ec3cd..1e54b6a7c7 100644
--- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp
+++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp
@@ -257,7 +257,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _drawElements(DrawElementsInfo, true)
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
- , _fadeInDistance(
+ , _fadeInDistances(
FadeInDistancesInfo,
glm::vec2(0.f),
glm::vec2(0.f),
@@ -374,9 +374,10 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
_sluminosity = p.scaleLuminosity.value_or(_sluminosity);
if (p.fadeInDistances.has_value()) {
- _fadeInDistance = *p.fadeInDistances;
+ _fadeInDistances = *p.fadeInDistances;
_disableFadeInDistance = false;
- addProperty(_fadeInDistance);
+ _fadeInDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_fadeInDistances);
addProperty(_disableFadeInDistance);
}
@@ -556,7 +557,7 @@ void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) {
if (!_disableFadeInDistance) {
float distCamera = static_cast(glm::length(data.camera.positionVec3()));
distCamera = static_cast(distCamera / scale);
- const glm::vec2 fadeRange = _fadeInDistance;
+ const glm::vec2 fadeRange = _fadeInDistances;
//const float a = 1.f / ((fadeRange.y - fadeRange.x) * scale);
const float a = 1.f / ((fadeRange.y - fadeRange.x));
const float b = -(fadeRange.x / (fadeRange.y - fadeRange.x));
@@ -792,7 +793,7 @@ void RenderablePlanesCloud::createPlanes() {
_dataIsDirty = false;
setBoundingSphere(maxRadius * _scaleFactor);
- _fadeInDistance.setMaxValue(glm::vec2(10.f * maxSize));
+ _fadeInDistances.setMaxValue(glm::vec2(10.f * maxSize));
}
if (_hasLabel && _labelDataIsDirty) {
diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.h b/modules/digitaluniverse/rendering/renderableplanescloud.h
index 32549a36f1..de2d2386cd 100644
--- a/modules/digitaluniverse/rendering/renderableplanescloud.h
+++ b/modules/digitaluniverse/rendering/renderableplanescloud.h
@@ -115,7 +115,7 @@ private:
properties::FloatProperty _textSize;
properties::BoolProperty _drawElements;
properties::OptionProperty _blendMode;
- properties::Vec2Property _fadeInDistance;
+ properties::Vec2Property _fadeInDistances;
properties::BoolProperty _disableFadeInDistance;
properties::FloatProperty _planeMinSize;
properties::OptionProperty _renderOption;
diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl
index 5b0369dad7..6ee47f1d7a 100644
--- a/modules/exoplanets/exoplanetsmodule_lua.inl
+++ b/modules/exoplanets/exoplanetsmodule_lua.inl
@@ -429,7 +429,7 @@ void createExoplanetSystem(const std::string& starName) {
"Renderable = {"
"Type = 'RenderableRadialGrid',"
"Enabled = " + isCircleEnabledString + ","
- "OuterRadius = " + std::to_string(AU) + ","
+ "Radii = { 0.0, 1.0 },"
"CircleSegments = 64,"
"LineWidth = 2.0,"
"},"
@@ -437,6 +437,10 @@ void createExoplanetSystem(const std::string& starName) {
"Rotation = {"
"Type = 'StaticRotation',"
"Rotation = " + ghoul::to_string(meanOrbitPlaneRotationMatrix) + ""
+ "},"
+ "Scale = {"
+ "Type = 'StaticScale',"
+ "Scale = " + std::to_string(AU) + ""
"}"
"},"
"GUI = {"
diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp
index e1a12759f4..2971318b53 100644
--- a/modules/gaia/rendering/renderablegaiastars.cpp
+++ b/modules/gaia/rendering/renderablegaiastars.cpp
@@ -517,7 +517,6 @@ RenderableGaiaStars::RenderableGaiaStars(const ghoul::Dictionary& dictionary)
_renderOption.onChange([&]() { _buffersAreDirty = true; });
addProperty(_renderOption);
-#ifndef __APPLE__
_shaderOption.addOptions({
{ gaia::ShaderOption::Point_SSBO, "Point_SSBO" },
{ gaia::ShaderOption::Point_VBO, "Point_VBO" },
@@ -525,35 +524,35 @@ RenderableGaiaStars::RenderableGaiaStars(const ghoul::Dictionary& dictionary)
{ gaia::ShaderOption::Billboard_VBO, "Billboard_VBO" },
{ gaia::ShaderOption::Billboard_SSBO_noFBO, "Billboard_SSBO_noFBO" }
});
-#else // __APPLE__
- _shaderOption.addOptions({
- { gaia::ShaderOption::Point_VBO, "Point_VBO" },
- { gaia::ShaderOption::Billboard_VBO, "Billboard_VBO" },
- });
-#endif // __APPLE__
if (p.shaderOption.has_value()) {
switch (*p.shaderOption) {
case Parameters::ShaderOption::PointSSBO:
_shaderOption = gaia::ShaderOption::Point_SSBO;
+#ifdef __APPLE__
+ LWARNING("Shader option unsupported, changing to Point VBO");
+ _shaderOption = gaia::ShaderOption::Point_VBO;
+#endif // __APPLE__
break;
case Parameters::ShaderOption::PointVBO:
-#ifdef __APPLE__
- throw ghoul::RuntimeError("Shader option is not supported on MacOS");
-#endif // __APPLE__
_shaderOption = gaia::ShaderOption::Point_VBO;
break;
case Parameters::ShaderOption::BillboardSSBO:
_shaderOption = gaia::ShaderOption::Billboard_SSBO;
+#ifdef __APPLE__
+ LWARNING("Shader option unsupported, changing to Point VBO");
+ _shaderOption = gaia::ShaderOption::Point_VBO;
+#endif // __APPLE__
break;
case Parameters::ShaderOption::BillboardVBO:
-#ifdef __APPLE__
- throw ghoul::RuntimeError("Shader option is not supported on MacOS");
-#endif // __APPLE__
_shaderOption = gaia::ShaderOption::Billboard_VBO;
break;
case Parameters::ShaderOption::BillboardSSBONoFBO:
_shaderOption = gaia::ShaderOption::Billboard_SSBO_noFBO;
+#ifdef __APPLE__
+ LWARNING("Shader option unsupported, changing to Point VBO");
+ _shaderOption = gaia::ShaderOption::Point_VBO;
+#endif // __APPLE__
break;
default:
throw ghoul::MissingCaseException();
diff --git a/modules/galaxy/rendering/galaxyraycaster.cpp b/modules/galaxy/rendering/galaxyraycaster.cpp
index 0f11505f9d..a861503af6 100644
--- a/modules/galaxy/rendering/galaxyraycaster.cpp
+++ b/modules/galaxy/rendering/galaxyraycaster.cpp
@@ -58,7 +58,7 @@ void GalaxyRaycaster::initialize() {
void GalaxyRaycaster::renderEntryPoints(const RenderData& data,
ghoul::opengl::ProgramObject& program)
{
- program.setUniform("modelViewTransform", glm::mat4(modelViewTransform(data)));
+ program.setUniform("modelViewTransform", modelViewTransform(data));
program.setUniform("projectionTransform", data.camera.projectionMatrix());
// Cull back face
@@ -73,7 +73,7 @@ void GalaxyRaycaster::renderExitPoints(const RenderData& data,
ghoul::opengl::ProgramObject& program)
{
// Uniforms
- program.setUniform("modelViewTransform", glm::mat4(modelViewTransform(data)));
+ program.setUniform("modelViewTransform", modelViewTransform(data));
program.setUniform("projectionTransform", data.camera.projectionMatrix());
// Cull front face
diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp
index 52d9c010c7..6cb9da54ee 100644
--- a/modules/galaxy/rendering/renderablegalaxy.cpp
+++ b/modules/galaxy/rendering/renderablegalaxy.cpp
@@ -161,10 +161,10 @@ namespace {
std::filesystem::path filename;
glm::ivec3 dimensions;
glm::vec3 size;
-
+
// [[codegen::verbatim(NumberOfRayCastingStepsInfo.description)]]
std::optional steps;
-
+
// [[codegen::verbatim(DownscaleVolumeRenderingInfo.description)]]
std::optional downscale;
};
@@ -227,7 +227,7 @@ RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _volumeRenderingEnabled(VolumeRenderingEnabledInfo, true)
, _starRenderingEnabled(StarRenderingEnabledInfo, true)
- , _stepSize(StepSizeInfo, 0.01f, 0.0005f, 0.05f, 0.001f)
+ , _stepSize(StepSizeInfo, 0.01f, 0.001f, 0.05f, 0.001f)
, _absorptionMultiply(AbsorptionMultiplyInfo, 40.f, 0.0f, 200.0f)
, _emissionMultiply(EmissionMultiplyInfo, 200.f, 0.0f, 1000.0f)
, _starRenderingMethod(
diff --git a/modules/galaxy/shaders/raycasterbounds_vs.glsl b/modules/galaxy/shaders/raycasterbounds_vs.glsl
index f5ecb07e09..edcf6acea7 100644
--- a/modules/galaxy/shaders/raycasterbounds_vs.glsl
+++ b/modules/galaxy/shaders/raycasterbounds_vs.glsl
@@ -24,19 +24,20 @@
#version __CONTEXT__
+#include "PowerScaling/powerScalingMath.hglsl"
+
layout(location = 0) in vec4 vertPosition;
out vec3 modelPosition;
out vec4 viewPosition;
uniform mat4 projectionTransform;
-uniform mat4 modelViewTransform;
+uniform dmat4 modelViewTransform;
void main() {
modelPosition = vertPosition.xyz;
- viewPosition = modelViewTransform*vertPosition;
+ dvec4 vp = modelViewTransform * vertPosition;
+ viewPosition = vec4(vp);
- // project the position to view space
- gl_Position = projectionTransform * viewPosition;
- gl_Position.z = 0.0;
+ gl_Position = z_normalization(vec4(projectionTransform * viewPosition));
}
diff --git a/modules/globebrowsing/scripts/layer_support.lua b/modules/globebrowsing/scripts/layer_support.lua
index e6153e0d84..82678d901c 100644
--- a/modules/globebrowsing/scripts/layer_support.lua
+++ b/modules/globebrowsing/scripts/layer_support.lua
@@ -63,13 +63,12 @@ openspace.globebrowsing.documentation = {
Name = "parseInfoFile",
Arguments = "string",
Documentation =
- "Parses the passed info file and returns two tables. The first return value " ..
- "contains the table for the color layer of a RenderableGlobe. The second " ..
- "return value contains the table for the height layer of a RenderableGlobe." ..
- "Usage: local color, height = openspace.globebrowsing.parseInfoFile(file)" ..
- "openspace.globebrowsing.addLayer(\"Earth\", \"ColorLayers\", color)" ..
- "openspace.globebrowsing.addLayer(\"Earth\", \"HeightLayers\", height)"
-
+ "Parses the passed info file and return the table with the information " ..
+ "provided in the info file. The return table contains the optional keys: " ..
+ "'Color', 'Height', 'Node', 'Location', 'Identifier'." ..
+ "Usage: local t = openspace.globebrowsing.parseInfoFile(file)" ..
+ "openspace.globebrowsing.addLayer(\"Earth\", \"ColorLayers\", t.color)" ..
+ "openspace.globebrowsing.addLayer(\"Earth\", \"HeightLayers\", t.height)"
},
{
Name = "addBlendingLayersFromDirectory",
@@ -264,7 +263,13 @@ openspace.globebrowsing.parseInfoFile = function (file)
location = Location
end
- return name, color, height, location, identifier
+ return {
+ Color = color,
+ Height = height,
+ Name = name,
+ Location = location,
+ Identifier = identifier
+ }
end
openspace.globebrowsing.addBlendingLayersFromDirectory = function (dir, node_name)
@@ -290,16 +295,14 @@ openspace.globebrowsing.addBlendingLayersFromDirectory = function (dir, node_nam
for _, file in pairs(files) do
if file and file:find('.info') and ends_with(file, '.info') then
- local c, h
- _, c, h, _ = openspace.globebrowsing.parseInfoFile(file)
-
- if c then
- openspace.printInfo("Adding color layer '" .. c["Identifier"] .. "'")
- openspace.globebrowsing.addLayer(node_name, "ColorLayers", c)
+ local t = openspace.globebrowsing.parseInfoFile(file)
+ if t.Color then
+ openspace.printInfo("Adding color layer '" .. t.Color["Identifier"] .. "'")
+ openspace.globebrowsing.addLayer(node_name, "ColorLayers", t.Color)
end
- if h then
- openspace.printInfo("Adding height layer '" .. h["Identifier"] .. "'")
- openspace.globebrowsing.addLayer(node_name, "HeightLayers", h)
+ if t.Height then
+ openspace.printInfo("Adding height layer '" .. t.Height["Identifier"] .. "'")
+ openspace.globebrowsing.addLayer(node_name, "HeightLayers", t.Height)
end
end
end
@@ -310,19 +313,18 @@ openspace.globebrowsing.addFocusNodesFromDirectory = function (dir, node_name)
for _, file in pairs(files) do
if file and file:find('.info') then
- local n, l
- n, _, _, l, i = openspace.globebrowsing.parseInfoFile(file)
+ local t = openspace.globebrowsing.parseInfoFile(file)
- if n and l then
+ if t.Node and t.Location then
openspace.printInfo("Creating focus node for '" .. n .. "'")
- local lat = l.Center[2]
- local long = l.Center[1]
+ local lat = t.Location.Center[2]
+ local long = t.Location.Center[1]
local a, b, c = openspace.globebrowsing.getGeoPosition(node_name, lat, long, 0.0)
local p = { a, b, c }
- local identifier = node_name .. " - " .. i
- local name = node_name .. " - " .. n
+ local identifier = node_name .. " - " .. t.Identifier
+ local name = node_name .. " - " .. t.Node
openspace.addSceneGraphNode({
Identifier = identifier,
diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp
index f97a13fe4d..7dbb215593 100644
--- a/modules/globebrowsing/src/globelabelscomponent.cpp
+++ b/modules/globebrowsing/src/globelabelscomponent.cpp
@@ -60,106 +60,86 @@ namespace {
constexpr int8_t CurrentCacheVersion = 1;
- constexpr openspace::properties::Property::PropertyInfo LabelsInfo = {
- "Labels",
- "Labels Enabled",
- "Enables and disables the rendering of labels on the globe surface from "
- "the csv label file"
+ constexpr openspace::properties::Property::PropertyInfo EnabledInfo = {
+ "Enabled",
+ "Enabled",
+ "Enables and disables labels' rendering."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsEnableInfo = {
- "Enable",
- "Enable",
- "Enables and disables labels' rendering from the asset file."
- };
-
- constexpr openspace::properties::Property::PropertyInfo LabelsFontSizeInfo = {
- "LabelsFontSize",
- "Labels Font Size",
+ constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = {
+ "FontSize",
+ "Font Size",
"Font size for the rendering labels. This is different fromt text size."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsMaxSizeInfo = {
- "LabelsMaxSize",
- "Labels Maximum Text Size",
- "Maximum label size"
+ constexpr openspace::properties::Property::PropertyInfo MinMaxSizeInfo = {
+ "MinMaxSize",
+ "Min/Max Text Size",
+ "Minimum and maximum label size, in pixels."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsMinSizeInfo = {
- "LabelsMinSize",
- "Labels Minimum Text Size",
- "Minimum label size"
- };
-
- constexpr openspace::properties::Property::PropertyInfo LabelsSizeInfo = {
+ constexpr openspace::properties::Property::PropertyInfo SizeInfo = {
"LabelsSize",
"Labels Size",
- "Labels Size"
+ "This value affects the size scale of the labels."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsMinHeightInfo = {
- "LabelsMinHeight",
- "Labels Minimum Height",
- "Labels Minimum Height"
+ constexpr openspace::properties::Property::PropertyInfo HeightOffsetInfo = {
+ "HeightOffset",
+ "Height Offset",
+ "This value moves the label away from the globe surface by the specified "
+ "distance (in meters)."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsColorInfo = {
- "LabelsColor",
- "Labels Color",
- "Labels Color"
+ constexpr openspace::properties::Property::PropertyInfo ColorInfo = {
+ "Color",
+ "Color",
+ "The text color of the labels."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsOpacityInfo = {
- "LabelsOpacity",
- "Labels Opacity",
- "Labels Opacity"
+ constexpr openspace::properties::Property::PropertyInfo OpacityInfo = {
+ "Opacity",
+ "Opacity",
+ "The opacity of the labels."
};
- constexpr openspace::properties::Property::PropertyInfo
- LabelsFadeInStartingDistanceInfo =
- {
- "FadeInStartingDistance",
- "Fade In Starting Distance for Labels",
- "Fade In Starting Distance for Labels"
+ constexpr openspace::properties::Property::PropertyInfo FadeDistancesInfo = {
+ "FadeDistances",
+ "Fade-In Distances",
+ "The distances above the globe's surface at which the labels start fading in or "
+ "out, given in meters. The final distances are also adjusted by the specified "
+ "height offset."
};
- constexpr openspace::properties::Property::PropertyInfo
- LabelsFadeOutStartingDistanceInfo =
- {
- "FadeOutStartingDistance",
- "Fade Out Starting Distance for Labels",
- "Fade Out Starting Distance for Labels"
+ constexpr openspace::properties::Property::PropertyInfo FadeInEnabledInfo = {
+ "FadeInEnabled",
+ "Fade In Enabled",
+ "Sets whether the labels fade in when approaching the globe from a distance. If "
+ "false, no fading happens and the labels immediately has full opacity."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsFadeInEnabledInfo = {
- "LabelsFadeInEnabled",
- "Labels fade In enabled",
- "Labels fade In enabled"
+ constexpr openspace::properties::Property::PropertyInfo FadeOutEnabledInfo = {
+ "FadeOutEnabled",
+ "Fade Out Enabled",
+ "Sets whether the labels fade out when approaching the surface of the globe. If "
+ "false, no fading happens and the labels stays in full opacity."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsFadeOutEnabledInfo = {
- "LabelsFadeOutEnabled",
- "Labels fade Out enabled",
- "Labels fade Out enabled"
+ constexpr openspace::properties::Property::PropertyInfo DisableCullingInfo = {
+ "DisableCulling",
+ "Culling Disabled",
+ "Labels culling disabled."
};
- constexpr openspace::properties::Property::PropertyInfo
- LabelsDisableCullingEnabledInfo =
- {
- "LabelsDisableCullingEnabled",
- "Labels culling disabled",
- "Labels culling disabled"
+ constexpr openspace::properties::Property::PropertyInfo DistanceEPSInfo = {
+ "DistanceEPS",
+ "Culling Distance",
+ "Labels culling distance from globe's center."
};
- constexpr openspace::properties::Property::PropertyInfo LabelsDistanceEPSInfo = {
- "LabelsDistanceEPS",
- "Labels culling distance from globe's center",
- "Labels culling distance from globe's center"
- };
-
- constexpr openspace::properties::Property::PropertyInfo LabelAlignmentOptionInfo = {
- "LabelAlignmentOption",
- "Label Alignment Option",
+ constexpr openspace::properties::Property::PropertyInfo AlignmentOptionInfo = {
+ "AlignmentOption",
+ "Alignment Option",
"Labels are aligned horizontally or circularly related to the planet."
};
@@ -167,57 +147,48 @@ namespace {
// The path to the labels file
std::optional fileName;
- // [[codegen::verbatim(LabelsInfo.description)]]
- std::optional labels;
+ // [[codegen::verbatim(EnabledInfo.description)]]
+ std::optional enabled;
- // [[codegen::verbatim(LabelsEnableInfo.description)]]
- std::optional enable;
+ // [[codegen::verbatim(FontSizeInfo.description)]]
+ std::optional fontSize;
- // [[codegen::verbatim(LabelsFontSizeInfo.description)]]
- std::optional labelsFontSize;
+ // [[codegen::verbatim(MinMaxSizeInfo.description)]]
+ std::optional minMaxSize;
- // [[codegen::verbatim(LabelsMinSizeInfo.description)]]
- std::optional labelsMinSize;
+ // [[codegen::verbatim(SizeInfo.description)]]
+ std::optional size;
- // [[codegen::verbatim(LabelsMaxSizeInfo.description)]]
- std::optional labelsMaxSize;
+ // [[codegen::verbatim(HeightOffsetInfo.description)]]
+ std::optional heightOffset;
- // [[codegen::verbatim(LabelsSizeInfo.description)]]
- std::optional labelsSize;
+ // [[codegen::verbatim(ColorInfo.description)]]
+ std::optional color [[codegen::color()]];
- // [[codegen::verbatim(LabelsMinHeightInfo.description)]]
- std::optional labelsMinHeight;
+ // [[codegen::verbatim(OpacityInfo.description)]]
+ std::optional opacity [[codegen::inrange(0.f, 1.f)]];
- // [[codegen::verbatim(LabelsColorInfo.description)]]
- std::optional labelsColor [[codegen::color()]];
+ // [[codegen::verbatim(FadeDistancesInfo.description)]]
+ std::optional fadeDistances;
- // [[codegen::verbatim(LabelsOpacityInfo.description)]]
- std::optional labelsOpacity [[codegen::inrange(0.f, 1.f)]];
+ // [[codegen::verbatim(FadeInEnabledInfo.description)]]
+ std::optional fadeInEnabled;
- // [[codegen::verbatim(LabelsFadeInStartingDistanceInfo.description)]]
- std::optional fadeInStartingDistance;
+ // [[codegen::verbatim(FadeOutEnabledInfo.description)]]
+ std::optional fadeOutEnabled;
- // [[codegen::verbatim(LabelsFadeOutStartingDistanceInfo.description)]]
- std::optional fadeOutStartingDistance;
+ // [[codegen::verbatim(DisableCullingInfo.description)]]
+ std::optional disableCulling;
- // [[codegen::verbatim(LabelsFadeInEnabledInfo.description)]]
- std::optional labelsFadeInEnabled;
-
- // [[codegen::verbatim(LabelsFadeOutEnabledInfo.description)]]
- std::optional labelsFadeOutEnabled;
-
- // [[codegen::verbatim(LabelsDisableCullingEnabledInfo.description)]]
- std::optional labelsDisableCullingEnabled;
-
- // [[codegen::verbatim(LabelsDistanceEPSInfo.description)]]
- std::optional labelsDistanceEPS;
+ // [[codegen::verbatim(DistanceEPSInfo.description)]]
+ std::optional distanceEPS;
enum class Alignment {
Horizontally,
Circularly
};
- // [[codegen::verbatim(LabelAlignmentOptionInfo.description)]]
- std::optional labelAlignmentOption;
+ // [[codegen::verbatim(AlignmentOptionInfo.description)]]
+ std::optional alignmentOption;
};
#include "globelabelscomponent_codegen.cpp"
} // namespace
@@ -230,49 +201,49 @@ documentation::Documentation GlobeLabelsComponent::Documentation() {
GlobeLabelsComponent::GlobeLabelsComponent()
: properties::PropertyOwner({ "Labels" })
- , _labelsEnabled(LabelsInfo, false)
- , _labelsFontSize(LabelsFontSizeInfo, 30, 1, 300)
- , _labelsMaxSize(LabelsMaxSizeInfo, 300, 10, 1000)
- , _labelsMinSize(LabelsMinSizeInfo, 4, 1, 100)
- , _labelsSize(LabelsSizeInfo, 2.5, 0, 30)
- , _labelsMinHeight(LabelsMinHeightInfo, 100.0, 0.0, 10000.0)
- , _labelsColor(
- LabelsColorInfo,
- glm::vec3(1.f, 1.f, 0.f),
- glm::vec3(0.f),
- glm::vec3(1.f)
+ , _enabled(EnabledInfo, false)
+ , _fontSize(FontSizeInfo, 30, 1, 300)
+ , _minMaxSize(MinMaxSizeInfo, glm::ivec2(1, 1000), glm::ivec2(1), glm::ivec2(1000))
+ , _size(SizeInfo, 2.5, 0, 30)
+ , _heightOffset(HeightOffsetInfo, 100.0, 0.0, 10000.0)
+ , _color(ColorInfo, glm::vec3(1.f, 1.f, 0.f), glm::vec3(0.f), glm::vec3(1.f))
+ , _opacity(OpacityInfo, 1.f, 0.f, 1.f)
+ , _fadeDistances(
+ FadeDistancesInfo,
+ glm::vec2(1e4, 1e6),
+ glm::vec2(1.f),
+ glm::vec2(1e8)
)
- , _labelsOpacity(LabelsOpacityInfo, 1.f, 0.f, 1.f)
- , _labelsFadeInDist(LabelsFadeInStartingDistanceInfo, 1e6, 1e3, 1e8)
- , _labelsFadeOutDist(LabelsFadeOutStartingDistanceInfo, 1e4, 1, 1e7)
- , _labelsFadeInEnabled(LabelsFadeInEnabledInfo, false)
- , _labelsFadeOutEnabled(LabelsFadeOutEnabledInfo, false)
- , _labelsDisableCullingEnabled(LabelsDisableCullingEnabledInfo, false)
- , _labelsDistanceEPS(LabelsDistanceEPSInfo, 100000.f, 1000.f, 10000000.f)
- , _labelAlignmentOption(
- LabelAlignmentOptionInfo,
+ , _fadeInEnabled(FadeInEnabledInfo, false)
+ , _fadeOutEnabled(FadeOutEnabledInfo, false)
+ , _disableCulling(DisableCullingInfo, false)
+ , _distanceEPS(DistanceEPSInfo, 100000.f, 1000.f, 10000000.f)
+ , _alignmentOption(
+ AlignmentOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
{
- addProperty(_labelsEnabled);
- addProperty(_labelsFontSize);
- addProperty(_labelsSize);
- addProperty(_labelsMinHeight);
- _labelsColor.setViewOption(properties::Property::ViewOptions::Color);
- addProperty(_labelsColor);
- addProperty(_labelsOpacity);
- addProperty(_labelsFadeInDist);
- addProperty(_labelsFadeOutDist);
- addProperty(_labelsMinSize);
- addProperty(_labelsFadeInEnabled);
- addProperty(_labelsFadeOutEnabled);
- addProperty(_labelsDisableCullingEnabled);
- addProperty(_labelsDistanceEPS);
+ addProperty(_enabled);
+ addProperty(_fontSize);
+ addProperty(_size);
+ _minMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_minMaxSize);
+ addProperty(_color);
+ addProperty(_opacity);
+ _fadeDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ _fadeDistances.setExponent(3.f);
+ addProperty(_fadeDistances);
+ addProperty(_fadeInEnabled);
+ addProperty(_fadeOutEnabled);
+ addProperty(_heightOffset);
+ _color.setViewOption(properties::Property::ViewOptions::Color);
+ addProperty(_disableCulling);
+ addProperty(_distanceEPS);
- _labelAlignmentOption.addOption(Horizontally, "Horizontally");
- _labelAlignmentOption.addOption(Circularly, "Circularly");
- _labelAlignmentOption = Horizontally;
- addProperty(_labelAlignmentOption);
+ _alignmentOption.addOption(Horizontally, "Horizontally");
+ _alignmentOption.addOption(Circularly, "Circularly");
+ _alignmentOption = Horizontally;
+ addProperty(_alignmentOption);
}
void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary,
@@ -291,30 +262,32 @@ void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary,
return;
}
- _labelsEnabled = p.enable.value_or(true);
- _labelsFontSize = p.labelsFontSize.value_or(_labelsFontSize);
- _labelsFontSize.onChange([this]() { initializeFonts(); });
- _labelsSize = p.labelsSize.value_or(_labelsSize);
- _labelsMinHeight = p.labelsMinHeight.value_or(_labelsMinHeight);
- _labelsColor = p.labelsColor.value_or(_labelsColor);
- _labelsOpacity = p.labelsOpacity.value_or(_labelsOpacity);
- _labelsFadeInEnabled = p.labelsFadeInEnabled.value_or(_labelsFadeInEnabled);
- _labelsFadeInDist = p.fadeInStartingDistance.value_or(_labelsFadeInDist);
- _labelsFadeOutEnabled = p.labelsFadeOutEnabled.value_or(_labelsFadeOutEnabled);
- _labelsFadeOutDist = p.fadeOutStartingDistance.value_or(_labelsFadeOutDist);
- _labelsMinSize = p.labelsMinSize.value_or(_labelsMinSize);
- _labelsMaxSize = p.labelsMaxSize.value_or(_labelsMaxSize);
- _labelsDisableCullingEnabled =
- p.labelsDisableCullingEnabled.value_or(_labelsDisableCullingEnabled);
- _labelsDistanceEPS = p.labelsDistanceEPS.value_or(_labelsDistanceEPS);
+ _enabled = p.enabled.value_or(_enabled);
+ _fontSize = p.fontSize.value_or(_fontSize);
+ _fontSize.onChange([this]() { initializeFonts(); });
- if (p.labelAlignmentOption.has_value()) {
- switch (*p.labelAlignmentOption) {
+ // @TODO (emmbr, 2021-05-31): Temporarily set as read only, to avoid errors from font
+ // rendering (avoid filling font atlas)
+ _fontSize.setReadOnly(true);
+
+ _size = p.size.value_or(_size);
+ _heightOffset = p.heightOffset.value_or(_heightOffset);
+ _color = p.color.value_or(_color);
+ _opacity = p.opacity.value_or(_opacity);
+ _fadeInEnabled = p.fadeInEnabled.value_or(_fadeInEnabled);
+ _fadeOutEnabled = p.fadeOutEnabled.value_or(_fadeOutEnabled);
+ _fadeDistances = p.fadeDistances.value_or(_fadeDistances);
+ _minMaxSize = p.minMaxSize.value_or(_minMaxSize);
+ _disableCulling = p.disableCulling.value_or(_disableCulling);
+ _distanceEPS = p.distanceEPS.value_or(_distanceEPS);
+
+ if (p.alignmentOption.has_value()) {
+ switch (*p.alignmentOption) {
case Parameters::Alignment::Horizontally:
- _labelAlignmentOption = Horizontally;
+ _alignmentOption = Horizontally;
break;
case Parameters::Alignment::Circularly:
- _labelAlignmentOption = Circularly;
+ _alignmentOption = Circularly;
break;
default:
throw ghoul::MissingCaseException();
@@ -327,9 +300,9 @@ void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary,
void GlobeLabelsComponent::initializeFonts() {
_font = openspace::global::fontManager->font(
"Mono",
- static_cast(_labelsFontSize),
+ static_cast(_fontSize),
ghoul::fontrendering::FontManager::Outline::Yes,
- ghoul::fontrendering::FontManager::LoadGlyphs::No
+ ghoul::fontrendering::FontManager::LoadGlyphs::Yes
);
}
@@ -512,7 +485,7 @@ bool GlobeLabelsComponent::saveCachedFile(const std::string& file) const {
}
void GlobeLabelsComponent::draw(const RenderData& data) {
- if (!_labelsEnabled) {
+ if (!_enabled) {
return;
}
@@ -524,18 +497,17 @@ void GlobeLabelsComponent::draw(const RenderData& data) {
glm::dvec3 globePosWorld =
glm::dvec3(_globe->modelTransform() * glm::vec4(0.f, 0.f, 0.f, 1.f));
- glm::dvec3 camToGlobeDistanceWorld = globePosWorld - data.camera.positionVec3();
- double distanceCameraGlobeWorld = glm::length(camToGlobeDistanceWorld);
+ glm::dvec3 cameraToGlobeWorld = globePosWorld - data.camera.positionVec3();
+ double distanceCameraGlobeWorld = glm::length(cameraToGlobeWorld);
float varyingOpacity = 1.f;
- double averageRadius = (
- _globe->ellipsoid().radii().x + _globe->ellipsoid().radii().y +
- _globe->ellipsoid().radii().z
- ) / 3.0;
- if (_labelsFadeInEnabled) {
- glm::dvec2 fadeRange = glm::dvec2(averageRadius + _labelsMinHeight);
- fadeRange.x += _labelsFadeInDist;
+ const glm::dvec3 globeRadii = _globe->ellipsoid().radii();
+ double averageRadius = (globeRadii.x + globeRadii.y + globeRadii.z) / 3.0;
+
+ if (_fadeInEnabled) {
+ glm::dvec2 fadeRange = glm::dvec2(averageRadius + _heightOffset);
+ fadeRange.x += _fadeDistances.value().y;
double a = 1.0 / (fadeRange.y - fadeRange.x);
double b = -(fadeRange.x / (fadeRange.y - fadeRange.x));
double funcValue = a * distanceCameraGlobeWorld + b;
@@ -546,11 +518,11 @@ void GlobeLabelsComponent::draw(const RenderData& data) {
}
}
- if (_labelsFadeOutEnabled) {
+ if (_fadeOutEnabled) {
glm::dvec2 fadeRange = glm::dvec2(
- averageRadius + _labelsMinHeight + LabelFadeOutLimitAltitudeMeters
+ averageRadius + _heightOffset + LabelFadeOutLimitAltitudeMeters
);
- fadeRange.x += _labelsFadeOutDist;
+ fadeRange.x += _fadeDistances.value().x;
double a = 1.0 / (fadeRange.x - fadeRange.y);
double b = -(fadeRange.y / (fadeRange.x - fadeRange.y));
double funcValue = a * distanceCameraGlobeWorld + b;
@@ -569,8 +541,8 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
float distToCamera, float fadeInVariable
) {
glm::vec4 textColor = glm::vec4(
- glm::vec3(_labelsColor),
- _labelsOpacity * fadeInVariable
+ glm::vec3(_color),
+ _opacity * fadeInVariable
);
glm::dmat4 VP = glm::dmat4(data.camera.sgctInternal.projectionMatrix()) *
@@ -604,11 +576,11 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
double distanceCameraToLabelWorld =
glm::length(locationPositionWorld - data.camera.positionVec3());
- if (_labelsDisableCullingEnabled ||
- ((distToCamera > (distanceCameraToLabelWorld + _labelsDistanceEPS)) &&
+ if (_disableCulling ||
+ ((distToCamera > (distanceCameraToLabelWorld + _distanceEPS)) &&
isLabelInFrustum(VP, locationPositionWorld)))
{
- if (_labelAlignmentOption == Circularly) {
+ if (_alignmentOption == Circularly) {
glm::dvec3 labelNormalObj = glm::dvec3(
invModelMatrix * glm::dvec4(data.camera.positionVec3(), 1.0)
) - glm::dvec3(position);
@@ -629,18 +601,19 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
orthoUp = glm::normalize(glm::cross(labelNormalObj, orthoRight));
}
- position += _labelsMinHeight;
+ // Move the position along the normal. Note that position is in model space
+ position += _heightOffset.value() * glm::normalize(position);
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
- labelInfo.minSize = _labelsMinSize;
- labelInfo.maxSize = _labelsMaxSize;
+ labelInfo.minSize = _minMaxSize.value().x;
+ labelInfo.maxSize = _minMaxSize.value().y;
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = 0;
labelInfo.mvpMatrix = modelViewProjectionMatrix;
- labelInfo.scale = powf(2.f, _labelsSize);
+ labelInfo.scale = powf(2.f, _size);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = true;
labelInfo.disableTransmittance = true;
@@ -667,7 +640,6 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
bool GlobeLabelsComponent::isLabelInFrustum(const glm::dmat4& MVMatrix,
const glm::dvec3& position) const
{
-
// Frustum Planes
glm::dvec3 col1(MVMatrix[0][0], MVMatrix[1][0], MVMatrix[2][0]);
glm::dvec3 col2(MVMatrix[0][1], MVMatrix[1][1], MVMatrix[2][1]);
diff --git a/modules/globebrowsing/src/globelabelscomponent.h b/modules/globebrowsing/src/globelabelscomponent.h
index bf45535604..a14ede7078 100644
--- a/modules/globebrowsing/src/globelabelscomponent.h
+++ b/modules/globebrowsing/src/globelabelscomponent.h
@@ -31,6 +31,8 @@
#include
#include
#include
+#include
+#include
#include
#include
#include
@@ -82,21 +84,21 @@ private:
std::vector labelsArray;
};
- properties::BoolProperty _labelsEnabled;
- properties::FloatProperty _labelsFontSize;
- properties::IntProperty _labelsMaxSize;
- properties::IntProperty _labelsMinSize;
- properties::FloatProperty _labelsSize;
- properties::FloatProperty _labelsMinHeight;
- properties::Vec3Property _labelsColor;
- properties::FloatProperty _labelsOpacity;
- properties::FloatProperty _labelsFadeInDist;
- properties::FloatProperty _labelsFadeOutDist;
- properties::BoolProperty _labelsFadeInEnabled;
- properties::BoolProperty _labelsFadeOutEnabled;
- properties::BoolProperty _labelsDisableCullingEnabled;
- properties::FloatProperty _labelsDistanceEPS;
- properties::OptionProperty _labelAlignmentOption;
+ properties::BoolProperty _enabled;
+ properties::FloatProperty _fontSize;
+ properties::FloatProperty _size;
+ properties::IVec2Property _minMaxSize;
+ properties::FloatProperty _heightOffset;
+
+ properties::Vec3Property _color;
+ properties::FloatProperty _opacity;
+
+ properties::Vec2Property _fadeDistances;
+ properties::BoolProperty _fadeInEnabled;
+ properties::BoolProperty _fadeOutEnabled;
+ properties::BoolProperty _disableCulling;
+ properties::FloatProperty _distanceEPS;
+ properties::OptionProperty _alignmentOption;
Labels _labels;
diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp
index e4b0a2310b..c54bb66491 100644
--- a/modules/globebrowsing/src/ringscomponent.cpp
+++ b/modules/globebrowsing/src/ringscomponent.cpp
@@ -122,10 +122,10 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo OffsetInfo = {
"Offset",
"Offset",
- "This value 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}."
+ "This value 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. For example, if the value is {0.5, 1.0}, the "
+ "ring is only shown between radius/2 and radius. It defaults to {0.0, 1.0}."
};
constexpr openspace::properties::Property::PropertyInfo NightFactorInfo = {
@@ -249,7 +249,7 @@ void RingsComponent::initialize() {
addProperty(_enabled);
- _size.setViewOption(properties::Property::ViewOptions::Logarithmic);
+ _size.setExponent(15.f);
_size = p.size.value_or(_size);
_size.onChange([&]() { _planeIsDirty = true; });
addProperty(_size);
@@ -305,6 +305,7 @@ void RingsComponent::initialize() {
}
_offset = p.offset.value_or(_offset);
+ _offset.setViewOption(properties::Property::ViewOptions::MinMaxRange);
addProperty(_offset);
_nightFactor = p.nightFactor.value_or(_nightFactor);
diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp
index 6462e330f4..71f566af29 100644
--- a/modules/imgui/src/renderproperties.cpp
+++ b/modules/imgui/src/renderproperties.cpp
@@ -390,7 +390,7 @@ void renderDoubleProperty(properties::Property* prop, const std::string& ownerNa
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
renderTooltip(prop, tooltipDelay);
@@ -545,7 +545,7 @@ void renderFloatProperty(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
renderTooltip(prop, tooltipDelay);
@@ -577,7 +577,7 @@ void renderVec2Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
renderTooltip(prop, tooltipDelay);
@@ -621,7 +621,7 @@ void renderVec3Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
}
if (showTooltip) {
@@ -666,7 +666,7 @@ void renderVec4Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
}
if (showTooltip) {
@@ -702,7 +702,7 @@ void renderDVec2Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
renderTooltip(prop, tooltipDelay);
@@ -738,7 +738,7 @@ void renderDVec3Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
renderTooltip(prop, tooltipDelay);
@@ -774,7 +774,7 @@ void renderDVec4Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
renderTooltip(prop, tooltipDelay);
@@ -822,7 +822,7 @@ void renderDMat2Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
changed |= ImGui::SliderFloat2(
"[1]",
@@ -830,7 +830,7 @@ void renderDMat2Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
@@ -881,7 +881,7 @@ void renderDMat3Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
changed |= ImGui::SliderFloat3(
"[1]",
@@ -889,7 +889,7 @@ void renderDMat3Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
changed |= ImGui::SliderFloat3(
"[2]",
@@ -897,7 +897,7 @@ void renderDMat3Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
@@ -950,7 +950,7 @@ void renderDMat4Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
changed |= ImGui::SliderFloat4(
"[1]",
@@ -958,7 +958,7 @@ void renderDMat4Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
changed |= ImGui::SliderFloat4(
"[2]",
@@ -966,7 +966,7 @@ void renderDMat4Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
changed |= ImGui::SliderFloat4(
"[3]",
@@ -974,7 +974,7 @@ void renderDMat4Property(Property* prop, const std::string& ownerName,
min,
max,
"%.5f",
- p->exponent()
+ ImGuiSliderFlags_Logarithmic
);
if (showTooltip) {
diff --git a/modules/space/rendering/renderablehabitablezone.cpp b/modules/space/rendering/renderablehabitablezone.cpp
index 27129f4079..fb5a7ca4fc 100644
--- a/modules/space/rendering/renderablehabitablezone.cpp
+++ b/modules/space/rendering/renderablehabitablezone.cpp
@@ -136,6 +136,7 @@ RenderableHabitableZone::RenderableHabitableZone(const ghoul::Dictionary& dictio
// The user should not be able to change this property. It's just used to communicate
// the different rendering that happens outside of this interval
addProperty(_kopparapuTeffInterval);
+ _kopparapuTeffInterval.setViewOption(properties::Property::ViewOptions::MinMaxRange);
_kopparapuTeffInterval.setReadOnly(true);
// Make parent's size related properties read only. We want to set them based on the
diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp
index 49d4b32450..e013449b9c 100644
--- a/modules/space/rendering/renderablerings.cpp
+++ b/modules/space/rendering/renderablerings.cpp
@@ -60,10 +60,10 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo OffsetInfo = {
"Offset",
"Offset",
- "This value 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}."
+ "This value 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. For example, if the value is {0.5, 1.0}, the "
+ "ring is only shown between radius/2 and radius. It defaults to {0.0, 1.0}."
};
constexpr openspace::properties::Property::PropertyInfo NightFactorInfo = {
@@ -127,6 +127,7 @@ RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary)
_textureFile = std::make_unique(_texturePath.value());
_offset = p.offset.value_or(_offset);
+ _offset.setViewOption(properties::Property::ViewOptions::MinMaxRange);
addProperty(_offset);
_texturePath.onChange([&]() { loadTexture(); });
diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp
index adbb5a76fb..89b4fdf9a5 100644
--- a/modules/space/rendering/renderablestars.cpp
+++ b/modules/space/rendering/renderablestars.cpp
@@ -511,7 +511,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
, _userProvidedTextureOwner(UserProvidedTextureOptionInfo)
, _parametersOwner(ParametersOwnerOptionInfo)
, _moffatMethodOwner(MoffatMethodOptionInfo)
- , _fadeInDistance(
+ , _fadeInDistances(
FadeInDistancesInfo,
glm::vec2(0.f),
glm::vec2(0.f),
@@ -617,6 +617,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
_otherDataOption.onChange([&]() { _dataIsDirty = true; });
addProperty(_otherDataOption);
+ _otherDataRange.setViewOption(properties::Property::ViewOptions::MinMaxRange);
addProperty(_otherDataRange);
addProperty(_otherDataColorMapPath);
@@ -727,9 +728,10 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
if (p.fadeInDistances.has_value()) {
glm::vec2 v = *p.fadeInDistances;
- _fadeInDistance = v;
+ _fadeInDistances = v;
_disableFadeInDistance = false;
- addProperty(_fadeInDistance);
+ _fadeInDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
+ addProperty(_fadeInDistances);
addProperty(_disableFadeInDistance);
}
}
@@ -1034,7 +1036,7 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) {
float fadeInVariable = 1.f;
if (!_disableFadeInDistance) {
float distCamera = static_cast(glm::length(data.camera.positionVec3()));
- const glm::vec2 fadeRange = _fadeInDistance;
+ const glm::vec2 fadeRange = _fadeInDistances;
const double a = 1.f / ((fadeRange.y - fadeRange.x) * PARSEC);
const double b = -(fadeRange.x / (fadeRange.y - fadeRange.x));
const double funcValue = a * distCamera + b;
diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h
index 0b6eb73a53..bb2af31f34 100644
--- a/modules/space/rendering/renderablestars.h
+++ b/modules/space/rendering/renderablestars.h
@@ -125,7 +125,7 @@ private:
properties::PropertyOwner _userProvidedTextureOwner;
properties::PropertyOwner _parametersOwner;
properties::PropertyOwner _moffatMethodOwner;
- properties::Vec2Property _fadeInDistance;
+ properties::Vec2Property _fadeInDistances;
properties::BoolProperty _disableFadeInDistance;
std::unique_ptr _program;
diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp
index 963a87a11b..dad12653d2 100644
--- a/modules/space/rotation/spicerotation.cpp
+++ b/modules/space/rotation/spicerotation.cpp
@@ -52,6 +52,13 @@ namespace {
"The time frame in which the spice kernels are valid."
};
+ constexpr openspace::properties::Property::PropertyInfo FixedDateInfo = {
+ "FixedDate",
+ "Fixed Date",
+ "A time to lock the rotation to. Setting this to an empty string will "
+ "unlock the time and return to rotation based on current simulation time."
+ };
+
struct [[codegen::Dictionary(SpiceRotation)]] Parameters {
// [[codegen::verbatim(SourceInfo.description)]]
std::string sourceFrame
@@ -66,6 +73,10 @@ namespace {
// [[codegen::verbatim(TimeFrameInfo.description)]]
std::optional timeFrame
[[codegen::reference("core_time_frame")]];
+
+ // [[codegen::verbatim(FixedDateInfo.description)]]
+ std::optional fixedDate
+ [[codegen::annotation("A time to lock the rotation to")]];
};
#include "spicerotation_codegen.cpp"
} // namespace
@@ -79,6 +90,7 @@ documentation::Documentation SpiceRotation::Documentation() {
SpiceRotation::SpiceRotation(const ghoul::Dictionary& dictionary)
: _sourceFrame(SourceInfo)
, _destinationFrame(DestinationInfo)
+ , _fixedDate(FixedDateInfo)
{
const Parameters p = codegen::bake(dictionary);
@@ -96,6 +108,17 @@ SpiceRotation::SpiceRotation(const ghoul::Dictionary& dictionary)
}
}
+ _fixedDate.onChange([this]() {
+ if (_fixedDate.value().empty()) {
+ _fixedEphemerisTime = std::nullopt;
+ }
+ else {
+ _fixedEphemerisTime = SpiceManager::ref().ephemerisTimeFromDate(_fixedDate);
+ }
+ });
+ _fixedDate = p.fixedDate.value_or(_fixedDate);
+ addProperty(_fixedDate);
+
if (dictionary.hasKey(TimeFrameInfo.identifier)) {
ghoul::Dictionary timeFrameDictionary =
dictionary.value(TimeFrameInfo.identifier);
@@ -111,16 +134,21 @@ SpiceRotation::SpiceRotation(const ghoul::Dictionary& dictionary)
_sourceFrame.onChange([this]() { requireUpdate(); });
_destinationFrame.onChange([this]() { requireUpdate(); });
+
}
glm::dmat3 SpiceRotation::matrix(const UpdateData& data) const {
if (_timeFrame && !_timeFrame->isActive(data.time)) {
return glm::dmat3(1.0);
}
+ double time = data.time.j2000Seconds();
+ if (_fixedEphemerisTime.has_value()) {
+ time = *_fixedEphemerisTime;
+ }
return SpiceManager::ref().positionTransformMatrix(
_sourceFrame,
_destinationFrame,
- data.time.j2000Seconds()
+ time
);
}
diff --git a/modules/space/rotation/spicerotation.h b/modules/space/rotation/spicerotation.h
index 1cc4043774..af819b9606 100644
--- a/modules/space/rotation/spicerotation.h
+++ b/modules/space/rotation/spicerotation.h
@@ -29,6 +29,7 @@
#include
#include
+#include
namespace openspace {
@@ -46,7 +47,10 @@ public:
private:
properties::StringProperty _sourceFrame;
properties::StringProperty _destinationFrame;
+ properties::StringProperty _fixedDate;
+
ghoul::mm_unique_ptr _timeFrame;
+ std::optional _fixedEphemerisTime;
};
} // namespace openspace
diff --git a/modules/space/translation/spicetranslation.cpp b/modules/space/translation/spicetranslation.cpp
index 95fe2a70c6..98cf2231ef 100644
--- a/modules/space/translation/spicetranslation.cpp
+++ b/modules/space/translation/spicetranslation.cpp
@@ -62,6 +62,13 @@ namespace {
"should be retrieved. The default value is GALACTIC."
};
+ constexpr openspace::properties::Property::PropertyInfo FixedDateInfo = {
+ "FixedDate",
+ "Fixed Date",
+ "A time to lock the position to. Setting this to an empty string will "
+ "unlock the time and return to position based on current simulation time."
+ };
+
struct [[codegen::Dictionary(SpiceTranslation)]] Parameters {
// [[codegen::verbatim(TargetInfo.description)]]
std::string target
@@ -74,6 +81,9 @@ namespace {
std::optional frame
[[codegen::annotation("A valid SPICE NAIF name for a reference frame")]];
+ std::optional fixedDate
+ [[codegen::annotation("A date to lock the position to")]];
+
// A single kernel or list of kernels that this SpiceTranslation depends on. All
// provided kernels will be loaded before any other operation is performed
std::optional, std::string>> kernels;
@@ -92,6 +102,7 @@ SpiceTranslation::SpiceTranslation(const ghoul::Dictionary& dictionary)
, _observer(ObserverInfo)
, _frame(FrameInfo, DefaultReferenceFrame)
, _cachedFrame(DefaultReferenceFrame)
+ , _fixedDate(FixedDateInfo)
{
const Parameters p = codegen::bake(dictionary);
@@ -142,6 +153,17 @@ SpiceTranslation::SpiceTranslation(const ghoul::Dictionary& dictionary)
});
addProperty(_frame);
+ _fixedDate.onChange([this]() {
+ if (_fixedDate.value().empty()) {
+ _fixedEphemerisTime = std::nullopt;
+ }
+ else {
+ _fixedEphemerisTime = SpiceManager::ref().ephemerisTimeFromDate(_fixedDate);
+ }
+ });
+ _fixedDate = p.fixedDate.value_or(_fixedDate);
+ addProperty(_fixedDate);
+
_target = p.target;
_observer = p.observer;
_frame = p.frame.value_or(_frame);
@@ -149,12 +171,17 @@ SpiceTranslation::SpiceTranslation(const ghoul::Dictionary& dictionary)
glm::dvec3 SpiceTranslation::position(const UpdateData& data) const {
double lightTime = 0.0;
+
+ double time = data.time.j2000Seconds();
+ if (_fixedEphemerisTime.has_value()) {
+ time = *_fixedEphemerisTime;
+ }
return SpiceManager::ref().targetPosition(
_cachedTarget,
_cachedObserver,
_cachedFrame,
{},
- data.time.j2000Seconds(),
+ time,
lightTime
) * 1000.0;
}
diff --git a/modules/space/translation/spicetranslation.h b/modules/space/translation/spicetranslation.h
index 6b3f78808a..0cbead6eab 100644
--- a/modules/space/translation/spicetranslation.h
+++ b/modules/space/translation/spicetranslation.h
@@ -28,6 +28,7 @@
#include
#include
+#include
namespace openspace {
@@ -43,6 +44,7 @@ private:
properties::StringProperty _target;
properties::StringProperty _observer;
properties::StringProperty _frame;
+ properties::StringProperty _fixedDate;
// We are accessing these values every frame and when retrieving a string from the
// StringProperty, it allocates some new memory, which we want to prevent. Until the
@@ -51,6 +53,7 @@ private:
std::string _cachedTarget;
std::string _cachedObserver;
std::string _cachedFrame;
+ std::optional _fixedEphemerisTime;
glm::dvec3 _position = glm::dvec3(0.0);
};
diff --git a/scripts/configuration_helper.lua b/scripts/configuration_helper.lua
index 84dd547e75..deb3b94651 100644
--- a/scripts/configuration_helper.lua
+++ b/scripts/configuration_helper.lua
@@ -797,6 +797,7 @@ function sgct.config.fisheye(arg)
arg["background"] = { r = 0.0, g = 0.0, b = 0.0, a = 1.0 }
end
+ local trackedSpecifier = ""
if (arg["tracked"] ~= nil and arg["tracked"] == true) then
trackedSpecifier = "tracked=\"true\""
else
diff --git a/shaders/framebuffer/fxaa.frag b/shaders/framebuffer/fxaa.frag
index 2a86d8b9ea..425f319987 100644
--- a/shaders/framebuffer/fxaa.frag
+++ b/shaders/framebuffer/fxaa.frag
@@ -34,12 +34,13 @@ const float[12] QUALITY = float[](1.f, 1.f, 1.f, 1.f, 1.f, 1.5f, 2.f, 2.f, 2.f,
// 18.f, 18.f, 18.f, 18.f, 18.f, 18.f, 18.f, 18.f, 18.f, 18.f,
// 18.f, 18.f};
+in vec2 texCoord;
layout (location = 0) out vec4 aaFinalColor;
uniform vec2 inverseScreenSize;
uniform sampler2D renderedTexture;
-
-in vec2 texCoord;
+uniform vec4 Viewport;
+uniform vec2 Resolution;
// Relative luminance
float getLum(vec3 rgb){
@@ -47,17 +48,28 @@ float getLum(vec3 rgb){
}
void main() {
- vec4 colorCenter = texture(renderedTexture,texCoord);
+ // Modify the texCoord based on the Viewport and Resolution. This modification is
+ // necessary in case of side-by-side stereo as we only want to access the part of the
+ // feeding texture that we are currently responsible for. Otherwise we would map the
+ // entire feeding texture into our half of the result texture, leading to a doubling
+ // of the "missing" half. If you don't believe me, load a configuration file with the
+ // side_by_side stereo mode enabled, disable FXAA, and remove this modification
+ // The same calculation is done in the HDR resolving shader
+ vec2 st = texCoord;
+ st.x = st.x / (Resolution.x / Viewport[2]) + (Viewport[0] / Resolution.x);
+ st.y = st.y / (Resolution.y / Viewport[3]) + (Viewport[1] / Resolution.y);
+
+ vec4 colorCenter = texture(renderedTexture, st);
// ============================
// Detecting where to apply AA:
// ============================
float pixelLumCenter = getLum(colorCenter.rgb);
- float pixelLumDown = getLum(textureOffset(renderedTexture, texCoord, ivec2(0,-1)).rgb);
- float pixelLumUp = getLum(textureOffset(renderedTexture, texCoord, ivec2(0,1)).rgb);
- float pixelLumLeft = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,0)).rgb);
- float pixelLumRight = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,0)).rgb);
+ float pixelLumDown = getLum(textureOffset(renderedTexture, st, ivec2(0,-1)).rgb);
+ float pixelLumUp = getLum(textureOffset(renderedTexture, st, ivec2(0,1)).rgb);
+ float pixelLumLeft = getLum(textureOffset(renderedTexture, st, ivec2(-1,0)).rgb);
+ float pixelLumRight = getLum(textureOffset(renderedTexture, st, ivec2(1,0)).rgb);
float pixelLumMin = min(pixelLumCenter, min(min(pixelLumDown, pixelLumUp), min(pixelLumLeft, pixelLumRight)));
float pixelLumMax = max(pixelLumCenter, max(max(pixelLumDown, pixelLumUp), max(pixelLumLeft, pixelLumRight)));
@@ -75,10 +87,10 @@ void main() {
// ============================
// Estimating the gradient:
// ============================
- float pixelLumDownLeft = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,-1)).rgb);
- float pixelLumUpRight = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,1)).rgb);
- float pixelLumUpLeft = getLum(textureOffset(renderedTexture, texCoord, ivec2(-1,1)).rgb);
- float pixelLumDownRight = getLum(textureOffset(renderedTexture, texCoord, ivec2(1,-1)).rgb);
+ float pixelLumDownLeft = getLum(textureOffset(renderedTexture, st, ivec2(-1,-1)).rgb);
+ float pixelLumUpRight = getLum(textureOffset(renderedTexture, st, ivec2(1,1)).rgb);
+ float pixelLumUpLeft = getLum(textureOffset(renderedTexture, st, ivec2(-1,1)).rgb);
+ float pixelLumDownRight = getLum(textureOffset(renderedTexture, st, ivec2(1,-1)).rgb);
float pixelLumDownUp = pixelLumDown + pixelLumUp;
float pixelLumLeftRight = pixelLumLeft + pixelLumRight;
@@ -119,7 +131,7 @@ void main() {
pixelLumLocalAverage = 0.5 * (pixelLum2 + pixelLumCenter);
}
- vec2 currentUv = texCoord;
+ vec2 currentUv = st;
if (isHorizontal) {
currentUv.y += stepLength * 0.5;
} else {
@@ -189,8 +201,8 @@ void main() {
// ============================
// Estimating the offset:
// ============================
- float distance1 = isHorizontal ? (texCoord.x - uv1.x) : (texCoord.y - uv1.y);
- float distance2 = isHorizontal ? (uv2.x - texCoord.x) : (uv2.y - texCoord.y);
+ float distance1 = isHorizontal ? (st.x - uv1.x) : (st.y - uv1.y);
+ float distance2 = isHorizontal ? (uv2.x - st.x) : (uv2.y - st.y);
bool isDirection1 = distance1 < distance2;
float distanceFinal = min(distance1, distance2);
@@ -222,7 +234,7 @@ void main() {
// Biggest of the two offsets.
finalOffset = max(finalOffset, subPixelOffsetFinal);
- vec2 finalUV = texCoord;
+ vec2 finalUV = st;
if (isHorizontal) {
finalUV.y += finalOffset * stepLength;
} else {
diff --git a/shaders/framebuffer/hdrAndFiltering.frag b/shaders/framebuffer/hdrAndFiltering.frag
index 5c501b4eaa..cc80c55fe9 100644
--- a/shaders/framebuffer/hdrAndFiltering.frag
+++ b/shaders/framebuffer/hdrAndFiltering.frag
@@ -29,6 +29,7 @@
#define HSV_COLOR 0u
#define HSL_COLOR 1u
+in vec2 texCoord;
layout (location = 0) out vec4 finalColor;
uniform float hdrExposure;
@@ -38,13 +39,24 @@ uniform float Hue;
uniform float Saturation;
uniform float Value;
uniform float Lightness;
+uniform vec4 Viewport;
+uniform vec2 Resolution;
uniform sampler2D hdrFeedingTexture;
-in vec2 texCoord;
-
void main() {
- vec4 color = texture(hdrFeedingTexture, texCoord);
+ // Modify the texCoord based on the Viewport and Resolution. This modification is
+ // necessary in case of side-by-side stereo as we only want to access the part of the
+ // feeding texture that we are currently responsible for. Otherwise we would map the
+ // entire feeding texture into our half of the result texture, leading to a doubling
+ // of the "missing" half. If you don't believe me, load a configuration file with the
+ // side_by_side stereo mode enabled, disable FXAA, and remove this modification.
+ // The same calculation is done in the FXAA shader
+ vec2 st = texCoord;
+ st.x = st.x / (Resolution.x / Viewport[2]) + (Viewport[0] / Resolution.x);
+ st.y = st.y / (Resolution.y / Viewport[3]) + (Viewport[1] / Resolution.y);
+
+ vec4 color = texture(hdrFeedingTexture, st);
color.rgb *= blackoutFactor;
// Applies TMO
diff --git a/shaders/framebuffer/mergeDownscaledVolume.frag b/shaders/framebuffer/mergeDownscaledVolume.frag
index 034ea8c5b9..f331461ff6 100644
--- a/shaders/framebuffer/mergeDownscaledVolume.frag
+++ b/shaders/framebuffer/mergeDownscaledVolume.frag
@@ -24,14 +24,26 @@
#version __CONTEXT__
+in vec2 texCoord;
layout (location = 0) out vec4 finalColor;
uniform sampler2D downscaledRenderedVolume;
uniform sampler2D downscaledRenderedVolumeDepth;
-
-in vec2 texCoord;
+uniform vec4 viewport;
+uniform vec2 resolution;
void main() {
- finalColor = texture(downscaledRenderedVolume, texCoord);
- gl_FragDepth = texture(downscaledRenderedVolumeDepth, texCoord).r;
+ // Modify the texCoord based on the Viewport and Resolution. This modification is
+ // necessary in case of side-by-side stereo as we only want to access the part of the
+ // feeding texture that we are currently responsible for. Otherwise we would map the
+ // entire feeding texture into our half of the result texture, leading to a doubling
+ // of the "missing" half. If you don't believe me, load a configuration file with the
+ // side_by_side stereo mode enabled, disable FXAA, and remove this modification
+ // The same calculation is done in the HDR resolving shader
+ vec2 st = texCoord;
+ st.x = st.x / (resolution.x / viewport[2]) + (viewport[0] / resolution.x);
+ st.y = st.y / (resolution.y / viewport[3]) + (viewport[1] / resolution.y);
+
+ finalColor = texture(downscaledRenderedVolume, st);
+ gl_FragDepth = texture(downscaledRenderedVolumeDepth, st).r;
}
diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp
index b4815e9cc4..b90779a4f4 100644
--- a/src/interaction/orbitalnavigator.cpp
+++ b/src/interaction/orbitalnavigator.cpp
@@ -254,7 +254,12 @@ OrbitalNavigator::OrbitalNavigator()
, _joystickSensitivity(JoystickSensitivityInfo, 10.f, 1.0f, 50.f)
, _websocketSensitivity(WebsocketSensitivityInfo, 5.f, 1.0f, 50.f)
, _useAdaptiveStereoscopicDepth(UseAdaptiveStereoscopicDepthInfo, true)
- , _stereoscopicDepthOfFocusSurface(StereoscopicDepthOfFocusSurfaceInfo, 8, 0.25, 100)
+ , _stereoscopicDepthOfFocusSurface(
+ StereoscopicDepthOfFocusSurfaceInfo,
+ 200000,
+ 0.25,
+ 500000
+ )
, _staticViewScaleExponent(StaticViewScaleExponentInfo, 0.f, -30, 10)
, _retargetInterpolationTime(RetargetInterpolationTimeInfo, 2.0, 0.0, 10.0)
, _stereoInterpolationTime(StereoInterpolationTimeInfo, 8.0, 0.0, 10.0)
@@ -386,6 +391,7 @@ OrbitalNavigator::OrbitalNavigator()
addProperty(_useAdaptiveStereoscopicDepth);
addProperty(_staticViewScaleExponent);
+ _stereoscopicDepthOfFocusSurface.setExponent(10.f);
addProperty(_stereoscopicDepthOfFocusSurface);
addProperty(_retargetInterpolationTime);
diff --git a/src/properties/property.cpp b/src/properties/property.cpp
index 1863bdd262..342e4c8fb5 100644
--- a/src/properties/property.cpp
+++ b/src/properties/property.cpp
@@ -35,7 +35,6 @@ namespace {
constexpr const char* MetaDataKeyReadOnly = "isReadOnly";
constexpr const char* MetaDataKeyViewOptions = "ViewOptions";
constexpr const char* MetaDataKeyVisibility = "Visibility";
-
} // namespace
namespace openspace::properties {
@@ -44,7 +43,7 @@ Property::OnChangeHandle Property::OnChangeHandleAll =
std::numeric_limits::max();
const char* Property::ViewOptions::Color = "Color";
-const char* Property::ViewOptions::Logarithmic = "Logarithmic";
+const char* Property::ViewOptions::MinMaxRange = "MinMaxRange";
const char* Property::IdentifierKey = "Identifier";
const char* Property::NameKey = "Name";
@@ -55,7 +54,6 @@ const char* Property::MetaDataKey = "MetaData";
const char* Property::AdditionalDataKey = "AdditionalData";
-
std::string sanitizeString(const std::string& s) {
std::string result;
diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp
index 83cfb75836..f25d3aa4e2 100644
--- a/src/rendering/framebufferrenderer.cpp
+++ b/src/rendering/framebufferrenderer.cpp
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -75,17 +76,18 @@ namespace {
constexpr const glm::vec4 PosBufferClearVal = { 1e32, 1e32, 1e32, 1.f };
- constexpr const std::array HDRUniformNames = {
+ constexpr const std::array HDRUniformNames = {
"hdrFeedingTexture", "blackoutFactor", "hdrExposure", "gamma",
- "Hue", "Saturation", "Value"
+ "Hue", "Saturation", "Value", "Viewport", "Resolution"
};
- constexpr const std::array FXAAUniformNames = {
- "renderedTexture", "inverseScreenSize"
+ constexpr const std::array FXAAUniformNames = {
+ "renderedTexture", "inverseScreenSize", "Viewport", "Resolution"
};
- constexpr const std::array DownscaledVolumeUniformNames = {
- "downscaledRenderedVolume", "downscaledRenderedVolumeDepth"
+ constexpr const std::array DownscaledVolumeUniformNames = {
+ "downscaledRenderedVolume", "downscaledRenderedVolumeDepth", "viewport",
+ "resolution"
};
constexpr const char* ExitFragmentShaderPath =
@@ -447,7 +449,7 @@ void FramebufferRenderer::deferredcastersChanged(Deferredcaster&,
_dirtyDeferredcastData = true;
}
-void FramebufferRenderer::applyTMO(float blackoutFactor) {
+void FramebufferRenderer::applyTMO(float blackoutFactor, const glm::ivec4& viewport) {
ZoneScoped
TracyGpuZone("applyTMO")
@@ -468,6 +470,8 @@ void FramebufferRenderer::applyTMO(float blackoutFactor) {
_hdrFilteringProgram->setUniform(_hdrUniformCache.Hue, _hue);
_hdrFilteringProgram->setUniform(_hdrUniformCache.Saturation, _saturation);
_hdrFilteringProgram->setUniform(_hdrUniformCache.Value, _value);
+ _hdrFilteringProgram->setUniform(_hdrUniformCache.Viewport, glm::vec4(viewport));
+ _hdrFilteringProgram->setUniform(_hdrUniformCache.Resolution, glm::vec2(_resolution));
glDepthMask(false);
glDisable(GL_DEPTH_TEST);
@@ -482,7 +486,7 @@ void FramebufferRenderer::applyTMO(float blackoutFactor) {
_hdrFilteringProgram->deactivate();
}
-void FramebufferRenderer::applyFXAA() {
+void FramebufferRenderer::applyFXAA(const glm::ivec4& viewport) {
_fxaaProgram->activate();
ghoul::opengl::TextureUnit renderedTextureUnit;
@@ -497,8 +501,10 @@ void FramebufferRenderer::applyFXAA() {
renderedTextureUnit
);
- glm::vec2 inverseScreenSize(1.f/_resolution.x, 1.f/_resolution.y);
+ glm::vec2 inverseScreenSize = glm::vec2(1.f / _resolution.x, 1.f / _resolution.y);
_fxaaProgram->setUniform(_fxaaUniformCache.inverseScreenSize, inverseScreenSize);
+ _fxaaProgram->setUniform(_fxaaUniformCache.Viewport, glm::vec4(viewport));
+ _fxaaProgram->setUniform(_fxaaUniformCache.Resolution, glm::vec2(_resolution));
glDepthMask(false);
glDisable(GL_DEPTH_TEST);
@@ -532,8 +538,8 @@ void FramebufferRenderer::updateDownscaleTextures() {
);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- float volumeBorderColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
- glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, volumeBorderColor);
+ constexpr const float VolumeBorderColor[] = { 0.f, 0.f, 0.f, 1.f };
+ glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, VolumeBorderColor);
glBindTexture(GL_TEXTURE_2D, _downscaleVolumeRendering.depthbuffer);
glTexImage2D(
@@ -555,7 +561,7 @@ void FramebufferRenderer::updateDownscaleTextures() {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
-void FramebufferRenderer::writeDownscaledVolume() {
+void FramebufferRenderer::writeDownscaledVolume(const glm::ivec4& viewport) {
_downscaledVolumeProgram->activate();
ghoul::opengl::TextureUnit downscaledTextureUnit;
@@ -582,6 +588,18 @@ void FramebufferRenderer::writeDownscaledVolume() {
downscaledDepthUnit
);
+ _downscaledVolumeProgram->setUniform(
+ _writeDownscaledVolumeUniformCache.viewport,
+ static_cast(viewport[0]),
+ static_cast(viewport[1]),
+ static_cast(viewport[2]),
+ static_cast(viewport[3])
+ );
+ _downscaledVolumeProgram->setUniform(
+ _writeDownscaledVolumeUniformCache.resolution,
+ glm::vec2(_resolution)
+ );
+
glEnablei(GL_BLEND, 0);
@@ -1103,8 +1121,10 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO);
global::renderEngine->openglStateCache().setDefaultFramebuffer(_defaultFBO);
- GLint viewport[4] = { 0 };
- global::renderEngine->openglStateCache().viewport(viewport);
+ GLint vp[4] = { 0 };
+ glGetIntegerv(GL_VIEWPORT, vp);
+ global::renderEngine->openglStateCache().setViewportState(vp);
+ glm::ivec4 viewport = glm::ivec4(vp[0], vp[1], vp[2], vp[3]);
// Reset Render Pipeline State
global::renderEngine->openglStateCache().resetCachedStates();
@@ -1120,9 +1140,6 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac
ZoneScopedN("Deferred G-Buffer")
TracyGpuZone("Deferred G-Buffer")
- GLint vp[4] = {viewport[0], viewport[1], _resolution.x, _resolution.y};
- global::renderEngine->openglStateCache().setViewportState(vp);
-
glBindFramebuffer(GL_FRAMEBUFFER, _gBuffers.framebuffer);
glDrawBuffers(3, ColorAttachmentArray);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -1165,20 +1182,20 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac
{
TracyGpuZone("Raycaster Tasks")
GLDebugGroup group("Raycaster Tasks");
- performRaycasterTasks(tasks.raycasterTasks);
+ performRaycasterTasks(tasks.raycasterTasks, viewport);
}
if (!tasks.deferredcasterTasks.empty()) {
TracyGpuZone("Deferred Caster Tasks")
GLDebugGroup group("Deferred Caster Tasks");
- // We use ping pong rendering in order to be able to
- // render to the same final buffer, multiple
- // deferred tasks at same time (e.g. more than 1 ATM being seen at once)
+ // We use ping pong rendering in order to be able to render multiple deferred
+ // tasks at same time (e.g. more than 1 ATM being seen at once) to the same final
+ // buffer
glBindFramebuffer(GL_FRAMEBUFFER, _pingPongBuffers.framebuffer);
glDrawBuffers(1, &ColorAttachmentArray[_pingPongIndex]);
- performDeferredTasks(tasks.deferredcasterTasks);
+ performDeferredTasks(tasks.deferredcasterTasks, viewport);
}
glDrawBuffers(1, &ColorAttachmentArray[_pingPongIndex]);
@@ -1222,18 +1239,20 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac
TracyGpuZone("Apply TMO")
GLDebugGroup group("Apply TMO");
- applyTMO(blackoutFactor);
+ applyTMO(blackoutFactor, glm::ivec4(viewport[0], viewport[1], viewport[2], viewport[3]));
}
if (_enableFXAA) {
TracyGpuZone("Apply FXAA")
GLDebugGroup group("Apply FXAA");
glBindFramebuffer(GL_FRAMEBUFFER, _defaultFBO);
- applyFXAA();
+ applyFXAA(viewport);
}
}
-void FramebufferRenderer::performRaycasterTasks(const std::vector& tasks) {
+void FramebufferRenderer::performRaycasterTasks(const std::vector& tasks,
+ const glm::ivec4& viewport)
+{
ZoneScoped
for (const RaycasterTask& raycasterTask : tasks) {
@@ -1243,8 +1262,7 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector
glBindFramebuffer(GL_FRAMEBUFFER, _exitFramebuffer);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- GLint viewport[4] = { 0 };
- global::renderEngine->openglStateCache().viewport(viewport);
+ //global::renderEngine->openglStateCache().viewport(glm::value_ptr(viewport));
ghoul::opengl::ProgramObject* exitProgram = _exitPrograms[raycaster].get();
if (exitProgram) {
@@ -1257,10 +1275,10 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector
glBindFramebuffer(GL_FRAMEBUFFER, _downscaleVolumeRendering.framebuffer);
const float s = raycaster->downscaleRender();
GLint newVP[4] = {
- viewport[0],
- viewport[1],
- static_cast(viewport[2] * s),
- static_cast(viewport[3] * s)
+ static_cast(viewport[0] * s),
+ static_cast(viewport[1] * s),
+ static_cast(viewport[2] * s),
+ static_cast(viewport[3] * s)
};
global::renderEngine->openglStateCache().setViewportState(newVP);
@@ -1359,15 +1377,18 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector
}
if (raycaster->downscaleRender() < 1.f) {
- global::renderEngine->openglStateCache().setViewportState(viewport);
+ global::renderEngine->openglStateCache().setViewportState(
+ glm::value_ptr(viewport)
+ );
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _gBuffers.framebuffer);
- writeDownscaledVolume();
+ writeDownscaledVolume(viewport);
}
}
}
void FramebufferRenderer::performDeferredTasks(
- const std::vector& tasks)
+ const std::vector& tasks,
+ const glm::ivec4& viewport)
{
ZoneScoped
@@ -1400,6 +1421,16 @@ void FramebufferRenderer::performDeferredTasks(
mainDColorTextureUnit
);
+ deferredcastProgram->setUniform(
+ "viewport",
+ static_cast(viewport[0]),
+ static_cast(viewport[1]),
+ static_cast(viewport[2]),
+ static_cast(viewport[3])
+ );
+ deferredcastProgram->setUniform("resolution", glm::vec2(_resolution));
+
+
ghoul::opengl::TextureUnit mainPositionTextureUnit;
mainPositionTextureUnit.activate();
glBindTexture(GL_TEXTURE_2D, _gBuffers.positionTexture);
diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp
index 50ad440364..7e1010aad5 100644
--- a/src/rendering/renderengine.cpp
+++ b/src/rendering/renderengine.cpp
@@ -253,7 +253,6 @@ namespace {
};
} // namespace
-
namespace openspace {
RenderEngine::RenderEngine()
diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp
index e5891cf8a1..0611b4cdd1 100644
--- a/src/scene/scenegraphnode.cpp
+++ b/src/scene/scenegraphnode.cpp
@@ -447,6 +447,7 @@ SceneGraphNode::SceneGraphNode()
_overrideBoundingSphere = std::nullopt;
}
});
+ _boundingSphere.setExponent(10.f);
addProperty(_boundingSphere);
_interactionSphere.onChange([this]() {
if (_interactionSphere >= 0.0) {
@@ -456,6 +457,7 @@ SceneGraphNode::SceneGraphNode()
_overrideInteractionSphere = std::nullopt;
}
});
+ _interactionSphere.setExponent(10.f);
addProperty(_interactionSphere);
addProperty(_showDebugSphere);
}
diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp
index e6850227f8..fa862a73df 100644
--- a/src/util/spicemanager.cpp
+++ b/src/util/spicemanager.cpp
@@ -1362,11 +1362,31 @@ scripting::LuaLibrary SpiceManager::luaLibrary() {
},
{
"getCkCoverage",
- & luascriptfunctions::ckCoverage,
+ &luascriptfunctions::ckCoverage,
{},
"{string [, printValues]}",
"Returns a list of CK coverage intervals for the target."
},
+ {
+ "rotationMatrix",
+ &luascriptfunctions::rotationMatrix,
+ {},
+ "{string, string, string}",
+ "Returns the rotationMatrix for a given body in a frame of reference at a specific"
+ "time. The first agument is the target body, the second is the frame of reference,"
+ " the third is the time. Example: openspace.spice.rotationMatrix('"
+ "INSIGHT_LANDER_CRUISE','MARS', '2018 NOV 26 19:45:34')."
+ },
+ {
+ "position",
+ &luascriptfunctions::position,
+ {},
+ "{string, string, string, string}",
+ "Returns the position for a target by an observer in a frame of reference at a specific"
+ "time. The first agument is the target body, the second is the observer body, the third"
+ "is the frame of reference, and the fourth is the time. Example: openspace.spice."
+ "position('INSIGHT','MARS','GALACTIC', '2018 NOV 26 19:45:34')."
+ },
{
"getSpiceBodies",
&luascriptfunctions::spiceBodies,
diff --git a/src/util/spicemanager_lua.inl b/src/util/spicemanager_lua.inl
index c5e68d796b..b0c2df9b63 100644
--- a/src/util/spicemanager_lua.inl
+++ b/src/util/spicemanager_lua.inl
@@ -231,4 +231,76 @@ int ckCoverage(lua_State* L) {
return 1;
}
+/**
+ * rotationMatrix({string, string, string}):
+ * Returns the rotationMatrix for a given body in a frame of reference
+ * at a specific time.
+ */
+int rotationMatrix(lua_State* L) {
+ ghoul::lua::checkArgumentsAndThrow(L, 3, "lua::rotationMatrix");
+
+ const bool isString = (lua_isstring(L, 1) == 1) &&
+ (lua_isstring(L, 2) == 1) && (lua_isstring(L, 3) == 1);
+
+ if (!isString) {
+ LERRORC(
+ "rotationMatrix",
+ fmt::format(
+ "{}: Expected argument of type 'string' for all three agruments",
+ ghoul::lua::errorLocation(L)
+ )
+ );
+ lua_settop(L, 0);
+ ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
+ return 0;
+ }
+
+ std::string body = ghoul::lua::value(L, 1);
+ std::string frame = ghoul::lua::value(L, 2);
+ std::string date = ghoul::lua::value(L, 3);
+ const double ephemerisTime = SpiceManager::ref().ephemerisTimeFromDate(date);
+ glm::dmat3 rotationMatrix = SpiceManager::ref().frameTransformationMatrix
+ (body, frame, ephemerisTime);
+ ghoul::lua::push(L, 1, rotationMatrix);
+
+ return 1;
+}
+
+/**
+ * position({string, string, string, string}):
+ * Returns the position for a given body relative to another body,
+ * in a given frame of reference, at a specific time.
+ */
+int position(lua_State* L) {
+ ghoul::lua::checkArgumentsAndThrow(L, 4, "lua::position");
+
+ const bool isString = (lua_isstring(L, 1) == 1) &&
+ (lua_isstring(L, 2) == 1) &&
+ (lua_isstring(L, 3) == 1) &&
+ (lua_isstring(L, 4) == 1);
+
+ if (!isString) {
+ LERRORC(
+ "position",
+ fmt::format(
+ "{}: Expected argument of type 'string' for all four agruments",
+ ghoul::lua::errorLocation(L)
+ )
+ );
+ lua_settop(L, 0);
+ ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
+ return 0;
+ }
+
+ std::string target = ghoul::lua::value(L, 1);
+ std::string observer = ghoul::lua::value(L, 2);
+ std::string frame = ghoul::lua::value(L, 3);
+ std::string date = ghoul::lua::value(L, 4);
+ const double ephemerisTime = SpiceManager::ref().ephemerisTimeFromDate(date);
+ glm::dvec3 postion = SpiceManager::ref().targetPosition(target, observer, frame, {}, ephemerisTime);
+ ghoul::lua::push(L, 1, postion);
+
+ return 1;
+}
+
} // namespace openspace::luascriptfunctions