diff --git a/data/scene/default.scene b/data/scene/default.scene index f40939d645..784ad59f1c 100644 --- a/data/scene/default.scene +++ b/data/scene/default.scene @@ -137,6 +137,7 @@ return { "saturn", "uranus", "neptune", + --"satellites", "grids", diff --git a/data/scene/digitaluniverse/backgroundradiation/backgroundradiation.mod b/data/scene/digitaluniverse/backgroundradiation/backgroundradiation.mod index 482b1f4a6e..d6a75440a7 100644 --- a/data/scene/digitaluniverse/backgroundradiation/backgroundradiation.mod +++ b/data/scene/digitaluniverse/backgroundradiation/backgroundradiation.mod @@ -10,7 +10,8 @@ return { Segments = 80, Alpha = 0.5, Texture = "textures/wmap_ilc_7yr_v4_200uK_RGB_sos.png", - Orientation = "Inside/Outside" + Orientation = "Inside/Outside", + FadeInThreshould = 8E26 }, GuiPath = "/Universe/Cosmic Microwave Background" }, @@ -24,7 +25,8 @@ return { Segments = 80, Alpha = 0.5, Texture = "textures/COBErect.png", - Orientation = "Inside/Outside" + Orientation = "Inside/Outside", + FadeInThreshould = 8E26 }, GuiPath = "/Universe/Cosmic Microwave Background" }, @@ -33,12 +35,13 @@ return { Parent = "Root", Renderable = { Type = "RenderableSphere", - Enabled = false, + Enabled = true, Size = 3975.41417036064E23, Segments = 80, Alpha = 0.5, Texture = "textures/cmb4k.jpg", Orientation = "Inside/Outside", + FadeInThreshould = 8E26 }, GuiPath = "/Universe/Cosmic Microwave Background" }, diff --git a/data/scene/digitaluniverse/quasars/quasars.mod b/data/scene/digitaluniverse/quasars/quasars.mod index 664810f3e3..c1f41c7b31 100644 --- a/data/scene/digitaluniverse/quasars/quasars.mod +++ b/data/scene/digitaluniverse/quasars/quasars.mod @@ -5,13 +5,15 @@ return { Parent = "Root", Renderable = { Type = "RenderableBillboardsCloud", - Enabled = false, + Enabled = true, Color = { 1.0, 0.4, 0.2 }, Transparency = 1.0, File = "speck/quasars.speck", Texture = "textures/point3.png", Unit = "Mpc", - ScaleFactor = 537.31 + ScaleFactor = 537.31, + -- Fade in value in the same unit as "Unit" + FadeInThreshould = 1000.0, }, GuiPath = "/Universe/Quasars" } diff --git a/data/scene/digitaluniverse/sloandss/sloandss.mod b/data/scene/digitaluniverse/sloandss/sloandss.mod index b1b8d0fa9e..665e831f12 100644 --- a/data/scene/digitaluniverse/sloandss/sloandss.mod +++ b/data/scene/digitaluniverse/sloandss/sloandss.mod @@ -5,7 +5,7 @@ return { Parent = "Root", Renderable = { Type = "RenderableBillboardsCloud", - Enabled = false, + Enabled = true, Color = { 0.8, 0.8, 1.0 }, Transparency = 1.0, ScaleFactor = 507.88, @@ -15,7 +15,8 @@ return { ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } }, Texture = "textures/point3.png", -- Fade in value in the same unit as "Unit" - FadeInThreshould = 40.0, + --FadeInThreshould = 4.7, + FadeInThreshould = 90.0, Unit = "Mpc" }, GuiPath = "/Universe/Galaxies" diff --git a/data/scene/digitaluniverse/starlabels/starlabels.mod b/data/scene/digitaluniverse/starlabels/starlabels.mod index 560fe19e1b..9b218fba77 100644 --- a/data/scene/digitaluniverse/starlabels/starlabels.mod +++ b/data/scene/digitaluniverse/starlabels/starlabels.mod @@ -8,7 +8,7 @@ return { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Transparency = 0.65, - LabelFile = "speck/stars-new.label", + LabelFile = "speck/stars.label", TextColor = { 0.4, 0.4, 0.4, 1.0 }, DrawLabels = true, TextSize = 14.7, diff --git a/data/scene/digitaluniverse/tully/tully.mod b/data/scene/digitaluniverse/tully/tully.mod index 26ac703597..a73b805c35 100644 --- a/data/scene/digitaluniverse/tully/tully.mod +++ b/data/scene/digitaluniverse/tully/tully.mod @@ -25,7 +25,8 @@ return { 0.0, 0.0, 0.0, 1.0 }, -- Fade in value in the same unit as "Unit" - FadeInThreshould = 2.0, + --FadeInThreshould = 5.5, + FadeInThreshould = 1.0, Unit = "Mpc" }, GuiPath = "/Universe/Galaxies" @@ -37,7 +38,7 @@ return { Parent = "Root", Renderable = { Type = "RenderablePlanesCloud", - Enabled = false, + Enabled = true, Color = { 1.0, 1.0, 1.0 }, Transparency = 0.99, ScaleFactor = 1.0, diff --git a/data/scene/milkyway/digitaluniverse/digitaluniverse.mod b/data/scene/milkyway/digitaluniverse/digitaluniverse.mod index 93bf016369..71494850b5 100644 --- a/data/scene/milkyway/digitaluniverse/digitaluniverse.mod +++ b/data/scene/milkyway/digitaluniverse/digitaluniverse.mod @@ -9,7 +9,7 @@ return { Alpha = 0.4, Texture = "textures/DarkUniverse_mellinger_8k.jpg", Orientation = "Inside/Outside", - FadeOutThreshould = 0.01 + FadeOutThreshould = 0.18 }, GuiPath = "/Milky Way/Milky Way" } diff --git a/data/scene/stars/digitaluniverse/digitaluniverse.mod b/data/scene/stars/digitaluniverse/digitaluniverse.mod index 56b8877c34..608185c013 100644 --- a/data/scene/stars/digitaluniverse/digitaluniverse.mod +++ b/data/scene/stars/digitaluniverse/digitaluniverse.mod @@ -5,7 +5,7 @@ return { Parent = "Root", Renderable = { Type = "RenderableStars", - File = "speck/stars-new.speck", + File = "speck/stars.speck", Texture = "textures/halo.png", ColorMap = "colorbv.cmap" }, diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index 9d959c969d..9f480701a3 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -84,6 +84,19 @@ namespace { "This value determines percentage of the sphere is visible before starting " "fading-out it." }; + + static const openspace::properties::Property::PropertyInfo FadeInThreshouldInfo = { + "FadeInThreshould", + "Fade-In Threshould", + "Distance from center of MilkyWay from where the astronomical object starts to " + "fade in." + }; + + static const openspace::properties::Property::PropertyInfo DisableFadeInOuInfo = { + "DisableFadeInOu", + "Disable Fade-In/Fade-Out effects", + "Enables/Disables the Fade-In/Out effects." + }; } // namespace namespace openspace { @@ -129,7 +142,19 @@ documentation::Documentation RenderableSphere::Documentation() { new DoubleInRangeVerifier(0.0, 1.0), Optional::Yes, FadeOutThreshouldInfo.description - } + }, + { + FadeInThreshouldInfo.identifier, + new DoubleVerifier, + Optional::Yes, + FadeInThreshouldInfo.description + }, + { + DisableFadeInOuInfo.identifier, + new BoolVerifier, + Optional::Yes, + DisableFadeInOuInfo.description + }, } }; } @@ -142,7 +167,9 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary) , _size(SizeInfo, 1.f, 0.f, 1e35f) , _segments(SegmentsInfo, 8, 4, 1000) , _transparency(TransparencyInfo, 1.f, 0.f, 1.f) + , _disableFadeInDistance(DisableFadeInOuInfo, true) , _fadeOutThreshold(-1.0) + , _fadeInThreshold(0.0) , _shader(nullptr) , _texture(nullptr) , _sphere(nullptr) @@ -209,7 +236,17 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary) _texturePath.onChange([this]() { loadTexture(); }); if (dictionary.hasKey(FadeOutThreshouldInfo.identifier)) { - _fadeOutThreshold = static_cast(dictionary.value(FadeOutThreshouldInfo.identifier)); + _fadeOutThreshold = static_cast(dictionary.value(FadeOutThreshouldInfo.identifier)); + } + + if (dictionary.hasKey(FadeInThreshouldInfo.identifier)) { + _fadeInThreshold = static_cast(dictionary.value(FadeInThreshouldInfo.identifier)); + } + + if (dictionary.hasKey(FadeOutThreshouldInfo.identifier) || + dictionary.hasKey(FadeInThreshouldInfo.identifier)) { + _disableFadeInDistance.set(false); + addProperty(_disableFadeInDistance); } } @@ -256,16 +293,29 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { setPscUniforms(*_shader.get(), data.camera, data.position); + float adjustedTransparency = _transparency; + + if (_fadeInThreshold > 0.0) { + float distCamera = glm::length(data.camera.positionVec3()); + float funcValue = static_cast((1.0 / double(_fadeInThreshold/1E24))*(distCamera / 1E24)); + + adjustedTransparency *= funcValue > 1.0 ? 1.0 : funcValue; + } + if (_fadeOutThreshold > -1.0) { float distCamera = glm::distance(data.camera.positionVec3(), data.position.dvec3()); double term = std::exp((-distCamera + _size * _fadeOutThreshold) / (_size * _fadeOutThreshold)); - _shader->setUniform("alpha", _transparency * static_cast(term / (term + 1.0))); - } - else { - _shader->setUniform("alpha", _transparency); + adjustedTransparency *= static_cast(term / (term + 1.0)); } + // Performance wise + if (adjustedTransparency < 0.01) { + return; + } + + _shader->setUniform("alpha", adjustedTransparency); + ghoul::opengl::TextureUnit unit; unit.activate(); _texture->bind(); diff --git a/modules/base/rendering/renderablesphere.h b/modules/base/rendering/renderablesphere.h index a38b090f2c..75939cc3e6 100644 --- a/modules/base/rendering/renderablesphere.h +++ b/modules/base/rendering/renderablesphere.h @@ -70,7 +70,10 @@ private: properties::FloatProperty _transparency; + properties::BoolProperty _disableFadeInDistance; + float _fadeOutThreshold; + float _fadeInThreshold; std::unique_ptr _shader; std::unique_ptr _texture; diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 9bfe855f46..5a66d9ee3f 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -169,8 +169,14 @@ namespace { static const openspace::properties::Property::PropertyInfo FadeInThreshouldInfo = { "FadeInThreshould", "Fade-In Threshould", - "This value determines percentage of the astronomical object is visible before starting " - "fading-in it." + "This value determines distance from the center of our galaxy from which the" + "astronomical object is visible before starting fading-in it." + }; + + static const openspace::properties::Property::PropertyInfo DisableFadeInInfo = { + "DisableFadeIn", + "Disable Fade-in effect", + "Enables/Disables the Fade-in effect." }; } // namespace @@ -284,6 +290,12 @@ documentation::Documentation RenderableBillboardsCloud::Documentation() { Optional::Yes, FadeInThreshouldInfo.description }, + { + DisableFadeInInfo.identifier, + new BoolVerifier, + Optional::Yes, + DisableFadeInInfo.description + }, } }; } @@ -317,6 +329,8 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di , _drawElements(DrawElementsInfo, true) , _drawLabels(DrawLabelInfo, false) , _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown) + , _fadeInDistance(FadeInThreshouldInfo, 0.0, 0.1, 100.0) + , _disableFadeInDistance(DisableFadeInInfo, true) , _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown) , _polygonTexture(nullptr) , _spriteTexture(nullptr) @@ -329,7 +343,6 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di , _colorOptionString("") , _unit(Parsec) , _nValuesPerAstronomicalObject(0) - , _fadeInThreshold(0.0) , _transformationMatrix(glm::dmat4(1.0)) , _vao(0) , _vbo(0) @@ -357,6 +370,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di _renderOption.addOption(1, "Camera Position Normal"); _renderOption.addOption(2, "Screen center Position Normal"); addProperty(_renderOption); + _renderOption.set(1); if (dictionary.hasKey(keyUnit)) { std::string unit = dictionary.value(keyUnit); @@ -501,8 +515,12 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di } if (dictionary.hasKey(FadeInThreshouldInfo.identifier)) { - _fadeInThreshold = static_cast(dictionary.value(FadeInThreshouldInfo.identifier)); - } + float fadeInValue = static_cast(dictionary.value(FadeInThreshouldInfo.identifier)); + _fadeInDistance.set(fadeInValue); + _disableFadeInDistance.set(false); + addProperty(_fadeInDistance); + addProperty(_disableFadeInDistance); + } } bool RenderableBillboardsCloud::isReady() const { @@ -671,7 +689,7 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data, const g } void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp) { + const glm::vec3& orthoRight, const glm::vec3& orthoUp, const float fadeInVariable) { RenderEngine& renderEngine = OsEng.renderEngine(); _fontRenderer->setFramebufferSize(renderEngine.renderingResolution()); @@ -701,6 +719,8 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm:: break; } + glm::vec4 textColor = _textColor; + textColor.a *= fadeInVariable; for (const std::pair& pair : _labelData) { //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); glm::vec3 scaledPos(pair.first); @@ -708,7 +728,8 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm:: _fontRenderer->render( *_font, scaledPos, - _textColor, + //_textColor, + textColor, pow(10.0, _textSize.value()), _textMinSize, modelViewProjectionMatrix, @@ -750,19 +771,26 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) { } float fadeInVariable = 1.0f; - if (_fadeInThreshold > 0.0) { - float distCamera = glm::distance(data.camera.positionVec3(), data.position.dvec3()); - double term = std::exp(distCamera / scale - _fadeInThreshold); - float func = static_cast(term / (term + 1.0)); + if (!_disableFadeInDistance) { + float distCamera = glm::length(data.camera.positionVec3()); + //double term = std::exp(distCamera/scale - _fadeInDistance); + //float func = static_cast(term / (term + 1.0)); // Let's not waste performance - if (func < 0.001) { + /*if (func < 0.01) { return; } if (!std::isinf(term)) { fadeInVariable = func; } + */ + float funcValue = static_cast((1.0 / double(_fadeInDistance*scale))*(distCamera)); + fadeInVariable *= funcValue > 1.0 ? 1.0 : funcValue; + + if (funcValue < 0.01) { + return; + } } glm::dmat4 modelMatrix = @@ -794,7 +822,7 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) { } if (_drawLabels && _hasLabel) { - renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp); + renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVariable); } } @@ -890,7 +918,6 @@ void RenderableBillboardsCloud::update(const UpdateData&) { } if (_hasLabel && _labelDataIsDirty) { - _labelDataIsDirty = false; } } @@ -1187,6 +1214,9 @@ bool RenderableBillboardsCloud::readLabelFile() { dummy.clear(); while (str >> dummy) { + if (dummy == "#") { + break; + } label += " " + dummy; dummy.clear(); } diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.h b/modules/digitaluniverse/rendering/renderablebillboardscloud.h index 12fca1b6cb..3ac832b910 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.h +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.h @@ -92,7 +92,7 @@ private: const glm::dmat4& projectionMatrix, const glm::vec3& orthoRight, const glm::vec3& orthoUp, const float fadeInVariable); void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp); + const glm::vec3& orthoRight, const glm::vec3& orthoUp, const float fadeInVariable); bool loadData(); bool readSpeckFile(); @@ -125,6 +125,8 @@ private: properties::BoolProperty _drawElements; properties::BoolProperty _drawLabels; properties::OptionProperty _colorOption; + properties::FloatProperty _fadeInDistance; + properties::BoolProperty _disableFadeInDistance; // DEBUG: properties::OptionProperty _renderOption; @@ -151,9 +153,7 @@ private: std::unordered_map _variableDataPositionMap; std::unordered_map _optionConversionMap; std::vector _colorRangeData; - - float _fadeInThreshold; - + int _nValuesPerAstronomicalObject; glm::dmat4 _transformationMatrix; diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index 7348a150dc..0d45e191e8 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -153,8 +153,14 @@ namespace { static const openspace::properties::Property::PropertyInfo FadeInThreshouldInfo = { "FadeInThreshould", "Fade-In Threshould", - "This value determines percentage of the astronomical object is visible before starting " - "fading-in it." + "This value determines distance from the center of our galaxy from which the" + "astronomical object is visible before starting fading-in it." + }; + + static const openspace::properties::Property::PropertyInfo DisableFadeInInfo = { + "DisableFadeIn", + "Disable Fade-in effect", + "Enables/Disables the Fade-in effect." }; } // namespace @@ -251,6 +257,12 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { Optional::Yes, FadeInThreshouldInfo.description }, + { + DisableFadeInInfo.identifier, + new BoolVerifier, + Optional::Yes, + DisableFadeInInfo.description + }, } }; } @@ -277,6 +289,8 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary , _textSize(TextSizeInfo, 8.0, 0.5, 24.0) , _drawElements(DrawElementsInfo, true) , _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown) + , _fadeInDistance(FadeInThreshouldInfo, 0.0, 0.1, 1000.0) + , _disableFadeInDistance(DisableFadeInInfo, true) , _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown) , _program(nullptr) , _fontRenderer(nullptr) @@ -288,7 +302,6 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary , _unit(Parsec) , _nValuesPerAstronomicalObject(0) , _sluminosity(1.f) - , _fadeInThreshold(0.0f) , _transformationMatrix(glm::dmat4(1.0)) { documentation::testSpecificationAndThrow( @@ -310,6 +323,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary _renderOption.addOption(1, "Camera Position Normal"); _renderOption.addOption(2, "Screen center Position Normal"); addProperty(_renderOption); + _renderOption.set(1); if (dictionary.hasKey(keyUnit)) { std::string unit = dictionary.value(keyUnit); @@ -428,7 +442,11 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary } if (dictionary.hasKey(FadeInThreshouldInfo.identifier)) { - _fadeInThreshold = static_cast(dictionary.value(FadeInThreshouldInfo.identifier)); + float fadeInValue = static_cast(dictionary.value(FadeInThreshouldInfo.identifier)); + _fadeInDistance.set(fadeInValue); + _disableFadeInDistance.set(false); + addProperty(_fadeInDistance); + addProperty(_disableFadeInDistance); } } @@ -568,7 +586,7 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&, } void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp) { + const glm::vec3& orthoRight, const glm::vec3& orthoUp, const float fadeInVariable) { RenderEngine& renderEngine = OsEng.renderEngine(); _fontRenderer->setFramebufferSize(renderEngine.renderingResolution()); @@ -598,6 +616,8 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat break; } + glm::vec4 textColor = _textColor; + textColor.a *= fadeInVariable; for (const std::pair& pair : _labelData) { //glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0)); glm::vec3 scaledPos(pair.first); @@ -605,7 +625,8 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat _fontRenderer->render( *_font, scaledPos, - _textColor, + //_textColor, + textColor, pow(10.0, _textSize.value()), _textMinSize, modelViewProjectionMatrix, @@ -621,7 +642,7 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat } void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) { - float scale = 0.0; + double scale = 0.0; switch (_unit) { case Meter: scale = 1.0; @@ -647,19 +668,16 @@ void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) { } float fadeInVariable = 1.0f; - if (_fadeInThreshold > 0.0) { - float distCamera = glm::distance(data.camera.positionVec3(), data.position.dvec3()); - double term = std::exp(distCamera / scale - _fadeInThreshold); - float func = static_cast(term / (term + 1.0)); - + if (!_disableFadeInDistance) { + double distCamera = glm::length(data.camera.positionVec3()); + float funcValue = static_cast((1.0 / double(_fadeInDistance))*(distCamera / scale)); + // Let's not waste performance - if (func < 0.001) { + if (funcValue < 0.01) { return; } - if (!std::isinf(term)) { - fadeInVariable = func; - } + fadeInVariable = funcValue > 1.0 ? 1.0 : funcValue; } glm::dmat4 modelMatrix = @@ -686,7 +704,7 @@ void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) { } if (_hasLabel) { - renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp); + renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVariable); } } diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.h b/modules/digitaluniverse/rendering/renderableplanescloud.h index 70f8fa3c43..ff232f1b1f 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.h +++ b/modules/digitaluniverse/rendering/renderableplanescloud.h @@ -95,7 +95,7 @@ namespace openspace { void renderPlanes(const RenderData& data, const glm::dmat4& modelViewMatrix, const glm::dmat4& projectionMatrix, const float fadeInVariable); void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix, - const glm::vec3& orthoRight, const glm::vec3& orthoUp); + const glm::vec3& orthoRight, const glm::vec3& orthoUp, const float fadeInVarible); bool loadData(); bool loadTextures(); @@ -120,6 +120,8 @@ namespace openspace { properties::FloatProperty _textSize; properties::BoolProperty _drawElements; properties::OptionProperty _blendMode; + properties::FloatProperty _fadeInDistance; + properties::BoolProperty _disableFadeInDistance; // DEBUG: properties::OptionProperty _renderOption; @@ -144,8 +146,7 @@ namespace openspace { int _nValuesPerAstronomicalObject; float _sluminosity; - float _fadeInThreshold; - + glm::dmat4 _transformationMatrix; std::unordered_map _renderingPlanesMap; diff --git a/modules/digitaluniverse/shaders/plane2_fs.glsl b/modules/digitaluniverse/shaders/plane2_fs.glsl index 1606bb4a88..a5e15c8e8d 100644 --- a/modules/digitaluniverse/shaders/plane2_fs.glsl +++ b/modules/digitaluniverse/shaders/plane2_fs.glsl @@ -45,7 +45,7 @@ Fragment getFragment() { frag.color = texture(galaxyTexture, vs_st); frag.color *= alphaValue; - frag.color.a *= fadeInValue; + frag.color *= fadeInValue; if (frag.color.a == 0.0) { discard; @@ -55,7 +55,7 @@ Fragment getFragment() { // frag.blend = BLEND_MODE_ADDITIVE; // } - frag.color = texture(galaxyTexture, vs_st); + //frag.color = texture(galaxyTexture, vs_st); frag.depth = vs_screenSpaceDepth; frag.gPosition = vec4(1e27, 1e27, 1e27, 1.0); frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0);