diff --git a/CMakeLists.txt b/CMakeLists.txt index 724729bcad..085fdbafc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,9 +27,9 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) project(OpenSpace) set(OPENSPACE_VERSION_MAJOR 0) -set(OPENSPACE_VERSION_MINOR 14) -set(OPENSPACE_VERSION_PATCH 1) -set(OPENSPACE_VERSION_STRING "Beta-4") +set(OPENSPACE_VERSION_MINOR 15) +set(OPENSPACE_VERSION_PATCH -1) +set(OPENSPACE_VERSION_STRING "Beta-5") set(OPENSPACE_BASE_DIR "${PROJECT_SOURCE_DIR}") diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 87bceea835..1be2584abe 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -1131,7 +1131,7 @@ int main(int argc, char** argv) { "evaluated before it is passed to OpenSpace." )); - // setCommandLine returns a referece to the vector that will be filled later + // setCommandLine returns a reference to the vector that will be filled later const std::vector& sgctArguments = parser.setCommandLine( { argv, argv + argc } ); diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset index 29a6437b42..9ecd45606a 100644 --- a/data/assets/util/webgui.asset +++ b/data/assets/util/webgui.asset @@ -3,7 +3,7 @@ asset.require('./static_server') local guiCustomization = asset.require('customization/gui') -- Select which commit hashes to use for the frontend and backend -local frontendHash = "2d1bb8d8d8478b6ed025ccc6f1e0ceacf04b6114" +local frontendHash = "129a2c70ec8179b193fdb3a689c37bd65418ac22" local dataProvider = "data.openspaceproject.com/files/webgui" local frontend = asset.syncedResource({ diff --git a/ext/ghoul b/ext/ghoul index 526b27cb65..d73b914734 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 526b27cb653fe9befc324278debc701297694207 +Subproject commit d73b9147347140932bf0691788183db92ccfaf14 diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h index 520608b90a..4ec4ced185 100644 --- a/include/openspace/interaction/orbitalnavigator.h +++ b/include/openspace/interaction/orbitalnavigator.h @@ -83,7 +83,7 @@ public: ScriptCameraStates& scriptStates(); const ScriptCameraStates& scriptStates() const; - bool shouldFollowAnchorRotation() const; + bool shouldFollowAnchorRotation(const glm::dvec3& cameraPosition) const; bool followingAnchorRotation() const; const SceneGraphNode* anchorNode() const; const SceneGraphNode* aimNode() const; @@ -290,8 +290,8 @@ private: /** * Interpolates between rotationDiff and a 0 rotation. */ - glm::dquat interpolateRotationDifferential(double deltaTime, - double interpolationTime, const glm::dquat& rotationDiff); + glm::dquat interpolateRotationDifferential(double deltaTime, double interpolationTime, + const glm::dvec3 cameraPosition, const glm::dquat& rotationDiff); /** * Get the vector from the camera to the surface of the anchor object in world space. diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index 2abeeaae0a..8093c16c4d 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -92,6 +92,9 @@ public: float globalBlackOutFactor(); void setGlobalBlackOutFactor(float opacity); + float hdrExposure() const; + bool isHdrDisabled() const; + void addScreenSpaceRenderable(std::unique_ptr s); void removeScreenSpaceRenderable(ScreenSpaceRenderable* s); void removeScreenSpaceRenderable(const std::string& identifier); diff --git a/modules/base/rendering/renderablesphericalgrid.cpp b/modules/base/rendering/renderablesphericalgrid.cpp index 8fb5c1491b..054c83fa6c 100644 --- a/modules/base/rendering/renderablesphericalgrid.cpp +++ b/modules/base/rendering/renderablesphericalgrid.cpp @@ -137,7 +137,12 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio if (dictionary.hasKey(SegmentsInfo.identifier)) { _segments = static_cast(dictionary.value(SegmentsInfo.identifier)); } - _segments.onChange([&]() { _gridIsDirty = true; }); + _segments.onChange([&]() { + if (_segments.value() % 2 == 1) { + _segments = _segments - 1; + } + _gridIsDirty = true; + }); addProperty(_segments); if (dictionary.hasKey(LineWidthInfo.identifier)) { @@ -259,7 +264,10 @@ void RenderableSphericalGrid::update(const UpdateData&) { _isize = 6 * _segments * _segments; _vsize = (_segments + 1) * (_segments + 1); _varray.resize(_vsize); + Vertex v = { 0.f, 0.f, 0.f }; + std::fill(_varray.begin(), _varray.end(), v); _iarray.resize(_isize); + std::fill(_iarray.begin(), _iarray.end(), 0); int nr = 0; const float fsegments = static_cast(_segments); diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 3d115a7809..836ee76954 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -202,7 +202,6 @@ RenderableTrail::Appearance::Appearance() RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary) : Renderable(dictionary) { - setRenderBin(RenderBin::Overlay); addProperty(_opacity); @@ -212,35 +211,28 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary) addPropertySubOwner(_translation.get()); _appearance.lineColor = dictionary.value(LineColorInfo.identifier); - addProperty(_appearance.lineColor); if (dictionary.hasKeyAndValue(EnableFadeInfo.identifier)) { _appearance.useLineFade = dictionary.value(EnableFadeInfo.identifier); } - addProperty(_appearance.useLineFade); if (dictionary.hasKeyAndValue(FadeInfo.identifier)) { - _appearance.lineFade = static_cast(dictionary.value(FadeInfo.identifier)); + _appearance.lineFade = static_cast( + dictionary.value(FadeInfo.identifier) + ); } - addProperty(_appearance.lineFade); if (dictionary.hasKeyAndValue(LineWidthInfo.identifier)) { _appearance.lineWidth = static_cast(dictionary.value( LineWidthInfo.identifier )); } - addProperty(_appearance.lineWidth); if (dictionary.hasKeyAndValue(PointSizeInfo.identifier)) { - _appearance.pointSize = static_cast(dictionary.value(PointSizeInfo.identifier)); + _appearance.pointSize = static_cast( + dictionary.value(PointSizeInfo.identifier) + ); } - addProperty(_appearance.pointSize); - - _appearance.renderingModes.addOptions({ - { RenderingModeLines, "Lines" }, - { RenderingModePoints, "Points" }, - { RenderingModeLinesPoints, "Lines+Points" } - }); // This map is not accessed out of order as long as the Documentation is adapted // whenever the map changes. The documentation will check for valid values @@ -252,7 +244,8 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary) else { _appearance.renderingModes = RenderingModeLines; } - addProperty(_appearance.renderingModes); + + addPropertySubOwner(_appearance); } void RenderableTrail::initializeGL() { @@ -331,7 +324,8 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) { } auto render = [renderLines, renderPoints, p = _programObject, &data, - &modelTransform, pointSize = _appearance.pointSize.value(), c = _uniformCache] + &modelTransform, pointSize = _appearance.pointSize.value(), + c = _uniformCache] (RenderInformation& info, int nVertices, int offset) { // We pass in the model view transformation matrix as double in order to maintain diff --git a/openspace.cfg b/openspace.cfg index d34aae67c9..51b091a9a4 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -78,7 +78,8 @@ Paths = { LOGS = "${BASE}/logs", MODULES = "${BASE}/modules", SCRIPTS = "${BASE}/scripts", - SHADERS = "${BASE}/shaders" + SHADERS = "${BASE}/shaders", + TEMPORARY = "${BASE}/temp" } ModuleConfigurations = { diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 6c2042961e..a204b7e44c 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -104,10 +104,7 @@ namespace openspace { class Scene; -OpenSpaceEngine::OpenSpaceEngine() - : _scene(nullptr) - , _loadingScreen(nullptr) -{ +OpenSpaceEngine::OpenSpaceEngine() { FactoryManager::initialize(); FactoryManager::ref().addFactory( std::make_unique>(), @@ -164,19 +161,20 @@ void OpenSpaceEngine::registerPathTokens() { ghoul::filesystem::FileSystem::TokenClosingBraces; LDEBUG(fmt::format("Registering path {}: {}", fullKey, path.second)); - const bool override = (fullKey == "${BASE}"); - if (override) { + const bool overrideBase = (fullKey == "${BASE}"); + if (overrideBase) { LINFO(fmt::format("Overriding base path with '{}'", path.second)); } + const bool overrideTemporary = (fullKey == "${TEMPORARY}"); + using Override = ghoul::filesystem::FileSystem::Override; FileSys.registerPathToken( std::move(fullKey), std::move(path.second), - Override(override) + Override(overrideBase || overrideTemporary) ); } - LTRACE("OpenSpaceEngine::initialize(end)"); } diff --git a/src/interaction/externinteraction.cpp b/src/interaction/externinteraction.cpp index 13f6915a34..ab383a67ff 100644 --- a/src/interaction/externinteraction.cpp +++ b/src/interaction/externinteraction.cpp @@ -40,42 +40,39 @@ #include namespace { -const uint32_t ProtocolVersion = 3; -const size_t MaxLatencyDiffs = 64; -const char* _loggerCat = "ExternInteraction"; + constexpr const uint32_t ProtocolVersion = 3; + constexpr const size_t MaxLatencyDiffs = 64; -constexpr openspace::properties::Property::PropertyInfo BufferTimeInfo = { - "BufferTime", - "Buffer Time", - "" // @TODO Missing documentation -}; + constexpr openspace::properties::Property::PropertyInfo BufferTimeInfo = { + "BufferTime", + "Buffer Time", + "" // @TODO Missing documentation + }; -constexpr openspace::properties::Property::PropertyInfo TimeKeyFrameInfo = { - "TimeKeyframeInterval", - "Time keyframe interval", - "" // @TODO Missing documentation -}; + constexpr openspace::properties::Property::PropertyInfo TimeKeyFrameInfo = { + "TimeKeyframeInterval", + "Time keyframe interval", + "" // @TODO Missing documentation + }; -constexpr openspace::properties::Property::PropertyInfo CameraKeyFrameInfo = { - "CameraKeyframeInterval", - "Camera Keyframe interval", - "" // @TODO Missing documentation -}; - -constexpr openspace::properties::Property::PropertyInfo TimeToleranceInfo = { - "TimeTolerance", - "Time tolerance", - "" // @TODO Missing documentation -}; + constexpr openspace::properties::Property::PropertyInfo CameraKeyFrameInfo = { + "CameraKeyframeInterval", + "Camera Keyframe interval", + "" // @TODO Missing documentation + }; + constexpr openspace::properties::Property::PropertyInfo TimeToleranceInfo = { + "TimeTolerance", + "Time tolerance", + "" // @TODO Missing documentation + }; } // namespace namespace openspace { ExternInteraction::ExternInteraction() : properties::PropertyOwner({ "ExternInteration", "External Interaction" }) -{ -} +{} void ExternInteraction::cameraInteraction(datamessagestructures::CameraKeyframe kf) { interaction::KeyframeNavigator::CameraPose pose; diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index ea267548d1..ea817396b4 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -369,7 +369,7 @@ void OrbitalNavigator::resetVelocities() { _websocketStates.resetVelocities(); _scriptStates.resetVelocities(); - if (shouldFollowAnchorRotation()) { + if (shouldFollowAnchorRotation(_camera->positionVec3())) { _followRotationInterpolator.end(); } else { @@ -459,6 +459,7 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) { anchorNodeRotationDiff = interpolateRotationDifferential( deltaTime, _followRotationInterpolationTime, + pose.position, anchorNodeRotationDiff ); @@ -701,7 +702,8 @@ void OrbitalNavigator::setRetargetInterpolationTime(float durationInSeconds) { _retargetInterpolationTime = durationInSeconds; } -bool OrbitalNavigator::shouldFollowAnchorRotation() const { +bool OrbitalNavigator::shouldFollowAnchorRotation(const glm::dvec3& cameraPosition) const +{ if (!_anchorNode) { return false; } @@ -709,7 +711,7 @@ bool OrbitalNavigator::shouldFollowAnchorRotation() const { const glm::dmat4 modelTransform = _anchorNode->modelTransform(); const glm::dmat4 inverseModelTransform = _anchorNode->inverseModelTransform(); const glm::dvec3 cameraPositionModelSpace = glm::dvec3(inverseModelTransform * - glm::dvec4(_camera->positionVec3(), 1.0)); + glm::dvec4(cameraPosition, 1.0)); const SurfacePositionHandle positionHandle = _anchorNode->calculateSurfacePositionHandle(cameraPositionModelSpace); @@ -719,7 +721,7 @@ bool OrbitalNavigator::shouldFollowAnchorRotation() const { ) * _followAnchorNodeRotationDistance; const double distanceToCamera = - glm::distance(_camera->positionVec3(), _anchorNode->worldPosition()); + glm::distance(cameraPosition, _anchorNode->worldPosition()); return distanceToCamera < maximumDistanceForRotation; } @@ -1277,10 +1279,12 @@ glm::dvec3 OrbitalNavigator::pushToSurface(double minHeightAboveGround, glm::dquat OrbitalNavigator::interpolateRotationDifferential(double deltaTime, double interpolationTime, + const glm::dvec3 cameraPosition, const glm::dquat& rotationDiff) { // Interpolate with a negative delta time if distance is too large to follow - const double interpolationSign = shouldFollowAnchorRotation() ? 1.0 : -1.0; + const double interpolationSign = + shouldFollowAnchorRotation(cameraPosition) ? 1.0 : -1.0; _followRotationInterpolator.setInterpolationTime(static_cast( interpolationTime diff --git a/src/interaction/websocketinputstate.cpp b/src/interaction/websocketinputstate.cpp index e49989147c..4a531c83bf 100644 --- a/src/interaction/websocketinputstate.cpp +++ b/src/interaction/websocketinputstate.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index ec726f73e3..49981a7a1a 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -935,6 +935,14 @@ void RenderEngine::setGlobalBlackOutFactor(float opacity) { _globalBlackOutFactor = opacity; } +float RenderEngine::hdrExposure() const { + return _hdrExposure; +} + +bool RenderEngine::isHdrDisabled() const { + return _disableHDRPipeline; +} + /** * Build a program object for rendering with the used renderer */ diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index d8aa117073..9a3b01f0dc 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -500,7 +500,9 @@ void ScreenSpaceRenderable::createShaders() { ghoul::Dictionary rendererData = { { "fragmentRendererPath", "${SHADERS}/framebuffer/renderframebuffer.frag" }, { "windowWidth" , res.x }, - { "windowHeight" , res.y } + { "windowHeight" , res.y }, + { "hdrExposure", global::renderEngine.hdrExposure() }, + { "disableHDR", global::renderEngine.isHdrDisabled() } }; dict.setValue("rendererData", rendererData); diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 914242cf9a..21b8c06d26 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -123,11 +123,13 @@ std::unique_ptr SceneGraphNode::createFromDictionary( )); return nullptr; } - result->addPropertySubOwner(result->_transform.translation.get()); LDEBUG(fmt::format( "Successfully created ephemeris for '{}'", result->identifier() )); } + if (result->_transform.translation) { + result->addPropertySubOwner(result->_transform.translation.get()); + } if (dictionary.hasKey(KeyTransformRotation)) { ghoul::Dictionary rotationDictionary; @@ -139,11 +141,13 @@ std::unique_ptr SceneGraphNode::createFromDictionary( )); return nullptr; } - result->addPropertySubOwner(result->_transform.rotation.get()); LDEBUG(fmt::format( "Successfully created rotation for '{}'", result->identifier() )); } + if (result->_transform.rotation) { + result->addPropertySubOwner(result->_transform.rotation.get()); + } if (dictionary.hasKey(KeyTransformScale)) { ghoul::Dictionary scaleDictionary; @@ -155,9 +159,11 @@ std::unique_ptr SceneGraphNode::createFromDictionary( )); return nullptr; } - result->addPropertySubOwner(result->_transform.scale.get()); LDEBUG(fmt::format("Successfully created scale for '{}'", result->identifier())); } + if (result->_transform.scale) { + result->addPropertySubOwner(result->_transform.scale.get()); + } if (dictionary.hasKey(KeyTimeFrame)) { ghoul::Dictionary timeFrameDictionary;