From 5ad69b841bb38490992c78cf145166804953cfca Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 24 Aug 2018 02:09:01 -0600 Subject: [PATCH] Remove extra opacity value from renderablebillboardscloud and make text labels listen to the opacity (closes #693) --- ext/sgct | 2 +- .../rendering/renderablebillboardscloud.cpp | 24 +++---------------- .../rendering/renderablebillboardscloud.h | 1 - 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/ext/sgct b/ext/sgct index adde6768da..44dfb0ba9d 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit adde6768dafb6cb4654bb18e92906eaddc018b27 +Subproject commit 44dfb0ba9dd2ad9aaa0d9889fb914b1a6b45a440 diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 8406169dab..abddadb107 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -84,13 +84,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", @@ -267,12 +260,6 @@ documentation::Documentation RenderableBillboardsCloud::Documentation() { Optional::Yes, SpriteTextureInfo.description }, - { - TransparencyInfo.identifier, - new DoubleVerifier, - Optional::No, - TransparencyInfo.description - }, { ScaleFactorInfo.identifier, new DoubleVerifier, @@ -393,7 +380,6 @@ documentation::Documentation RenderableBillboardsCloud::Documentation() { RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f) , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 600.f) , _pointColor( ColorInfo, @@ -536,12 +522,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di addProperty(_pointColor); } - if (dictionary.hasKey(TransparencyInfo.identifier)) { - _alphaValue = static_cast( - dictionary.value(TransparencyInfo.identifier) - ); - } - addProperty(_alphaValue); + addProperty(_opacity); if (dictionary.hasKey(ScaleFactorInfo.identifier)) { _scaleFactor = static_cast( @@ -783,7 +764,7 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data, _program->setUniform(_uniformCache.minBillboardSize, _billboardMinSize); // in pixels _program->setUniform(_uniformCache.maxBillboardSize, _billboardMaxSize); // in pixels _program->setUniform(_uniformCache.color, _pointColor); - _program->setUniform(_uniformCache.alphaValue, _alphaValue); + _program->setUniform(_uniformCache.alphaValue, _opacity); _program->setUniform(_uniformCache.scaleFactor, _scaleFactor); _program->setUniform(_uniformCache.up, orthoUp); _program->setUniform(_uniformCache.right, orthoRight); @@ -864,6 +845,7 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, glm::vec4 textColor = _textColor; textColor.a *= fadeInVariable; + textColor.a *= _opacity; for (const std::pair& pair : _labelData) { //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); glm::vec3 scaledPos(pair.first); diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.h b/modules/digitaluniverse/rendering/renderablebillboardscloud.h index fe46a4cf67..0a8ba138f3 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.h +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.h @@ -110,7 +110,6 @@ private: GLuint _pTexture = 0; - properties::FloatProperty _alphaValue; properties::FloatProperty _scaleFactor; properties::Vec3Property _pointColor; properties::StringProperty _spriteTexturePath;