From c65806d464be007e0df5c5125732cd4c4daf2724 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Wed, 1 Jul 2020 09:35:44 +0200 Subject: [PATCH 01/10] Update opacity property description in renderable base class --- src/rendering/renderable.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 8e11770be0..5a6f50de0f 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -44,8 +44,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo OpacityInfo = { "Opacity", - "Transparency", - "This value determines the transparency of this object." + "Opacity", + "This value determines the opacity of this renderable. A value of 0 means " + "completely transparent." }; constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = { From b14eba72f8ceb88dba5912688279a6d122252bec Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Tue, 30 Jun 2020 15:45:35 +0200 Subject: [PATCH 02/10] Change properties and variables to opacity instead of transparency --- .../digitaluniverse/constellations.asset | 4 +-- .../scene/digitaluniverse/deepsky.asset | 2 +- data/assets/scene/digitaluniverse/grids.asset | 30 +++++++++---------- .../scene/digitaluniverse/milkyway.asset | 2 +- .../scene/digitaluniverse/starorbits.asset | 14 ++++----- data/assets/scene/digitaluniverse/tully.asset | 2 +- modules/base/rendering/renderablesphere.cpp | 14 ++++----- .../rendering/renderabledumeshes.cpp | 28 +++-------------- .../rendering/renderabledumeshes.h | 1 - .../rendering/renderableplanescloud.cpp | 25 ++-------------- .../rendering/renderableplanescloud.h | 1 - .../rendering/renderablepoints.cpp | 26 +++------------- .../rendering/renderablepoints.h | 1 - .../src/globelabelscomponent.cpp | 6 ++-- modules/space/rendering/renderablestars.cpp | 22 ++++---------- modules/space/rendering/renderablestars.h | 1 - 16 files changed, 53 insertions(+), 126 deletions(-) diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index d7aea41f79..92b8accc2f 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -15,7 +15,7 @@ local constellationsExtragalactic = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 0.4, 0.2 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/constellationsEXGAL.speck", LabelFile = speck .. "/constellationsEXGAL.label", @@ -38,7 +38,7 @@ local constellations = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 0.4, 0.2 }, - Transparency = 0.3, + Opacity = 0.3, ScaleFactor = 1.0, File = speck .. "/constellations.speck", LabelFile = speck .. "/constellations.label", diff --git a/data/assets/scene/digitaluniverse/deepsky.asset b/data/assets/scene/digitaluniverse/deepsky.asset index 66793c377f..7b3093051f 100644 --- a/data/assets/scene/digitaluniverse/deepsky.asset +++ b/data/assets/scene/digitaluniverse/deepsky.asset @@ -61,7 +61,7 @@ local deepSkyImages = { Type = "RenderablePlanesCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.99, + Opacity = 0.99, ScaleFactor = 1.0, File = speck .. "/dso.speck", TexturePath = textures, diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index ecddec43cf..e2d9cea844 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -114,7 +114,7 @@ local eclipticLabels = { Type = "RenderableBillboardsCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.65, + Opacity = 0.65, LabelFile = speck .. "/eclip.label", DrawLabels = true, TextColor = { 0.5, 0.5, 0.5, 1.0 }, @@ -168,7 +168,7 @@ local equatorialLabels = { Type = "RenderableBillboardsCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.65, + Opacity = 0.65, LabelFile = speck .. "/radec.label", DrawLabels = true, TextColor = { 0.5, 0.5, 0.5, 1.0 }, @@ -212,7 +212,7 @@ local galacticLabels = { Type = "RenderableBillboardsCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.65, + Opacity = 0.65, LabelFile = speck .. "/galac.label", DrawLabels = true, TextColor = { 0.5, 0.5, 0.5, 1.0 }, @@ -240,7 +240,7 @@ local plane1ld = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/1ld.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -270,7 +270,7 @@ local plane1lm = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/1lm.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -300,7 +300,7 @@ local plane1ly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/1ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -330,7 +330,7 @@ local plane10ly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/10ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -360,7 +360,7 @@ local plane100ly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/100ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -390,7 +390,7 @@ local plane1kly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/1kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -420,7 +420,7 @@ local plane10kly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/10kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -443,7 +443,7 @@ local plane100kly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/100kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -466,7 +466,7 @@ local plane1Mly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/1Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -489,7 +489,7 @@ local plane10Mly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/10Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -512,7 +512,7 @@ local plane100Mly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/100Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, @@ -535,7 +535,7 @@ local plane20Gly = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.4, + Opacity = 0.4, ScaleFactor = 1.0, File = speck .. "/20Gly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, diff --git a/data/assets/scene/digitaluniverse/milkyway.asset b/data/assets/scene/digitaluniverse/milkyway.asset index ee2261e5f1..2f1cb3fc5f 100644 --- a/data/assets/scene/digitaluniverse/milkyway.asset +++ b/data/assets/scene/digitaluniverse/milkyway.asset @@ -63,7 +63,7 @@ local plane = { Type = "RenderablePlanesCloud", Enabled = true, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.99, + Opacity = 0.99, ScaleFactor = 2.8, File = planeSpeck .. "/galaxy.speck", TexturePath = planeTextures, diff --git a/data/assets/scene/digitaluniverse/starorbits.asset b/data/assets/scene/digitaluniverse/starorbits.asset index b240a57024..60c0e26578 100644 --- a/data/assets/scene/digitaluniverse/starorbits.asset +++ b/data/assets/scene/digitaluniverse/starorbits.asset @@ -17,7 +17,7 @@ local sunOrbit = { Type = "RenderableDUMeshes", Enabled = false, Color = { 1.0, 0.65, 0.0 }, - Transparency = 1.0, + Opacity = 1.0, ScaleFactor = 1.0, File = speck .. "/starorbits-Sun.speck", MeshColor = {{ 1.0, 0.65, 0.0 }}, @@ -41,7 +41,7 @@ local barnardsOrbit = { Type = "RenderableDUMeshes", Enabled = false, Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, + Opacity = 1.0, ScaleFactor = 1.0, File = speck .. "/starorbits-BarnardsStar.speck", MeshColor = {{0.39, 0.58, 0.93}}, @@ -65,7 +65,7 @@ local kapteynsOrbit = { Type = "RenderableDUMeshes", Enabled = false, Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, + Opacity = 1.0, ScaleFactor = 1.0, File = speck .. "/starorbits-KapteynsStar.speck", MeshColor = {{0.6, 0.6, 0.6}}, @@ -89,7 +89,7 @@ local lacaille9352Orbit = { Type = "RenderableDUMeshes", Enabled = false, Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, + Opacity = 1.0, ScaleFactor = 1.0, File = speck .. "/starorbits-Lacaille9352.speck", MeshColor = {{0.58, 0.0, 0.83}}, @@ -113,7 +113,7 @@ local lSR1826Orbit = { Type = "RenderableDUMeshes", Enabled = false, Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, + Opacity = 1.0, ScaleFactor = 1.0, File = speck .. "/starorbits-LSR1826+3014.speck", MeshColor = {{0.0, 0.39, 0.0}}, @@ -137,7 +137,7 @@ local lSRJ0822Orbit = { Type = "RenderableDUMeshes", Enabled = false, Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, + Opacity = 1.0, ScaleFactor = 1.0, File = speck .. "/starorbits-LSRJ0822+1700.speck", MeshColor = {{0.5, 1.0, 0.0}}, @@ -161,7 +161,7 @@ local pM_J13420Orbit = { Type = "RenderableDUMeshes", Enabled = false, Color = {1.0, 1.0, 1.0}, - Transparency = 1.0, + Opacity = 1.0, ScaleFactor = 1.0, File = speck .. "/starorbits-PM_J13420-3415.speck", MeshColor = {{0.70, 0.13, 0.13}}, diff --git a/data/assets/scene/digitaluniverse/tully.asset b/data/assets/scene/digitaluniverse/tully.asset index d169e0c815..a562b8ea4f 100644 --- a/data/assets/scene/digitaluniverse/tully.asset +++ b/data/assets/scene/digitaluniverse/tully.asset @@ -64,7 +64,7 @@ local tullyImages = { Type = "RenderablePlanesCloud", Enabled = true, Color = { 1.0, 1.0, 1.0 }, - Transparency = 0.99, + Opacity = 0.99, ScaleFactor = 1.0, File = speck .. "/tully.speck", TexturePath = textures, diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index bd46acce0c..d38c48c417 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -360,7 +360,7 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { ); _shader->setUniform(_uniformCache.modelViewRotation, modelViewRotation); - float adjustedTransparency = _opacity; + float adjustedOpacity = _opacity; if (!_disableFadeInDistance) { if (_fadeInThreshold > -1.0) { @@ -377,10 +377,10 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { 0.f, 1.f ); - adjustedTransparency *= fadeFactor; + adjustedOpacity *= fadeFactor; } else if (logDistCamera <= startLogFadeDistance) { - adjustedTransparency = 0.f; + adjustedOpacity = 0.f; } } @@ -398,19 +398,19 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { 0.f, 1.f ); - adjustedTransparency *= (1.f - fadeFactor); + adjustedOpacity *= (1.f - fadeFactor); } else if (logDistCamera >= stopLogFadeDistance) { - adjustedTransparency = 0.f; + adjustedOpacity = 0.f; } } } // Performance wise - if (adjustedTransparency < 0.01f) { + if (adjustedOpacity < 0.01f) { return; } - _shader->setUniform(_uniformCache.opacity, adjustedTransparency); + _shader->setUniform(_uniformCache.opacity, adjustedOpacity); _shader->setUniform(_uniformCache._mirrorTexture, _mirrorTexture.value()); ghoul::opengl::TextureUnit unit; diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 32ab42b076..7b1eef71a5 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -70,13 +70,6 @@ namespace { constexpr const int8_t CurrentCacheVersion = 1; constexpr const double PARSEC = 0.308567756E17; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value is a multiplicative factor that is applied to the transparency of " - "all point." - }; - constexpr openspace::properties::Property::PropertyInfo TextColorInfo = { "TextColor", "Text Color", @@ -173,12 +166,6 @@ documentation::Documentation RenderableDUMeshes::Documentation() { Optional::Yes, "Astronomical Object Color (r,g,b)." }, - { - TransparencyInfo.identifier, - new DoubleVerifier, - Optional::Yes, - TransparencyInfo.description - }, /*{ ScaleFactorInfo.identifier, new DoubleVerifier, @@ -246,7 +233,6 @@ documentation::Documentation RenderableDUMeshes::Documentation() { RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) //, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f) , _textColor(TextColorInfo, glm::vec4(1.f), glm::vec4(0.f), glm::vec4(1.f)) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) @@ -263,6 +249,9 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) "RenderableDUMeshes" ); + addProperty(_opacity); + registerUpdateRenderBinFromOpacity(); + if (dictionary.hasKey(KeyFile)) { _speckFile = absPath(dictionary.value(KeyFile)); _hasSpeckFile = true; @@ -314,13 +303,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) } addProperty(_pointColor);*/ - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - addProperty(_alphaValue); - /*if (dictionary.hasKey(ScaleFactorInfo.identifier)) { _scaleFactor = static_cast( dictionary.value(ScaleFactorInfo.identifier) @@ -385,8 +367,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) ); } } - - setRenderBin(Renderable::RenderBin::Opaque); } bool RenderableDUMeshes::isReady() const { @@ -482,7 +462,7 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, _program->setUniform(_uniformCache.modelViewTransform, modelViewMatrix); _program->setUniform(_uniformCache.projectionTransform, projectionMatrix); - _program->setUniform(_uniformCache.alphaValue, _alphaValue); + _program->setUniform(_uniformCache.alphaValue, _opacity); //_program->setUniform(_uniformCache.scaleFactor, _scaleFactor); for (const std::pair& pair : _renderingMeshesMap) { diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h index bb0b6dce20..29d5ae658c 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.h +++ b/modules/digitaluniverse/rendering/renderabledumeshes.h @@ -118,7 +118,6 @@ private: bool _textColorIsDirty = true; bool _hasLabel = false; - properties::FloatProperty _alphaValue; //properties::FloatProperty _scaleFactor; //properties::Vec3Property _pointColor; properties::Vec4Property _textColor; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index befa6a125e..e08f89e394 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -68,13 +68,6 @@ namespace { BlendModeAdditive }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value is a multiplicative factor that is applied to the transparency of " - "all points." - }; - constexpr openspace::properties::Property::PropertyInfo ScaleFactorInfo = { "ScaleFactor", "Scale Factor", @@ -200,12 +193,6 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { "The path to the SPECK file that contains information about the " "astronomical object being rendered." }, - { - TransparencyInfo.identifier, - new DoubleVerifier, - Optional::No, - TransparencyInfo.description - }, { ScaleFactorInfo.identifier, new DoubleVerifier, @@ -297,7 +284,6 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 10000.f) , _textColor( TextColorInfo, @@ -324,6 +310,8 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary "RenderablePlanesCloud" ); + addProperty(_opacity); + if (dictionary.hasKey(KeyFile)) { _speckFile = absPath(dictionary.value(KeyFile)); _hasSpeckFile = true; @@ -371,13 +359,6 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary _unit = Meter; } - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - addProperty(_alphaValue); - if (dictionary.hasKey(ScaleFactorInfo.identifier)) { _scaleFactor = static_cast( dictionary.value(ScaleFactorInfo.identifier) @@ -580,7 +561,7 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&, _uniformCache.modelViewProjectionTransform, modelViewProjectionMatrix ); - _program->setUniform(_uniformCache.alphaValue, _alphaValue); + _program->setUniform(_uniformCache.alphaValue, _opacity); _program->setUniform(_uniformCache.fadeInValue, fadeInVariable); GLint viewport[4]; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.h b/modules/digitaluniverse/rendering/renderableplanescloud.h index bf7cced594..6601c9d96f 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.h +++ b/modules/digitaluniverse/rendering/renderableplanescloud.h @@ -116,7 +116,6 @@ private: int _planeStartingIndexPos = 0; int _textureVariableIndex = 0; - properties::FloatProperty _alphaValue; properties::FloatProperty _scaleFactor; properties::Vec4Property _textColor; properties::FloatProperty _textSize; diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index 22054c2734..d48ddd9313 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -72,13 +72,6 @@ namespace { "The path to the texture that should be used as the point sprite." }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value is a multiplicative factor that is applied to the transparency of " - "all points." - }; - constexpr openspace::properties::Property::PropertyInfo ScaleFactorInfo = { "ScaleFactor", "Scale Factor", @@ -131,12 +124,6 @@ documentation::Documentation RenderablePoints::Documentation() { Optional::Yes, SpriteTextureInfo.description }, - { - TransparencyInfo.identifier, - new DoubleVerifier, - Optional::No, - TransparencyInfo.description - }, { ScaleFactorInfo.identifier, new DoubleVerifier, @@ -157,7 +144,6 @@ documentation::Documentation RenderablePoints::Documentation() { RenderablePoints::RenderablePoints(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f) , _pointColor( ColorInfo, @@ -173,6 +159,9 @@ RenderablePoints::RenderablePoints(const ghoul::Dictionary& dictionary) "RenderablePoints" ); + addProperty(_opacity); + registerUpdateRenderBinFromOpacity(); + _speckFile = absPath(dictionary.value(KeyFile)); if (dictionary.hasKey(keyUnit)) { @@ -233,13 +222,6 @@ RenderablePoints::RenderablePoints(const ghoul::Dictionary& dictionary) _hasColorMapFile = true; } - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - addProperty(_alphaValue); - if (dictionary.hasKey(ScaleFactorInfo.identifier)) { _scaleFactor = static_cast( dictionary.value(ScaleFactorInfo.identifier) @@ -322,7 +304,7 @@ void RenderablePoints::render(const RenderData& data, RendererTasks&) { _program->setUniform(_uniformCache.color, _pointColor); _program->setUniform(_uniformCache.sides, 4); - _program->setUniform(_uniformCache.alphaValue, _alphaValue); + _program->setUniform(_uniformCache.alphaValue, _opacity); _program->setUniform(_uniformCache.scaleFactor, _scaleFactor); if (_hasSpriteTexture) { diff --git a/modules/digitaluniverse/rendering/renderablepoints.h b/modules/digitaluniverse/rendering/renderablepoints.h index 58731d3c56..1b27786097 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.h +++ b/modules/digitaluniverse/rendering/renderablepoints.h @@ -87,7 +87,6 @@ private: bool _spriteTextureIsDirty = true; bool _hasColorMapFile = false; - properties::FloatProperty _alphaValue; properties::FloatProperty _scaleFactor; properties::Vec3Property _pointColor; properties::StringProperty _spriteTexturePath; diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index 2e678a03c6..e051411010 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -51,7 +51,7 @@ namespace { constexpr const double LabelFadeRangeConst = 1500.0; constexpr const double RangeAngularCoefConst = 0.8; - constexpr const float MinTransparencyValueConst = 0.009f; + constexpr const float MinOpacityValueConst = 0.009f; enum LabelRenderingAlignmentType { Horizontally = 0, @@ -642,7 +642,7 @@ void GlobeLabelsComponent::draw(const RenderData& data) { double funcValue = a * distanceCameraGlobeWorld + b; varyingOpacity *= static_cast(std::min(funcValue, 1.0)); - if (varyingOpacity < MinTransparencyValueConst) { + if (varyingOpacity < MinOpacityValueConst) { return; } } @@ -657,7 +657,7 @@ void GlobeLabelsComponent::draw(const RenderData& data) { double funcValue = a * distanceCameraGlobeWorld + b; varyingOpacity *= static_cast(std::min(funcValue, 1.0)); - if (varyingOpacity < MinTransparencyValueConst) { + if (varyingOpacity < MinOpacityValueConst) { return; } } diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 2778673233..585c43a94e 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -165,13 +165,6 @@ namespace { "The path to the texture that should be used as the base shape for the stars." };*/ - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value is a multiplicative factor that is applied to the transparency of " - "all stars." - }; - // PSF constexpr openspace::properties::Property::PropertyInfo MagnitudeExponentInfo = { "MagnitudeExponent", @@ -434,7 +427,6 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) , _fixedColor(FixedColorInfo, glm::vec4(1.f), glm::vec4(0.f), glm::vec4(1.f)) , _filterOutOfRange(FilterOutOfRangeInfo, false) , _pointSpreadFunctionTexturePath(PsfTextureInfo) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) , _psfMethodOption( PSFMethodOptionInfo, properties::OptionProperty::DisplayType::Dropdown @@ -478,6 +470,9 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) "RenderableStars" ); + addProperty(_opacity); + registerUpdateRenderBinFromOpacity(); + _speckFile = absPath(dictionary.value(KeyFile)); _speckFile.onChange([&]() { _speckFileIsDirty = true; }); addProperty(_speckFile); @@ -605,13 +600,6 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) }); _userProvidedTextureOwner.addProperty(_pointSpreadFunctionTexturePath); - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - _parametersOwner.addProperty(_alphaValue); - _psfMethodOption.addOption(PsfMethodSpencer, "Spencer's Function"); _psfMethodOption.addOption(PsfMethodMoffat, "Moffat's Function"); _psfMethodOption = PsfMethodSpencer; @@ -1020,10 +1008,10 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) { const double funcValue = a * distCamera + b; fadeInVariable *= static_cast(funcValue > 1.f ? 1.f : funcValue); - _program->setUniform(_uniformCache.alphaValue, _alphaValue * fadeInVariable); + _program->setUniform(_uniformCache.alphaValue, _opacity * fadeInVariable); } else { - _program->setUniform(_uniformCache.alphaValue, _alphaValue); + _program->setUniform(_uniformCache.alphaValue, _opacity); } ghoul::opengl::TextureUnit psfUnit; diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h index 7e36d0aafb..9ab74c787d 100644 --- a/modules/space/rendering/renderablestars.h +++ b/modules/space/rendering/renderablestars.h @@ -104,7 +104,6 @@ private: std::unique_ptr _pointSpreadFunctionTexture; std::unique_ptr _pointSpreadFunctionFile; - properties::FloatProperty _alphaValue; properties::OptionProperty _psfMethodOption; properties::OptionProperty _psfMultiplyOption; properties::FloatProperty _lumCent; From 1a0eaf2df08fdb7443a5567908fd8d19cc95a9c1 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Thu, 2 Jul 2020 13:42:22 +0200 Subject: [PATCH 03/10] Use opacity instead of transparency in TouchMarker --- modules/touch/include/touchmarker.h | 4 ++-- modules/touch/shaders/marker_fs.glsl | 4 ++-- modules/touch/src/touchmarker.cpp | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/touch/include/touchmarker.h b/modules/touch/include/touchmarker.h index 43d2d7be94..26ed9e18bf 100644 --- a/modules/touch/include/touchmarker.h +++ b/modules/touch/include/touchmarker.h @@ -58,12 +58,12 @@ private: properties::BoolProperty _visible; properties::FloatProperty _radiusSize; - properties::FloatProperty _transparency; + properties::FloatProperty _opacity; properties::FloatProperty _thickness; properties::Vec3Property _color; std::unique_ptr _shader; - UniformCache(radius, transparency, thickness, color) _uniformCache; + UniformCache(radius, opacity, thickness, color) _uniformCache; std::vector _vertexData; GLuint _quad = 0; diff --git a/modules/touch/shaders/marker_fs.glsl b/modules/touch/shaders/marker_fs.glsl index 9d04a92a38..2425e5323a 100644 --- a/modules/touch/shaders/marker_fs.glsl +++ b/modules/touch/shaders/marker_fs.glsl @@ -28,7 +28,7 @@ in vec2 out_position; uniform float radius; -uniform float transparency; +uniform float opacity; uniform float thickness; uniform vec3 color; @@ -47,7 +47,7 @@ Fragment getFragment() { // calculate lighting vec3 light_dir = vec3(0.0, 0.0, 1.0); float diffuse = max(0.0, dot(light_dir, n)); - float alpha = min(pow(sqrt(mag), thickness), transparency); + float alpha = min(pow(sqrt(mag), thickness), opacity); Fragment frag; frag.color = vec4(color * diffuse, alpha); diff --git a/modules/touch/src/touchmarker.cpp b/modules/touch/src/touchmarker.cpp index 386007074c..8abd11e7e8 100644 --- a/modules/touch/src/touchmarker.cpp +++ b/modules/touch/src/touchmarker.cpp @@ -32,7 +32,7 @@ namespace { constexpr const std::array UniformNames = { - "radius", "transparency", "thickness", "color" + "radius", "opacity", "thickness", "color" }; constexpr openspace::properties::Property::PropertyInfo VisibilityInfo = { @@ -47,9 +47,9 @@ namespace { "" // @TODO Missing documentation }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Marker transparency", + constexpr openspace::properties::Property::PropertyInfo OpacityInfo = { + "Opacity", + "Marker opacity", "" // @TODO Missing documentation }; @@ -71,13 +71,13 @@ TouchMarker::TouchMarker() : properties::PropertyOwner({ "TouchMarker" }) , _visible(VisibilityInfo, true) , _radiusSize(RadiusInfo, 30.f, 0.f, 100.f) - , _transparency(TransparencyInfo, 0.8f, 0.f, 1.f) + , _opacity(OpacityInfo, 0.8f, 0.f, 1.f) , _thickness(ThicknessInfo, 2.f, 0.f, 4.f ) , _color(ColorInfo, glm::vec3(0.96f, 0.2f, 0.2f), glm::vec3(0.f), glm::vec3(1.f)) { addProperty(_visible); addProperty(_radiusSize); - addProperty(_transparency); + addProperty(_opacity); addProperty(_thickness); _color.setViewOption(properties::Property::ViewOptions::Color); addProperty(_color); @@ -117,7 +117,7 @@ void TouchMarker::render(const std::vector& list) { _shader->activate(); _shader->setUniform(_uniformCache.radius, _radiusSize); - _shader->setUniform(_uniformCache.transparency, _transparency); + _shader->setUniform(_uniformCache.opacity, _opacity); _shader->setUniform(_uniformCache.thickness, _thickness); _shader->setUniform(_uniformCache.color, _color.value()); From 66719c08810f08e3fc7e1970273410f8a49fdb38 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Thu, 2 Jul 2020 13:56:14 +0200 Subject: [PATCH 04/10] Rename 'transparency' to 'colorFilter' in the ring classes to avoid confusion with opacity name change. Also, the 'transparency' used in the rings had a diffrent meaning than for the rest of the rendered objects. It affects the filtering of the color values. --- modules/globebrowsing/shaders/rings_fs.glsl | 13 +++++---- modules/globebrowsing/src/ringscomponent.cpp | 28 ++++++++++---------- modules/globebrowsing/src/ringscomponent.h | 4 +-- modules/space/rendering/renderablerings.cpp | 28 ++++++++++---------- modules/space/rendering/renderablerings.h | 4 +-- modules/space/shaders/rings_fs.glsl | 14 +++++----- 6 files changed, 46 insertions(+), 45 deletions(-) diff --git a/modules/globebrowsing/shaders/rings_fs.glsl b/modules/globebrowsing/shaders/rings_fs.glsl index b18d5d71a8..04cf03d2cc 100644 --- a/modules/globebrowsing/shaders/rings_fs.glsl +++ b/modules/globebrowsing/shaders/rings_fs.glsl @@ -35,7 +35,7 @@ in vec4 shadowCoords; uniform sampler2DShadow shadowMapTexture; uniform sampler1D ringTexture; uniform vec2 textureOffset; -uniform float transparency; +uniform float colorFilterValue; uniform vec3 sunPosition; uniform float _nightFactor; @@ -67,12 +67,11 @@ Fragment getFragment() { } vec4 diffuse = texture(ringTexture, texCoord); - float colorValue = length(diffuse.rgb); - // times 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want - // to normalize the transparency value to [0,1] - if (colorValue < 3.0 * transparency) { - diffuse.a = pow(colorValue / (3.0 * transparency), 1); - //diffuse.a = (colorValue / 3.0) * transparency; + // divided by 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want + // to normalize the alpha value to [0,1] + float colorValue = length(diffuse.rgb) / 3.0; + if (colorValue < colorFilterValue) { + diffuse.a = colorValue * colorFilterValue; if (diffuse.a < 0.65) discard; } diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index 4a45be2517..7bf3a70d73 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -52,7 +52,7 @@ namespace { constexpr const char* _loggerCat = "RingsComponent"; constexpr const std::array UniformNames = { - "modelViewProjectionMatrix", "textureOffset", "transparency", "_nightFactor", + "modelViewProjectionMatrix", "textureOffset", "colorFilterValue", "_nightFactor", "sunPosition", "ringTexture", "shadowMatrix", "shadowMapTexture", "zFightingPercentage" }; @@ -91,11 +91,11 @@ namespace { "of the night side occurs." }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value determines the transparency of part of the rings depending on the " - "color values. For this value v, the transparency is equal to length(color) / v." + constexpr openspace::properties::Property::PropertyInfo ColorFilterInfo = { + "ColorFilter", + "Color Filter", + "This value affects the filtering out of part of the rings depending on the " + "color values of the texture. The higher value, the more rings are filtered out." }; constexpr openspace::properties::Property::PropertyInfo ZFightingPercentageInfo = { @@ -146,10 +146,10 @@ documentation::Documentation RingsComponent::Documentation() { NightFactorInfo.description }, { - TransparencyInfo.identifier, + ColorFilterInfo.identifier, new DoubleVerifier, Optional::Yes, - TransparencyInfo.description + ColorFilterInfo.description }, { ZFightingPercentageInfo.identifier, @@ -173,7 +173,7 @@ RingsComponent::RingsComponent(const ghoul::Dictionary& dictionary) , _size(SizeInfo, 1.f, 0.f, 1e25f) , _offset(OffsetInfo, glm::vec2(0.f, 1.f), glm::vec2(0.f), glm::vec2(1.f)) , _nightFactor(NightFactorInfo, 0.33f, 0.f, 1.f) - , _transparency(TransparencyInfo, 0.15f, 0.f, 1.f) + , _colorFilter(ColorFilterInfo, 0.15f, 0.f, 1.f) , _enabled({ "Enabled", "Enabled", "Enable/Disable Rings" }, true) , _zFightingPercentage(ZFightingPercentageInfo, 0.995f, 0.000001f, 1.f) , _nShadowSamples(NumberShadowSamplesInfo, 2, 1, 7) @@ -228,9 +228,9 @@ void RingsComponent::initialize() { } addProperty(_nightFactor); - if (_ringsDictionary.hasKeyAndValue(TransparencyInfo.identifier)) { - _transparency = static_cast( - _ringsDictionary.value(TransparencyInfo.identifier) + if (_ringsDictionary.hasKeyAndValue(ColorFilterInfo.identifier)) { + _colorFilter = static_cast( + _ringsDictionary.value(ColorFilterInfo.identifier) ); } @@ -248,7 +248,7 @@ void RingsComponent::initialize() { _nShadowSamples.onChange([this]() { compileShadowShader(); }); addProperty(_nShadowSamples); - addProperty(_transparency); + addProperty(_colorFilter); } bool RingsComponent::isReady() const { @@ -327,7 +327,7 @@ void RingsComponent::draw(const RenderData& data, modelViewProjectionTransform ); _shader->setUniform(_uniformCache.textureOffset, _offset); - _shader->setUniform(_uniformCache.transparency, _transparency); + _shader->setUniform(_uniformCache.colorFilterValue, _colorFilter); _shader->setUniform(_uniformCache.nightFactor, _nightFactor); _shader->setUniform(_uniformCache.sunPosition, _sunPosition); _shader->setUniform(_uniformCache.zFightingPercentage, _zFightingPercentage); diff --git a/modules/globebrowsing/src/ringscomponent.h b/modules/globebrowsing/src/ringscomponent.h index 62980e1bf6..d6c7351a90 100644 --- a/modules/globebrowsing/src/ringscomponent.h +++ b/modules/globebrowsing/src/ringscomponent.h @@ -81,14 +81,14 @@ private: properties::FloatProperty _size; properties::Vec2Property _offset; properties::FloatProperty _nightFactor; - properties::FloatProperty _transparency; + properties::FloatProperty _colorFilter; properties::BoolProperty _enabled; properties::FloatProperty _zFightingPercentage; properties::IntProperty _nShadowSamples; std::unique_ptr _shader; std::unique_ptr _geometryOnlyShader; - UniformCache(modelViewProjectionMatrix, textureOffset, transparency, nightFactor, + UniformCache(modelViewProjectionMatrix, textureOffset, colorFilterValue, nightFactor, sunPosition, ringTexture, shadowMatrix, shadowMapTexture, zFightingPercentage ) _uniformCache; UniformCache(modelViewProjectionMatrix, textureOffset, ringTexture diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index 1a30124232..1291ccbe4d 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -39,7 +39,7 @@ namespace { constexpr const std::array UniformNames = { - "modelViewProjectionTransform", "textureOffset", "transparency", "_nightFactor", + "modelViewProjectionTransform", "textureOffset", "colorFilterValue", "_nightFactor", "sunPosition", "texture1" }; @@ -73,11 +73,11 @@ namespace { "of the night side occurs." }; - constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = { - "Transparency", - "Transparency", - "This value determines the transparency of part of the rings depending on the " - "color values. For this value v, the transparency is equal to length(color) / v." + constexpr openspace::properties::Property::PropertyInfo ColorFilterInfo = { + "ColorFilter", + "Color Filter", + "This value affects the filtering out of part of the rings depending on the " + "color values of the texture. The higher value, the more rings are filtered out." }; } // namespace @@ -119,10 +119,10 @@ documentation::Documentation RenderableRings::Documentation() { NightFactorInfo.description }, { - TransparencyInfo.identifier, + ColorFilterInfo.identifier, new DoubleVerifier, Optional::Yes, - TransparencyInfo.description + ColorFilterInfo.description } } }; @@ -134,7 +134,7 @@ RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary) , _size(SizeInfo, 1.f, 0.f, 1e25f) , _offset(OffsetInfo, glm::vec2(0.f, 1.f), glm::vec2(0.f), glm::vec2(1.f)) , _nightFactor(NightFactorInfo, 0.33f, 0.f, 1.f) - , _transparency(TransparencyInfo, 0.15f, 0.f, 1.f) + , _colorFilter(ColorFilterInfo, 0.15f, 0.f, 1.f) { using ghoul::filesystem::File; @@ -169,12 +169,12 @@ RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary) } addProperty(_nightFactor); - if (dictionary.hasKeyAndValue(TransparencyInfo.identifier)) { - _transparency = static_cast( - dictionary.value(TransparencyInfo.identifier) + if (dictionary.hasKeyAndValue(ColorFilterInfo.identifier)) { + _colorFilter = static_cast( + dictionary.value(ColorFilterInfo.identifier) ); } - addProperty(_transparency); + addProperty(_colorFilter); } bool RenderableRings::isReady() const { @@ -226,7 +226,7 @@ void RenderableRings::render(const RenderData& data, RendererTasks&) { data.camera.projectionMatrix() * glm::mat4(modelViewTransform) ); _shader->setUniform(_uniformCache.textureOffset, _offset); - _shader->setUniform(_uniformCache.transparency, _transparency); + _shader->setUniform(_uniformCache.colorFilterValue, _colorFilter); _shader->setUniform(_uniformCache.nightFactor, _nightFactor); _shader->setUniform(_uniformCache.sunPosition, _sunPosition); diff --git a/modules/space/rendering/renderablerings.h b/modules/space/rendering/renderablerings.h index d850670051..35152b1629 100644 --- a/modules/space/rendering/renderablerings.h +++ b/modules/space/rendering/renderablerings.h @@ -66,10 +66,10 @@ private: properties::FloatProperty _size; properties::Vec2Property _offset; properties::FloatProperty _nightFactor; - properties::FloatProperty _transparency; + properties::FloatProperty _colorFilter; std::unique_ptr _shader; - UniformCache(modelViewProjection, textureOffset, transparency, nightFactor, + UniformCache(modelViewProjection, textureOffset, colorFilterValue, nightFactor, sunPosition, texture) _uniformCache; std::unique_ptr _texture; std::unique_ptr _textureFile; diff --git a/modules/space/shaders/rings_fs.glsl b/modules/space/shaders/rings_fs.glsl index b9d4e484c8..ffa20731da 100644 --- a/modules/space/shaders/rings_fs.glsl +++ b/modules/space/shaders/rings_fs.glsl @@ -32,7 +32,7 @@ in vec4 vs_position; uniform sampler1D texture1; uniform vec2 textureOffset; -uniform float transparency; +uniform float colorFilterValue; uniform bool hasSunPosition; uniform vec3 sunPosition; @@ -60,11 +60,13 @@ Fragment getFragment() { } vec4 diffuse = texture(texture1, texCoord); - float colorValue = length(diffuse.rgb); - // times 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want - // to normalize the transparency value to [0,1] - if (colorValue < 3.0 * transparency) { - diffuse.a = pow(colorValue / (3.0 * transparency), 1); + // divided by 3 as length of vec3(1.0, 1.0, 1.0) will return 3 and we want + // to normalize the alpha value to [0,1] + float colorValue = length(diffuse.rgb) / 3.0; + if (colorValue < colorFilterValue) { + diffuse.a = colorValue * colorFilterValue; + if (diffuse.a < 0.65) + discard; } // The normal for the one plane depends on whether we are dealing From bdb6e626baf56a853f2e872974937e63bfd2a389 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Thu, 2 Jul 2020 15:55:49 +0200 Subject: [PATCH 05/10] Color values specified with vec3 instead of vec4 --- data/assets/examples/volume/toyvolume.asset | 2 +- data/assets/scene/digitaluniverse/abell.asset | 2 +- .../digitaluniverse/alternatestarlabels.asset | 2 +- .../scene/digitaluniverse/clusters.asset | 2 +- .../digitaluniverse/constellations.asset | 4 +- .../scene/digitaluniverse/deepsky.asset | 2 +- .../assets/scene/digitaluniverse/dwarfs.asset | 2 +- .../scene/digitaluniverse/exoplanets.asset | 2 +- .../digitaluniverse/globularclusters.asset | 2 +- data/assets/scene/digitaluniverse/grids.asset | 30 ++++++------ .../assets/scene/digitaluniverse/groups.asset | 2 +- .../scene/digitaluniverse/h2regions.asset | 2 +- .../scene/digitaluniverse/localdwarfs.asset | 2 +- .../scene/digitaluniverse/milkyway.asset | 2 +- .../digitaluniverse/obassociations.asset | 2 +- .../scene/digitaluniverse/openclusters.asset | 2 +- .../digitaluniverse/planetarynebulae.asset | 2 +- .../scene/digitaluniverse/pulsars.asset | 2 +- .../scene/digitaluniverse/starlabels.asset | 2 +- .../scene/digitaluniverse/starorbits.asset | 14 +++--- .../scene/digitaluniverse/superclusters.asset | 2 +- .../digitaluniverse/supernovaremnants.asset | 2 +- data/assets/scene/digitaluniverse/tully.asset | 2 +- data/assets/scene/digitaluniverse/voids.asset | 2 +- data/assets/util/debug_helper.asset | 6 +-- data/assets/util/generate_bookmarks.asset | 3 +- .../rendering/renderablecartesianaxes.cpp | 30 ++++++------ .../base/rendering/renderablecartesianaxes.h | 8 +-- modules/base/rendering/renderablelabels.cpp | 11 +++-- modules/base/rendering/renderablelabels.h | 4 +- modules/base/shaders/axes_fs.glsl | 9 ++-- .../rendering/renderablebillboardscloud.cpp | 12 ++--- .../rendering/renderablebillboardscloud.h | 3 +- .../rendering/renderabledumeshes.cpp | 10 ++-- .../rendering/renderabledumeshes.h | 3 +- .../rendering/renderableplanescloud.cpp | 13 ++--- .../rendering/renderableplanescloud.h | 3 +- .../rendering/renderablefov.cpp | 49 ++++++++++++++++--- .../rendering/renderablefov.h | 22 ++++----- .../spacecraftinstruments/shaders/fov_vs.glsl | 32 ++++++------ .../rendering/renderabletoyvolume.cpp | 14 ++++-- .../toyvolume/rendering/renderabletoyvolume.h | 3 +- 42 files changed, 181 insertions(+), 144 deletions(-) diff --git a/data/assets/examples/volume/toyvolume.asset b/data/assets/examples/volume/toyvolume.asset index 93730536f1..9a2f39d1c5 100644 --- a/data/assets/examples/volume/toyvolume.asset +++ b/data/assets/examples/volume/toyvolume.asset @@ -11,7 +11,7 @@ local ToyVolume = { Size = {5, 5, 5}, ScalingExponent = 11, StepSize = 0.01, - Color = {1, 0, 0, 1} + Color = {1, 0, 0} }, GUI = { Path = "/Examples" diff --git a/data/assets/scene/digitaluniverse/abell.asset b/data/assets/scene/digitaluniverse/abell.asset index 287eab6c52..80b5bbbe94 100644 --- a/data/assets/scene/digitaluniverse/abell.asset +++ b/data/assets/scene/digitaluniverse/abell.asset @@ -27,7 +27,7 @@ local object = { File = speck .. "/abell.speck", Texture = textures .. "/point3A.png", LabelFile = speck .. "/abell.label", - TextColor = { 0.0, 0.8, 0.0, 1.0 }, + TextColor = { 0.0, 0.8, 0.0 }, TextSize = 22, TextMinSize = 10.0, Unit = "Mpc", diff --git a/data/assets/scene/digitaluniverse/alternatestarlabels.asset b/data/assets/scene/digitaluniverse/alternatestarlabels.asset index 2289f24eae..dcef9924a2 100644 --- a/data/assets/scene/digitaluniverse/alternatestarlabels.asset +++ b/data/assets/scene/digitaluniverse/alternatestarlabels.asset @@ -17,7 +17,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, LabelFile = speck .. "/stars-altlbl.label", - TextColor = { 0.4, 0.4, 0.4, 1.0 }, + TextColor = { 0.4, 0.4, 0.4 }, DrawLabels = true, TextSize = 14.7, TextMinSize = 6.0, diff --git a/data/assets/scene/digitaluniverse/clusters.asset b/data/assets/scene/digitaluniverse/clusters.asset index f0bb7ac5ea..3f0475d98b 100644 --- a/data/assets/scene/digitaluniverse/clusters.asset +++ b/data/assets/scene/digitaluniverse/clusters.asset @@ -17,7 +17,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, LabelFile = speck .. "/galclust.label", - TextColor = { 1.0, 0.44, 0.0, 1.0 }, + TextColor = { 1.0, 0.44, 0.0 }, DrawLabels = true, TextSize = 22, TextMinSize = 8.0, diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index 92b8accc2f..8a9b470ced 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -19,7 +19,7 @@ local constellationsExtragalactic = { ScaleFactor = 1.0, File = speck .. "/constellationsEXGAL.speck", LabelFile = speck .. "/constellationsEXGAL.label", - TextColor = { 0.8, 0.8, 0.8, 0.4 }, + TextColor = { 0.8, 0.8, 0.8 }, TextSize = 20.0, TextMinSize = 20.0, TextMaxSize = 30.0, @@ -42,7 +42,7 @@ local constellations = { ScaleFactor = 1.0, File = speck .. "/constellations.speck", LabelFile = speck .. "/constellations.label", - TextColor = { 0.8, 0.8, 0.8, 0.3 }, + TextColor = { 0.8, 0.8, 0.8 }, TextSize = 14.5, TextMaxSize = 170.0, TextMinSize = 8.0, diff --git a/data/assets/scene/digitaluniverse/deepsky.asset b/data/assets/scene/digitaluniverse/deepsky.asset index 7b3093051f..4789551408 100644 --- a/data/assets/scene/digitaluniverse/deepsky.asset +++ b/data/assets/scene/digitaluniverse/deepsky.asset @@ -30,7 +30,7 @@ local deepSkyPoints = { --ColorOption = { "prox5Mpc" }, --ColorRange = { { 1.0, 30.0 } }, LabelFile = speck .. "/dso.label", - TextColor = { 0.1, 0.4, 0.6, 1.0 }, + TextColor = { 0.1, 0.4, 0.6 }, TextSize = 20.50, TextMinSize = 16.0, Unit = "Mpc", diff --git a/data/assets/scene/digitaluniverse/dwarfs.asset b/data/assets/scene/digitaluniverse/dwarfs.asset index 507fd039d3..a302fd9154 100644 --- a/data/assets/scene/digitaluniverse/dwarfs.asset +++ b/data/assets/scene/digitaluniverse/dwarfs.asset @@ -29,7 +29,7 @@ local object = { ColorMap = speck .. "/dwarfs.cmap", ColorOption = { "typeindex" }, --ColorRange = { { 1.0, 4.0} }, - TextColor = { 0.5, 0.1, 0.2, 1.0 }, + TextColor = { 0.5, 0.1, 0.2 }, TextSize = 14.6, TextMinSize = 10.0, ScaleFactor = 370, diff --git a/data/assets/scene/digitaluniverse/exoplanets.asset b/data/assets/scene/digitaluniverse/exoplanets.asset index cd1d29aae3..7915477f17 100644 --- a/data/assets/scene/digitaluniverse/exoplanets.asset +++ b/data/assets/scene/digitaluniverse/exoplanets.asset @@ -28,7 +28,7 @@ local object = { File = speck .. "/expl.speck", LabelFile = speck .. "/expl.label", ScaleFactor = 392.5, - TextColor = { 0.3, 0.3, 0.8, 1.0 }, + TextColor = { 0.3, 0.3, 0.8 }, TextSize = 14.8, TextMaxSize = 200.0, TextMinSize = 10.0, diff --git a/data/assets/scene/digitaluniverse/globularclusters.asset b/data/assets/scene/digitaluniverse/globularclusters.asset index d7e26b6829..035052eea1 100644 --- a/data/assets/scene/digitaluniverse/globularclusters.asset +++ b/data/assets/scene/digitaluniverse/globularclusters.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 5, LabelFile = speck .. "/gc.label", - TextColor = { 0.5, 0.5, 0.0, 1.0 }, + TextColor = { 0.5, 0.5, 0.0 }, ScaleFactor = 431.0, TextSize = 16.7, TextMinSize = 4.0, diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index e2d9cea844..7d25f4c347 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -117,7 +117,7 @@ local eclipticLabels = { Opacity = 0.65, LabelFile = speck .. "/eclip.label", DrawLabels = true, - TextColor = { 0.5, 0.5, 0.5, 1.0 }, + TextColor = { 0.5, 0.5, 0.5 }, TextSize = 14.75, TextMinSize = 1.3, TextMaxSize = 50.0, @@ -171,7 +171,7 @@ local equatorialLabels = { Opacity = 0.65, LabelFile = speck .. "/radec.label", DrawLabels = true, - TextColor = { 0.5, 0.5, 0.5, 1.0 }, + TextColor = { 0.5, 0.5, 0.5 }, TextSize = 14.5, TextMinSize = 1.7, TextMaxSize = 70.0, @@ -215,7 +215,7 @@ local galacticLabels = { Opacity = 0.65, LabelFile = speck .. "/galac.label", DrawLabels = true, - TextColor = { 0.5, 0.5, 0.5, 1.0 }, + TextColor = { 0.5, 0.5, 0.5 }, TextSize = 15.8, TextMinSize = 0.5, TextMaxSize = 100.0, @@ -245,7 +245,7 @@ local plane1ld = { File = speck .. "/1ld.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -275,7 +275,7 @@ local plane1lm = { File = speck .. "/1lm.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1lm.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 11.8, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -305,7 +305,7 @@ local plane1ly = { File = speck .. "/1ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1ly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 13.0, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -335,7 +335,7 @@ local plane10ly = { File = speck .. "/10ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10ly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 14.17, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -365,7 +365,7 @@ local plane100ly = { File = speck .. "/100ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100ly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 15.0, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -395,7 +395,7 @@ local plane1kly = { File = speck .. "/1kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1kly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 16.0, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -425,7 +425,7 @@ local plane10kly = { File = speck .. "/10kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10kly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 17.25, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -448,7 +448,7 @@ local plane100kly = { File = speck .. "/100kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100kly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 18.6, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -471,7 +471,7 @@ local plane1Mly = { File = speck .. "/1Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1Mly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 19.6, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -494,7 +494,7 @@ local plane10Mly = { File = speck .. "/10Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10Mly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 20.6, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -517,7 +517,7 @@ local plane100Mly = { File = speck .. "/100Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100Mly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 21.6, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -540,7 +540,7 @@ local plane20Gly = { File = speck .. "/20Gly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/20Gly.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 23.6, TextMinSize = 0.5, TextMaxSize = 30.0, diff --git a/data/assets/scene/digitaluniverse/groups.asset b/data/assets/scene/digitaluniverse/groups.asset index 745f054baf..682f7fb65b 100644 --- a/data/assets/scene/digitaluniverse/groups.asset +++ b/data/assets/scene/digitaluniverse/groups.asset @@ -18,7 +18,7 @@ local object = { Opacity = 0.65, --ScaleFactor = 10.0, LabelFile = speck .. "/groups.label", - TextColor = { 0.1, 0.6, 0.2, 1.0 }, + TextColor = { 0.1, 0.6, 0.2 }, TextSize = 21.5, TextMinSize = 8.0, Unit = "Mpc", diff --git a/data/assets/scene/digitaluniverse/h2regions.asset b/data/assets/scene/digitaluniverse/h2regions.asset index aee342d6e2..db9cf215c6 100644 --- a/data/assets/scene/digitaluniverse/h2regions.asset +++ b/data/assets/scene/digitaluniverse/h2regions.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .."/point4.png", PolygonSides = 6, LabelFile = speck .. "/h2.label", - TextColor = { 0.5, 0.5, 0.5, 1.0 }, + TextColor = { 0.5, 0.5, 0.5 }, ScaleFactor = 420, TextSize = 16.24, TextMinSize = 4.0, diff --git a/data/assets/scene/digitaluniverse/localdwarfs.asset b/data/assets/scene/digitaluniverse/localdwarfs.asset index bd9c6ccfd7..df011129ee 100644 --- a/data/assets/scene/digitaluniverse/localdwarfs.asset +++ b/data/assets/scene/digitaluniverse/localdwarfs.asset @@ -29,7 +29,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 12, LabelFile = speck .. "/localgroup.label", - TextColor = { 0.3, 0.3, 1.0, 1.0 }, + TextColor = { 0.3, 0.3, 1.0 }, ScaleFactor = 465, TextSize = 18.3, TextMinSize = 7.3, diff --git a/data/assets/scene/digitaluniverse/milkyway.asset b/data/assets/scene/digitaluniverse/milkyway.asset index 2f1cb3fc5f..814ce42fe2 100644 --- a/data/assets/scene/digitaluniverse/milkyway.asset +++ b/data/assets/scene/digitaluniverse/milkyway.asset @@ -92,7 +92,7 @@ local homeLabel = { -- Texture = textures .. "/point3.png", DrawLabels = true, LabelFile = homespeck .. "/home.label", - TextColor = { 0.8, 0.8, 0.8, 1.0 }, + TextColor = { 0.8, 0.8, 0.8 }, TextSize = 20.50, TextMinSize = 16.0, TransformationMatrix = { diff --git a/data/assets/scene/digitaluniverse/obassociations.asset b/data/assets/scene/digitaluniverse/obassociations.asset index dd62c55c97..ad25602989 100644 --- a/data/assets/scene/digitaluniverse/obassociations.asset +++ b/data/assets/scene/digitaluniverse/obassociations.asset @@ -31,7 +31,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 7, LabelFile = speck .. "/ob.label", - TextColor = { 0.4, 0.5, 1.0, 1.0 }, + TextColor = { 0.4, 0.5, 1.0 }, ScaleFactor = 390.0, TextSize = 16.24, TextMinSize = 4.50, diff --git a/data/assets/scene/digitaluniverse/openclusters.asset b/data/assets/scene/digitaluniverse/openclusters.asset index a37fe37335..d060f744db 100644 --- a/data/assets/scene/digitaluniverse/openclusters.asset +++ b/data/assets/scene/digitaluniverse/openclusters.asset @@ -26,7 +26,7 @@ local object = { File = speck .. "/oc.speck", Texture = textures .. "/point4.png", PolygonSides = 12, - TextColor = { 0.05, 0.4, 0.2, 1.0 }, + TextColor = { 0.05, 0.4, 0.2 }, LabelFile = speck .. "/oc.label", ScaleFactor = 405.75, TextSize = 15.5, diff --git a/data/assets/scene/digitaluniverse/planetarynebulae.asset b/data/assets/scene/digitaluniverse/planetarynebulae.asset index 5c178355d9..685cd6d21a 100644 --- a/data/assets/scene/digitaluniverse/planetarynebulae.asset +++ b/data/assets/scene/digitaluniverse/planetarynebulae.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 3, LabelFile = speck .. "/pn.label", - TextColor = { 0.25, 0.25, 0.65, 1.0 }, + TextColor = { 0.25, 0.25, 0.65 }, ScaleFactor = 425.0, TextSize = 16.24, TextMinSize = 4.5, diff --git a/data/assets/scene/digitaluniverse/pulsars.asset b/data/assets/scene/digitaluniverse/pulsars.asset index fa87280a4c..bd58260f22 100644 --- a/data/assets/scene/digitaluniverse/pulsars.asset +++ b/data/assets/scene/digitaluniverse/pulsars.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 4, LabelFile = speck .. "/pulsar.label", - TextColor = { 0.7, 0.2, 0.2, 1.0 }, + TextColor = { 0.7, 0.2, 0.2 }, ScaleFactor = 424, TextSize = 15.77, TextMinSize = 4, diff --git a/data/assets/scene/digitaluniverse/starlabels.asset b/data/assets/scene/digitaluniverse/starlabels.asset index 5576bb4a9f..6e12b8e7eb 100644 --- a/data/assets/scene/digitaluniverse/starlabels.asset +++ b/data/assets/scene/digitaluniverse/starlabels.asset @@ -17,7 +17,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, LabelFile = speck .. "/stars.label", - TextColor = { 0.4, 0.4, 0.4, 1.0 }, + TextColor = { 0.4, 0.4, 0.4 }, DrawLabels = true, TextSize = 14.7, TextMinSize = 6.0, diff --git a/data/assets/scene/digitaluniverse/starorbits.asset b/data/assets/scene/digitaluniverse/starorbits.asset index 60c0e26578..51e7d555aa 100644 --- a/data/assets/scene/digitaluniverse/starorbits.asset +++ b/data/assets/scene/digitaluniverse/starorbits.asset @@ -22,7 +22,7 @@ local sunOrbit = { File = speck .. "/starorbits-Sun.speck", MeshColor = {{ 1.0, 0.65, 0.0 }}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -46,7 +46,7 @@ local barnardsOrbit = { File = speck .. "/starorbits-BarnardsStar.speck", MeshColor = {{0.39, 0.58, 0.93}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -70,7 +70,7 @@ local kapteynsOrbit = { File = speck .. "/starorbits-KapteynsStar.speck", MeshColor = {{0.6, 0.6, 0.6}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -94,7 +94,7 @@ local lacaille9352Orbit = { File = speck .. "/starorbits-Lacaille9352.speck", MeshColor = {{0.58, 0.0, 0.83}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -118,7 +118,7 @@ local lSR1826Orbit = { File = speck .. "/starorbits-LSR1826+3014.speck", MeshColor = {{0.0, 0.39, 0.0}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -142,7 +142,7 @@ local lSRJ0822Orbit = { File = speck .. "/starorbits-LSRJ0822+1700.speck", MeshColor = {{0.5, 1.0, 0.0}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, @@ -166,7 +166,7 @@ local pM_J13420Orbit = { File = speck .. "/starorbits-PM_J13420-3415.speck", MeshColor = {{0.70, 0.13, 0.13}}, --LabelFile = speck .. "/1ld.label", - TextColor = { 0.0, 0.2, 0.5, 1.0 }, + TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinSize = 0.5, TextMaxSize = 30.0, diff --git a/data/assets/scene/digitaluniverse/superclusters.asset b/data/assets/scene/digitaluniverse/superclusters.asset index 5ce754caa7..6ebbb1f488 100644 --- a/data/assets/scene/digitaluniverse/superclusters.asset +++ b/data/assets/scene/digitaluniverse/superclusters.asset @@ -27,7 +27,7 @@ local object = { File = speck .. "/superclust.speck", Texture = textures .. "/point3A.png", LabelFile = speck .. "/superclust.label", - TextColor = { 0.9, 0.9, 0.9, 1.0 }, + TextColor = { 0.9, 0.9, 0.9 }, ScaleFactor = 531.0, TextSize = 22.44, TextMinSize = 8.0, diff --git a/data/assets/scene/digitaluniverse/supernovaremnants.asset b/data/assets/scene/digitaluniverse/supernovaremnants.asset index 56b841a2e3..c821080e65 100644 --- a/data/assets/scene/digitaluniverse/supernovaremnants.asset +++ b/data/assets/scene/digitaluniverse/supernovaremnants.asset @@ -27,7 +27,7 @@ local object = { Texture = textures .. "/point4.png", PolygonSides = 7, LabelFile = speck .. "/snr.label", - TextColor = { 0.6, 0.46, 0.0, 1.0 }, + TextColor = { 0.6, 0.46, 0.0 }, ScaleFactor = 424, TextSize = 16.44, TextMinSize = 4.0, diff --git a/data/assets/scene/digitaluniverse/tully.asset b/data/assets/scene/digitaluniverse/tully.asset index a562b8ea4f..45ce730432 100644 --- a/data/assets/scene/digitaluniverse/tully.asset +++ b/data/assets/scene/digitaluniverse/tully.asset @@ -33,7 +33,7 @@ local tullyPoints = { ColorRange = { { 1.0, 30.0 } }, LabelFile = speck .. "/tully.label", DrawLabels = true, - TextColor = { 0.7, 0.7, 0.7, 1.0 }, + TextColor = { 0.7, 0.7, 0.7 }, TextSize = 19.36, TextMinSize = 8.2, TransformationMatrix = { diff --git a/data/assets/scene/digitaluniverse/voids.asset b/data/assets/scene/digitaluniverse/voids.asset index 64ca8bb4ad..420ebe54b7 100644 --- a/data/assets/scene/digitaluniverse/voids.asset +++ b/data/assets/scene/digitaluniverse/voids.asset @@ -19,7 +19,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, LabelFile = speck .. "/voids.label", - TextColor = { 0.296, 0.629, 1.0, 1.0 }, + TextColor = { 0.296, 0.629, 1.0 }, TextSize = 20.9, TextMinSize = 8.0, Unit = "Mpc" diff --git a/data/assets/util/debug_helper.asset b/data/assets/util/debug_helper.asset index 90e80893e2..b0f830e37a 100644 --- a/data/assets/util/debug_helper.asset +++ b/data/assets/util/debug_helper.asset @@ -84,9 +84,9 @@ local addCartesianAxes = function (specification) Renderable = { Type = "RenderableCartesianAxes", Enabled = true, - XColor = {1.0, 0.0, 0.0, 1.0}, - YColor = {0.0, 1.0, 0.0, 1.0}, - ZColor = {0.0, 0.0, 1.0, 1.0} + XColor = {1.0, 0.0, 0.0}, + YColor = {0.0, 1.0, 0.0}, + ZColor = {0.0, 0.0, 1.0} }, GUI = { Name = name, diff --git a/data/assets/util/generate_bookmarks.asset b/data/assets/util/generate_bookmarks.asset index 8c02268e83..2e3da2a9e3 100644 --- a/data/assets/util/generate_bookmarks.asset +++ b/data/assets/util/generate_bookmarks.asset @@ -35,7 +35,8 @@ local getBookmarks = function (guiPath, bookmarkfile) Renderable = { Type = 'RenderableSphericalGrid', Enabled = false, - GridColor = { 0.3, 0.84, 1.0, 0.3}, + Opacity = 0.3, + GridColor = { 0.3, 0.84, 1.0}, LineWidth = linewidth }, GUI = { diff --git a/modules/base/rendering/renderablecartesianaxes.cpp b/modules/base/rendering/renderablecartesianaxes.cpp index ced04ad50e..fe2a07a6db 100644 --- a/modules/base/rendering/renderablecartesianaxes.cpp +++ b/modules/base/rendering/renderablecartesianaxes.cpp @@ -67,19 +67,19 @@ documentation::Documentation RenderableCartesianAxes::Documentation() { { { XColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, XColorInfo.description }, { YColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, YColorInfo.description }, { ZColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, ZColorInfo.description } @@ -93,21 +93,21 @@ RenderableCartesianAxes::RenderableCartesianAxes(const ghoul::Dictionary& dictio , _program(nullptr) , _xColor( XColorInfo, - glm::vec4(0.f, 0.f, 0.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(1.f, 0.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) ) , _yColor( YColorInfo, - glm::vec4(0.f, 1.f, 0.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(0.f, 1.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) ) , _zColor( ZColorInfo, - glm::vec4(0.f, 0.f, 1.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(0.f, 0.f, 1.f), + glm::vec3(0.f), + glm::vec3(1.f) ) { documentation::testSpecificationAndThrow( @@ -117,19 +117,19 @@ RenderableCartesianAxes::RenderableCartesianAxes(const ghoul::Dictionary& dictio ); if (dictionary.hasKey(XColorInfo.identifier)) { - _xColor = dictionary.value(XColorInfo.identifier); + _xColor = dictionary.value(XColorInfo.identifier); } _xColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_xColor); if (dictionary.hasKey(XColorInfo.identifier)) { - _yColor = dictionary.value(YColorInfo.identifier); + _yColor = dictionary.value(YColorInfo.identifier); } _yColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_yColor); if (dictionary.hasKey(ZColorInfo.identifier)) { - _zColor = dictionary.value(ZColorInfo.identifier); + _zColor = dictionary.value(ZColorInfo.identifier); } _zColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_zColor); diff --git a/modules/base/rendering/renderablecartesianaxes.h b/modules/base/rendering/renderablecartesianaxes.h index 600770100b..99741b9fb6 100644 --- a/modules/base/rendering/renderablecartesianaxes.h +++ b/modules/base/rendering/renderablecartesianaxes.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include namespace ghoul::opengl { class ProgramObject; } @@ -61,9 +61,9 @@ protected: ghoul::opengl::ProgramObject* _program; - properties::Vec4Property _xColor; - properties::Vec4Property _yColor; - properties::Vec4Property _zColor; + properties::Vec3Property _xColor; + properties::Vec3Property _yColor; + properties::Vec3Property _zColor; GLuint _vaoId = 0; GLuint _vBufferId = 0; diff --git a/modules/base/rendering/renderablelabels.cpp b/modules/base/rendering/renderablelabels.cpp index dfff61258d..18f05453b8 100644 --- a/modules/base/rendering/renderablelabels.cpp +++ b/modules/base/rendering/renderablelabels.cpp @@ -201,7 +201,7 @@ documentation::Documentation RenderableLabels::Documentation() { }, { LabelColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, LabelColorInfo.description, }, @@ -304,9 +304,9 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& 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) + glm::vec3(1.f, 1.f, 1.f), + glm::vec3(0.f), + glm::vec3(1.f) ) , _labelSize(LabelSizeInfo, 8.f, 0.5f, 30.f) , _fontSize(FontSizeInfo, 50.f, 1.f, 100.f) @@ -338,6 +338,7 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary) "RenderableLabels" ); + addProperty(_opacity); registerUpdateRenderBinFromOpacity(); _blendMode.addOptions({ @@ -691,7 +692,7 @@ void RenderableLabels::renderLabels(const RenderData& data, const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable) { - glm::vec4 textColor = _labelColor; + glm::vec4 textColor = glm::vec4(glm::vec3(_labelColor), 1.f); textColor.a *= fadeInVariable; textColor.a *= _opacity; diff --git a/modules/base/rendering/renderablelabels.h b/modules/base/rendering/renderablelabels.h index 7d0466b9d0..af3b90ece5 100644 --- a/modules/base/rendering/renderablelabels.h +++ b/modules/base/rendering/renderablelabels.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -104,7 +104,7 @@ private: float linearSmoothStepFunc(float x, float startX, float endX, float sUnit, float eUnit) const; - properties::Vec4Property _labelColor; + properties::Vec3Property _labelColor; properties::FloatProperty _labelSize; properties::FloatProperty _fontSize; properties::FloatProperty _labelMinSize; diff --git a/modules/base/shaders/axes_fs.glsl b/modules/base/shaders/axes_fs.glsl index 0b1513ac46..17777c410f 100644 --- a/modules/base/shaders/axes_fs.glsl +++ b/modules/base/shaders/axes_fs.glsl @@ -29,16 +29,17 @@ in float vs_screenSpaceDepth; in vec4 vs_positionViewSpace; in vec3 vs_positionModelSpace; -uniform vec4 xColor; -uniform vec4 yColor; -uniform vec4 zColor; +uniform vec3 xColor; +uniform vec3 yColor; +uniform vec3 zColor; Fragment getFragment() { Fragment frag; vec3 colorComponents = step(0.01f, vs_positionModelSpace); - frag.color = colorComponents.x * xColor + + frag.color.a = 1.0; + frag.color.rgb = colorComponents.x * xColor + colorComponents.y * yColor + colorComponents.z * zColor; diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index caa8c1d84f..79e0095a4e 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -308,7 +308,7 @@ documentation::Documentation RenderableBillboardsCloud::Documentation() { }, { TextColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, TextColorInfo.description }, @@ -413,9 +413,9 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di , _spriteTexturePath(SpriteTextureInfo) , _textColor( TextColorInfo, - glm::vec4(1.f, 1.f, 1.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(1.f, 1.f, 1.f), + glm::vec3(0.f), + glm::vec3(1.f) ) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) , _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f) @@ -610,7 +610,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di _hasLabel = true; if (dictionary.hasKey(TextColorInfo.identifier)) { - _textColor = dictionary.value(TextColorInfo.identifier); + _textColor = dictionary.value(TextColorInfo.identifier); _hasLabel = true; } _textColor.setViewOption(properties::Property::ViewOptions::Color); @@ -911,7 +911,7 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, break; } - glm::vec4 textColor = _textColor; + glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), 1.f); textColor.a *= fadeInVariable; textColor.a *= _opacity; diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.h b/modules/digitaluniverse/rendering/renderablebillboardscloud.h index 7953806824..e58d53da87 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.h +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -115,7 +114,7 @@ private: properties::FloatProperty _scaleFactor; properties::Vec3Property _pointColor; properties::StringProperty _spriteTexturePath; - properties::Vec4Property _textColor; + properties::Vec3Property _textColor; properties::FloatProperty _textSize; properties::FloatProperty _textMinSize; properties::FloatProperty _textMaxSize; diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 7b1eef71a5..2b3b33c9ef 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -180,7 +180,7 @@ documentation::Documentation RenderableDUMeshes::Documentation() { }, { TextColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, TextColorInfo.description }, @@ -234,7 +234,7 @@ documentation::Documentation RenderableDUMeshes::Documentation() { RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) : Renderable(dictionary) //, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f) - , _textColor(TextColorInfo, glm::vec4(1.f), glm::vec4(0.f), glm::vec4(1.f)) + , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) , _drawElements(DrawElementsInfo, true) , _drawLabels(DrawLabelInfo, false) @@ -327,7 +327,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) _hasLabel = true; if (dictionary.hasKey(TextColorInfo.identifier)) { - _textColor = dictionary.value(TextColorInfo.identifier); + _textColor = dictionary.value(TextColorInfo.identifier); _hasLabel = true; } _textColor.setViewOption(properties::Property::ViewOptions::Color); @@ -542,6 +542,8 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, labelInfo.scale = pow(10.f, _textSize); labelInfo.enableDepth = true; labelInfo.enableFalseDepth = false; + + glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _opacity); for (const std::pair& pair : _labelData) { //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); @@ -551,7 +553,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, *_font, scaledPos, pair.second, - _textColor, + textColor, labelInfo ); } diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h index 29d5ae658c..60f5994e7a 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.h +++ b/modules/digitaluniverse/rendering/renderabledumeshes.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -120,7 +119,7 @@ private: //properties::FloatProperty _scaleFactor; //properties::Vec3Property _pointColor; - properties::Vec4Property _textColor; + properties::Vec3Property _textColor; properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::BoolProperty _drawLabels; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index e08f89e394..ec87964d79 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -201,7 +201,7 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { }, { TextColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, TextColorInfo.description }, @@ -285,12 +285,7 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 10000.f) - , _textColor( - TextColorInfo, - glm::vec4(1.0f, 1.0, 1.0f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) - ) + , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _textSize(TextSizeInfo, 8.0, 0.5, 24.0) , _drawElements(DrawElementsInfo, true) , _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown) @@ -374,7 +369,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary _hasLabel = true; if (dictionary.hasKey(TextColorInfo.identifier)) { - _textColor = dictionary.value(TextColorInfo.identifier); + _textColor = dictionary.value(TextColorInfo.identifier); _hasLabel = true; } _textColor.setViewOption(properties::Property::ViewOptions::Color); @@ -632,7 +627,7 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, break; } - glm::vec4 textColor = _textColor; + glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), 1.f); textColor.a *= fadeInVariable * _opacity; ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.h b/modules/digitaluniverse/rendering/renderableplanescloud.h index 6601c9d96f..583409d58e 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.h +++ b/modules/digitaluniverse/rendering/renderableplanescloud.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -117,7 +116,7 @@ private: int _textureVariableIndex = 0; properties::FloatProperty _scaleFactor; - properties::Vec4Property _textColor; + properties::Vec3Property _textColor; properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::OptionProperty _blendMode; diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index 12e2d4de1d..f0f4b1f011 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -256,13 +256,48 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) , _drawSolid(DrawSolidInfo, false) , _standOffDistance(StandoffDistanceInfo, 0.9999, 0.99, 1.0, 0.000001) , _colors({ - { DefaultStartColorInfo, glm::vec4(0.4f) }, - { DefaultEndColorInfo, glm::vec4(0.85f, 0.85f, 0.85f, 1.f) }, - { ActiveColorInfo, glm::vec4(0.f, 1.f, 0.f, 1.f) }, - { TargetInFovInfo, glm::vec4(0.f, 0.5f, 0.7f, 1.f) }, - { IntersectionStartInfo, glm::vec4(1.f, 0.89f, 0.f, 1.f) }, - { IntersectionEndInfo, glm::vec4(1.f, 0.29f, 0.f, 1.f) }, - { SquareColorInfo, glm::vec4(0.85f, 0.85f, 0.85f, 1.f) } + { + DefaultStartColorInfo, + glm::vec3(0.4f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + DefaultEndColorInfo, + glm::vec3(0.85f, 0.85f, 0.85f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + ActiveColorInfo, + glm::vec3(0.f, 1.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + TargetInFovInfo, + glm::vec3(0.f, 0.5f, 0.7f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + IntersectionStartInfo, + glm::vec3(1.f, 0.89f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + IntersectionEndInfo, + glm::vec3(1.f, 0.29f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + SquareColorInfo, + glm::vec3(0.85f, 0.85f, 0.85f), + glm::vec3(0.f), + glm::vec3(1.f) + } }) { documentation::testSpecificationAndThrow( diff --git a/modules/spacecraftinstruments/rendering/renderablefov.h b/modules/spacecraftinstruments/rendering/renderablefov.h index dca23e19d3..082e6cb1fd 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.h +++ b/modules/spacecraftinstruments/rendering/renderablefov.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -69,15 +69,15 @@ private: void updateGPU(); void insertPoint(std::vector& arr, glm::vec4 p, glm::vec4 c); - glm::vec4 squareColor(float t) const { + glm::vec3 squareColor(float t) const { return _colors.active.value() * t + _colors.square.value() * (1 - t); } - glm::vec4 endColor(float t) const { + glm::vec3 endColor(float t) const { return _colors.active.value() * t + _colors.intersectionEnd.value() * (1 - t); } - glm::vec4 fovColor(float t) const { + glm::vec3 fovColor(float t) const { return _colors.active.value() * t + _colors.targetInFieldOfView.value() * (1 - t); } @@ -150,13 +150,13 @@ private: RenderInformation _fieldOfViewBounds; struct { - properties::Vec4Property defaultStart; // Start color for uninteresting times - properties::Vec4Property defaultEnd; // End color for uninteresting times - properties::Vec4Property active; // Color use when a field-of-view is projecting - properties::Vec4Property targetInFieldOfView; // Color to use for target in fov - properties::Vec4Property intersectionStart; // Color at the start of intersection - properties::Vec4Property intersectionEnd; // Color at the end of intersection - properties::Vec4Property square; // Color for the orthogonal square + properties::Vec3Property defaultStart; // Start color for uninteresting times + properties::Vec3Property defaultEnd; // End color for uninteresting times + properties::Vec3Property active; // Color use when a field-of-view is projecting + properties::Vec3Property targetInFieldOfView; // Color to use for target in fov + properties::Vec3Property intersectionStart; // Color at the start of intersection + properties::Vec3Property intersectionEnd; // Color at the end of intersection + properties::Vec3Property square; // Color for the orthogonal square } _colors; }; diff --git a/modules/spacecraftinstruments/shaders/fov_vs.glsl b/modules/spacecraftinstruments/shaders/fov_vs.glsl index 489f38ec48..2bf1ff5fde 100644 --- a/modules/spacecraftinstruments/shaders/fov_vs.glsl +++ b/modules/spacecraftinstruments/shaders/fov_vs.glsl @@ -34,13 +34,13 @@ out vec4 vs_positionScreenSpace; uniform mat4 modelViewProjectionTransform; -uniform vec4 defaultColorStart; -uniform vec4 defaultColorEnd; -uniform vec4 activeColor; -uniform vec4 targetInFieldOfViewColor; -uniform vec4 intersectionStartColor; -uniform vec4 intersectionEndColor; -uniform vec4 squareColor; +uniform vec3 defaultColorStart; +uniform vec3 defaultColorEnd; +uniform vec3 activeColor; +uniform vec3 targetInFieldOfViewColor; +uniform vec3 intersectionStartColor; +uniform vec3 intersectionEndColor; +uniform vec3 squareColor; uniform float interpolation; // This needs to be synced with the RenderableFov header @@ -60,29 +60,31 @@ void main() { vs_positionScreenSpace = z_normalization(positionClipSpace); gl_Position = vs_positionScreenSpace; + vec3 color; switch (colorInformation) { case VertexColorTypeDefaultStart: - vs_color = defaultColorStart; + color = defaultColorStart; break; case VertexColorTypeDefaultEnd: - vs_color = defaultColorEnd; + color = defaultColorEnd; break; case VertexColorTypeInFieldOfView: - vs_color = activeColor * interpolation + targetInFieldOfViewColor * (1 - interpolation); + color = activeColor * interpolation + targetInFieldOfViewColor * (1 - interpolation); break; case VertexColorTypeActive: - vs_color = activeColor; + color = activeColor; break; case VertexColorTypeIntersectionStart: - vs_color = intersectionStartColor; + color = intersectionStartColor; break; case VertexColorTypeIntersectionEnd: - vs_color = activeColor * interpolation + intersectionEndColor * (1 - interpolation); + color = activeColor * interpolation + intersectionEndColor * (1 - interpolation); break; case VertexColorTypeSquare: - vs_color = activeColor * interpolation + squareColor * (1 - interpolation); + color = activeColor * interpolation + squareColor * (1 - interpolation); break; default: - vs_color = vec4(1.0, 0.0, 1.0, 1.0); + color = vec3(1.0, 0.0, 1.0); } + vs_color = vec4(color, 1.0); } diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index 46dc7ffca8..f5bdc26ad9 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -92,7 +92,7 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) glm::vec3(0.f), glm::vec3(glm::two_pi()) ) - , _color(ColorInfo, glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f)) + , _color(ColorInfo, glm::vec3(1.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(1.f)) , _downScaleVolumeRendering(DownscaleVolumeRenderingInfo, 1.f, 0.1f, 1.f) { if (dictionary.hasKeyAndValue(ScalingExponentInfo.identifier)) { @@ -113,8 +113,8 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) _rotation = dictionary.value(RotationInfo.identifier); } - if (dictionary.hasKeyAndValue(ColorInfo.identifier)) { - _color = dictionary.value(ColorInfo.identifier); + if (dictionary.hasKeyAndValue(ColorInfo.identifier)) { + _color = dictionary.value(ColorInfo.identifier); } if (dictionary.hasKeyAndValue(StepSizeInfo.identifier)) { @@ -141,7 +141,8 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) RenderableToyVolume::~RenderableToyVolume() {} void RenderableToyVolume::initializeGL() { - _raycaster = std::make_unique(_color); + glm::vec4 color{ glm::vec3(_color), _opacity }; + _raycaster = std::make_unique(color); _raycaster->initialize(); global::raycasterManager.attachRaycaster(*_raycaster.get()); @@ -163,6 +164,7 @@ void RenderableToyVolume::initializeGL() { addProperty(_translation); addProperty(_rotation); addProperty(_color); + addProperty(_opacity); addProperty(_downScaleVolumeRendering); } @@ -196,7 +198,9 @@ void RenderableToyVolume::update(const UpdateData& data) { std::pow(10.f, static_cast(_scalingExponent)) ); - _raycaster->setColor(_color); + glm::vec4 color{ glm::vec3(_color), _opacity }; + + _raycaster->setColor(color); _raycaster->setStepSize(_stepSize); _raycaster->setModelTransform(transform); _raycaster->setTime(data.time.j2000Seconds()); diff --git a/modules/toyvolume/rendering/renderabletoyvolume.h b/modules/toyvolume/rendering/renderabletoyvolume.h index 4f4692534b..d42988639d 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.h +++ b/modules/toyvolume/rendering/renderabletoyvolume.h @@ -30,7 +30,6 @@ #include #include #include -#include namespace openspace { @@ -54,7 +53,7 @@ private: properties::FloatProperty _stepSize; properties::Vec3Property _translation; properties::Vec3Property _rotation; - properties::Vec4Property _color; + properties::Vec3Property _color; properties::FloatProperty _downScaleVolumeRendering; std::unique_ptr _raycaster; From ef0eef842d4a844b358e5424ddf09f48a9ea6980 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Fri, 3 Jul 2020 16:36:53 +0200 Subject: [PATCH 06/10] Add opacity for text labels and fix constellation label opacity --- .../digitaluniverse/constellations.asset | 2 ++ .../rendering/renderablebillboardscloud.cpp | 21 ++++++++++++++++-- .../rendering/renderablebillboardscloud.h | 1 + .../rendering/renderabledumeshes.cpp | 20 ++++++++++++++++- .../rendering/renderabledumeshes.h | 1 + .../rendering/renderableplanescloud.cpp | 22 +++++++++++++++++-- .../rendering/renderableplanescloud.h | 1 + 7 files changed, 63 insertions(+), 5 deletions(-) diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index 8a9b470ced..6f98dda9bc 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -20,6 +20,7 @@ local constellationsExtragalactic = { File = speck .. "/constellationsEXGAL.speck", LabelFile = speck .. "/constellationsEXGAL.label", TextColor = { 0.8, 0.8, 0.8 }, + TextOpacity = 0.4, TextSize = 20.0, TextMinSize = 20.0, TextMaxSize = 30.0, @@ -43,6 +44,7 @@ local constellations = { File = speck .. "/constellations.speck", LabelFile = speck .. "/constellations.label", TextColor = { 0.8, 0.8, 0.8 }, + TextOpacity = 0.3, TextSize = 14.5, TextMaxSize = 170.0, TextMinSize = 8.0, diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 79e0095a4e..003f75360f 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -131,6 +131,13 @@ namespace { "The text color for the astronomical object." }; + constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = { + "TextOpacity", + "Text Opacity", + "Determines the transparency of the text label, where 1 is completely opaque " + "and 0 fully transparent." + }; + constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = { "TextSize", "Text Size", @@ -312,6 +319,12 @@ documentation::Documentation RenderableBillboardsCloud::Documentation() { Optional::Yes, TextColorInfo.description }, + { + TextOpacityInfo.identifier, + new DoubleVerifier, + Optional::Yes, + TextOpacityInfo.description + }, { TextSizeInfo.identifier, new DoubleVerifier, @@ -417,6 +430,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di glm::vec3(0.f), glm::vec3(1.f) ) + , _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) , _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f) , _textMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f) @@ -617,6 +631,10 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di addProperty(_textColor); _textColor.onChange([&]() { _textColorIsDirty = true; }); + if (dictionary.hasKey(TextOpacityInfo.identifier)) { + _textOpacity = dictionary.value(TextOpacityInfo.identifier); + } + addProperty(_textOpacity); if (dictionary.hasKey(TextSizeInfo.identifier)) { _textSize = dictionary.value(TextSizeInfo.identifier); @@ -911,9 +929,8 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, break; } - glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), 1.f); + glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity); textColor.a *= fadeInVariable; - textColor.a *= _opacity; ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo; labelInfo.orthoRight = orthoRight; diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.h b/modules/digitaluniverse/rendering/renderablebillboardscloud.h index e58d53da87..1c95698927 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.h +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.h @@ -115,6 +115,7 @@ private: properties::Vec3Property _pointColor; properties::StringProperty _spriteTexturePath; properties::Vec3Property _textColor; + properties::FloatProperty _textOpacity; properties::FloatProperty _textSize; properties::FloatProperty _textMinSize; properties::FloatProperty _textMaxSize; diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 2b3b33c9ef..4250467706 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -76,6 +76,13 @@ namespace { "The text color for the astronomical object." }; + constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = { + "TextOpacity", + "Text Opacity", + "Determines the transparency of the text label, where 1 is completely opaque " + "and 0 fully transparent." + }; + constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = { "TextSize", "Text Size", @@ -184,6 +191,12 @@ documentation::Documentation RenderableDUMeshes::Documentation() { Optional::Yes, TextColorInfo.description }, + { + TextOpacityInfo.identifier, + new DoubleVerifier, + Optional::Yes, + TextOpacityInfo.description + }, { TextSizeInfo.identifier, new DoubleVerifier, @@ -235,6 +248,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) : Renderable(dictionary) //, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f) , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) + , _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) , _drawElements(DrawElementsInfo, true) , _drawLabels(DrawLabelInfo, false) @@ -334,6 +348,10 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) addProperty(_textColor); _textColor.onChange([&]() { _textColorIsDirty = true; }); + if (dictionary.hasKey(TextOpacityInfo.identifier)) { + _textOpacity = dictionary.value(TextOpacityInfo.identifier); + } + addProperty(_textOpacity); if (dictionary.hasKey(TextSizeInfo.identifier)) { _textSize = dictionary.value(TextSizeInfo.identifier); @@ -543,7 +561,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, labelInfo.enableDepth = true; labelInfo.enableFalseDepth = false; - glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _opacity); + glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity); for (const std::pair& pair : _labelData) { //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h index 60f5994e7a..530c6c0fca 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.h +++ b/modules/digitaluniverse/rendering/renderabledumeshes.h @@ -120,6 +120,7 @@ private: //properties::FloatProperty _scaleFactor; //properties::Vec3Property _pointColor; properties::Vec3Property _textColor; + properties::FloatProperty _textOpacity; properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::BoolProperty _drawLabels; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index ec87964d79..8ef1121861 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -81,6 +81,13 @@ namespace { "The text color for the astronomical object." }; + constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = { + "TextOpacity", + "Text Opacity", + "Determines the transparency of the text label, where 1 is completely opaque " + "and 0 fully transparent." + }; + constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = { "TextSize", "Text Size", @@ -205,6 +212,12 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { Optional::Yes, TextColorInfo.description }, + { + TextOpacityInfo.identifier, + new DoubleVerifier, + Optional::Yes, + TextOpacityInfo.description + }, { TextSizeInfo.identifier, new DoubleVerifier, @@ -286,6 +299,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary : Renderable(dictionary) , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 10000.f) , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) + , _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f) , _textSize(TextSizeInfo, 8.0, 0.5, 24.0) , _drawElements(DrawElementsInfo, true) , _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown) @@ -376,6 +390,10 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary addProperty(_textColor); _textColor.onChange([&]() { _textColorIsDirty = true; }); + if (dictionary.hasKey(TextOpacityInfo.identifier)) { + _textOpacity = dictionary.value(TextOpacityInfo.identifier); + } + addProperty(_textOpacity); if (dictionary.hasKey(TextSizeInfo.identifier)) { _textSize = dictionary.value(TextSizeInfo.identifier); @@ -627,8 +645,8 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, break; } - glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), 1.f); - textColor.a *= fadeInVariable * _opacity; + glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity); + textColor.a *= fadeInVariable; ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo; labelInfo.orthoRight = orthoRight; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.h b/modules/digitaluniverse/rendering/renderableplanescloud.h index 583409d58e..96d2813edb 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.h +++ b/modules/digitaluniverse/rendering/renderableplanescloud.h @@ -117,6 +117,7 @@ private: properties::FloatProperty _scaleFactor; properties::Vec3Property _textColor; + properties::FloatProperty _textOpacity; properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::OptionProperty _blendMode; From a9021ac8dcdf5f2715b75ccca517283adff69be8 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Tue, 7 Jul 2020 10:23:24 +0200 Subject: [PATCH 07/10] Separate GlobeLabels vec4 color into opacity and vec3 color This commit does not change the previous behavior. Note however that the behavior for opacity is a bit weird for this component. --- .../dwarf_planets/pluto/charon.asset | 2 +- .../dwarf_planets/pluto/pluto.asset | 2 +- .../solarsystem/planets/earth/earth.asset | 2 +- .../solarsystem/planets/earth/moon/moon.asset | 2 +- .../planets/jupiter/callisto/callisto.asset | 2 +- .../planets/jupiter/europa/europa.asset | 2 +- .../planets/jupiter/ganymede/ganymede.asset | 2 +- .../solarsystem/planets/jupiter/io/io.asset | 2 +- .../scene/solarsystem/planets/mars/mars.asset | 2 +- .../solarsystem/planets/mercury/mercury.asset | 2 +- .../planets/saturn/dione/dione.asset | 2 +- .../planets/saturn/enceladus/enceladus.asset | 2 +- .../planets/saturn/iapetus/iapetus.asset | 2 +- .../planets/saturn/mimas/mimas.asset | 2 +- .../planets/saturn/rhea/rhea.asset | 2 +- .../planets/saturn/tethys/tethys.asset | 2 +- .../planets/saturn/titan/titan.asset | 2 +- .../solarsystem/planets/venus/venus.asset | 2 +- .../src/globelabelscomponent.cpp | 30 +++++++++++++++---- .../globebrowsing/src/globelabelscomponent.h | 5 ++-- 20 files changed, 45 insertions(+), 26 deletions(-) diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset index 87139c2b9e..9b02a6352e 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset @@ -50,7 +50,7 @@ local Charon = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index ce98ef30f8..62fa02ad0a 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -50,7 +50,7 @@ local Pluto = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index 1693d8ad15..db4e09d581 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -291,7 +291,7 @@ local Earth = { FadeOutStartingDistance = 80000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1500000.0, - LabelsColor = {1.0, 0.0, 0.0, 1.0} + LabelsColor = {1.0, 0.0, 0.0} } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset index 642e0a0e90..d896642c2c 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset @@ -162,7 +162,7 @@ local Moon = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, GUI = { diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset index d0b2496e52..7ee21f1966 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset @@ -58,7 +58,7 @@ local Callisto = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset index d5e455bb9f..f589215dd3 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset @@ -67,7 +67,7 @@ local Europa = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset index 513136ef98..d53036f909 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset @@ -58,7 +58,7 @@ local Ganymede = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset index fb10f0b3a8..b34822bab3 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset @@ -58,7 +58,7 @@ local Io = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index f6d9b9d188..b9d8a2d13f 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -196,7 +196,7 @@ local Mars = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index 8eda6c5eb9..780b3a1ea9 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -214,7 +214,7 @@ local Mercury = { FadeOutStartingDistance = 80000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1500000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset index ded4b6ae73..5e0014abf8 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset @@ -56,7 +56,7 @@ local Dione = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset index 8a66735198..4538de4a35 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset @@ -63,7 +63,7 @@ local Enceladus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset index 892cc2c13e..5d6bba2f12 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset @@ -56,7 +56,7 @@ local Iapetus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset index 53d9b7da21..a27427627c 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset @@ -56,7 +56,7 @@ local Mimas = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset index 008663ecf5..a218d2280a 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset @@ -56,7 +56,7 @@ local Rhea = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset index fea8618180..dc41241974 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset @@ -56,7 +56,7 @@ local Tethys = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset index a086c9eecb..5c871fb20a 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset @@ -63,7 +63,7 @@ local Titan = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 486f2d2cab..0eb0654b9d 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -87,7 +87,7 @@ local Venus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 3500000.0, - LabelsColor = {1.0, 1.0, 0.0, 1.0} + LabelsColor = {1.0, 1.0, 0.0} } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index e051411010..3d6b27583d 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -109,6 +109,12 @@ namespace { "Labels Color" }; + constexpr openspace::properties::Property::PropertyInfo LabelsOpacityInfo = { + "LabelsOpacity", + "Labels Opacity", + "Labels Opacity" + }; + constexpr openspace::properties::Property::PropertyInfo LabelsFadeInStartingDistanceInfo = { @@ -210,10 +216,16 @@ documentation::Documentation GlobeLabelsComponent::Documentation() { }, { LabelsColorInfo.identifier, - new Vector4Verifier(), + new DoubleVector3Verifier, Optional::Yes, LabelsColorInfo.description }, + { + LabelsOpacityInfo.identifier, + new DoubleVerifier, + Optional::Yes, + LabelsOpacityInfo.description + }, { LabelsFadeInStartingDistanceInfo.identifier, new DoubleVerifier, @@ -270,10 +282,11 @@ GlobeLabelsComponent::GlobeLabelsComponent() , _labelsMinHeight(LabelsMinHeightInfo, 100.0, 0.0, 10000.0) , _labelsColor( LabelsColorInfo, - glm::vec4(1.f, 1.f, 0.f, 1.f), - glm::vec4(0.f), - glm::vec4(1.f) + glm::vec3(1.f, 1.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) ) + , _labelsOpacity(LabelsOpacityInfo, 1.f, 0.f, 1.f) , _labelsFadeInDist(LabelsFadeInStartingDistanceInfo, 1e6, 1e3, 1e8) , _labelsFadeOutDist(LabelsFadeOutStartingDistanceInfo, 1e4, 1, 1e7) , _labelsFadeInEnabled(LabelsFadeInEnabledInfo, false) @@ -291,6 +304,7 @@ GlobeLabelsComponent::GlobeLabelsComponent() addProperty(_labelsMinHeight); _labelsColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_labelsColor); + addProperty(_labelsOpacity); addProperty(_labelsFadeInDist); addProperty(_labelsFadeOutDist); addProperty(_labelsMinSize); @@ -355,7 +369,11 @@ void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary, } if (dictionary.hasKey(LabelsColorInfo.identifier)) { - _labelsColor = dictionary.value(LabelsColorInfo.identifier); + _labelsColor = dictionary.value(LabelsColorInfo.identifier); + } + + if (dictionary.hasKey(LabelsOpacityInfo.identifier)) { + _labelsOpacity = dictionary.value(LabelsOpacityInfo.identifier); } if (dictionary.hasKey(LabelsFadeInEnabledInfo.identifier)) { @@ -670,7 +688,7 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data, float distToCamera, float fadeInVariable ) { - glm::vec4 textColor = _labelsColor; + glm::vec4 textColor = glm::vec4(glm::vec3(_labelsColor), _labelsOpacity); textColor.a *= fadeInVariable; glm::dvec4 cameraUpVecWorld = glm::dvec4(data.camera.lookUpVectorWorldSpace(), 0.0); diff --git a/modules/globebrowsing/src/globelabelscomponent.h b/modules/globebrowsing/src/globelabelscomponent.h index 98371f39e6..1bded12791 100644 --- a/modules/globebrowsing/src/globelabelscomponent.h +++ b/modules/globebrowsing/src/globelabelscomponent.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -89,7 +89,8 @@ private: properties::IntProperty _labelsMinSize; properties::FloatProperty _labelsSize; properties::FloatProperty _labelsMinHeight; - properties::Vec4Property _labelsColor; + properties::Vec3Property _labelsColor; + properties::FloatProperty _labelsOpacity; properties::FloatProperty _labelsFadeInDist; properties::FloatProperty _labelsFadeOutDist; properties::BoolProperty _labelsFadeInEnabled; From 2654164a6af3515b8fc30e881b5b6da1498fc47a Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Tue, 7 Jul 2020 13:03:36 +0200 Subject: [PATCH 08/10] Separate opacity and color and tidy up shaders a bit --- .../rendering/renderableshadowcylinder.cpp | 22 +++++++++++-------- .../rendering/renderableshadowcylinder.h | 6 ++--- .../shaders/terminatorshadow_fs.glsl | 9 ++++---- .../shaders/terminatorshadow_vs.glsl | 9 +++----- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp index 3bef08edd9..11e83bcec6 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp @@ -38,8 +38,8 @@ namespace { constexpr const char* ProgramName = "ShadowCylinderProgram"; constexpr const char* MainFrame = "GALACTIC"; - constexpr const std::array UniformNames = { - "modelViewProjectionTransform", "shadowColor" + constexpr const std::array UniformNames = { + "modelViewProjectionTransform", "shadowColor", "opacity" }; constexpr openspace::properties::Property::PropertyInfo NumberPointsInfo = { @@ -135,7 +135,7 @@ documentation::Documentation RenderableShadowCylinder::Documentation() { }, { ShadowColorInfo.identifier, - new DoubleVector4Verifier, + new DoubleVector3Verifier, Optional::Yes, ShadowColorInfo.description }, @@ -189,11 +189,7 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict : Renderable(dictionary) , _numberOfPoints(NumberPointsInfo, 190, 1, 300) , _shadowLength(ShadowLengthInfo, 0.1f, 0.f, 0.5f) - , _shadowColor( - ShadowColorInfo, - glm::vec4(1.f, 1.f, 1.f, 0.25f), - glm::vec4(0.f), glm::vec4(1.f) - ) + , _shadowColor(ShadowColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _terminatorType( TerminatorTypeInfo, properties::OptionProperty::DisplayType::Dropdown @@ -210,6 +206,10 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict "RenderableShadowCylinder" ); + _opacity.setValue(0.25f); + addProperty(_opacity); + registerUpdateRenderBinFromOpacity(); + if (dictionary.hasKey(NumberPointsInfo.identifier)) { _numberOfPoints = static_cast( dictionary.value(NumberPointsInfo.identifier) @@ -227,7 +227,7 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict if (dictionary.hasKey(ShadowColorInfo.identifier)) { - _shadowColor = dictionary.value(ShadowLengthInfo.identifier); + _shadowColor = dictionary.value(ShadowLengthInfo.identifier); } _shadowColor.setViewOption(properties::Property::ViewOptions::Color); addProperty(_shadowColor); @@ -306,6 +306,8 @@ bool RenderableShadowCylinder::isReady() const { void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) { glDepthMask(false); + glDisable(GL_CULL_FACE); + _shader->activate(); // Model transform and view transform needs to be in double precision @@ -321,6 +323,7 @@ void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) { ); _shader->setUniform(_uniformCache.shadowColor, _shadowColor); + _shader->setUniform(_uniformCache.opacity, _opacity); glBindVertexArray(_vao); glDrawArrays(GL_TRIANGLE_STRIP, 0, static_cast(_vertices.size())); @@ -328,6 +331,7 @@ void RenderableShadowCylinder::render(const RenderData& data, RendererTasks&) { _shader->deactivate(); + glDisable(GL_CULL_FACE); glDepthMask(true); } diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h index 85be7ab556..236f519470 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -70,7 +70,7 @@ private: properties::IntProperty _numberOfPoints; properties::FloatProperty _shadowLength; - properties::Vec4Property _shadowColor; + properties::Vec3Property _shadowColor; properties::OptionProperty _terminatorType; properties::StringProperty _lightSource; properties::StringProperty _observer; @@ -79,7 +79,7 @@ private: properties::OptionProperty _aberration; ghoul::opengl::ProgramObject* _shader = nullptr; - UniformCache(modelViewProjectionTransform, shadowColor) _uniformCache; + UniformCache(modelViewProjectionTransform, shadowColor, opacity) _uniformCache; glm::dmat3 _stateMatrix = glm::dmat3(1.0); diff --git a/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl b/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl index 1fafbc02a2..d6e16b36fb 100644 --- a/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl +++ b/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl @@ -26,15 +26,14 @@ #include "fragment.glsl" in vec4 vs_positionScreenSpace; -in vec4 vs_point_velocity; -in vec4 vs_color; - -uniform vec3 color; +in vec3 vs_color; +uniform float opacity; Fragment getFragment() { Fragment frag; - frag.color = vs_color; + frag.color = vec4(vs_color, 1.0); + frag.color.a *= opacity; frag.depth = vs_positionScreenSpace.w; return frag; diff --git a/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl b/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl index c837cac53b..55fd791490 100644 --- a/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl +++ b/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl @@ -28,22 +28,19 @@ layout(location = 0) in vec4 in_point_position; -out vec4 vs_color; +out vec3 vs_color; out vec4 vs_positionScreenSpace; uniform mat4 modelViewProjectionTransform; -uniform vec4 objectVelocity; - -uniform uint nVertices; -uniform vec4 shadowColor; +uniform vec3 shadowColor; void main() { if (mod(gl_VertexID,2) == 0.0) { vs_color = shadowColor; } else { - vs_color = vec4(0.0); + vs_color = vec3(0.0); } // Transform the damn psc to homogenous coordinate From 8d45d25ed48b820530c64237c42d389c6fe74dae Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Tue, 7 Jul 2020 13:16:27 +0200 Subject: [PATCH 09/10] Append TODO comment with color and opacity info This class was not working, so could not test it. As there was already a todo comment I simply added to the comment. --- .../rendering/renderablecrawlingline.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp index d3dd6614b3..2ba4d88f6c 100644 --- a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp +++ b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp @@ -49,8 +49,9 @@ namespace { }; } // namespace -// @TODO: This clas is not properly working anymore and needs to be substantially -// rewritten +// @TODO: This class is not properly working anymore and needs to be substantially +// rewritten. When doing so, make sure that any color property uses three +// values, not four. The opacity should be handled separately namespace openspace { From cb19f730df841fa7a20f9257820662284d57dc37 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Wed, 8 Jul 2020 15:28:54 +0200 Subject: [PATCH 10/10] Mixed cleanup --- data/assets/examples/volume/toyvolume.asset | 4 +- .../digitaluniverse/constellations.asset | 4 -- data/assets/scene/digitaluniverse/grids.asset | 24 --------- .../scene/digitaluniverse/starorbits.asset | 14 ----- .../dwarf_planets/pluto/charon.asset | 2 +- .../dwarf_planets/pluto/pluto.asset | 2 +- .../missions/newhorizons/charon.asset | 1 + .../missions/newhorizons/pluto.asset | 1 + .../solarsystem/planets/earth/earth.asset | 2 +- .../solarsystem/planets/earth/moon/moon.asset | 2 +- .../planets/jupiter/callisto/callisto.asset | 2 +- .../planets/jupiter/europa/europa.asset | 2 +- .../solarsystem/planets/jupiter/io/io.asset | 2 +- .../scene/solarsystem/planets/mars/mars.asset | 2 +- .../solarsystem/planets/mercury/mercury.asset | 2 +- .../planets/saturn/dione/dione.asset | 2 +- .../planets/saturn/enceladus/enceladus.asset | 2 +- .../planets/saturn/iapetus/iapetus.asset | 2 +- .../planets/saturn/mimas/mimas.asset | 2 +- .../planets/saturn/rhea/rhea.asset | 2 +- .../planets/saturn/tethys/tethys.asset | 2 +- .../planets/saturn/titan/titan.asset | 2 +- .../solarsystem/planets/venus/venus.asset | 2 +- data/assets/util/debug_helper.asset | 10 ++-- modules/base/shaders/axes_fs.glsl | 2 +- .../rendering/renderablebillboardscloud.cpp | 13 ++--- .../rendering/renderabledumeshes.cpp | 52 +------------------ .../rendering/renderabledumeshes.h | 5 -- .../rendering/renderableplanescloud.cpp | 6 ++- .../src/globelabelscomponent.cpp | 6 ++- .../rendering/renderablefov.cpp | 4 +- .../rendering/renderableshadowcylinder.cpp | 1 - .../shaders/terminatorshadow_fs.glsl | 3 +- .../rendering/renderabletoyvolume.cpp | 4 +- 34 files changed, 46 insertions(+), 142 deletions(-) diff --git a/data/assets/examples/volume/toyvolume.asset b/data/assets/examples/volume/toyvolume.asset index 9a2f39d1c5..a52f4d879d 100644 --- a/data/assets/examples/volume/toyvolume.asset +++ b/data/assets/examples/volume/toyvolume.asset @@ -8,10 +8,10 @@ local ToyVolume = { Parent = transforms.SolarSystemBarycenter.Identifier, Renderable = { Type = "RenderableToyVolume", - Size = {5, 5, 5}, + Size = { 5, 5, 5 }, ScalingExponent = 11, StepSize = 0.01, - Color = {1, 0, 0} + Color = { 1, 0, 0 } }, GUI = { Path = "/Examples" diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index 6f98dda9bc..216a320283 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -14,9 +14,7 @@ local constellationsExtragalactic = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 0.4, 0.2 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/constellationsEXGAL.speck", LabelFile = speck .. "/constellationsEXGAL.label", TextColor = { 0.8, 0.8, 0.8 }, @@ -38,9 +36,7 @@ local constellations = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 0.4, 0.2 }, Opacity = 0.3, - ScaleFactor = 1.0, File = speck .. "/constellations.speck", LabelFile = speck .. "/constellations.label", TextColor = { 0.8, 0.8, 0.8 }, diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index 7d25f4c347..dcb069250a 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -239,9 +239,7 @@ local plane1ld = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/1ld.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1ld.label", @@ -269,9 +267,7 @@ local plane1lm = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/1lm.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1lm.label", @@ -299,9 +295,7 @@ local plane1ly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/1ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1ly.label", @@ -329,9 +323,7 @@ local plane10ly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/10ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10ly.label", @@ -359,9 +351,7 @@ local plane100ly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/100ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100ly.label", @@ -389,9 +379,7 @@ local plane1kly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/1kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1kly.label", @@ -419,9 +407,7 @@ local plane10kly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/10kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10kly.label", @@ -442,9 +428,7 @@ local plane100kly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/100kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100kly.label", @@ -465,9 +449,7 @@ local plane1Mly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/1Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/1Mly.label", @@ -488,9 +470,7 @@ local plane10Mly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/10Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/10Mly.label", @@ -511,9 +491,7 @@ local plane100Mly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/100Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/100Mly.label", @@ -534,9 +512,7 @@ local plane20Gly = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 1.0, 1.0 }, Opacity = 0.4, - ScaleFactor = 1.0, File = speck .. "/20Gly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, LabelFile = speck .. "/20Gly.label", diff --git a/data/assets/scene/digitaluniverse/starorbits.asset b/data/assets/scene/digitaluniverse/starorbits.asset index 51e7d555aa..212d2a9b3f 100644 --- a/data/assets/scene/digitaluniverse/starorbits.asset +++ b/data/assets/scene/digitaluniverse/starorbits.asset @@ -16,9 +16,7 @@ local sunOrbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = { 1.0, 0.65, 0.0 }, Opacity = 1.0, - ScaleFactor = 1.0, File = speck .. "/starorbits-Sun.speck", MeshColor = {{ 1.0, 0.65, 0.0 }}, --LabelFile = speck .. "/1ld.label", @@ -40,9 +38,7 @@ local barnardsOrbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, Opacity = 1.0, - ScaleFactor = 1.0, File = speck .. "/starorbits-BarnardsStar.speck", MeshColor = {{0.39, 0.58, 0.93}}, --LabelFile = speck .. "/1ld.label", @@ -64,9 +60,7 @@ local kapteynsOrbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, Opacity = 1.0, - ScaleFactor = 1.0, File = speck .. "/starorbits-KapteynsStar.speck", MeshColor = {{0.6, 0.6, 0.6}}, --LabelFile = speck .. "/1ld.label", @@ -88,9 +82,7 @@ local lacaille9352Orbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, Opacity = 1.0, - ScaleFactor = 1.0, File = speck .. "/starorbits-Lacaille9352.speck", MeshColor = {{0.58, 0.0, 0.83}}, --LabelFile = speck .. "/1ld.label", @@ -112,9 +104,7 @@ local lSR1826Orbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, Opacity = 1.0, - ScaleFactor = 1.0, File = speck .. "/starorbits-LSR1826+3014.speck", MeshColor = {{0.0, 0.39, 0.0}}, --LabelFile = speck .. "/1ld.label", @@ -136,9 +126,7 @@ local lSRJ0822Orbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, Opacity = 1.0, - ScaleFactor = 1.0, File = speck .. "/starorbits-LSRJ0822+1700.speck", MeshColor = {{0.5, 1.0, 0.0}}, --LabelFile = speck .. "/1ld.label", @@ -160,9 +148,7 @@ local pM_J13420Orbit = { Renderable = { Type = "RenderableDUMeshes", Enabled = false, - Color = {1.0, 1.0, 1.0}, Opacity = 1.0, - ScaleFactor = 1.0, File = speck .. "/starorbits-PM_J13420-3415.speck", MeshColor = {{0.70, 0.13, 0.13}}, --LabelFile = speck .. "/1ld.label", diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset index 9b02a6352e..21b55af0f3 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon.asset @@ -50,7 +50,7 @@ local Charon = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index 62fa02ad0a..461228389c 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -50,7 +50,7 @@ local Pluto = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/missions/newhorizons/charon.asset b/data/assets/scene/solarsystem/missions/newhorizons/charon.asset index 3929571670..8f2c7d5910 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/charon.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/charon.asset @@ -100,6 +100,7 @@ local CharonShadow = { Parent = CharonProjection .Identifier, Renderable = { Type = "RenderableShadowCylinder", + Opacity = 0.25, TerminatorType = "PENUMBRAL", LightSource = "SUN", Observer = "NEW HORIZONS", diff --git a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset index 72eb98db1e..3a963722e2 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset @@ -226,6 +226,7 @@ local PlutoShadow = { Parent = PlutoProjection.Identifier, Renderable = { Type = "RenderableShadowCylinder", + Opacity = 0.25, TerminatorType = "PENUMBRAL", LightSource = "SUN", Observer = "NEW HORIZONS", diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index db4e09d581..3a86e2dab4 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -291,7 +291,7 @@ local Earth = { FadeOutStartingDistance = 80000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1500000.0, - LabelsColor = {1.0, 0.0, 0.0} + LabelsColor = { 1.0, 0.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset index d896642c2c..0fb4c42957 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset @@ -162,7 +162,7 @@ local Moon = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, GUI = { diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset index 7ee21f1966..a0aeaa4b69 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset @@ -58,7 +58,7 @@ local Callisto = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset index f589215dd3..aa71361517 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset @@ -67,7 +67,7 @@ local Europa = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset index b34822bab3..802c862dcc 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset @@ -58,7 +58,7 @@ local Io = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" }, diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index b9d8a2d13f..cdd1a58f33 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -196,7 +196,7 @@ local Mars = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index 780b3a1ea9..9bba1841fb 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -214,7 +214,7 @@ local Mercury = { FadeOutStartingDistance = 80000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1500000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset index 5e0014abf8..9e6c7e980a 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset @@ -56,7 +56,7 @@ local Dione = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset index 4538de4a35..8e0f929c1d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset @@ -63,7 +63,7 @@ local Enceladus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset index 5d6bba2f12..e858a866fd 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset @@ -56,7 +56,7 @@ local Iapetus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset index a27427627c..1cc2009017 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset @@ -56,7 +56,7 @@ local Mimas = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset index a218d2280a..5ce62dc9e6 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset @@ -56,7 +56,7 @@ local Rhea = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset index dc41241974..61c0b44d83 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset @@ -56,7 +56,7 @@ local Tethys = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset index 5c871fb20a..785f62691d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset @@ -63,7 +63,7 @@ local Titan = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 1350000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" }, diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 0eb0654b9d..8ccab1e13a 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -87,7 +87,7 @@ local Venus = { FadeOutStartingDistance = 1000000.0, LabelsForceDomeRendering = true, LabelsDistanceEPS = 3500000.0, - LabelsColor = {1.0, 1.0, 0.0} + LabelsColor = { 1.0, 1.0, 0.0 } } }, Tag = { "planet_solarSystem", "planet_terrestrial" }, diff --git a/data/assets/util/debug_helper.asset b/data/assets/util/debug_helper.asset index b0f830e37a..f01d50824d 100644 --- a/data/assets/util/debug_helper.asset +++ b/data/assets/util/debug_helper.asset @@ -61,8 +61,8 @@ local addCartesianAxes = function (specification) local name = specification.Name or specification.Identifier local parent = specification.Parent or "Root" local scale = specification.Scale or 1.0 - local position = specification.Position or {0.0, 0.0, 0.0} - local rotation = specification.Rotation or {0.0, 0.0, 0.0} + local position = specification.Position or { 0.0, 0.0, 0.0 } + local rotation = specification.Rotation or { 0.0, 0.0, 0.0 } local axes = { Identifier = identifier, @@ -84,9 +84,9 @@ local addCartesianAxes = function (specification) Renderable = { Type = "RenderableCartesianAxes", Enabled = true, - XColor = {1.0, 0.0, 0.0}, - YColor = {0.0, 1.0, 0.0}, - ZColor = {0.0, 0.0, 1.0} + XColor = { 1.0, 0.0, 0.0 }, + YColor = { 0.0, 1.0, 0.0 }, + ZColor = { 0.0, 0.0, 1.0 } }, GUI = { Name = name, diff --git a/modules/base/shaders/axes_fs.glsl b/modules/base/shaders/axes_fs.glsl index 17777c410f..8540409131 100644 --- a/modules/base/shaders/axes_fs.glsl +++ b/modules/base/shaders/axes_fs.glsl @@ -38,10 +38,10 @@ Fragment getFragment() { vec3 colorComponents = step(0.01f, vs_positionModelSpace); - frag.color.a = 1.0; frag.color.rgb = colorComponents.x * xColor + colorComponents.y * yColor + colorComponents.z * zColor; + frag.color.a = 1.0; frag.depth = vs_screenSpaceDepth; frag.gPosition = vs_positionViewSpace; diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 003f75360f..8fc50b03e5 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -424,12 +424,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 600.f) , _pointColor(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _spriteTexturePath(SpriteTextureInfo) - , _textColor( - TextColorInfo, - glm::vec3(1.f, 1.f, 1.f), - glm::vec3(0.f), - glm::vec3(1.f) - ) + , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) , _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f) @@ -929,8 +924,10 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, break; } - glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity); - textColor.a *= fadeInVariable; + glm::vec4 textColor = glm::vec4( + glm::vec3(_textColor), + _textOpacity * fadeInVariable + ); ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo; labelInfo.orthoRight = orthoRight; diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 4250467706..aceeb07940 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -54,7 +54,6 @@ namespace { }; constexpr const char* KeyFile = "File"; - constexpr const char* keyColor = "Color"; constexpr const char* keyUnit = "Unit"; constexpr const char* MeterUnit = "m"; constexpr const char* KilometerUnit = "Km"; @@ -128,12 +127,6 @@ namespace { "Determines whether labels should be drawn or hidden." }; - constexpr openspace::properties::Property::PropertyInfo TransformationMatrixInfo = { - "TransformationMatrix", - "Transformation Matrix", - "Transformation matrix to be applied to each astronomical object." - }; - constexpr openspace::properties::Property::PropertyInfo MeshColorInfo = { "MeshColor", "Meshes colors", @@ -167,18 +160,6 @@ documentation::Documentation RenderableDUMeshes::Documentation() { "The path to the SPECK file that contains information about the " "astronomical object being rendered." }, - { - keyColor, - new Vector3Verifier, - Optional::Yes, - "Astronomical Object Color (r,g,b)." - }, - /*{ - ScaleFactorInfo.identifier, - new DoubleVerifier, - Optional::Yes, - ScaleFactorInfo.description - },*/ { DrawLabelInfo.identifier, new BoolVerifier, @@ -227,12 +208,6 @@ documentation::Documentation RenderableDUMeshes::Documentation() { Optional::Yes, LineWidthInfo.description }, - { - TransformationMatrixInfo.identifier, - new Matrix4x4Verifier, - Optional::Yes, - TransformationMatrixInfo.description - }, { MeshColorInfo.identifier, new Vector3ListVerifier, @@ -243,10 +218,8 @@ documentation::Documentation RenderableDUMeshes::Documentation() { }; } - RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - //, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f) , _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) , _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f) , _textSize(TextSizeInfo, 8.f, 0.5f, 24.f) @@ -312,18 +285,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) } } - /*if (dictionary.hasKey(keyColor)) { - _pointColor = dictionary.value(keyColor); - } - addProperty(_pointColor);*/ - - /*if (dictionary.hasKey(ScaleFactorInfo.identifier)) { - _scaleFactor = static_cast( - dictionary.value(ScaleFactorInfo.identifier) - ); - } - addProperty(_scaleFactor);*/ - if (dictionary.hasKeyAndValue(LineWidthInfo.identifier)) { _lineWidth = static_cast( dictionary.value(LineWidthInfo.identifier) @@ -369,12 +330,6 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary) addProperty(_textMaxSize); } - if (dictionary.hasKey(TransformationMatrixInfo.identifier)) { - _transformationMatrix = dictionary.value( - TransformationMatrixInfo.identifier - ); - } - if (dictionary.hasKey(MeshColorInfo.identifier)) { ghoul::Dictionary colorDict = dictionary.value( MeshColorInfo.identifier @@ -481,7 +436,6 @@ void RenderableDUMeshes::renderMeshes(const RenderData&, _program->setUniform(_uniformCache.modelViewTransform, modelViewMatrix); _program->setUniform(_uniformCache.projectionTransform, projectionMatrix); _program->setUniform(_uniformCache.alphaValue, _opacity); - //_program->setUniform(_uniformCache.scaleFactor, _scaleFactor); for (const std::pair& pair : _renderingMeshesMap) { _program->setUniform(_uniformCache.color, _meshColorMap[pair.second.colorIndex]); @@ -564,7 +518,6 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity); for (const std::pair& pair : _labelData) { - //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); glm::vec3 scaledPos(pair.first); scaledPos *= scale; ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render( @@ -899,10 +852,7 @@ bool RenderableDUMeshes::readLabelFile() { dummy.clear(); } - glm::vec3 transformedPos = glm::vec3( - _transformationMatrix * glm::dvec4(position, 1.0) - ); - _labelData.emplace_back(std::make_pair(transformedPos, label)); + _labelData.emplace_back(std::make_pair(position, label)); } while (!file.eof()); diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h index 530c6c0fca..3a1fa603eb 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.h +++ b/modules/digitaluniverse/rendering/renderabledumeshes.h @@ -117,14 +117,11 @@ private: bool _textColorIsDirty = true; bool _hasLabel = false; - //properties::FloatProperty _scaleFactor; - //properties::Vec3Property _pointColor; properties::Vec3Property _textColor; properties::FloatProperty _textOpacity; properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::BoolProperty _drawLabels; - //properties::OptionProperty _blendMode; properties::FloatProperty _textMinSize; properties::FloatProperty _textMaxSize; properties::FloatProperty _lineWidth; @@ -146,8 +143,6 @@ private: std::vector> _labelData; int _nValuesPerAstronomicalObject = 0; - glm::dmat4 _transformationMatrix = glm::dmat4(1.0); - std::unordered_map _meshColorMap; std::unordered_map _renderingMeshesMap; }; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index 8ef1121861..3fc991b7ee 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -645,8 +645,10 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, break; } - glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity); - textColor.a *= fadeInVariable; + glm::vec4 textColor = glm::vec4( + glm::vec3(_textColor), + _textOpacity * fadeInVariable + ); ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo; labelInfo.orthoRight = orthoRight; diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index 3d6b27583d..28c9b60409 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -688,8 +688,10 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data, float distToCamera, float fadeInVariable ) { - glm::vec4 textColor = glm::vec4(glm::vec3(_labelsColor), _labelsOpacity); - textColor.a *= fadeInVariable; + glm::vec4 textColor = glm::vec4( + glm::vec3(_labelsColor), + _labelsOpacity * fadeInVariable + ); glm::dvec4 cameraUpVecWorld = glm::dvec4(data.camera.lookUpVectorWorldSpace(), 0.0); diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index f0f4b1f011..9da17a57b1 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -264,7 +264,7 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) }, { DefaultEndColorInfo, - glm::vec3(0.85f, 0.85f, 0.85f), + glm::vec3(0.85f), glm::vec3(0.f), glm::vec3(1.f) }, @@ -294,7 +294,7 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) }, { SquareColorInfo, - glm::vec3(0.85f, 0.85f, 0.85f), + glm::vec3(0.85f), glm::vec3(0.f), glm::vec3(1.f) } diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp index 11e83bcec6..df97458c92 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp @@ -206,7 +206,6 @@ RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dict "RenderableShadowCylinder" ); - _opacity.setValue(0.25f); addProperty(_opacity); registerUpdateRenderBinFromOpacity(); diff --git a/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl b/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl index d6e16b36fb..bf7c29b1fb 100644 --- a/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl +++ b/modules/spacecraftinstruments/shaders/terminatorshadow_fs.glsl @@ -32,8 +32,7 @@ uniform float opacity; Fragment getFragment() { Fragment frag; - frag.color = vec4(vs_color, 1.0); - frag.color.a *= opacity; + frag.color = vec4(vs_color, opacity); frag.depth = vs_positionScreenSpace.w; return frag; diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index f5bdc26ad9..7a3d3b9479 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -141,7 +141,7 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) RenderableToyVolume::~RenderableToyVolume() {} void RenderableToyVolume::initializeGL() { - glm::vec4 color{ glm::vec3(_color), _opacity }; + glm::vec4 color(glm::vec3(_color), _opacity); _raycaster = std::make_unique(color); _raycaster->initialize(); @@ -198,7 +198,7 @@ void RenderableToyVolume::update(const UpdateData& data) { std::pow(10.f, static_cast(_scalingExponent)) ); - glm::vec4 color{ glm::vec3(_color), _opacity }; + glm::vec4 color(glm::vec3(_color), _opacity); _raycaster->setColor(color); _raycaster->setStepSize(_stepSize);