From c6b460ab74ef9843357651bda0f7eee772483efd Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Fri, 22 Nov 2019 18:11:49 -0500 Subject: [PATCH 01/10] Added planet label rendering. Added Earth's label. --- .../solarsystem/planets/earth/earth.asset | 38 +- modules/base/CMakeLists.txt | 2 + modules/base/basemodule.cpp | 3 + modules/base/rendering/renderablelabels.cpp | 449 ++++++++++++++++++ modules/base/rendering/renderablelabels.h | 108 +++++ .../rendering/renderablebillboardscloud.cpp | 1 - 6 files changed, 599 insertions(+), 2 deletions(-) create mode 100644 modules/base/rendering/renderablelabels.cpp create mode 100644 modules/base/rendering/renderablelabels.h diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index 3c90956e24..22f7b7c225 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -287,6 +287,42 @@ local Earth = { } } +local EarthLabel = { + Identifier = "EarthLabel", + Parent = Earth.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Earth", + FontSize = 100.0, + LabelSize = 6.5, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, -8.0E6, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 1.0E7, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Earth Label", + Path = "/Solar System/Planets/Earth" + } +} -assetHelper.registerSceneGraphNodesAndExport(asset, { Earth }) +assetHelper.registerSceneGraphNodesAndExport(asset, { Earth, EarthLabel }) diff --git a/modules/base/CMakeLists.txt b/modules/base/CMakeLists.txt index 2ce1e6846c..8ba250eac0 100644 --- a/modules/base/CMakeLists.txt +++ b/modules/base/CMakeLists.txt @@ -41,6 +41,7 @@ set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rendering/multimodelgeometry.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableboxgrid.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablecartesianaxes.h + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablelabels.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodel.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplane.h ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplaneimagelocal.h @@ -88,6 +89,7 @@ set(SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rendering/multimodelgeometry.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableboxgrid.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablecartesianaxes.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablelabels.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplane.cpp ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplaneimagelocal.cpp diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index ba70bd6c2e..ca0c8d4975 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -122,6 +123,7 @@ void BaseModule::internalInitialize(const ghoul::Dictionary&) { fRenderable->registerClass("RenderableBoxGrid"); fRenderable->registerClass("RenderableCartesianAxes"); + fRenderable->registerClass("RenderableLabels"); fRenderable->registerClass("RenderableModel"); fRenderable->registerClass("RenderablePlaneImageLocal"); fRenderable->registerClass("RenderablePlaneImageOnline"); @@ -189,6 +191,7 @@ std::vector BaseModule::documentations() const { DashboardItemVelocity::Documentation(), RenderableBoxGrid::Documentation(), + RenderableLabels::Documentation(), RenderableModel::Documentation(), RenderablePlane::Documentation(), RenderableSphere::Documentation(), diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp new file mode 100644 index 0000000000..9c9a3cb213 --- /dev/null +++ b/modules/base/rendering/renderablelabels.cpp @@ -0,0 +1,449 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2019 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + constexpr const char* _loggerCat = "base::RenderableLabels"; + + enum BlendMode { + BlendModeNormal = 0, + BlendModeAdditive + }; + + constexpr const int ViewDirection = 0; + constexpr const int NormalDirection = 1; + + constexpr openspace::properties::Property::PropertyInfo BlendModeInfo = { + "BlendMode", + "Blending Mode", + "This determines the blending mode that is applied to this plane." + }; + + constexpr openspace::properties::Property::PropertyInfo LabelColorInfo = { + "LabelColor", + "Label Color", + "The label color for the astronomical object." + }; + + constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = { + "FontSize", + "Font Size", + "The font size for the astronomical object labels." + }; + + constexpr openspace::properties::Property::PropertyInfo LabelSizeInfo = { + "LabelSize", + "Label Size", + "The label size for the astronomical object labels." + }; + + constexpr openspace::properties::Property::PropertyInfo LabelTextInfo = { + "LabelText", + "Label 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 TransformationMatrixInfo = { + "TransformationMatrix", + "Transformation Matrix", + "Transformation matrix to be applied to each astronomical object." + }; + + constexpr openspace::properties::Property::PropertyInfo LabelOrientationOptionInfo = { + "LabelOrientationOption", + "Label Orientation Option", + "Label orientation rendering mode." + }; + + constexpr openspace::properties::Property::PropertyInfo FadeInDistancesInfo = { + "FadeInDistances", + "Fade-In Start and End Distances", + "These values determine the initial and final distances from the center of " + "our galaxy from which the astronomical object will start and end " + "fading-in." + }; + + constexpr openspace::properties::Property::PropertyInfo DisableFadeInInfo = { + "DisableFadeIn", + "Disable Fade-in effect", + "Enables/Disables the Fade-in effect." + }; + + constexpr openspace::properties::Property::PropertyInfo + CorrectionSizeEndDistanceInfo = { + "CorrectionSizeEndDistance", + "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.", + "" + }; + + constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = { + "EnablePixelSizeControl", + "Enable pixel size control.", + "Enable pixel size control for rectangular projections." + }; +} // namespace + +namespace openspace { + +documentation::Documentation RenderableLabels::Documentation() { + using namespace documentation; + return { + "Renderable Labels", + "base_renderable_labels", + { + { + BlendModeInfo.identifier, + new StringInListVerifier({ "Normal", "Additive" }), + Optional::Yes, + BlendModeInfo.description, // + " The default value is 'Normal'.", + } + } + }; +} + +RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) + : Renderable(dictionary) + , _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown) + , _labelColor( + LabelColorInfo, + glm::vec4(1.f, 1.f, 1.f, 1.f), + glm::vec4(0.f), + glm::vec4(1.f) + ) + , _labelSize(LabelSizeInfo, 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) + , _fadeInDistance( + FadeInDistancesInfo, + glm::vec2(0.f), + glm::vec2(0.f), + glm::vec2(100.f) + ) + , _disableFadeInDistance(DisableFadeInInfo, true) + , _correctionSizeEndDistance(CorrectionSizeEndDistanceInfo, 17.f, 12.f, 25.f) + , _correctionSizeFactor(CorrectionSizeFactorInfo, 8.f, 0.f, 20.f) + , _labelOrientationOption(LabelOrientationOptionInfo, properties::OptionProperty::DisplayType::Dropdown) +{ + documentation::testSpecificationAndThrow( + Documentation(), + dictionary, + "RenderableLabels" + ); + + registerUpdateRenderBinFromOpacity(); + + _blendMode.addOptions({ + { BlendModeNormal, "Normal" }, + { BlendModeAdditive, "Additive"} + }); + _blendMode.onChange([&]() { + switch (_blendMode) { + case BlendModeNormal: + setRenderBinFromOpacity(); + break; + case BlendModeAdditive: + setRenderBin(Renderable::RenderBin::Transparent); + break; + default: + throw ghoul::MissingCaseException(); + } + }); + + if (dictionary.hasKey(BlendModeInfo.identifier)) { + const std::string v = dictionary.value(BlendModeInfo.identifier); + if (v == "Normal") { + _blendMode = BlendModeNormal; + } + else if (v == "Additive") { + _blendMode = BlendModeAdditive; + } + } + + addProperty(_blendMode); + + _labelOrientationOption.addOption(ViewDirection, "Camera View Direction"); + _labelOrientationOption.addOption(NormalDirection, "Camera Position Normal"); + + _labelOrientationOption = NormalDirection; + if (dictionary.hasKeyAndValue(LabelOrientationOptionInfo.identifier)) { + const std::string o = dictionary.value(LabelOrientationOptionInfo.identifier); + + if (o == "Camera View Direction") { + _labelOrientationOption = ViewDirection; + } + else if (o == "Camera Position Normal") { + _labelOrientationOption = NormalDirection; + } + } + + if (dictionary.hasKey(LabelTextInfo.identifier)) { + _labelText = dictionary.value(LabelTextInfo.identifier); + } + + addProperty(_labelOrientationOption); + + _labelColor.setViewOption(properties::Property::ViewOptions::Color); + if (dictionary.hasKey(LabelColorInfo.identifier)) { + _labelColor = dictionary.value(LabelColorInfo.identifier); + } + addProperty(_labelColor); + + if (dictionary.hasKey(FontSizeInfo.identifier)) { + _fontSize = dictionary.value(FontSizeInfo.identifier); + } + _fontSize.onChange([&]() { + _font = global::fontManager.font( + "Mono", + _fontSize, + ghoul::fontrendering::FontManager::Outline::Yes, + ghoul::fontrendering::FontManager::LoadGlyphs::No + ); + }); + addProperty(_fontSize); + + if (dictionary.hasKey(LabelSizeInfo.identifier)) { + _labelSize = dictionary.value(LabelSizeInfo.identifier); + } + addProperty(_labelSize); + + if (dictionary.hasKey(LabelMinSizeInfo.identifier)) { + _labelMinSize = dictionary.value(LabelMinSizeInfo.identifier); + } + addProperty(_labelMinSize); + + if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) { + _labelMaxSize = dictionary.value(LabelMaxSizeInfo.identifier); + } + addProperty(_labelMaxSize); + + if (dictionary.hasKey(TransformationMatrixInfo.identifier)) { + _transformationMatrix = dictionary.value( + TransformationMatrixInfo.identifier + ); + } + + if (dictionary.hasKey(FadeInDistancesInfo.identifier)) { + glm::vec2 v = dictionary.value(FadeInDistancesInfo.identifier); + _fadeInDistance = v; + _disableFadeInDistance = false; + addProperty(_fadeInDistance); + addProperty(_disableFadeInDistance); + } + + if (dictionary.hasKey(CorrectionSizeEndDistanceInfo.identifier)) { + _correctionSizeEndDistance = static_cast( + dictionary.value(CorrectionSizeEndDistanceInfo.identifier) + ); + } + addProperty(_correctionSizeEndDistance); + + if (dictionary.hasKey(CorrectionSizeFactorInfo.identifier)) { + _correctionSizeFactor = static_cast( + dictionary.value(CorrectionSizeFactorInfo.identifier) + ); + + addProperty(_correctionSizeFactor); + } + + + if (dictionary.hasKey(PixelSizeControlInfo.identifier)) { + _pixelSizeControl = dictionary.value(PixelSizeControlInfo.identifier); + addProperty(_pixelSizeControl); + } + + //setBoundingSphere(_size); +} + +bool RenderableLabels::isReady() const { + return true; +} + +void RenderableLabels::initialize() { + bool success = true;// loadData(); + if (!success) { + throw ghoul::RuntimeError("Error loading objects labels data."); + } + + setRenderBin(Renderable::RenderBin::Transparent); +} + +void RenderableLabels::initializeGL() { + if (_font == nullptr) { + //size_t _fontSize = 50; + _font = global::fontManager.font( + "Mono", + _fontSize, + ghoul::fontrendering::FontManager::Outline::Yes, + ghoul::fontrendering::FontManager::LoadGlyphs::No + ); + } +} + +void RenderableLabels::deinitializeGL() { +} + +void RenderableLabels::render(const RenderData& data, RendererTasks&) { + + //bool additiveBlending = (_blendMode == BlendModeAdditive); + //if (additiveBlending) { + glDepthMask(false); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + //} + + float fadeInVariable = 1.f; + if (!_disableFadeInDistance) { + float distCamera = static_cast(glm::length(data.camera.positionVec3())); + const glm::vec2 fadeRange = _fadeInDistance; + const float a = 1.f / ((fadeRange.y - fadeRange.x)); + const float b = -(fadeRange.x / (fadeRange.y - fadeRange.x)); + const float funcValue = a * distCamera + b; + fadeInVariable *= funcValue > 1.f ? 1.f : funcValue; + + if (funcValue < 0.01f) { + return; + } + } + + //glm::dmat4 modelMatrix = + // glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation + // glm::dmat4(data.modelTransform.rotation) * // Spice rotation + // glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)); + + glm::dmat4 modelMatrix(1.0); + glm::dmat4 modelViewMatrix = data.camera.combinedViewMatrix() * modelMatrix; + glm::dmat4 projectionMatrix = glm::dmat4(data.camera.projectionMatrix()); + + glm::dmat4 modelViewProjectionMatrix = projectionMatrix * modelViewMatrix; + + glm::dvec3 cameraViewDirectionWorld = -data.camera.viewDirectionWorldSpace(); + glm::dvec3 cameraUpDirectionWorld = data.camera.lookUpVectorWorldSpace(); + glm::dvec3 orthoRight = glm::normalize( + glm::cross(cameraUpDirectionWorld, cameraViewDirectionWorld) + ); + if (orthoRight == glm::dvec3(0.0)) { + glm::dvec3 otherVector( + cameraUpDirectionWorld.y, + cameraUpDirectionWorld.x, + cameraUpDirectionWorld.z + ); + orthoRight = glm::normalize(glm::cross(otherVector, cameraViewDirectionWorld)); + } + glm::dvec3 orthoUp = glm::normalize(glm::cross(cameraViewDirectionWorld, orthoRight)); + + renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVariable); + + //if (additiveBlending) { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDepthMask(true); + //} +} + +void RenderableLabels::update(const UpdateData&) { + // JCC: Change font size? +} + +void RenderableLabels::renderLabels(const RenderData& data, + const glm::dmat4& modelViewProjectionMatrix, + const glm::dvec3& orthoRight, + const glm::dvec3& orthoUp, + float fadeInVariable) +{ + glm::vec4 textColor = _labelColor; + + 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.enableFalseDepth = false; + + // We don't use spice rotation and scale + glm::vec3 transformedPos( + _transformationMatrix * glm::dvec4(data.modelTransform.translation, 1.0) + ); + + ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render( + *_font, + transformedPos, + _labelText, + textColor, + labelInfo + ); +} +} // namespace openspace diff --git a/modules/base/rendering/renderablelabels.h b/modules/base/rendering/renderablelabels.h new file mode 100644 index 0000000000..f0ee7392eb --- /dev/null +++ b/modules/base/rendering/renderablelabels.h @@ -0,0 +1,108 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2019 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_MODULE_BASE___RENDERABLELABELS___H__ +#define __OPENSPACE_MODULE_BASE___RENDERABLELABELS___H__ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace ghoul::filesystem { class File; } +namespace ghoul::fontrendering { class Font; } +namespace ghoul::opengl { + class ProgramObject; + class Texture; +} // namespace ghoul::opengl + +namespace openspace { + +struct RenderData; +struct UpdateData; + +namespace documentation { struct Documentation; } + +struct LinePoint; + +class RenderableLabels : public Renderable { +public: + RenderableLabels(const ghoul::Dictionary& dictionary); + + void initialize() override; + void initializeGL() override; + void deinitializeGL() override; + + bool isReady() const override; + + void render(const RenderData& data, RendererTasks& rendererTask) override; + void update(const UpdateData& data) override; + + static documentation::Documentation Documentation(); + +protected: + properties::OptionProperty _blendMode; + +private: + void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, + const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable); + + properties::Vec4Property _labelColor; + properties::FloatProperty _labelSize; + properties::FloatProperty _fontSize; + properties::FloatProperty _labelMinSize; + properties::FloatProperty _labelMaxSize; + properties::BoolProperty _pixelSizeControl; + properties::Vec2Property _fadeInDistance; + properties::BoolProperty _disableFadeInDistance; + properties::FloatProperty _correctionSizeEndDistance; + properties::FloatProperty _correctionSizeFactor; + + properties::OptionProperty _labelOrientationOption; + + std::shared_ptr _font; + + std::string _speckFile; + std::string _colorMapFile; + std::string _labelFile; + std::string _colorOptionString; + std::string _datavarSizeOptionString; + + std::string _labelText; + + // Data may require some type of transformation prior the spice transformation being + // applied. + glm::dmat4 _transformationMatrix = glm::dmat4(1.0); +}; + +} // namespace openspace + +#endif // __OPENSPACE_MODULE_BASE___RENDERABLELABELS___H__ diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index da42b36210..40d332b2d6 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include From 747e699d5f8b6b766cf1af3cf38df6e465ac476e Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Mon, 25 Nov 2019 13:10:11 -0500 Subject: [PATCH 02/10] Added other planets. --- .../dwarf_planets/pluto/pluto.asset | 39 ++++++++++++++++++- .../solarsystem/planets/earth/earth.asset | 2 +- .../solarsystem/planets/jupiter/jupiter.asset | 39 ++++++++++++++++++- .../scene/solarsystem/planets/mars/mars.asset | 39 ++++++++++++++++++- .../solarsystem/planets/mercury/mercury.asset | 38 +++++++++++++++++- .../solarsystem/planets/neptune/neptune.asset | 39 ++++++++++++++++++- .../solarsystem/planets/saturn/saturn.asset | 38 +++++++++++++++++- .../solarsystem/planets/uranus/uranus.asset | 39 ++++++++++++++++++- .../solarsystem/planets/venus/venus.asset | 38 +++++++++++++++++- 9 files changed, 299 insertions(+), 12 deletions(-) diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index 8d2b891b4b..b4de13d9d1 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -59,6 +59,41 @@ local Pluto = { } } +local PlutoLabel = { + Identifier = "PlutoLabel", + Parent = Pluto.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Pluto", + FontSize = 100.0, + LabelSize = 8.9, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Pluto Label", + Path = "/Solar System/Planets/Pluto" + } +} - -assetHelper.registerSceneGraphNodesAndExport(asset, { Pluto }) +assetHelper.registerSceneGraphNodesAndExport(asset, { Pluto, PlutoLabel }) diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index 22f7b7c225..d6d6c43ddc 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -307,7 +307,7 @@ local EarthLabel = { Type = "RenderableLabels", LabelText = "Earth", FontSize = 100.0, - LabelSize = 6.5, + LabelSize = 8.6, LabelMaxSize = 100.0, LabelMinSize = 1.0, BlendMode = "Additive", diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset index 9333c339c1..6cc5961b41 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset @@ -42,6 +42,41 @@ local Jupiter = { } } +local JupiterLabel = { + Identifier = "JupiterLabel", + Parent = Jupiter.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Jupiter", + FontSize = 100.0, + LabelSize = 8.6, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Jupiter Label", + Path = "/Solar System/Planets/Jupiter" + } +} - -assetHelper.registerSceneGraphNodesAndExport(asset, { Jupiter }) +assetHelper.registerSceneGraphNodesAndExport(asset, { Jupiter, JupiterLabel }) diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index 57ee23d861..5912db1141 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -187,4 +187,41 @@ local Mars = { } } -assetHelper.registerSceneGraphNodesAndExport(asset, { Mars }) +local MarsLabel = { + Identifier = "MarsLabel", + Parent = Mars.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Mars", + FontSize = 100.0, + LabelSize = 8.5, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, -8.0E6, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 1.0E7, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Mars Label", + Path = "/Solar System/Planets/Mars" + } +} + +assetHelper.registerSceneGraphNodesAndExport(asset, { Mars, MarsLabel }) diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index d2bcf7c591..868d83520d 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -223,5 +223,41 @@ local Mercury = { } } +local MercuryLabel = { + Identifier = "MercuryLabel", + Parent = Mercury.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Mercury", + FontSize = 100.0, + LabelSize = 8.3, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Mercury Label", + Path = "/Solar System/Planets/Mercury" + } +} -assetHelper.registerSceneGraphNodesAndExport(asset, { Mercury }) +assetHelper.registerSceneGraphNodesAndExport(asset, { Mercury, MercuryLabel }) diff --git a/data/assets/scene/solarsystem/planets/neptune/neptune.asset b/data/assets/scene/solarsystem/planets/neptune/neptune.asset index 677395e8e5..03016589de 100644 --- a/data/assets/scene/solarsystem/planets/neptune/neptune.asset +++ b/data/assets/scene/solarsystem/planets/neptune/neptune.asset @@ -40,4 +40,41 @@ local Neptune = { } } -assetHelper.registerSceneGraphNodesAndExport(asset, { Neptune }) +local NeptuneLabel = { + Identifier = "NeptuneLabel", + Parent = Neptune.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Neptune", + FontSize = 100.0, + LabelSize = 8.8, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Neptune Label", + Path = "/Solar System/Planets/Neptune" + } +} + +assetHelper.registerSceneGraphNodesAndExport(asset, { Neptune, NeptuneLabel }) diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index 77b45972f2..aabb1d9fb2 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -57,6 +57,42 @@ local SaturnRings = { } } +local SaturnLabel = { + Identifier = "SaturnLabel", + Parent = Saturn.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Saturn", + FontSize = 100.0, + LabelSize = 8.7, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Saturn Label", + Path = "/Solar System/Planets/Saturn" + } +} -assetHelper.registerSceneGraphNodesAndExport(asset, { Saturn, SaturnRings }) +assetHelper.registerSceneGraphNodesAndExport(asset, { Saturn, SaturnRings, SaturnLabel }) diff --git a/data/assets/scene/solarsystem/planets/uranus/uranus.asset b/data/assets/scene/solarsystem/planets/uranus/uranus.asset index 1bb29fa184..d4ec613b8c 100644 --- a/data/assets/scene/solarsystem/planets/uranus/uranus.asset +++ b/data/assets/scene/solarsystem/planets/uranus/uranus.asset @@ -42,6 +42,41 @@ local Uranus = { } } +local UranusLabel = { + Identifier = "UranusLabel", + Parent = Uranus.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Uranus", + FontSize = 100.0, + LabelSize = 8.7, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Neptune Label", + Path = "/Solar System/Planets/Uranus" + } +} - -assetHelper.registerSceneGraphNodesAndExport(asset, { Uranus }) +assetHelper.registerSceneGraphNodesAndExport(asset, { Uranus, UranusLabel }) diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 0b7617dad2..051ba208d1 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -64,6 +64,42 @@ local Venus = { } } +local VenusLabel = { + Identifier = "VenusLabel", + Parent = Venus.Identifier, + -- Transform = { + -- Translation = { + -- Type = "SpiceTranslation", + -- Target = "EARTH", + -- Observer = "EARTH BARYCENTER" + -- }, + -- -- Rotation = { + -- -- Type = "SpiceRotation", + -- -- SourceFrame = "IAU_MOON", + -- -- DestinationFrame = "GALACTIC" + -- -- } + -- }, + Renderable = { + Enabled = true, + Type = "RenderableLabels", + LabelText = "Venus", + FontSize = 100.0, + LabelSize = 8.4, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + BlendMode = "Additive", + TransformationMatrix = { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Venus Label", + Path = "/Solar System/Planets/Venus" + } +} -assetHelper.registerSceneGraphNodesAndExport(asset, { Venus }) +assetHelper.registerSceneGraphNodesAndExport(asset, { Venus, VenusLabel }) From dfb08b98e5aec3db4cc0c382a270a2557a97b614 Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Mon, 25 Nov 2019 13:15:31 -0500 Subject: [PATCH 03/10] Removed unused code. --- modules/base/rendering/renderablelabels.cpp | 31 --------------------- modules/base/rendering/renderablelabels.h | 4 +-- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp index 9c9a3cb213..1e71a91ed4 100644 --- a/modules/base/rendering/renderablelabels.cpp +++ b/modules/base/rendering/renderablelabels.cpp @@ -127,19 +127,6 @@ namespace { "Enables/Disables the Fade-in effect." }; - constexpr openspace::properties::Property::PropertyInfo - CorrectionSizeEndDistanceInfo = { - "CorrectionSizeEndDistance", - "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.", - "" - }; - constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = { "EnablePixelSizeControl", "Enable pixel size control.", @@ -186,8 +173,6 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) glm::vec2(100.f) ) , _disableFadeInDistance(DisableFadeInInfo, true) - , _correctionSizeEndDistance(CorrectionSizeEndDistanceInfo, 17.f, 12.f, 25.f) - , _correctionSizeFactor(CorrectionSizeFactorInfo, 8.f, 0.f, 20.f) , _labelOrientationOption(LabelOrientationOptionInfo, properties::OptionProperty::DisplayType::Dropdown) { documentation::testSpecificationAndThrow( @@ -296,22 +281,6 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) addProperty(_disableFadeInDistance); } - if (dictionary.hasKey(CorrectionSizeEndDistanceInfo.identifier)) { - _correctionSizeEndDistance = static_cast( - dictionary.value(CorrectionSizeEndDistanceInfo.identifier) - ); - } - addProperty(_correctionSizeEndDistance); - - if (dictionary.hasKey(CorrectionSizeFactorInfo.identifier)) { - _correctionSizeFactor = static_cast( - dictionary.value(CorrectionSizeFactorInfo.identifier) - ); - - addProperty(_correctionSizeFactor); - } - - if (dictionary.hasKey(PixelSizeControlInfo.identifier)) { _pixelSizeControl = dictionary.value(PixelSizeControlInfo.identifier); addProperty(_pixelSizeControl); diff --git a/modules/base/rendering/renderablelabels.h b/modules/base/rendering/renderablelabels.h index f0ee7392eb..9c424964c7 100644 --- a/modules/base/rendering/renderablelabels.h +++ b/modules/base/rendering/renderablelabels.h @@ -83,9 +83,7 @@ private: properties::BoolProperty _pixelSizeControl; properties::Vec2Property _fadeInDistance; properties::BoolProperty _disableFadeInDistance; - properties::FloatProperty _correctionSizeEndDistance; - properties::FloatProperty _correctionSizeFactor; - + properties::OptionProperty _labelOrientationOption; std::shared_ptr _font; From ef2d14d7fa872c5aac35fcc896b7b7c273daf381 Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Mon, 25 Nov 2019 13:30:39 -0500 Subject: [PATCH 04/10] Changed default label's orientation. --- .../assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset | 3 ++- data/assets/scene/solarsystem/planets/earth/earth.asset | 5 +++-- data/assets/scene/solarsystem/planets/jupiter/jupiter.asset | 1 + data/assets/scene/solarsystem/planets/mars/mars.asset | 1 + data/assets/scene/solarsystem/planets/mercury/mercury.asset | 1 + data/assets/scene/solarsystem/planets/neptune/neptune.asset | 1 + data/assets/scene/solarsystem/planets/saturn/saturn.asset | 1 + data/assets/scene/solarsystem/planets/uranus/uranus.asset | 1 + data/assets/scene/solarsystem/planets/venus/venus.asset | 1 + 9 files changed, 12 insertions(+), 3 deletions(-) diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index b4de13d9d1..8f2d2f3036 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -83,6 +83,7 @@ local PlutoLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, BlendMode = "Additive", + LabelOrientationOption = "Camera View Direction", TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, @@ -92,7 +93,7 @@ local PlutoLabel = { }, GUI = { Name = "Pluto Label", - Path = "/Solar System/Planets/Pluto" + Path = "/Solar System/Dwarf Planets/Pluto" } } diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index d6d6c43ddc..cb14706431 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -310,11 +310,12 @@ local EarthLabel = { LabelSize = 8.6, LabelMaxSize = 100.0, LabelMinSize = 1.0, + LabelOrientationOption = "Camera View Direction", BlendMode = "Additive", TransformationMatrix = { - 1.0, 0.0, 0.0, -8.0E6, + 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 1.0E7, + 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 }, }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset index 6cc5961b41..1996531c87 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset @@ -65,6 +65,7 @@ local JupiterLabel = { LabelSize = 8.6, LabelMaxSize = 100.0, LabelMinSize = 1.0, + LabelOrientationOption = "Camera View Direction", BlendMode = "Additive", TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index 5912db1141..0575f88e03 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -210,6 +210,7 @@ local MarsLabel = { LabelSize = 8.5, LabelMaxSize = 100.0, LabelMinSize = 1.0, + LabelOrientationOption = "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 868d83520d..1d24fa241d 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -246,6 +246,7 @@ local MercuryLabel = { LabelSize = 8.3, LabelMaxSize = 100.0, LabelMinSize = 1.0, + LabelOrientationOption = "Camera View Direction", BlendMode = "Additive", TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, diff --git a/data/assets/scene/solarsystem/planets/neptune/neptune.asset b/data/assets/scene/solarsystem/planets/neptune/neptune.asset index 03016589de..5e617b7286 100644 --- a/data/assets/scene/solarsystem/planets/neptune/neptune.asset +++ b/data/assets/scene/solarsystem/planets/neptune/neptune.asset @@ -63,6 +63,7 @@ local NeptuneLabel = { LabelSize = 8.8, LabelMaxSize = 100.0, LabelMinSize = 1.0, + LabelOrientationOption = "Camera View Direction", BlendMode = "Additive", TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index aabb1d9fb2..22a223eb3a 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -81,6 +81,7 @@ local SaturnLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, BlendMode = "Additive", + LabelOrientationOption = "Camera View Direction", TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, diff --git a/data/assets/scene/solarsystem/planets/uranus/uranus.asset b/data/assets/scene/solarsystem/planets/uranus/uranus.asset index d4ec613b8c..f522c2fa89 100644 --- a/data/assets/scene/solarsystem/planets/uranus/uranus.asset +++ b/data/assets/scene/solarsystem/planets/uranus/uranus.asset @@ -65,6 +65,7 @@ local UranusLabel = { LabelSize = 8.7, LabelMaxSize = 100.0, LabelMinSize = 1.0, + LabelOrientationOption = "Camera View Direction", BlendMode = "Additive", TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 051ba208d1..3572c07083 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -87,6 +87,7 @@ local VenusLabel = { LabelSize = 8.4, LabelMaxSize = 100.0, LabelMinSize = 1.0, + LabelOrientationOption = "Camera View Direction", BlendMode = "Additive", TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, From 6432f484c4d8ca0fe3eb641fa76f3b2260d969ce Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Sun, 8 Dec 2019 18:44:08 -0500 Subject: [PATCH 05/10] Changed to accpet text label updating. Added super-fine controls for fading effects. --- .../solarsystem/planets/earth/earth.asset | 7 + modules/base/rendering/renderablelabels.cpp | 321 +++++++++++++++--- modules/base/rendering/renderablelabels.h | 54 ++- 3 files changed, 328 insertions(+), 54 deletions(-) diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index cb14706431..1b735b3e66 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -312,6 +312,13 @@ local EarthLabel = { LabelMinSize = 1.0, LabelOrientationOption = "Camera View Direction", BlendMode = "Additive", + EnableFading = true, + FadeStartUnit = "au", + FadeStartDistance = 1.5, + FadeStartSpeed = 1.0, + FadeEndUnit = "au", + FadeEndDistance = 15.0, + FadeEndSpeed = 25.0, TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp index 1e71a91ed4..38a3449127 100644 --- a/modules/base/rendering/renderablelabels.cpp +++ b/modules/base/rendering/renderablelabels.cpp @@ -49,6 +49,15 @@ namespace { constexpr const char* _loggerCat = "base::RenderableLabels"; + constexpr const char* MeterUnit = "m"; + constexpr const char* KilometerUnit = "Km"; + constexpr const char* AstronomicalUnit = "au"; + constexpr const char* ParsecUnit = "pc"; + constexpr const char* KiloparsecUnit = "Kpc"; + constexpr const char* MegaparsecUnit = "Mpc"; + constexpr const char* GigaparsecUnit = "Gpc"; + constexpr const char* GigalightyearUnit = "Gly"; + enum BlendMode { BlendModeNormal = 0, BlendModeAdditive @@ -57,6 +66,8 @@ namespace { constexpr const int ViewDirection = 0; constexpr const int NormalDirection = 1; + constexpr double PARSEC = 0.308567756E17; + constexpr openspace::properties::Property::PropertyInfo BlendModeInfo = { "BlendMode", "Blending Mode", @@ -113,18 +124,10 @@ namespace { "Label orientation rendering mode." }; - constexpr openspace::properties::Property::PropertyInfo FadeInDistancesInfo = { - "FadeInDistances", - "Fade-In Start and End Distances", - "These values determine the initial and final distances from the center of " - "our galaxy from which the astronomical object will start and end " - "fading-in." - }; - - constexpr openspace::properties::Property::PropertyInfo DisableFadeInInfo = { - "DisableFadeIn", - "Disable Fade-in effect", - "Enables/Disables the Fade-in effect." + constexpr openspace::properties::Property::PropertyInfo EnableFadingEffectInfo = { + "EnableFading", + "Enable/Disable Fade-in effect", + "Enable/Disable the Fade-in effect." }; constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = { @@ -132,6 +135,42 @@ namespace { "Enable pixel size control.", "Enable pixel size control for rectangular projections." }; + + 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 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." + }; } // namespace namespace openspace { @@ -166,14 +205,15 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) , _labelMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f) , _labelMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f) , _pixelSizeControl(PixelSizeControlInfo, false) - , _fadeInDistance( - FadeInDistancesInfo, - glm::vec2(0.f), - glm::vec2(0.f), - glm::vec2(100.f) - ) - , _disableFadeInDistance(DisableFadeInInfo, true) + , _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, properties::OptionProperty::DisplayType::Dropdown) + , _fadeStartUnitOption(FadeStartUnitOptionInfo, properties::OptionProperty::DisplayType::Dropdown) + , _fadeEndUnitOption(FadeEndUnitOptionInfo, properties::OptionProperty::DisplayType::Dropdown) { documentation::testSpecificationAndThrow( Documentation(), @@ -230,6 +270,7 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) if (dictionary.hasKey(LabelTextInfo.identifier)) { _labelText = dictionary.value(LabelTextInfo.identifier); } + addProperty(_labelText); addProperty(_labelOrientationOption); @@ -273,19 +314,135 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) ); } - if (dictionary.hasKey(FadeInDistancesInfo.identifier)) { - glm::vec2 v = dictionary.value(FadeInDistancesInfo.identifier); - _fadeInDistance = v; - _disableFadeInDistance = false; - addProperty(_fadeInDistance); - addProperty(_disableFadeInDistance); - } - if (dictionary.hasKey(PixelSizeControlInfo.identifier)) { _pixelSizeControl = dictionary.value(PixelSizeControlInfo.identifier); addProperty(_pixelSizeControl); } + if (dictionary.hasKey(EnableFadingEffectInfo.identifier)) { + _enableFadingEffect = dictionary.value(EnableFadingEffectInfo.identifier); + } + addProperty(_enableFadingEffect); + + if (dictionary.hasKey(FadeStartDistInfo.identifier)) { + _fadeStartDistance = dictionary.value(FadeStartDistInfo.identifier); + } + + addProperty(_fadeStartDistance); + + _fadeStartUnitOption.addOption(Meter, MeterUnit); + _fadeStartUnitOption.addOption(Kilometer, KilometerUnit); + _fadeStartUnitOption.addOption(AU, AstronomicalUnit); + _fadeStartUnitOption.addOption(Parsec, ParsecUnit); + _fadeStartUnitOption.addOption(Kiloparsec, KiloparsecUnit); + _fadeStartUnitOption.addOption(Megaparsec, MegaparsecUnit); + _fadeStartUnitOption.addOption(Gigaparsec, GigaparsecUnit); + _fadeStartUnitOption.addOption(GigalightYears, GigalightyearUnit); + + _fadeStartUnitOption = AU; + + if (dictionary.hasKey(FadeStartUnitOptionInfo.identifier)) { + std::string unit = dictionary.value(FadeStartUnitOptionInfo.identifier); + if (unit == MeterUnit) { + _fadeStartUnitOption = Meter; + } + else if (unit == KilometerUnit) { + _fadeStartUnitOption = Kilometer; + } + else if (unit == AstronomicalUnit) { + _fadeStartUnitOption = AU; + } + else if (unit == ParsecUnit) { + _fadeStartUnitOption = Parsec; + } + else if (unit == KiloparsecUnit) { + _fadeStartUnitOption = Kiloparsec; + } + else if (unit == MegaparsecUnit) { + _fadeStartUnitOption = Megaparsec; + } + else if (unit == GigaparsecUnit) { + _fadeStartUnitOption = Gigaparsec; + } + else if (unit == GigalightyearUnit) { + _fadeStartUnitOption = GigalightYears; + } + else { + LWARNING( + "No unit given for RenderableLabels. Using kilometer as units." + ); + _fadeStartUnitOption = Kilometer; + } + } + + addProperty(_fadeStartUnitOption); + + if (dictionary.hasKey(FadeStartSpeedInfo.identifier)) { + _fadeStartSpeed = dictionary.value(FadeStartSpeedInfo.identifier); + } + + addProperty(_fadeStartSpeed); + + if (dictionary.hasKey(FadeEndDistInfo.identifier)) { + _fadeEndDistance = dictionary.value(FadeEndDistInfo.identifier); + } + + addProperty(_fadeEndDistance); + + _fadeEndUnitOption.addOption(Meter, MeterUnit); + _fadeEndUnitOption.addOption(Kilometer, KilometerUnit); + _fadeEndUnitOption.addOption(AU, AstronomicalUnit); + _fadeEndUnitOption.addOption(Parsec, ParsecUnit); + _fadeEndUnitOption.addOption(Kiloparsec, KiloparsecUnit); + _fadeEndUnitOption.addOption(Megaparsec, MegaparsecUnit); + _fadeEndUnitOption.addOption(Gigaparsec, GigaparsecUnit); + _fadeEndUnitOption.addOption(GigalightYears, GigalightyearUnit); + + _fadeEndUnitOption = AU; + + if (dictionary.hasKey(FadeEndUnitOptionInfo.identifier)) { + std::string unit = dictionary.value(FadeEndUnitOptionInfo.identifier); + if (unit == MeterUnit) { + _fadeEndUnitOption = Meter; + } + else if (unit == KilometerUnit) { + _fadeEndUnitOption = Kilometer; + } + else if (unit == AstronomicalUnit) { + _fadeEndUnitOption = AU; + } + else if (unit == ParsecUnit) { + _fadeEndUnitOption = Parsec; + } + else if (unit == KiloparsecUnit) { + _fadeEndUnitOption = Kiloparsec; + } + else if (unit == MegaparsecUnit) { + _fadeEndUnitOption = Megaparsec; + } + else if (unit == GigaparsecUnit) { + _fadeEndUnitOption = Gigaparsec; + } + else if (unit == GigalightyearUnit) { + _fadeEndUnitOption = GigalightYears; + } + else { + LWARNING( + "No unit given for RenderableLabels. Using kilometer as units." + ); + _fadeEndUnitOption = Kilometer; + } + } + + addProperty(_fadeEndUnitOption); + + if (dictionary.hasKey(FadeEndSpeedInfo.identifier)) { + _fadeEndSpeed = dictionary.value(FadeEndSpeedInfo.identifier); + } + + addProperty(_fadeEndSpeed); + + //setBoundingSphere(_size); } @@ -326,24 +483,20 @@ void RenderableLabels::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 float a = 1.f / ((fadeRange.y - fadeRange.x)); - const float b = -(fadeRange.x / (fadeRange.y - fadeRange.x)); - const float funcValue = a * distCamera + b; - fadeInVariable *= funcValue > 1.f ? 1.f : funcValue; - - if (funcValue < 0.01f) { - return; - } + + if (_enableFadingEffect) { + float distanceNodeToCamera = glm::distance( + data.camera.positionVec3(), + data.modelTransform.translation + ); + float sUnit = getUnit(_fadeStartUnitOption); + float eUnit = getUnit(_fadeEndUnitOption); + float startX = _fadeStartDistance * sUnit; + float endX = _fadeEndDistance * eUnit; + //fadeInVariable = changedPerlinSmoothStepFunc(distanceNodeToCamera, startX, endX); + fadeInVariable = linearSmoothStepFunc(distanceNodeToCamera, startX, endX, sUnit, eUnit); } - //glm::dmat4 modelMatrix = - // glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation - // glm::dmat4(data.modelTransform.rotation) * // Spice rotation - // glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)); - glm::dmat4 modelMatrix(1.0); glm::dmat4 modelViewMatrix = data.camera.combinedViewMatrix() * modelMatrix; glm::dmat4 projectionMatrix = glm::dmat4(data.camera.projectionMatrix()); @@ -374,7 +527,10 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) { } void RenderableLabels::update(const UpdateData&) { - // JCC: Change font size? +} + +void RenderableLabels::setLabelText(const std::string & newText) { + _labelText = newText; } void RenderableLabels::renderLabels(const RenderData& data, @@ -415,4 +571,81 @@ void RenderableLabels::renderLabels(const RenderData& data, labelInfo ); } + +float RenderableLabels::changedPerlinSmoothStepFunc(const float x, + const float startX, + const 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; + + 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); + } +} + +float RenderableLabels::linearSmoothStepFunc(const float x, + const float startX, + const float endX, + const float sUnit, + const 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); + } +} + +float RenderableLabels::getUnit(int unit) const { + + float scale = 0.f; + switch (static_cast(unit)) { + case Meter: + scale = 1.f; + break; + case Kilometer: + scale = 1e3f; + break; + case AU: + scale = 149597870700.f; + break; + case Parsec: + scale = static_cast(PARSEC); + break; + case Kiloparsec: + scale = static_cast(1e3 * PARSEC); + break; + case Megaparsec: + scale = static_cast(1e6 * PARSEC); + break; + case Gigaparsec: + scale = static_cast(1e9 * PARSEC); + break; + case GigalightYears: + scale = static_cast(306391534.73091 * PARSEC); + break; + } + + return scale; +} } // namespace openspace diff --git a/modules/base/rendering/renderablelabels.h b/modules/base/rendering/renderablelabels.h index 9c424964c7..491755f825 100644 --- a/modules/base/rendering/renderablelabels.h +++ b/modules/base/rendering/renderablelabels.h @@ -54,6 +54,18 @@ namespace documentation { struct Documentation; } struct LinePoint; class RenderableLabels : public Renderable { +private: + enum Unit { + Meter = 0, + Kilometer = 1, + AU = 2, + Parsec = 3, + Kiloparsec = 4, + Megaparsec = 5, + Gigaparsec = 6, + GigalightYears = 7 + }; + public: RenderableLabels(const ghoul::Dictionary& dictionary); @@ -68,6 +80,8 @@ public: static documentation::Documentation Documentation(); + void setLabelText(const std::string & newText); + protected: properties::OptionProperty _blendMode; @@ -75,16 +89,38 @@ private: void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable); - properties::Vec4Property _labelColor; - properties::FloatProperty _labelSize; - properties::FloatProperty _fontSize; - properties::FloatProperty _labelMinSize; - properties::FloatProperty _labelMaxSize; - properties::BoolProperty _pixelSizeControl; - properties::Vec2Property _fadeInDistance; - properties::BoolProperty _disableFadeInDistance; + float changedPerlinSmoothStepFunc( + const float x, + const float startX, + const float endX + ) const; + float linearSmoothStepFunc( + const float x, + const float startX, + const float endX, + const float sUnit, + const float eUnit + ) const; + + float getUnit(int unit) const; + + properties::Vec4Property _labelColor; + properties::FloatProperty _labelSize; + 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::OptionProperty _labelOrientationOption; + properties::OptionProperty _fadeStartUnitOption; + properties::OptionProperty _fadeEndUnitOption; std::shared_ptr _font; @@ -94,8 +130,6 @@ private: std::string _colorOptionString; std::string _datavarSizeOptionString; - std::string _labelText; - // Data may require some type of transformation prior the spice transformation being // applied. glm::dmat4 _transformationMatrix = glm::dmat4(1.0); From 140de3d808b0f46bbe4cc217adbd8bfdcee7cdfc Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Tue, 10 Dec 2019 12:55:58 -0500 Subject: [PATCH 06/10] Added automatic documentation and Sun's label. --- data/assets/scene/solarsystem/sun/sun.asset | 35 +++++++- modules/base/rendering/renderablelabels.cpp | 98 ++++++++++++++++++++- 2 files changed, 131 insertions(+), 2 deletions(-) diff --git a/data/assets/scene/solarsystem/sun/sun.asset b/data/assets/scene/solarsystem/sun/sun.asset index cc887dc4d2..81f72297f9 100644 --- a/data/assets/scene/solarsystem/sun/sun.asset +++ b/data/assets/scene/solarsystem/sun/sun.asset @@ -27,4 +27,37 @@ local Sun = { } } -assetHelper.registerSceneGraphNodesAndExport(asset, { Sun }) +local SunLabel = { + Identifier = "SunLabel", + Parent = Sun.Identifier, + Renderable = { + Enabled = false, + Type = "RenderableLabels", + LabelText = "Sun", + FontSize = 100.0, + LabelSize = 8.6, + LabelMaxSize = 100.0, + LabelMinSize = 1.0, + LabelOrientationOption = "Camera View Direction", + BlendMode = "Additive", + EnableFading = true, + FadeStartUnit = "pc", + FadeStartDistance = 0.1, + FadeStartSpeed = 1.0, + FadeEndUnit = "pc", + FadeEndDistance = 1.0, + FadeEndSpeed = 4.0, + TransformationMatrix = { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0 + }, + }, + GUI = { + Name = "Sun Label", + Path = "/Solar System/Sun" + } +} + +assetHelper.registerSceneGraphNodesAndExport(asset, { Sun, SunLabel }) diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp index 38a3449127..ff20e8cbad 100644 --- a/modules/base/rendering/renderablelabels.cpp +++ b/modules/base/rendering/renderablelabels.cpp @@ -186,7 +186,103 @@ documentation::Documentation RenderableLabels::Documentation() { new StringInListVerifier({ "Normal", "Additive" }), Optional::Yes, BlendModeInfo.description, // + " The default value is 'Normal'.", - } + }, + { + LabelOrientationOptionInfo.identifier, + new StringInListVerifier({ "Camera View Direction", "Camera Position Normal" }), + Optional::Yes, + LabelOrientationOptionInfo.description, + }, + { + LabelColorInfo.identifier, + new DoubleVector4Verifier, + Optional::Yes, + LabelColorInfo.description, + }, + { + LabelColorInfo.identifier, + new DoubleVector4Verifier, + Optional::Yes, + LabelColorInfo.description, + }, + { + LabelTextInfo.identifier, + new StringVerifier, + Optional::No, + LabelTextInfo.description + }, + { + FontSizeInfo.identifier, + new DoubleVerifier, + Optional::Yes, + FontSizeInfo.description + }, + { + LabelSizeInfo.identifier, + new DoubleVerifier, + Optional::Yes, + LabelSizeInfo.description + }, + { + LabelMinSizeInfo.identifier, + new DoubleVerifier, + Optional::Yes, + LabelMinSizeInfo.description + }, + { + LabelMaxSizeInfo.identifier, + new DoubleVerifier, + Optional::Yes, + LabelMaxSizeInfo.description + }, + { + EnableFadingEffectInfo.identifier, + new BoolVerifier, + Optional::Yes, + EnableFadingEffectInfo.description + }, + { + PixelSizeControlInfo.identifier, + new BoolVerifier, + Optional::Yes, + PixelSizeControlInfo.description + }, + { + FadeStartUnitOptionInfo.identifier, + new StringInListVerifier({"m", "Km", "au", "pc", "Kpc", "Mpc", "Gpc", "Gly"}), + Optional::Yes, + FadeStartUnitOptionInfo.description, + }, + { + FadeEndUnitOptionInfo.identifier, + new StringInListVerifier({"m", "Km", "au", "pc", "Kpc", "Mpc", "Gpc", "Gly"}), + Optional::Yes, + FadeEndUnitOptionInfo.description, + }, + { + FadeStartDistInfo.identifier, + new DoubleVerifier, + Optional::Yes, + FadeStartDistInfo.description + }, + { + FadeEndDistInfo.identifier, + new DoubleVerifier, + Optional::Yes, + FadeEndDistInfo.description + }, + { + FadeStartSpeedInfo.identifier, + new DoubleVerifier, + Optional::Yes, + FadeStartSpeedInfo.description + }, + { + FadeEndSpeedInfo.identifier, + new DoubleVerifier, + Optional::Yes, + FadeEndSpeedInfo.description + }, } }; } From 5509fb0a6bf6cf7d5d3af44c72b1b13e07b2af5f Mon Sep 17 00:00:00 2001 From: Jonathas Costa Date: Wed, 11 Dec 2019 15:38:11 -0500 Subject: [PATCH 07/10] Added more units to refine fading controls. Updated Sun fading values. --- data/assets/scene/solarsystem/sun/sun.asset | 14 +++--- modules/base/rendering/renderablelabels.cpp | 54 +++++++++++++++++++-- modules/base/rendering/renderablelabels.h | 16 +++--- 3 files changed, 68 insertions(+), 16 deletions(-) diff --git a/data/assets/scene/solarsystem/sun/sun.asset b/data/assets/scene/solarsystem/sun/sun.asset index 81f72297f9..0ca4e4a8be 100644 --- a/data/assets/scene/solarsystem/sun/sun.asset +++ b/data/assets/scene/solarsystem/sun/sun.asset @@ -31,22 +31,22 @@ local SunLabel = { Identifier = "SunLabel", Parent = Sun.Identifier, Renderable = { - Enabled = false, + Enabled = true, Type = "RenderableLabels", LabelText = "Sun", FontSize = 100.0, - LabelSize = 8.6, + LabelSize = 13.127, LabelMaxSize = 100.0, LabelMinSize = 1.0, LabelOrientationOption = "Camera View Direction", BlendMode = "Additive", EnableFading = true, - FadeStartUnit = "pc", - FadeStartDistance = 0.1, - FadeStartSpeed = 1.0, + FadeStartUnit = "Pm", + FadeStartDistance = 2.841, + FadeStartSpeed = 1.375, FadeEndUnit = "pc", - FadeEndDistance = 1.0, - FadeEndSpeed = 4.0, + FadeEndDistance = 1.326, + FadeEndSpeed = 1.0, TransformationMatrix = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp index ff20e8cbad..a5b33f2624 100644 --- a/modules/base/rendering/renderablelabels.cpp +++ b/modules/base/rendering/renderablelabels.cpp @@ -51,7 +51,11 @@ namespace { constexpr const char* MeterUnit = "m"; constexpr const char* KilometerUnit = "Km"; + constexpr const char* MegameterUnit = "Mm"; + constexpr const char* GigameterUnit = "Gm"; constexpr const char* AstronomicalUnit = "au"; + constexpr const char* TerameterUnit = "Tm"; + constexpr const char* PetameterUnit = "Pm"; constexpr const char* ParsecUnit = "pc"; constexpr const char* KiloparsecUnit = "Kpc"; constexpr const char* MegaparsecUnit = "Mpc"; @@ -249,13 +253,13 @@ documentation::Documentation RenderableLabels::Documentation() { }, { FadeStartUnitOptionInfo.identifier, - new StringInListVerifier({"m", "Km", "au", "pc", "Kpc", "Mpc", "Gpc", "Gly"}), + new StringInListVerifier({"m", "Km", "Mm", "Gm", "au", "Tm", "Pm", "pc", "Kpc", "Mpc", "Gpc", "Gly"}), Optional::Yes, FadeStartUnitOptionInfo.description, }, { FadeEndUnitOptionInfo.identifier, - new StringInListVerifier({"m", "Km", "au", "pc", "Kpc", "Mpc", "Gpc", "Gly"}), + new StringInListVerifier({"m", "Km", "Mm", "Gm", "au", "Tm", "Pm", "pc", "Kpc", "Mpc", "Gpc", "Gly"}), Optional::Yes, FadeEndUnitOptionInfo.description, }, @@ -428,7 +432,11 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) _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); @@ -445,9 +453,21 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) else if (unit == KilometerUnit) { _fadeStartUnitOption = Kilometer; } + else if (unit == MegameterUnit) { + _fadeStartUnitOption = Megameter; + } + else if (unit == GigameterUnit) { + _fadeStartUnitOption = Gigameter; + } else if (unit == AstronomicalUnit) { _fadeStartUnitOption = AU; } + else if (unit == TerameterUnit) { + _fadeStartUnitOption = Terameter; + } + else if (unit == PetameterUnit) { + _fadeStartUnitOption = Petameter; + } else if (unit == ParsecUnit) { _fadeStartUnitOption = Parsec; } @@ -487,7 +507,11 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) _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); @@ -504,9 +528,21 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) else if (unit == KilometerUnit) { _fadeEndUnitOption = Kilometer; } + else if (unit == MegameterUnit) { + _fadeEndUnitOption = Megameter; + } + else if (unit == GigameterUnit) { + _fadeEndUnitOption = Gigameter; + } else if (unit == AstronomicalUnit) { _fadeEndUnitOption = AU; } + else if (unit == TerameterUnit) { + _fadeEndUnitOption = Terameter; + } + else if (unit == PetameterUnit) { + _fadeEndUnitOption = Petameter; + } else if (unit == ParsecUnit) { _fadeEndUnitOption = Parsec; } @@ -720,11 +756,23 @@ float RenderableLabels::getUnit(int unit) const { scale = 1.f; break; case Kilometer: - scale = 1e3f; + scale = 1e3; + break; + case Megameter: + scale = 1e6; + break; + case Gigameter: + scale = 1e9; break; case AU: scale = 149597870700.f; break; + case Terameter: + scale = 1e12; + break; + case Petameter: + scale = 1e15; + break; case Parsec: scale = static_cast(PARSEC); break; diff --git a/modules/base/rendering/renderablelabels.h b/modules/base/rendering/renderablelabels.h index 491755f825..c0fa9848e9 100644 --- a/modules/base/rendering/renderablelabels.h +++ b/modules/base/rendering/renderablelabels.h @@ -58,12 +58,16 @@ private: enum Unit { Meter = 0, Kilometer = 1, - AU = 2, - Parsec = 3, - Kiloparsec = 4, - Megaparsec = 5, - Gigaparsec = 6, - GigalightYears = 7 + Megameter = 2, + Gigameter = 3, + AU = 4, + Terameter = 5, + Petameter = 6, + Parsec = 7, + Kiloparsec = 8, + Megaparsec = 9, + Gigaparsec = 10, + GigalightYears = 11 }; public: From dfa25b28e6c3ff83efce435790268ec74fb67544 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Dec 2019 10:26:42 +0100 Subject: [PATCH 08/10] Disable labels on default Some small code cleanup --- .../dwarf_planets/pluto/pluto.asset | 20 +-- .../solarsystem/planets/earth/earth.asset | 10 +- .../solarsystem/planets/jupiter/jupiter.asset | 22 +-- .../scene/solarsystem/planets/mars/mars.asset | 14 +- .../solarsystem/planets/mercury/mercury.asset | 22 +-- .../solarsystem/planets/neptune/neptune.asset | 22 +-- .../solarsystem/planets/saturn/saturn.asset | 22 +-- .../solarsystem/planets/uranus/uranus.asset | 22 +-- .../solarsystem/planets/venus/venus.asset | 22 +-- data/assets/scene/solarsystem/sun/sun.asset | 10 +- modules/base/rendering/renderablelabels.cpp | 143 ++++++++++-------- modules/base/rendering/renderablelabels.h | 68 ++++----- 12 files changed, 129 insertions(+), 268 deletions(-) diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index 8f2d2f3036..db18a54cc1 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -62,18 +62,6 @@ local Pluto = { local PlutoLabel = { Identifier = "PlutoLabel", Parent = Pluto.Identifier, - -- Transform = { - -- Translation = { - -- Type = "SpiceTranslation", - -- Target = "EARTH", - -- Observer = "EARTH BARYCENTER" - -- }, - -- -- Rotation = { - -- -- Type = "SpiceRotation", - -- -- SourceFrame = "IAU_MOON", - -- -- DestinationFrame = "GALACTIC" - -- -- } - -- }, Renderable = { Enabled = true, Type = "RenderableLabels", @@ -83,13 +71,7 @@ local PlutoLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, BlendMode = "Additive", - LabelOrientationOption = "Camera View Direction", - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + LabelOrientationOption = "Camera View Direction" }, GUI = { Name = "Pluto Label", diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index 1b735b3e66..dc14382046 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -303,7 +303,7 @@ local EarthLabel = { -- -- } -- }, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Earth", FontSize = 100.0, @@ -318,13 +318,7 @@ local EarthLabel = { FadeStartSpeed = 1.0, FadeEndUnit = "au", FadeEndDistance = 15.0, - FadeEndSpeed = 25.0, - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + FadeEndSpeed = 25.0 }, GUI = { Name = "Earth Label", diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset index 1996531c87..1ce8b88fff 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset @@ -45,20 +45,8 @@ local Jupiter = { local JupiterLabel = { Identifier = "JupiterLabel", Parent = Jupiter.Identifier, - -- Transform = { - -- Translation = { - -- Type = "SpiceTranslation", - -- Target = "EARTH", - -- Observer = "EARTH BARYCENTER" - -- }, - -- -- Rotation = { - -- -- Type = "SpiceRotation", - -- -- SourceFrame = "IAU_MOON", - -- -- DestinationFrame = "GALACTIC" - -- -- } - -- }, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Jupiter", FontSize = 100.0, @@ -66,13 +54,7 @@ local JupiterLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, LabelOrientationOption = "Camera View Direction", - BlendMode = "Additive", - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + BlendMode = "Additive" }, GUI = { Name = "Jupiter Label", diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index 0575f88e03..cee87159c5 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -190,20 +190,8 @@ local Mars = { local MarsLabel = { Identifier = "MarsLabel", Parent = Mars.Identifier, - -- Transform = { - -- Translation = { - -- Type = "SpiceTranslation", - -- Target = "EARTH", - -- Observer = "EARTH BARYCENTER" - -- }, - -- -- Rotation = { - -- -- Type = "SpiceRotation", - -- -- SourceFrame = "IAU_MOON", - -- -- DestinationFrame = "GALACTIC" - -- -- } - -- }, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Mars", FontSize = 100.0, diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index 1d24fa241d..98bd538f33 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -226,20 +226,8 @@ local Mercury = { local MercuryLabel = { Identifier = "MercuryLabel", Parent = Mercury.Identifier, - -- Transform = { - -- Translation = { - -- Type = "SpiceTranslation", - -- Target = "EARTH", - -- Observer = "EARTH BARYCENTER" - -- }, - -- -- Rotation = { - -- -- Type = "SpiceRotation", - -- -- SourceFrame = "IAU_MOON", - -- -- DestinationFrame = "GALACTIC" - -- -- } - -- }, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Mercury", FontSize = 100.0, @@ -247,13 +235,7 @@ local MercuryLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, LabelOrientationOption = "Camera View Direction", - BlendMode = "Additive", - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + BlendMode = "Additive" }, GUI = { Name = "Mercury Label", diff --git a/data/assets/scene/solarsystem/planets/neptune/neptune.asset b/data/assets/scene/solarsystem/planets/neptune/neptune.asset index 5e617b7286..a7546d5f2a 100644 --- a/data/assets/scene/solarsystem/planets/neptune/neptune.asset +++ b/data/assets/scene/solarsystem/planets/neptune/neptune.asset @@ -43,20 +43,8 @@ local Neptune = { local NeptuneLabel = { Identifier = "NeptuneLabel", Parent = Neptune.Identifier, - -- Transform = { - -- Translation = { - -- Type = "SpiceTranslation", - -- Target = "EARTH", - -- Observer = "EARTH BARYCENTER" - -- }, - -- -- Rotation = { - -- -- Type = "SpiceRotation", - -- -- SourceFrame = "IAU_MOON", - -- -- DestinationFrame = "GALACTIC" - -- -- } - -- }, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Neptune", FontSize = 100.0, @@ -64,13 +52,7 @@ local NeptuneLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, LabelOrientationOption = "Camera View Direction", - BlendMode = "Additive", - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + BlendMode = "Additive" }, GUI = { Name = "Neptune Label", diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index 22a223eb3a..853bd1ce8b 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -60,20 +60,8 @@ local SaturnRings = { local SaturnLabel = { Identifier = "SaturnLabel", Parent = Saturn.Identifier, - -- Transform = { - -- Translation = { - -- Type = "SpiceTranslation", - -- Target = "EARTH", - -- Observer = "EARTH BARYCENTER" - -- }, - -- -- Rotation = { - -- -- Type = "SpiceRotation", - -- -- SourceFrame = "IAU_MOON", - -- -- DestinationFrame = "GALACTIC" - -- -- } - -- }, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Saturn", FontSize = 100.0, @@ -81,13 +69,7 @@ local SaturnLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, BlendMode = "Additive", - LabelOrientationOption = "Camera View Direction", - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + LabelOrientationOption = "Camera View Direction" }, GUI = { Name = "Saturn Label", diff --git a/data/assets/scene/solarsystem/planets/uranus/uranus.asset b/data/assets/scene/solarsystem/planets/uranus/uranus.asset index f522c2fa89..758f87f998 100644 --- a/data/assets/scene/solarsystem/planets/uranus/uranus.asset +++ b/data/assets/scene/solarsystem/planets/uranus/uranus.asset @@ -45,20 +45,8 @@ local Uranus = { local UranusLabel = { Identifier = "UranusLabel", Parent = Uranus.Identifier, - -- Transform = { - -- Translation = { - -- Type = "SpiceTranslation", - -- Target = "EARTH", - -- Observer = "EARTH BARYCENTER" - -- }, - -- -- Rotation = { - -- -- Type = "SpiceRotation", - -- -- SourceFrame = "IAU_MOON", - -- -- DestinationFrame = "GALACTIC" - -- -- } - -- }, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Uranus", FontSize = 100.0, @@ -66,13 +54,7 @@ local UranusLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, LabelOrientationOption = "Camera View Direction", - BlendMode = "Additive", - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + BlendMode = "Additive" }, GUI = { Name = "Neptune Label", diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 3572c07083..52cfe29303 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -67,20 +67,8 @@ local Venus = { local VenusLabel = { Identifier = "VenusLabel", Parent = Venus.Identifier, - -- Transform = { - -- Translation = { - -- Type = "SpiceTranslation", - -- Target = "EARTH", - -- Observer = "EARTH BARYCENTER" - -- }, - -- -- Rotation = { - -- -- Type = "SpiceRotation", - -- -- SourceFrame = "IAU_MOON", - -- -- DestinationFrame = "GALACTIC" - -- -- } - -- }, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Venus", FontSize = 100.0, @@ -88,13 +76,7 @@ local VenusLabel = { LabelMaxSize = 100.0, LabelMinSize = 1.0, LabelOrientationOption = "Camera View Direction", - BlendMode = "Additive", - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + BlendMode = "Additive" }, GUI = { Name = "Venus Label", diff --git a/data/assets/scene/solarsystem/sun/sun.asset b/data/assets/scene/solarsystem/sun/sun.asset index 0ca4e4a8be..9d44fb2462 100644 --- a/data/assets/scene/solarsystem/sun/sun.asset +++ b/data/assets/scene/solarsystem/sun/sun.asset @@ -31,7 +31,7 @@ local SunLabel = { Identifier = "SunLabel", Parent = Sun.Identifier, Renderable = { - Enabled = true, + Enabled = false, Type = "RenderableLabels", LabelText = "Sun", FontSize = 100.0, @@ -46,13 +46,7 @@ local SunLabel = { FadeStartSpeed = 1.375, FadeEndUnit = "pc", FadeEndDistance = 1.326, - FadeEndSpeed = 1.0, - TransformationMatrix = { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - }, + FadeEndSpeed = 1.0 }, GUI = { Name = "Sun Label", diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp index a5b33f2624..5c8bbd20ae 100644 --- a/modules/base/rendering/renderablelabels.cpp +++ b/modules/base/rendering/renderablelabels.cpp @@ -193,7 +193,9 @@ documentation::Documentation RenderableLabels::Documentation() { }, { LabelOrientationOptionInfo.identifier, - new StringInListVerifier({ "Camera View Direction", "Camera Position Normal" }), + new StringInListVerifier( + { "Camera View Direction", "Camera Position Normal" } + ), Optional::Yes, LabelOrientationOptionInfo.description, }, @@ -253,13 +255,19 @@ documentation::Documentation RenderableLabels::Documentation() { }, { FadeStartUnitOptionInfo.identifier, - new StringInListVerifier({"m", "Km", "Mm", "Gm", "au", "Tm", "Pm", "pc", "Kpc", "Mpc", "Gpc", "Gly"}), + new StringInListVerifier( + { "m", "Km", "Mm", "Gm", "au", "Tm", "Pm", "pc", "Kpc", "Mpc", + "Gpc", "Gly"} + ), Optional::Yes, FadeStartUnitOptionInfo.description, }, { FadeEndUnitOptionInfo.identifier, - new StringInListVerifier({"m", "Km", "Mm", "Gm", "au", "Tm", "Pm", "pc", "Kpc", "Mpc", "Gpc", "Gly"}), + new StringInListVerifier( + {"m", "Km", "Mm", "Gm", "au", "Tm", "Pm", "pc", "Kpc", "Mpc", + "Gpc", "Gly"} + ), Optional::Yes, FadeEndUnitOptionInfo.description, }, @@ -311,9 +319,18 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) , _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, properties::OptionProperty::DisplayType::Dropdown) - , _fadeStartUnitOption(FadeStartUnitOptionInfo, properties::OptionProperty::DisplayType::Dropdown) - , _fadeEndUnitOption(FadeEndUnitOptionInfo, properties::OptionProperty::DisplayType::Dropdown) + , _labelOrientationOption( + LabelOrientationOptionInfo, + properties::OptionProperty::DisplayType::Dropdown + ) + , _fadeStartUnitOption( + FadeStartUnitOptionInfo, + properties::OptionProperty::DisplayType::Dropdown + ) + , _fadeEndUnitOption( + FadeEndUnitOptionInfo, + properties::OptionProperty::DisplayType::Dropdown + ) { documentation::testSpecificationAndThrow( Documentation(), @@ -357,7 +374,9 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) _labelOrientationOption = NormalDirection; if (dictionary.hasKeyAndValue(LabelOrientationOptionInfo.identifier)) { - const std::string o = dictionary.value(LabelOrientationOptionInfo.identifier); + const std::string o = dictionary.value( + LabelOrientationOptionInfo.identifier + ); if (o == "Camera View Direction") { _labelOrientationOption = ViewDirection; @@ -446,7 +465,9 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) _fadeStartUnitOption = AU; if (dictionary.hasKey(FadeStartUnitOptionInfo.identifier)) { - std::string unit = dictionary.value(FadeStartUnitOptionInfo.identifier); + std::string unit = dictionary.value( + FadeStartUnitOptionInfo.identifier + ); if (unit == MeterUnit) { _fadeStartUnitOption = Meter; } @@ -521,7 +542,9 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) _fadeEndUnitOption = AU; if (dictionary.hasKey(FadeEndUnitOptionInfo.identifier)) { - std::string unit = dictionary.value(FadeEndUnitOptionInfo.identifier); + std::string unit = dictionary.value( + FadeEndUnitOptionInfo.identifier + ); if (unit == MeterUnit) { _fadeEndUnitOption = Meter; } @@ -573,9 +596,6 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) } addProperty(_fadeEndSpeed); - - - //setBoundingSphere(_size); } bool RenderableLabels::isReady() const { @@ -603,8 +623,7 @@ void RenderableLabels::initializeGL() { } } -void RenderableLabels::deinitializeGL() { -} +void RenderableLabels::deinitializeGL() {} void RenderableLabels::render(const RenderData& data, RendererTasks&) { @@ -626,7 +645,13 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) { float startX = _fadeStartDistance * sUnit; float endX = _fadeEndDistance * eUnit; //fadeInVariable = changedPerlinSmoothStepFunc(distanceNodeToCamera, startX, endX); - fadeInVariable = linearSmoothStepFunc(distanceNodeToCamera, startX, endX, sUnit, eUnit); + fadeInVariable = linearSmoothStepFunc( + distanceNodeToCamera, + startX, + endX, + sUnit, + eUnit + ); } glm::dmat4 modelMatrix(1.0); @@ -668,8 +693,7 @@ void RenderableLabels::setLabelText(const std::string & newText) { void RenderableLabels::renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, const glm::dvec3& orthoRight, - const glm::dvec3& orthoUp, - float fadeInVariable) + const glm::dvec3& orthoUp, float fadeInVariable) { glm::vec4 textColor = _labelColor; @@ -704,9 +728,8 @@ void RenderableLabels::renderLabels(const RenderData& data, ); } -float RenderableLabels::changedPerlinSmoothStepFunc(const float x, - const float startX, - const float endX) const +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); @@ -725,11 +748,8 @@ float RenderableLabels::changedPerlinSmoothStepFunc(const float x, } } -float RenderableLabels::linearSmoothStepFunc(const float x, - const float startX, - const float endX, - const float sUnit, - const float eUnit) const +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); @@ -752,44 +772,45 @@ float RenderableLabels::getUnit(int unit) const { float scale = 0.f; switch (static_cast(unit)) { - case Meter: - scale = 1.f; - break; - case Kilometer: - scale = 1e3; - break; - case Megameter: - scale = 1e6; - break; - case Gigameter: - scale = 1e9; - break; - case AU: - scale = 149597870700.f; - break; - case Terameter: - scale = 1e12; - break; - case Petameter: - scale = 1e15; - break; - case Parsec: - scale = static_cast(PARSEC); - break; - case Kiloparsec: - scale = static_cast(1e3 * PARSEC); - break; - case Megaparsec: - scale = static_cast(1e6 * PARSEC); - break; - case Gigaparsec: - scale = static_cast(1e9 * PARSEC); - break; - case GigalightYears: - scale = static_cast(306391534.73091 * PARSEC); - break; + case Meter: + scale = 1.f; + break; + case Kilometer: + scale = 1e3; + break; + case Megameter: + scale = 1e6; + break; + case Gigameter: + scale = 1e9; + break; + case AU: + scale = 149597870700.f; + break; + case Terameter: + scale = 1e12; + break; + case Petameter: + scale = 1e15; + break; + case Parsec: + scale = static_cast(PARSEC); + break; + case Kiloparsec: + scale = static_cast(1e3 * PARSEC); + break; + case Megaparsec: + scale = static_cast(1e6 * PARSEC); + break; + case Gigaparsec: + scale = static_cast(1e9 * PARSEC); + break; + case GigalightYears: + scale = static_cast(306391534.73091 * PARSEC); + break; } return scale; } + } // namespace openspace diff --git a/modules/base/rendering/renderablelabels.h b/modules/base/rendering/renderablelabels.h index c0fa9848e9..0f5bbf6f99 100644 --- a/modules/base/rendering/renderablelabels.h +++ b/modules/base/rendering/renderablelabels.h @@ -54,22 +54,6 @@ namespace documentation { struct Documentation; } struct LinePoint; class RenderableLabels : public Renderable { -private: - enum Unit { - Meter = 0, - Kilometer = 1, - Megameter = 2, - Gigameter = 3, - AU = 4, - Terameter = 5, - Petameter = 6, - Parsec = 7, - Kiloparsec = 8, - Megaparsec = 9, - Gigaparsec = 10, - GigalightYears = 11 - }; - public: RenderableLabels(const ghoul::Dictionary& dictionary); @@ -90,37 +74,43 @@ protected: properties::OptionProperty _blendMode; private: + enum Unit { + Meter = 0, + Kilometer, + Megameter, + Gigameter, + AU, + Terameter, + Petameter, + Parsec, + Kiloparsec, + Megaparsec, + Gigaparsec, + GigalightYears + }; + void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable); - float changedPerlinSmoothStepFunc( - const float x, - const float startX, - const float endX - ) const; + float changedPerlinSmoothStepFunc(float x, float startX, float endX) const; - float linearSmoothStepFunc( - const float x, - const float startX, - const float endX, - const float sUnit, - const float eUnit - ) const; + float linearSmoothStepFunc(float x, float startX, float endX, float sUnit, + float eUnit) const; float getUnit(int unit) const; - properties::Vec4Property _labelColor; - properties::FloatProperty _labelSize; - properties::FloatProperty _fontSize; - properties::FloatProperty _labelMinSize; - properties::FloatProperty _labelMaxSize; - properties::BoolProperty _pixelSizeControl; - properties::BoolProperty _enableFadingEffect; + properties::Vec4Property _labelColor; + properties::FloatProperty _labelSize; + 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 _fadeStartDistance; + properties::FloatProperty _fadeEndDistance; + properties::FloatProperty _fadeStartSpeed; + properties::FloatProperty _fadeEndSpeed; properties::OptionProperty _labelOrientationOption; properties::OptionProperty _fadeStartUnitOption; From bfc2da3475160f2741a2964f6df140c815fc288d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Dec 2019 10:38:10 +0100 Subject: [PATCH 09/10] Make a defaut keybind for toggling the labels --- data/assets/base.asset | 16 ++++++++++++++++ .../scene/solarsystem/planets/earth/earth.asset | 1 + .../solarsystem/planets/jupiter/jupiter.asset | 1 + .../scene/solarsystem/planets/mars/mars.asset | 1 + .../solarsystem/planets/mercury/mercury.asset | 1 + .../solarsystem/planets/neptune/neptune.asset | 1 + .../solarsystem/planets/saturn/saturn.asset | 1 + .../solarsystem/planets/uranus/uranus.asset | 1 + .../scene/solarsystem/planets/venus/venus.asset | 1 + data/assets/scene/solarsystem/sun/sun.asset | 1 + 10 files changed, 25 insertions(+) diff --git a/data/assets/base.asset b/data/assets/base.asset index 73e2db77ab..6ef26ab294 100644 --- a/data/assets/base.asset +++ b/data/assets/base.asset @@ -63,6 +63,22 @@ local Keybindings = { GuiPath = "/Rendering", Local = false }, + { + Key = "l", + Name = "Turn on labels", + Command = "openspace.setPropertyValue('{solarsystem_labels}.Renderable.Enabled', true)", + Documentation = "Turns on visibility for all solar system labels", + GuiPath = "/Rendering", + Local = false + }, + { + Key = "Shift+l", + Name = "Turn off labels", + Command = "openspace.setPropertyValue('{solarsystem_labels}.Renderable.Enabled', false)", + Documentation = "Turns off visibility for all solar system labels", + GuiPath = "/Rendering", + Local = false + } } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index dc14382046..c604a102ce 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -320,6 +320,7 @@ local EarthLabel = { FadeEndDistance = 15.0, FadeEndSpeed = 25.0 }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Earth Label", Path = "/Solar System/Planets/Earth" diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset index 1ce8b88fff..071a9cad9f 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset @@ -56,6 +56,7 @@ local JupiterLabel = { LabelOrientationOption = "Camera View Direction", BlendMode = "Additive" }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Jupiter Label", Path = "/Solar System/Planets/Jupiter" diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index cee87159c5..4c2e8dcd76 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -207,6 +207,7 @@ local MarsLabel = { 0.0, 0.0, 0.0, 1.0 }, }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Mars Label", Path = "/Solar System/Planets/Mars" diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index 98bd538f33..93924f8444 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -237,6 +237,7 @@ local MercuryLabel = { LabelOrientationOption = "Camera View Direction", BlendMode = "Additive" }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Mercury Label", Path = "/Solar System/Planets/Mercury" diff --git a/data/assets/scene/solarsystem/planets/neptune/neptune.asset b/data/assets/scene/solarsystem/planets/neptune/neptune.asset index a7546d5f2a..326b2ef6c0 100644 --- a/data/assets/scene/solarsystem/planets/neptune/neptune.asset +++ b/data/assets/scene/solarsystem/planets/neptune/neptune.asset @@ -54,6 +54,7 @@ local NeptuneLabel = { LabelOrientationOption = "Camera View Direction", BlendMode = "Additive" }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Neptune Label", Path = "/Solar System/Planets/Neptune" diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index 853bd1ce8b..aabfe92b81 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -71,6 +71,7 @@ local SaturnLabel = { BlendMode = "Additive", LabelOrientationOption = "Camera View Direction" }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Saturn Label", Path = "/Solar System/Planets/Saturn" diff --git a/data/assets/scene/solarsystem/planets/uranus/uranus.asset b/data/assets/scene/solarsystem/planets/uranus/uranus.asset index 758f87f998..db3fb11848 100644 --- a/data/assets/scene/solarsystem/planets/uranus/uranus.asset +++ b/data/assets/scene/solarsystem/planets/uranus/uranus.asset @@ -56,6 +56,7 @@ local UranusLabel = { LabelOrientationOption = "Camera View Direction", BlendMode = "Additive" }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Neptune Label", Path = "/Solar System/Planets/Uranus" diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 52cfe29303..f3e1f83fed 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -78,6 +78,7 @@ local VenusLabel = { LabelOrientationOption = "Camera View Direction", BlendMode = "Additive" }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Venus Label", Path = "/Solar System/Planets/Venus" diff --git a/data/assets/scene/solarsystem/sun/sun.asset b/data/assets/scene/solarsystem/sun/sun.asset index 9d44fb2462..10c0ff4aec 100644 --- a/data/assets/scene/solarsystem/sun/sun.asset +++ b/data/assets/scene/solarsystem/sun/sun.asset @@ -48,6 +48,7 @@ local SunLabel = { FadeEndDistance = 1.326, FadeEndSpeed = 1.0 }, + Tag = { "solarsystem_labels" }, GUI = { Name = "Sun Label", Path = "/Solar System/Sun" From 4f2883034ba39617e1fb02838d8f194f29c81033 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 16 Dec 2019 10:51:38 +0100 Subject: [PATCH 10/10] Rename labels assets to globe_labels --- data/assets/scene/solarsystem/planets/earth/earth.asset | 2 +- .../earth/{earth_labels.asset => earth_globelabels.asset} | 0 .../scene/solarsystem/planets/jupiter/callisto/callisto.asset | 2 +- .../scene/solarsystem/planets/jupiter/europa/europa.asset | 2 +- .../scene/solarsystem/planets/jupiter/ganymede/ganymede.asset | 2 +- data/assets/scene/solarsystem/planets/jupiter/io/io.asset | 2 +- .../jupiter/{jupiter_labels.asset => jupiter_globelabels.asset} | 0 data/assets/scene/solarsystem/planets/mars/mars.asset | 2 +- .../planets/mars/{mars_labels.asset => mars_globelabels.asset} | 0 data/assets/scene/solarsystem/planets/mercury/mercury.asset | 2 +- .../mercury/{mercury_labels.asset => mercury_globelabels.asset} | 0 data/assets/scene/solarsystem/planets/saturn/dione/dione.asset | 2 +- .../scene/solarsystem/planets/saturn/enceladus/enceladus.asset | 2 +- .../scene/solarsystem/planets/saturn/iapetus/iapetus.asset | 2 +- data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset | 2 +- data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset | 2 +- .../saturn/{saturn_labels.asset => saturn_globelabels.asset} | 0 .../assets/scene/solarsystem/planets/saturn/tethys/tethys.asset | 2 +- data/assets/scene/solarsystem/planets/saturn/titan/titan.asset | 2 +- data/assets/scene/solarsystem/planets/venus/venus.asset | 2 +- .../venus/{venus_labels.asset => venus_globelabels.asset} | 0 21 files changed, 15 insertions(+), 15 deletions(-) rename data/assets/scene/solarsystem/planets/earth/{earth_labels.asset => earth_globelabels.asset} (100%) rename data/assets/scene/solarsystem/planets/jupiter/{jupiter_labels.asset => jupiter_globelabels.asset} (100%) rename data/assets/scene/solarsystem/planets/mars/{mars_labels.asset => mars_globelabels.asset} (100%) rename data/assets/scene/solarsystem/planets/mercury/{mercury_labels.asset => mercury_globelabels.asset} (100%) rename data/assets/scene/solarsystem/planets/saturn/{saturn_labels.asset => saturn_globelabels.asset} (100%) rename data/assets/scene/solarsystem/planets/venus/{venus_labels.asset => venus_globelabels.asset} (100%) diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index c604a102ce..aab7c67f07 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -1,7 +1,7 @@ local transforms = asset.require('./transforms') local assetHelper = asset.require('util/asset_helper') local texturesPath = asset.require('./earth_textures').TexturesPath -local labelsPath = asset.require('./earth_labels').LabelsPath +local labelsPath = asset.require('./earth_globelabels').LabelsPath asset.request('./trail') diff --git a/data/assets/scene/solarsystem/planets/earth/earth_labels.asset b/data/assets/scene/solarsystem/planets/earth/earth_globelabels.asset similarity index 100% rename from data/assets/scene/solarsystem/planets/earth/earth_labels.asset rename to data/assets/scene/solarsystem/planets/earth/earth_globelabels.asset diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset index 1a31062cd1..d0b2496e52 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset @@ -3,7 +3,7 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.request('./trail') local kernel = asset.require('../kernels').jup310 -local labelsPath = asset.require('../jupiter_labels').LabelsPath +local labelsPath = asset.require('../jupiter_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset index 9ee299ebf6..d5e455bb9f 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset @@ -3,7 +3,7 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.request('./trail') local kernel = asset.require('../kernels').jup310 -local labelsPath = asset.require('../jupiter_labels').LabelsPath +local labelsPath = asset.require('../jupiter_globelabels').LabelsPath local map_service_configs = asset.localResource("map_service_configs") diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset index 510484cebf..513136ef98 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset @@ -3,7 +3,7 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.request('./trail') local kernel = asset.require('../kernels').jup310 -local labelsPath = asset.require('../jupiter_labels').LabelsPath +local labelsPath = asset.require('../jupiter_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset index ca10670c06..fb10f0b3a8 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset @@ -3,7 +3,7 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.request('./trail') local kernel = asset.require('../kernels').jup310 -local labelsPath = asset.require('../jupiter_labels').LabelsPath +local labelsPath = asset.require('../jupiter_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter_labels.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter_globelabels.asset similarity index 100% rename from data/assets/scene/solarsystem/planets/jupiter/jupiter_labels.asset rename to data/assets/scene/solarsystem/planets/jupiter/jupiter_globelabels.asset diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index 4c2e8dcd76..ee4da17e7d 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -2,7 +2,7 @@ local transforms = asset.require('./transforms') local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.request('./trail') -local labelsPath = asset.require('./mars_labels').LabelsPath +local labelsPath = asset.require('./mars_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/mars/mars_labels.asset b/data/assets/scene/solarsystem/planets/mars/mars_globelabels.asset similarity index 100% rename from data/assets/scene/solarsystem/planets/mars/mars_labels.asset rename to data/assets/scene/solarsystem/planets/mars/mars_globelabels.asset diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index 93924f8444..8eda6c5eb9 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -1,6 +1,6 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./transforms') -local labelsPath = asset.require('./mercury_labels').LabelsPath +local labelsPath = asset.require('./mercury_globelabels').LabelsPath asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury_labels.asset b/data/assets/scene/solarsystem/planets/mercury/mercury_globelabels.asset similarity index 100% rename from data/assets/scene/solarsystem/planets/mercury/mercury_labels.asset rename to data/assets/scene/solarsystem/planets/mercury/mercury_globelabels.asset diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset index 7cdd49b5cd..ded4b6ae73 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset @@ -2,7 +2,7 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.request('./trail') -local labelsPath = asset.require('../saturn_labels').LabelsPath +local labelsPath = asset.require('../saturn_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset index 5fa01501ba..8a66735198 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset @@ -2,7 +2,7 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.request('./trail') -local labelsPath = asset.require('../saturn_labels').LabelsPath +local labelsPath = asset.require('../saturn_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset index bab9c45056..892cc2c13e 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset @@ -2,7 +2,7 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.request('./trail') -local labelsPath = asset.require('../saturn_labels').LabelsPath +local labelsPath = asset.require('../saturn_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset index 4dbedaad48..53d9b7da21 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset @@ -2,7 +2,7 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.request('./trail') -local labelsPath = asset.require('../saturn_labels').LabelsPath +local labelsPath = asset.require('../saturn_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset index 0ab5688544..008663ecf5 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset @@ -2,7 +2,7 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.request('./trail') -local labelsPath = asset.require('../saturn_labels').LabelsPath +local labelsPath = asset.require('../saturn_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn_labels.asset b/data/assets/scene/solarsystem/planets/saturn/saturn_globelabels.asset similarity index 100% rename from data/assets/scene/solarsystem/planets/saturn/saturn_labels.asset rename to data/assets/scene/solarsystem/planets/saturn/saturn_globelabels.asset diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset index 1979cf4d66..fea8618180 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset @@ -2,7 +2,7 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.request('./trail') -local labelsPath = asset.require('../saturn_labels').LabelsPath +local labelsPath = asset.require('../saturn_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset index 0145308ed4..a086c9eecb 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset @@ -2,7 +2,7 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.request('./trail') -local labelsPath = asset.require('../saturn_labels').LabelsPath +local labelsPath = asset.require('../saturn_globelabels').LabelsPath local map_service_configs = asset.localResource("map_service_configs") diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index f3e1f83fed..e53b0e7ede 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -2,7 +2,7 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./transforms') asset.require("spice/base") asset.request('./trail') -local labelsPath = asset.require('./venus_labels').LabelsPath +local labelsPath = asset.require('./venus_globelabels').LabelsPath diff --git a/data/assets/scene/solarsystem/planets/venus/venus_labels.asset b/data/assets/scene/solarsystem/planets/venus/venus_globelabels.asset similarity index 100% rename from data/assets/scene/solarsystem/planets/venus/venus_labels.asset rename to data/assets/scene/solarsystem/planets/venus/venus_globelabels.asset