From 23a446cb2c9a41c8f06f4a92831f89b67586af96 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 13 Dec 2017 21:55:29 -0500 Subject: [PATCH] Update Ghoul repository Adapt to changes that absPath is not called automatically as often anymore Remove atmosphereearth.scene --- data/scene/atmosphereearth.scene | 58 ------------------- data/scene/dawn.scene | 4 +- data/scene/default.scene | 6 +- data/scene/fieldlines.scene | 4 +- data/scene/juno.scene | 4 +- data/scene/newhorizons.scene | 4 +- data/scene/osirisrex.scene | 6 +- data/scene/rosetta.scene | 4 +- data/scene/tests.scene | 4 +- data/scene/volumetricmilkyway.scene | 4 +- data/scene/voyager.scene | 4 +- ext/ghoul | 2 +- modules/base/rendering/renderablemodel.cpp | 4 +- modules/base/rendering/renderableplane.cpp | 7 ++- modules/base/rendering/renderablesphere.cpp | 8 ++- .../rendering/renderablesphericalgrid.cpp | 7 ++- modules/base/rendering/renderabletrail.cpp | 5 +- modules/debugging/rendering/debugrenderer.cpp | 7 ++- .../rendering/renderabledebugplane.cpp | 6 +- .../rendering/renderablebillboardscloud.cpp | 10 ++-- .../rendering/renderabledumeshes.cpp | 8 ++- .../rendering/renderableplanescloud.cpp | 8 ++- .../rendering/renderablepoints.cpp | 17 +++--- .../rendering/renderablefieldlines.cpp | 6 +- .../renderablefieldlinessequencesetup.cpp | 4 +- modules/galaxy/rendering/renderablegalaxy.cpp | 10 ++-- modules/globebrowsing/globes/pointglobe.cpp | 6 +- .../rendering/layershadermanager.cpp | 5 +- modules/imgui/src/gui.cpp | 4 +- modules/iswa/rendering/iswacygnet.cpp | 8 ++- .../rendering/renderablekameleonvolume.cpp | 2 +- .../renderableconstellationbounds.cpp | 4 +- modules/space/rendering/renderableplanet.cpp | 20 ++++--- modules/space/rendering/renderablerings.cpp | 9 +-- modules/space/rendering/renderablestars.cpp | 7 ++- .../space/translation/spicetranslation.cpp | 4 +- .../rendering/renderablecrawlingline.cpp | 5 +- .../rendering/renderablefov.cpp | 5 +- .../rendering/renderablemodelprojection.cpp | 28 ++++++--- .../rendering/renderableplaneprojection.cpp | 4 +- .../rendering/renderableplanetprojection.cpp | 12 ++-- .../rendering/renderableshadowcylinder.cpp | 5 +- modules/touch/src/touchmarker.cpp | 7 ++- src/engine/configurationmanager.cpp | 3 +- src/engine/openspaceengine.cpp | 4 +- src/interaction/luaconsole.cpp | 4 +- src/rendering/framebufferrenderer.cpp | 5 +- src/rendering/loadingscreen.cpp | 4 +- src/rendering/renderengine.cpp | 5 +- src/scene/scenegraphnode.cpp | 33 ++++++----- src/scripting/scriptengine_lua.inl | 2 +- src/util/openspacemodule.cpp | 2 +- src/util/taskloader.cpp | 3 +- 53 files changed, 200 insertions(+), 211 deletions(-) delete mode 100644 data/scene/atmosphereearth.scene diff --git a/data/scene/atmosphereearth.scene b/data/scene/atmosphereearth.scene deleted file mode 100644 index 80c6ae04b5..0000000000 --- a/data/scene/atmosphereearth.scene +++ /dev/null @@ -1,58 +0,0 @@ -function preInitialization() - --[[ - The scripts in this function are executed after the scene is loaded but before the - scene elements have been initialized, thus they should be used to set the time at - which the scene should start and other settings that might determine initialization - critical objects. - ]]-- - openspace.set_default_dashboard() - - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") - - openspace.time.setTime(openspace.time.currentWallTime()) - dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) -end - -function postInitialization() - --[[ - The scripts in this function are executed after all objects in the scene have been - created and initialized, but before the first render call. This is the place to set - graphical settings for the renderables. - ]]-- - openspace.set_default_gui_sorting() - - openspace.printInfo("Setting default values") - openspace.setPropertyValue("Sun.renderable.Enabled", false) - openspace.setPropertyValue("SunMarker.renderable.Enabled", true) - openspace.setPropertyValue("EarthMarker.renderable.enabled", true) - openspace.setPropertyValue("Constellation Bounds.renderable.Enabled", false) - - openspace.setPropertyValue("MilkyWay.renderable.Transparency", 0.55) - openspace.setPropertyValue("MilkyWay.renderable.Segments", 50) - - openspace.printInfo("Done setting default values") - - if openspace.modules.isLoaded("ISWA") then - openspace.iswa.addCdfFiles("${OPENSPACE_DATA}/cdflist.json"); - end -end - - -return { - ScenePath = ".", - CommonFolder = "common", - Camera = { - Focus = "Earth", - Position = {1, 0, 0}, - Rotation = {0.250635, -0.028751, 0.879269, 0.404030}, - }, - Modules = { - "sun", - "earth", - "stars/digitaluniverse", - -- "stars/denver", - "milkyway/digitaluniverse", - --"milkyway/eso", - } -} diff --git a/data/scene/dawn.scene b/data/scene/dawn.scene index 42f6c756ed..a1903a6120 100644 --- a/data/scene/dawn.scene +++ b/data/scene/dawn.scene @@ -7,8 +7,8 @@ function preInitialization() ]]-- openspace.set_default_dashboard() - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) openspace.time.setTime("2011 AUG 06 00:00:00") dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) diff --git a/data/scene/default.scene b/data/scene/default.scene index 150a4d886d..002c73cf22 100644 --- a/data/scene/default.scene +++ b/data/scene/default.scene @@ -27,8 +27,8 @@ function preInitialization() ]]-- openspace.set_default_dashboard() - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) openspace.time.setTime(openspace.time.currentWallTime()) dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) @@ -133,7 +133,7 @@ return { -- "satellites", "grids", - "digitaluniverse", + -- "digitaluniverse", "stars/digitaluniverse", "milkyway/digitaluniverse" } diff --git a/data/scene/fieldlines.scene b/data/scene/fieldlines.scene index 68105fd851..2833ca5645 100644 --- a/data/scene/fieldlines.scene +++ b/data/scene/fieldlines.scene @@ -7,8 +7,8 @@ function preInitialization() ]]-- openspace.set_default_dashboard() - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) openspace.time.setTime("2015 JAN 01 12:00:00.000") dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) diff --git a/data/scene/juno.scene b/data/scene/juno.scene index 1fb89600e7..054cb1033a 100755 --- a/data/scene/juno.scene +++ b/data/scene/juno.scene @@ -7,8 +7,8 @@ function preInitialization() ]]-- openspace.set_default_dashboard() - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) openspace.time.setTime("2016-07-01T10:05:00.00") diff --git a/data/scene/newhorizons.scene b/data/scene/newhorizons.scene index dc4a0983c5..9691e8ea28 100644 --- a/data/scene/newhorizons.scene +++ b/data/scene/newhorizons.scene @@ -45,8 +45,8 @@ function preInitialization() Type = "DashboardItemInstruments" }) - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) openspace.time.setTime("2015-07-14T08:00:00.00") diff --git a/data/scene/osirisrex.scene b/data/scene/osirisrex.scene index 449e9d12e4..84a11b840e 100644 --- a/data/scene/osirisrex.scene +++ b/data/scene/osirisrex.scene @@ -9,8 +9,8 @@ function preInitialization() ]]-- openspace.set_default_dashboard() - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) --local startTime = "2019 APR 16 12:03:00.00" openspace.time.setTime("2016 SEP 8 23:00:00.500") @@ -73,7 +73,7 @@ function preInitialization() "Toggles the visibility of the text marking the location of the Earth." ) - openspace.scriptScheduler.loadFile("${OPENSPACE_DATA}/scene/missions/osirisrex/scheduled_scripts.lua") + openspace.scriptScheduler.loadFile(openspace.absPath("${OPENSPACE_DATA}/scene/missions/osirisrex/scheduled_scripts.lua")) end function postInitialization() diff --git a/data/scene/rosetta.scene b/data/scene/rosetta.scene index 43935f9856..72b650d7a8 100644 --- a/data/scene/rosetta.scene +++ b/data/scene/rosetta.scene @@ -7,8 +7,8 @@ function preInitialization() ]]-- openspace.set_default_dashboard() - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) -- Usual start openspace.time.setTime("2014-08-01T03:05:18.101") diff --git a/data/scene/tests.scene b/data/scene/tests.scene index 1c57635e7f..dbce97ee34 100644 --- a/data/scene/tests.scene +++ b/data/scene/tests.scene @@ -179,8 +179,8 @@ function preInitialization() }) - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) openspace.time.setTime("2000 JAN 01") dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua')) diff --git a/data/scene/volumetricmilkyway.scene b/data/scene/volumetricmilkyway.scene index fb723772dd..cdac50ae1f 100644 --- a/data/scene/volumetricmilkyway.scene +++ b/data/scene/volumetricmilkyway.scene @@ -7,8 +7,8 @@ function preInitialization() ]]-- openspace.set_default_dashboard() - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) openspace.time.setTime(openspace.time.currentWallTime()) dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) diff --git a/data/scene/voyager.scene b/data/scene/voyager.scene index c02ce885ba..1c9c4e6354 100644 --- a/data/scene/voyager.scene +++ b/data/scene/voyager.scene @@ -7,8 +7,8 @@ function preInitialization() ]]-- openspace.set_default_dashboard() - openspace.spice.loadKernel("${SPICE}/naif0012.tls") - openspace.spice.loadKernel("${SPICE}/pck00010.tpc") + openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls")) + openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc")) -- openspace.time.setTime(openspace.time.currentWallTime()) openspace.time.setTime("1977 SEP 10 12:00:00") diff --git a/ext/ghoul b/ext/ghoul index bbf1018920..e1c845024b 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit bbf1018920fd1d774ff4851971543e18c08422f5 +Subproject commit e1c845024b2c55574194c8c155232de5509cac71 diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 1c5a5a5b8a..8f9c07736a 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -159,8 +159,8 @@ bool RenderableModel::isReady() const { void RenderableModel::initializeGL() { _programObject = OsEng.renderEngine().buildRenderProgram( "ModelProgram", - "${MODULE_BASE}/shaders/model_vs.glsl", - "${MODULE_BASE}/shaders/model_fs.glsl" + absPath("${MODULE_BASE}/shaders/model_vs.glsl"), + absPath("${MODULE_BASE}/shaders/model_fs.glsl") ); loadTexture(); diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index 3bdad0e230..62701f1256 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -183,9 +183,10 @@ void RenderablePlane::initializeGL() { glGenBuffers(1, &_vertexPositionBuffer); // generate buffer createPlane(); - _shader = OsEng.renderEngine().buildRenderProgram("PlaneProgram", - "${MODULE_BASE}/shaders/plane_vs.glsl", - "${MODULE_BASE}/shaders/plane_fs.glsl" + _shader = OsEng.renderEngine().buildRenderProgram( + "PlaneProgram", + absPath("${MODULE_BASE}/shaders/plane_vs.glsl"), + absPath("${MODULE_BASE}/shaders/plane_fs.glsl") ); loadTexture(); diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index 9ba2a62fcc..39fbba6d09 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -227,9 +227,11 @@ void RenderableSphere::initializeGL() { _sphere->initialize(); // pscstandard - _shader = OsEng.renderEngine().buildRenderProgram("Sphere", - "${MODULE_BASE}/shaders/sphere_vs.glsl", - "${MODULE_BASE}/shaders/sphere_fs.glsl"); + _shader = OsEng.renderEngine().buildRenderProgram( + "Sphere", + absPath("${MODULE_BASE}/shaders/sphere_vs.glsl"), + absPath("${MODULE_BASE}/shaders/sphere_fs.glsl") + ); loadTexture(); } diff --git a/modules/base/rendering/renderablesphericalgrid.cpp b/modules/base/rendering/renderablesphericalgrid.cpp index f9478e4f91..587d1c24bf 100644 --- a/modules/base/rendering/renderablesphericalgrid.cpp +++ b/modules/base/rendering/renderablesphericalgrid.cpp @@ -32,6 +32,7 @@ #include #include +#include #include namespace { @@ -179,9 +180,9 @@ bool RenderableSphericalGrid::isReady() const { void RenderableSphericalGrid::initializeGL() { _gridProgram = OsEng.renderEngine().buildRenderProgram( - "GridProgram", - "${MODULE_BASE}/shaders/grid_vs.glsl", - "${MODULE_BASE}/shaders/grid_fs.glsl" + "GridProgram", + absPath("${MODULE_BASE}/shaders/grid_vs.glsl"), + absPath("${MODULE_BASE}/shaders/grid_fs.glsl") ); glGenVertexArrays(1, &_vaoID); diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 3f11564117..7a0ddd9954 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -31,6 +31,7 @@ #include #include +#include #include namespace { @@ -221,8 +222,8 @@ void RenderableTrail::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); _programObject = renderEngine.buildRenderProgram( "EphemerisProgram", - "${MODULE_BASE}/shaders/renderabletrail_vs.glsl", - "${MODULE_BASE}/shaders/renderabletrail_fs.glsl" + absPath("${MODULE_BASE}/shaders/renderabletrail_vs.glsl"), + absPath("${MODULE_BASE}/shaders/renderabletrail_fs.glsl") ); setRenderBin(Renderable::RenderBin::Overlay); diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index d29a1c24a8..4575a9bb01 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -45,9 +46,9 @@ DebugRenderer* DebugRenderer::_reference = nullptr; DebugRenderer::DebugRenderer() { _programObject = OsEng.renderEngine().buildRenderProgram( "BasicDebugShader", - "${MODULE_DEBUGGING}/rendering/debugshader_vs.glsl", - "${MODULE_DEBUGGING}/rendering/debugshader_fs.glsl" - ); + absPath("${MODULE_DEBUGGING}/rendering/debugshader_vs.glsl"), + absPath("${MODULE_DEBUGGING}/rendering/debugshader_fs.glsl") + ); } DebugRenderer::DebugRenderer(std::unique_ptr programObject) diff --git a/modules/debugging/rendering/renderabledebugplane.cpp b/modules/debugging/rendering/renderabledebugplane.cpp index 1e1847ae38..1de3d6624f 100644 --- a/modules/debugging/rendering/renderabledebugplane.cpp +++ b/modules/debugging/rendering/renderabledebugplane.cpp @@ -198,9 +198,9 @@ void RenderableDebugPlane::initializeGL() { if (!_shader) { RenderEngine& renderEngine = OsEng.renderEngine(); _shader = renderEngine.buildRenderProgram("PlaneProgram", - "${MODULE_BASE}/shaders/plane_vs.glsl", - "${MODULE_BASE}/shaders/plane_fs.glsl" - ); + absPath("${MODULE_BASE}/shaders/plane_vs.glsl"), + absPath("${MODULE_BASE}/shaders/plane_fs.glsl") + ); } } diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 7460bc1183..95a8c6094b 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -509,10 +509,12 @@ void RenderableBillboardsCloud::initialize() { void RenderableBillboardsCloud::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); - _program = renderEngine.buildRenderProgram("RenderableBillboardsCloud", - "${MODULE_DIGITALUNIVERSE}/shaders/billboard2_vs.glsl", - "${MODULE_DIGITALUNIVERSE}/shaders/billboard2_fs.glsl", - "${MODULE_DIGITALUNIVERSE}/shaders/billboard2_gs.glsl"); + _program = renderEngine.buildRenderProgram( + "RenderableBillboardsCloud", + absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard2_vs.glsl"), + absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard2_fs.glsl"), + absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard2_gs.glsl") + ); if (_hasPolygon) { createPolygonTexture(); diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 56fb957cf1..6ff5a5b7a5 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -391,9 +391,11 @@ bool RenderableDUMeshes::isReady() const { void RenderableDUMeshes::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); - _program = renderEngine.buildRenderProgram("RenderableDUMeshes", - "${MODULE_DIGITALUNIVERSE}/shaders/dumesh_vs.glsl", - "${MODULE_DIGITALUNIVERSE}/shaders/dumesh_fs.glsl"); + _program = renderEngine.buildRenderProgram( + "RenderableDUMeshes", + absPath("${MODULE_DIGITALUNIVERSE}/shaders/dumesh_vs.glsl"), + absPath("${MODULE_DIGITALUNIVERSE}/shaders/dumesh_fs.glsl") + ); bool success = loadData(); if (!success) { diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index bcb9a67bf0..c27a5380c0 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -447,9 +447,11 @@ void RenderablePlanesCloud::initialize() { void RenderablePlanesCloud::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); - _program = renderEngine.buildRenderProgram("RenderablePlanesCloud", - "${MODULE_DIGITALUNIVERSE}/shaders/plane2_vs.glsl", - "${MODULE_DIGITALUNIVERSE}/shaders/plane2_fs.glsl"); + _program = renderEngine.buildRenderProgram( + "RenderablePlanesCloud", + absPath("${MODULE_DIGITALUNIVERSE}/shaders/plane2_vs.glsl"), + absPath("${MODULE_DIGITALUNIVERSE}/shaders/plane2_fs.glsl") + ); createPlanes(); diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index 4f84585cc4..b08a0b4ef4 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -263,15 +263,18 @@ namespace openspace { void RenderablePoints::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); if (_hasSpriteTexture) { - _program = renderEngine.buildRenderProgram("RenderablePoints", - "${MODULE_DIGITALUNIVERSE}/shaders/points_vs.glsl", - "${MODULE_DIGITALUNIVERSE}/shaders/points_sprite_fs.glsl"); + _program = renderEngine.buildRenderProgram( + "RenderablePoints", + absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_vs.glsl"), + absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_sprite_fs.glsl") + ); } else { - _program = renderEngine.buildRenderProgram("RenderablePoints", - "${MODULE_DIGITALUNIVERSE}/shaders/points_vs.glsl", - "${MODULE_DIGITALUNIVERSE}/shaders/points_fs.glsl");// , - //"${MODULE_DIGITALUNIVERSE}/shaders/points_gs.glsl"); + _program = renderEngine.buildRenderProgram( + "RenderablePoints", + absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_vs.glsl"), + absPath("${MODULE_DIGITALUNIVERSE}/shaders/points_fs.glsl") + ); } } diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index c038b13891..05fef687d5 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -242,9 +242,9 @@ void RenderableFieldlines::initializeGL() { _program = OsEng.renderEngine().buildRenderProgram( "Fieldline", - "${MODULE_FIELDLINES}/shaders/fieldline_vs.glsl", - "${MODULE_FIELDLINES}/shaders/fieldline_fs.glsl", - "${MODULE_FIELDLINES}/shaders/fieldline_gs.glsl" + absPath("${MODULE_FIELDLINES}/shaders/fieldline_vs.glsl"), + absPath("${MODULE_FIELDLINES}/shaders/fieldline_fs.glsl"), + absPath("${MODULE_FIELDLINES}/shaders/fieldline_gs.glsl") ); } diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequencesetup.cpp b/modules/fieldlinessequence/rendering/renderablefieldlinessequencesetup.cpp index 0ca663d969..0225f126ea 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequencesetup.cpp +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequencesetup.cpp @@ -266,8 +266,8 @@ void RenderableFieldlinesSequence::initialize() { // Setup shader program _shaderProgram = OsEng.renderEngine().buildRenderProgram( "FieldlinesSequence", - "${MODULE_FIELDLINESSEQUENCE}/shaders/fieldlinessequence_vs.glsl", - "${MODULE_FIELDLINESSEQUENCE}/shaders/fieldlinessequence_fs.glsl" + absPath("${MODULE_FIELDLINESSEQUENCE}/shaders/fieldlinessequence_vs.glsl"), + absPath("${MODULE_FIELDLINESSEQUENCE}/shaders/fieldlinessequence_fs.glsl") ); if (!_shaderProgram) { diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index 39e7432dcd..a301688b69 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -260,10 +260,12 @@ void RenderableGalaxy::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); - _pointsProgram = renderEngine.buildRenderProgram("Galaxy points", - "${MODULE_GALAXY}/shaders/points.vs", - "${MODULE_GALAXY}/shaders/points.fs", - ghoul::Dictionary()); + _pointsProgram = renderEngine.buildRenderProgram( + "Galaxy points", + absPath("${MODULE_GALAXY}/shaders/points.vs"), + absPath("${MODULE_GALAXY}/shaders/points.fs"), + ghoul::Dictionary() + ); _pointsProgram->setIgnoreUniformLocationError( ghoul::opengl::ProgramObject::IgnoreError::Yes diff --git a/modules/globebrowsing/globes/pointglobe.cpp b/modules/globebrowsing/globes/pointglobe.cpp index 630cbd300c..a12301d610 100644 --- a/modules/globebrowsing/globes/pointglobe.cpp +++ b/modules/globebrowsing/globes/pointglobe.cpp @@ -31,6 +31,7 @@ #include #include +#include #include namespace { @@ -67,8 +68,9 @@ PointGlobe::~PointGlobe() { void PointGlobe::initialize() { _programObject = OsEng.renderEngine().buildRenderProgram( "PointGlobe", - "${MODULE_GLOBEBROWSING}/shaders/pointglobe_vs.glsl", - "${MODULE_GLOBEBROWSING}/shaders/pointglobe_fs.glsl"); + absPath("${MODULE_GLOBEBROWSING}/shaders/pointglobe_vs.glsl"), + absPath("${MODULE_GLOBEBROWSING}/shaders/pointglobe_fs.glsl") + ); glGenVertexArrays(1, &_vaoID); glGenBuffers(1, &_vertexBufferID); diff --git a/modules/globebrowsing/rendering/layershadermanager.cpp b/modules/globebrowsing/rendering/layershadermanager.cpp index 1ba3456403..4c2c0710b8 100644 --- a/modules/globebrowsing/rendering/layershadermanager.cpp +++ b/modules/globebrowsing/rendering/layershadermanager.cpp @@ -33,6 +33,7 @@ #include #include +#include #include namespace openspace::globebrowsing { @@ -225,8 +226,8 @@ void LayerShaderManager::recompileShaderProgram( _programObject = OsEng.renderEngine().buildRenderProgram( _shaderName, - _vsPath, - _fsPath, + absPath(_vsPath), + absPath(_fsPath), shaderDictionary ); diff --git a/modules/imgui/src/gui.cpp b/modules/imgui/src/gui.cpp index 9f9c3f549c..05a785f28d 100644 --- a/modules/imgui/src/gui.cpp +++ b/modules/imgui/src/gui.cpp @@ -529,8 +529,8 @@ void GUI::deinitialize() { void GUI::initializeGL() { _program = ghoul::opengl::ProgramObject::Build( "GUI", - "${MODULE_IMGUI}/shaders/gui_vs.glsl", - "${MODULE_IMGUI}/shaders/gui_fs.glsl" + absPath("${MODULE_IMGUI}/shaders/gui_vs.glsl"), + absPath("${MODULE_IMGUI}/shaders/gui_fs.glsl") ); if (!_program) { return; diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp index 208709f1db..3f767e99bf 100644 --- a/modules/iswa/rendering/iswacygnet.cpp +++ b/modules/iswa/rendering/iswacygnet.cpp @@ -31,6 +31,7 @@ #include #include +#include #include namespace { @@ -266,9 +267,10 @@ void IswaCygnet::initializeTime() { bool IswaCygnet::createShader() { if (_shader == nullptr) { RenderEngine& renderEngine = OsEng.renderEngine(); - _shader = renderEngine.buildRenderProgram(_programName, - _vsPath, - _fsPath + _shader = renderEngine.buildRenderProgram( + _programName, + absPath(_vsPath), + absPath(_fsPath) ); if (!_shader) { return false; diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 79da27d01f..3f863c183c 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -338,7 +338,7 @@ bool RenderableKameleonVolume::cachingEnabled() { } void RenderableKameleonVolume::load() { - if (!FileSys.fileExists(_sourcePath)) { + if (!FileSys.fileExists(ghoul::filesystem::File(_sourcePath))) { LERROR("File " << _sourcePath << " does not exist."); return; } diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp index 0355f5009a..1c5dd07b42 100644 --- a/modules/space/rendering/renderableconstellationbounds.cpp +++ b/modules/space/rendering/renderableconstellationbounds.cpp @@ -198,8 +198,8 @@ RenderableConstellationBounds::RenderableConstellationBounds( void RenderableConstellationBounds::initializeGL() { _program = OsEng.renderEngine().buildRenderProgram( "ConstellationBounds", - "${MODULE_SPACE}/shaders/constellationbounds_vs.glsl", - "${MODULE_SPACE}/shaders/constellationbounds_fs.glsl" + absPath("${MODULE_SPACE}/shaders/constellationbounds_vs.glsl"), + absPath("${MODULE_SPACE}/shaders/constellationbounds_fs.glsl") ); diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp index ad3478efa3..61c5e88f15 100644 --- a/modules/space/rendering/renderableplanet.cpp +++ b/modules/space/rendering/renderableplanet.cpp @@ -342,29 +342,33 @@ void RenderablePlanet::initializeGL() { // shadow program _programObject = renderEngine.buildRenderProgram( "shadowNightProgram", - "${MODULE_SPACE}/shaders/shadow_nighttexture_vs.glsl", - "${MODULE_SPACE}/shaders/shadow_nighttexture_fs.glsl"); + absPath("${MODULE_SPACE}/shaders/shadow_nighttexture_vs.glsl"), + absPath("${MODULE_SPACE}/shaders/shadow_nighttexture_fs.glsl") + ); } else if (_programObject == nullptr && _shadowEnabled) { // shadow program _programObject = renderEngine.buildRenderProgram( "shadowProgram", - "${MODULE_SPACE}/shaders/shadow_vs.glsl", - "${MODULE_SPACE}/shaders/shadow_fs.glsl"); + absPath("${MODULE_SPACE}/shaders/shadow_vs.glsl"), + absPath("${MODULE_SPACE}/shaders/shadow_fs.glsl") + ); } else if (_programObject == nullptr && _hasNightTexture) { // Night texture program _programObject = renderEngine.buildRenderProgram( "nightTextureProgram", - "${MODULE_SPACE}/shaders/nighttexture_vs.glsl", - "${MODULE_SPACE}/shaders/nighttexture_fs.glsl"); + absPath("${MODULE_SPACE}/shaders/nighttexture_vs.glsl"), + absPath("${MODULE_SPACE}/shaders/nighttexture_fs.glsl") + ); } else if (_programObject == nullptr) { // pscstandard _programObject = renderEngine.buildRenderProgram( "pscstandard", - "${MODULE_SPACE}/shaders/renderableplanet_vs.glsl", - "${MODULE_SPACE}/shaders/renderableplanet_fs.glsl"); + absPath("${MODULE_SPACE}/shaders/renderableplanet_vs.glsl"), + absPath("${MODULE_SPACE}/shaders/renderableplanet_fs.glsl") + ); } using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; _programObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index 5c29b9108b..2f14d37544 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -186,10 +186,11 @@ bool RenderableRings::isReady() const { void RenderableRings::initializeGL() { if (!_shader) { RenderEngine& renderEngine = OsEng.renderEngine(); - _shader = renderEngine.buildRenderProgram("RingProgram", - "${MODULE_SPACE}/shaders/rings_vs.glsl", - "${MODULE_SPACE}/shaders/rings_fs.glsl" - ); + _shader = renderEngine.buildRenderProgram( + "RingProgram", + absPath("${MODULE_SPACE}/shaders/rings_vs.glsl"), + absPath("${MODULE_SPACE}/shaders/rings_fs.glsl") + ); _shader->setIgnoreUniformLocationError( ghoul::opengl::ProgramObject::IgnoreError::Yes ); diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index a90e6fc53b..f755186d54 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -289,9 +289,10 @@ bool RenderableStars::isReady() const { void RenderableStars::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); _program = renderEngine.buildRenderProgram("Star", - "${MODULE_SPACE}/shaders/star_vs.glsl", - "${MODULE_SPACE}/shaders/star_fs.glsl", - "${MODULE_SPACE}/shaders/star_ge.glsl"); + absPath("${MODULE_SPACE}/shaders/star_vs.glsl"), + absPath("${MODULE_SPACE}/shaders/star_fs.glsl"), + absPath("${MODULE_SPACE}/shaders/star_ge.glsl") + ); bool success = loadData(); if (!success) { diff --git a/modules/space/translation/spicetranslation.cpp b/modules/space/translation/spicetranslation.cpp index 0fa2e97d95..ce223bfc52 100644 --- a/modules/space/translation/spicetranslation.cpp +++ b/modules/space/translation/spicetranslation.cpp @@ -147,13 +147,13 @@ SpiceTranslation::SpiceTranslation(const ghoul::Dictionary& dictionary) // Due to the specification, we can be sure it is either a Dictionary or a string if (dictionary.hasValue(KeyKernels)) { std::string kernel = dictionary.value(KeyKernels); - loadKernel(kernel); + loadKernel(absPath(kernel)); } else { ghoul::Dictionary kernels = dictionary.value(KeyKernels); for (size_t i = 1; i <= kernels.size(); ++i) { std::string kernel = kernels.value(std::to_string(i)); - loadKernel(kernel); + loadKernel(absPath(kernel)); } } } diff --git a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp index 6b711a7132..98dc9a7bdd 100644 --- a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp +++ b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -139,8 +140,8 @@ void RenderableCrawlingLine::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); _program = renderEngine.buildRenderProgram( "RenderableCrawlingLine", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/crawlingline_vs.glsl", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/crawlingline_fs.glsl" + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/crawlingline_vs.glsl"), + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/crawlingline_fs.glsl") ); glGenVertexArrays(1, &_vao); diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index 226c089204..297559e824 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -301,8 +302,8 @@ void RenderableFov::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); _programObject = renderEngine.buildRenderProgram( "FovProgram", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/fov_vs.glsl", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/fov_fs.glsl" + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/fov_vs.glsl"), + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/fov_fs.glsl") ); // Fetch information about the specific instrument diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp index 52f7d53a80..0e864f897e 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp @@ -182,21 +182,31 @@ bool RenderableModelProjection::isReady() const { void RenderableModelProjection::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); - _programObject = renderEngine.buildRenderProgram("ModelShader", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModel_vs.glsl", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModel_fs.glsl"); + _programObject = renderEngine.buildRenderProgram( + "ModelShader", + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModel_vs.glsl"), + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModel_fs.glsl") + ); - _fboProgramObject = ghoul::opengl::ProgramObject::Build("ProjectionPass", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModelProjection_vs.glsl", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModelProjection_fs.glsl"); + _fboProgramObject = ghoul::opengl::ProgramObject::Build( + "ProjectionPass", + absPath( + "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModelProjection_vs.glsl" + ), + absPath( + "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModelProjection_fs.glsl" + ) + ); _fboProgramObject->setIgnoreUniformLocationError( ghoul::opengl::ProgramObject::IgnoreError::Yes ); - _depthFboProgramObject = ghoul::opengl::ProgramObject::Build("DepthPass", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModelDepth_vs.glsl", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModelDepth_fs.glsl"); + _depthFboProgramObject = ghoul::opengl::ProgramObject::Build( + "DepthPass", + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModelDepth_vs.glsl"), + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderableModelDepth_fs.glsl") + ); loadTextures(); diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp index e90c6b7ed6..c60e9fa154 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp @@ -100,8 +100,8 @@ void RenderablePlaneProjection::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); _shader = renderEngine.buildRenderProgram( "Image Plane", - "${MODULE_BASE}/shaders/imageplane_vs.glsl", - "${MODULE_BASE}/shaders/imageplane_fs.glsl" + absPath("${MODULE_BASE}/shaders/imageplane_vs.glsl"), + absPath("${MODULE_BASE}/shaders/imageplane_fs.glsl") ); setTarget(_defaultTarget); diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index 4471e33193..7eb6119d96 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -226,14 +226,18 @@ RenderablePlanetProjection::~RenderablePlanetProjection() {} void RenderablePlanetProjection::initializeGL() { _programObject = OsEng.renderEngine().buildRenderProgram( "projectiveProgram", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderablePlanet_vs.glsl", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderablePlanet_fs.glsl" + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderablePlanet_vs.glsl"), + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderablePlanet_fs.glsl") ); _fboProgramObject = ghoul::opengl::ProgramObject::Build( "fboPassProgram", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderablePlanetProjection_vs.glsl", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderablePlanetProjection_fs.glsl" + absPath( + "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderablePlanetProjection_vs.glsl" + ), + absPath( + "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/renderablePlanetProjection_fs.glsl" + ) ); loadTextures(); diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp index 02dc695cf9..bffb6d2a34 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp @@ -31,6 +31,7 @@ #include #include +#include #include namespace { @@ -267,8 +268,8 @@ void RenderableShadowCylinder::initializeGL() { RenderEngine& renderEngine = OsEng.renderEngine(); _shader = renderEngine.buildRenderProgram( "ShadowCylinderProgram", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/terminatorshadow_vs.glsl", - "${MODULE_SPACECRAFTINSTRUMENTS}/shaders/terminatorshadow_fs.glsl" + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/terminatorshadow_vs.glsl"), + absPath("${MODULE_SPACECRAFTINSTRUMENTS}/shaders/terminatorshadow_fs.glsl") ); } diff --git a/modules/touch/src/touchmarker.cpp b/modules/touch/src/touchmarker.cpp index d71404b413..2509c59ada 100644 --- a/modules/touch/src/touchmarker.cpp +++ b/modules/touch/src/touchmarker.cpp @@ -94,9 +94,10 @@ bool TouchMarker::initialize() { glGenBuffers(1, &_vertexPositionBuffer); // generate buffer try { - _shader = OsEng.renderEngine().buildRenderProgram("MarkerProgram", - "${MODULE_TOUCH}/shaders/marker_vs.glsl", - "${MODULE_TOUCH}/shaders/marker_fs.glsl" + _shader = OsEng.renderEngine().buildRenderProgram( + "MarkerProgram", + absPath("${MODULE_TOUCH}/shaders/marker_vs.glsl"), + absPath("${MODULE_TOUCH}/shaders/marker_fs.glsl") ); } catch (const ghoul::opengl::ShaderObject::ShaderCompileError& e) { diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index a070a79aed..97496bc63f 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -157,8 +157,7 @@ void ConfigurationManager::loadFromFile(const string& filename) { FileSystem::TokenClosingBraces; // Retrieving the directory in which the configuration file lies - string absolutePath = FileSys.absolutePath(filename); - string basePath = ghoul::filesystem::File(absolutePath).directoryName(); + string basePath = ghoul::filesystem::File(filename).directoryName(); FileSys.registerPathToken(basePathToken, basePath); ghoul::lua::LuaState state; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 0e6ae23832..f492efff13 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -919,12 +919,12 @@ void OpenSpaceEngine::runGlobalCustomizationScripts(const std::string& sceneDesc if (_configurationManager->hasKey(k)) { ghoul::Dictionary dict = _configurationManager->value(k); for (int i = 1; i <= dict.size(); ++i) { - std::string script = dict.value(std::to_string(i)); + std::string script = absPath(dict.value(std::to_string(i))); if (FileSys.fileExists(script)) { try { LINFO("Running global customization script: " << script); - ghoul::lua::runScriptFile(state, absPath(script)); + ghoul::lua::runScriptFile(state, script); } catch (ghoul::RuntimeError& e) { LERRORC(e.component, e.message); } diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index 532f0bf750..6d97fa68ce 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -223,8 +223,8 @@ void LuaConsole::initialize() { _program = ghoul::opengl::ProgramObject::Build( "Console", - "${SHADERS}/luaconsole.vert", - "${SHADERS}/luaconsole.frag" + absPath("${SHADERS}/luaconsole.vert"), + absPath("${SHADERS}/luaconsole.frag") ); GLfloat data[] = { diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index 82455c01ca..fd9debc830 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -154,8 +155,8 @@ void FramebufferRenderer::initialize() { try { _resolveProgram = ghoul::opengl::ProgramObject::Build( "Framebuffer Resolve", - "${SHADERS}/framebuffer/resolveframebuffer.vert", - "${SHADERS}/framebuffer/resolveframebuffer.frag" + absPath("${SHADERS}/framebuffer/resolveframebuffer.vert"), + absPath("${SHADERS}/framebuffer/resolveframebuffer.frag") ); } catch (const ghoul::RuntimeError& e) { LERRORC(e.component, e.message); diff --git a/src/rendering/loadingscreen.cpp b/src/rendering/loadingscreen.cpp index 07d9f8e73a..cb32bdb457 100644 --- a/src/rendering/loadingscreen.cpp +++ b/src/rendering/loadingscreen.cpp @@ -115,8 +115,8 @@ LoadingScreen::LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeName { _program = ghoul::opengl::ProgramObject::Build( "Loading Screen", - "${SHADERS}/loadingscreen.vert", - "${SHADERS}/loadingscreen.frag" + absPath("${SHADERS}/loadingscreen.vert"), + absPath("${SHADERS}/loadingscreen.frag") ); _loadingFont = OsEng.fontManager().font( diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 417d297bf5..cf762298df 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -688,7 +689,7 @@ std::unique_ptr RenderEngine::buildRenderProgram( std::unique_ptr program = ProgramObject::Build( name, vsPath, - RenderFsPath, + absPath(RenderFsPath), dict ); @@ -718,7 +719,7 @@ std::unique_ptr RenderEngine::buildRenderProgram( std::unique_ptr program = ProgramObject::Build( name, vsPath, - RenderFsPath, + absPath(RenderFsPath), csPath, dict ); diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 68f094d8f7..7679274519 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -86,22 +86,6 @@ std::unique_ptr SceneGraphNode::createFromDictionary( std::string name = dictionary.value(KeyName); result->setName(name); - if (dictionary.hasValue(KeyRenderable)) { - ghoul::Dictionary renderableDictionary; - dictionary.getValue(KeyRenderable, renderableDictionary); - - renderableDictionary.setValue(KeyName, name); - - result->_renderable = Renderable::createFromDictionary(renderableDictionary); - if (result->_renderable == nullptr) { - LERROR("Failed to create renderable for SceneGraphNode '" - << result->name() << "'"); - return nullptr; - } - result->addPropertySubOwner(result->_renderable.get()); - LDEBUG("Successfully created renderable for '" << result->name() << "'"); - } - if (dictionary.hasKey(keyTransformTranslation)) { ghoul::Dictionary translationDictionary; dictionary.getValue(keyTransformTranslation, translationDictionary); @@ -143,6 +127,23 @@ std::unique_ptr SceneGraphNode::createFromDictionary( LDEBUG("Successfully created scale for '" << result->name() << "'"); } + // We initialize the renderable last as it probably has the most dependencies + if (dictionary.hasValue(KeyRenderable)) { + ghoul::Dictionary renderableDictionary; + dictionary.getValue(KeyRenderable, renderableDictionary); + + renderableDictionary.setValue(KeyName, name); + + result->_renderable = Renderable::createFromDictionary(renderableDictionary); + if (result->_renderable == nullptr) { + LERROR("Failed to create renderable for SceneGraphNode '" + << result->name() << "'"); + return nullptr; + } + result->addPropertySubOwner(result->_renderable.get()); + LDEBUG("Successfully created renderable for '" << result->name() << "'"); + } + if (dictionary.hasKey(KeyTag)) { if (dictionary.hasKeyAndValue(KeyTag)) { std::string tagName = dictionary.value(KeyTag); diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 883f6774a2..b613ed0f71 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -198,7 +198,7 @@ int absolutePath(lua_State* L) { std::string path = luaL_checkstring(L, -1); path = absPath(path); - path = FileSys.convertPathSeparator(path, '/'); + //path = FileSys.convertPathSeparator(path, '/'); lua_pushstring(L, path.c_str()); return 1; } diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index b3f3a0137b..4e8c47b2ed 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -96,7 +96,7 @@ std::string OpenSpaceModule::modulePath() const { ); // First try the internal module directory - if (FileSys.directoryExists("${MODULES}/" + moduleName)) { + if (FileSys.directoryExists(absPath("${MODULES}/" + moduleName))) { return absPath("${MODULES}/" + moduleName); } else { // Otherwise, it might be one of the external directories diff --git a/src/util/taskloader.cpp b/src/util/taskloader.cpp index c8365b1fa7..bfc4b2bddd 100644 --- a/src/util/taskloader.cpp +++ b/src/util/taskloader.cpp @@ -65,8 +65,7 @@ std::vector> TaskLoader::tasksFromDictionary( std::vector> TaskLoader::tasksFromFile(const std::string& path) { std::string absTasksFile = absPath(path); - using RawPath = ghoul::filesystem::FileSystem::RawPath; - if (!FileSys.fileExists(absTasksFile, RawPath::Yes)) { + if (!FileSys.fileExists(ghoul::filesystem::File(absTasksFile))) { LERROR("Could not load tasks file '" << absTasksFile << "'. " << "File not found"); return std::vector>();