diff --git a/data/scene/lodglobes/earth/earth.mod b/data/scene/lodglobes/earth/earth.mod index 40ca41b843..e18362ed33 100644 --- a/data/scene/lodglobes/earth/earth.mod +++ b/data/scene/lodglobes/earth/earth.mod @@ -66,11 +66,6 @@ return { SegmentsPerPatch = 64, Layers = { ColorLayers = { - { - Name = "Earth Bluemarble Height", - FilePath = "textures/earth_bluemarble_height.jpg", - Enabled = true, - }, { Name = "ESRI VIIRS Combo", Type = "ByLevelTileLayer", @@ -98,8 +93,8 @@ return { } }, { + Name = "ESRI_Imagery_World_2D", FilePath = "map_service_configs/ESRI/ESRI_Imagery_World_2D.wms", - Name = "ESRI", }, { Name = "BMNG", @@ -165,11 +160,6 @@ return { Name = "MODIS_Water_Mask", FilePath = "map_service_configs/GIBS/MODIS_Water_Mask.xml", Enabled = true, - Fallback = { - Name = "Earth Reflectance", - FilePath = "textures/earth_reflectance.jpg", - Enabled = true, - } }, { Name = "GEBCO", diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp index 60de75ff00..c38a791557 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.cpp +++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp @@ -279,6 +279,11 @@ void ChunkedLodGlobe::notifyShaderRecompilation() { _shadersNeedRecompilation = true; } +void ChunkedLodGlobe::recompileShaders() { + _renderer->recompileShaders(_owner); + _shadersNeedRecompilation = false; +} + void ChunkedLodGlobe::render(const RenderData& data) { stats.startNewRecord(); if (_shadersNeedRecompilation) { diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index 52f5e61d3c..8b7dba9651 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -107,8 +107,18 @@ public: */ float getHeight(glm::dvec3 position) const; + /** + * Notifies the renderer to recompile its shaders the next time the render function is + * called. The actual shader recompilation takes place in the render function because + * properties that the shader depends on need to be properly synced. + */ void notifyShaderRecompilation(); + /** + * Directly recompile the shaders of the renderer. + */ + void recompileShaders(); + const int minSplitDepth; const int maxSplitDepth; diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index 6b61e0f7d0..d7dd6d4b49 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -141,6 +141,10 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) addPropertySubOwner(_debugPropertyOwner); addPropertySubOwner(_layerManager.get()); //addPropertySubOwner(_pointGlobe.get()); + + // Recompile the shaders directly so that it is not done the first time the render + // function is called. + _chunkedLodGlobe->recompileShaders(); } bool RenderableGlobe::initialize() {