diff --git a/include/openspace/rendering/planets/renderableplanetprojection.h b/include/openspace/rendering/planets/renderableplanetprojection.h index 2edbb2c5b9..a585aa5b0d 100644 --- a/include/openspace/rendering/planets/renderableplanetprojection.h +++ b/include/openspace/rendering/planets/renderableplanetprojection.h @@ -77,7 +77,7 @@ protected: void textureBind(); void project(); - + void clearAllProjections(); private: void imageProjectGPU(); @@ -88,6 +88,8 @@ private: properties::IntProperty _rotation; properties::FloatProperty _fadeProjection; properties::BoolProperty _performProjection; + properties::BoolProperty _clearAllProjections; + ghoul::opengl::ProgramObject* _programObject; ghoul::opengl::ProgramObject* _fboProgramObject; @@ -136,6 +138,7 @@ private: std::string _target; std::string _frame; std::string _defaultProjImage; + std::string _clearingImage; std::string _next; bool _capture; diff --git a/openspace-data b/openspace-data index 74c67fe4cc..3fe0b83814 160000 --- a/openspace-data +++ b/openspace-data @@ -1 +1 @@ -Subproject commit 74c67fe4cc6dffc387f0340b0dc8f9c40849a415 +Subproject commit 3fe0b83814a3494007244e1607299273bee519ad diff --git a/src/rendering/planets/renderableplanetprojection.cpp b/src/rendering/planets/renderableplanetprojection.cpp index cd60bde3e9..a0cb398db5 100644 --- a/src/rendering/planets/renderableplanetprojection.cpp +++ b/src/rendering/planets/renderableplanetprojection.cpp @@ -89,6 +89,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& , _rotation("rotation", "Rotation", 0, 0, 360) , _fadeProjection("fadeProjections", "Image Fading Factor", 0.f, 0.f, 1.f) , _performProjection("performProjection", "Perform Projections", true) + , _clearAllProjections("clearAllProjections", "Clear Projections", false) , _programObject(nullptr) , _fboProgramObject(nullptr) , _texture(nullptr) @@ -96,6 +97,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& , _textureProj(nullptr) , _textureWhiteSquare(nullptr) , _geometry(nullptr) + , _clearingImage(absPath("${OPENSPACE_DATA}/scene/common/textures/clear.png")) { std::string name; bool success = dictionary.getValue(constants::scenegraphnode::keyName, name); @@ -166,6 +168,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& addProperty(_rotation); addProperty(_fadeProjection); addProperty(_performProjection); + addProperty(_clearAllProjections); addProperty(_colorTexturePath); _colorTexturePath.onChange(std::bind(&RenderablePlanetProjection::loadTexture, this)); @@ -431,12 +434,23 @@ void RenderablePlanetProjection::project(){ _capture = false; } +void RenderablePlanetProjection::clearAllProjections(){ + float tmp = _fadeProjection; + _fadeProjection = 1.f; + _projectionTexturePath = _clearingImage; + imageProjectGPU(); + _fadeProjection = tmp; + _clearAllProjections = false; +} + #define GPU_PROJ void RenderablePlanetProjection::render(const RenderData& data){ if (!_programObject) return; if (!_textureProj) return; + if (_clearAllProjections) clearAllProjections(); + _camScaling = data.camera.scaling(); _up = data.camera.lookUpVector(); diff --git a/src/util/imagesequencer2.cpp b/src/util/imagesequencer2.cpp index f1f5428af6..41ffa1d74a 100644 --- a/src/util/imagesequencer2.cpp +++ b/src/util/imagesequencer2.cpp @@ -74,7 +74,7 @@ void ImageSequencer2::updateSequencer(double time){ Time::ref().setDeltaTime(0.1); } // Time is not properly updated when time jump with dt = 0 - if (_currentTime < time){ + if (_currentTime != time){ _previousTime = _currentTime; _currentTime = time; }