From 6d4ac1fe49ea86468489ff69af8a12daeb3c3e8d Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 10 Dec 2014 00:22:41 +0100 Subject: [PATCH 01/28] Add a new include path to the base shader folder Move the RenderableStars shaders into a separate folder --- ext/ghoul | 2 +- shaders/{ => modules/stars}/star_fs.glsl | 0 shaders/{ => modules/stars}/star_ge.glsl | 0 shaders/{ => modules/stars}/star_vs.glsl | 0 src/engine/openspaceengine.cpp | 3 +++ src/rendering/stars/renderablestars.cpp | 9 +++------ 6 files changed, 7 insertions(+), 7 deletions(-) rename shaders/{ => modules/stars}/star_fs.glsl (100%) rename shaders/{ => modules/stars}/star_ge.glsl (100%) rename shaders/{ => modules/stars}/star_vs.glsl (100%) diff --git a/ext/ghoul b/ext/ghoul index 9bf35183c1..5c087a74a6 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 9bf35183c11d94262fbf3792df4d15d9678facc8 +Subproject commit 5c087a74a6ef36a05d204c801d518cff3da38e96 diff --git a/shaders/star_fs.glsl b/shaders/modules/stars/star_fs.glsl similarity index 100% rename from shaders/star_fs.glsl rename to shaders/modules/stars/star_fs.glsl diff --git a/shaders/star_ge.glsl b/shaders/modules/stars/star_ge.glsl similarity index 100% rename from shaders/star_ge.glsl rename to shaders/modules/stars/star_ge.glsl diff --git a/shaders/star_vs.glsl b/shaders/modules/stars/star_vs.glsl similarity index 100% rename from shaders/star_vs.glsl rename to shaders/modules/stars/star_vs.glsl diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 3c14cfd78f..2e7da2b2d9 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -174,6 +174,9 @@ bool OpenSpaceEngine::create(int argc, char** argv, FileSys.createCacheManager(absPath("${" + constants::configurationmanager::keyCache + "}")); _engine->_console.loadHistory(); + // Register the provided shader directories + ghoul::opengl::ShaderObject::addIncludePath("${SHADERS}"); + _engine->_syncBuffer = new SyncBuffer(1024); // Determining SGCT configuration file diff --git a/src/rendering/stars/renderablestars.cpp b/src/rendering/stars/renderablestars.cpp index 3bf5be04af..c4868cd097 100644 --- a/src/rendering/stars/renderablestars.cpp +++ b/src/rendering/stars/renderablestars.cpp @@ -129,12 +129,9 @@ bool RenderableStars::initialize() { bool completeSuccess = true; _program = ghoul::opengl::ProgramObject::Build("Star", - "${SHADERS}/star_vs.glsl", - "${SHADERS}/star_fs.glsl", - "${SHADERS}/star_ge.glsl"); - //_program = ghoul::opengl::ProgramObject::Build("Star", - // "${SHADERS}/star_vs.glsl", - // "${SHADERS}/star_fs.glsl"); + "${SHADERS}/modules/stars/star_vs.glsl", + "${SHADERS}/modules/stars/star_fs.glsl", + "${SHADERS}/modules/stars/star_ge.glsl"); if (!_program) return false; _program->setProgramObjectCallback([&](ghoul::opengl::ProgramObject*){ _programIsDirty = true; }); From c3bb233d29339ca5a8184e6cc7c322c679e3b6c0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 10 Dec 2014 00:27:35 +0100 Subject: [PATCH 02/28] Moved shadercode of constellationbounds --- .../constellationbounds}/constellationbounds_fs.glsl | 0 .../constellationbounds}/constellationbounds_vs.glsl | 0 src/rendering/stars/renderableconstellationbounds.cpp | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename shaders/{ => modules/constellationbounds}/constellationbounds_fs.glsl (100%) rename shaders/{ => modules/constellationbounds}/constellationbounds_vs.glsl (100%) diff --git a/shaders/constellationbounds_fs.glsl b/shaders/modules/constellationbounds/constellationbounds_fs.glsl similarity index 100% rename from shaders/constellationbounds_fs.glsl rename to shaders/modules/constellationbounds/constellationbounds_fs.glsl diff --git a/shaders/constellationbounds_vs.glsl b/shaders/modules/constellationbounds/constellationbounds_vs.glsl similarity index 100% rename from shaders/constellationbounds_vs.glsl rename to shaders/modules/constellationbounds/constellationbounds_vs.glsl diff --git a/src/rendering/stars/renderableconstellationbounds.cpp b/src/rendering/stars/renderableconstellationbounds.cpp index 4053ae44ac..61d568cd6d 100644 --- a/src/rendering/stars/renderableconstellationbounds.cpp +++ b/src/rendering/stars/renderableconstellationbounds.cpp @@ -84,8 +84,8 @@ RenderableConstellationBounds::RenderableConstellationBounds( bool RenderableConstellationBounds::initialize() { _program = ghoul::opengl::ProgramObject::Build("ConstellationBounds", - "${SHADERS}/constellationbounds_vs.glsl", - "${SHADERS}/constellationbounds_fs.glsl"); + "${SHADERS}/modules/constellationbounds/constellationbounds_vs.glsl", + "${SHADERS}/modules/constellationbounds/constellationbounds_fs.glsl"); if (!_program) return false; _program->setProgramObjectCallback([&](ghoul::opengl::ProgramObject*){ this->_programIsDirty = true; }); From 2883eaf2545105d9d9e2e8258079a9f3fef7fdc5 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 10 Dec 2014 00:55:51 +0100 Subject: [PATCH 03/28] Enable Gui integration of SelectionPropertys --- include/openspace/engine/gui.h | 1 + .../openspace/properties/selectionproperty.h | 2 +- src/engine/gui.cpp | 30 +++++++++++++++++++ src/properties/selectionproperty.cpp | 8 ++--- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/include/openspace/engine/gui.h b/include/openspace/engine/gui.h index 4ee66e318d..36363c42a3 100644 --- a/include/openspace/engine/gui.h +++ b/include/openspace/engine/gui.h @@ -93,6 +93,7 @@ private: std::set _vec3Properties; std::set _stringProperties; std::set _optionProperty; + std::set _selectionProperty; std::set _triggerProperty; std::map> _propertiesByOwner; diff --git a/include/openspace/properties/selectionproperty.h b/include/openspace/properties/selectionproperty.h index 59f2f6eb17..86b20298cb 100644 --- a/include/openspace/properties/selectionproperty.h +++ b/include/openspace/properties/selectionproperty.h @@ -46,7 +46,7 @@ public: void addOption(Option option); const std::vector