mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-29 23:39:26 -05:00
b219638e29
Enables globe-browsing data to be cached using caching mrf's as it is loaded from the original dataset. Subsequent reads of tiles that have been cached do not query the original dataset but picks it up from the mrf data.
Supports anything that can be used a dataset for a gdal raster but raw images such as JPGs are explicitly disallowed as they lack necessary geotransform data.
Activated on a global scale by setting the following keys in openspace.cfg (ModuleConfigurations/GlobeBrowsing)
MRFCacheEnabled = true,
MRFCacheLocation = "<somepath>",
Settings can be overriden on a per-layer basis by adding the following entries to the layer entity of an asset
CacheSettings = { Enabled = true, Compression = "LERC", BlockSize = 512, Quality=25 },
The following per-layer settings are available and override the global module settings:
Enabled : enable/disable caching for this layer.
Compression: The compression algorithm to use for tile cache storage. (JPEG, PNG, or LERC)
BlockSize: Size of tiles in cache, should be a multiple of 2 although this is not required.
Quality: The quality setting of the JPEG compression (when used)
Note that heightlayers must use LERC compresison and this is the default unless overridden by a layer.
165 lines
6.2 KiB
CMake
165 lines
6.2 KiB
CMake
##########################################################################################
|
|
# #
|
|
# OpenSpace #
|
|
# #
|
|
# Copyright (c) 2014-2023 #
|
|
# #
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of this #
|
|
# software and associated documentation files (the "Software"), to deal in the Software #
|
|
# without restriction, including without limitation the rights to use, copy, modify, #
|
|
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to #
|
|
# permit persons to whom the Software is furnished to do so, subject to the following #
|
|
# conditions: #
|
|
# #
|
|
# The above copyright notice and this permission notice shall be included in all copies #
|
|
# or substantial portions of the Software. #
|
|
# #
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, #
|
|
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A #
|
|
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #
|
|
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF #
|
|
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE #
|
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #
|
|
##########################################################################################
|
|
|
|
include(${PROJECT_SOURCE_DIR}/support/cmake/module_definition.cmake)
|
|
|
|
set(HEADER_FILES
|
|
globebrowsingmodule.h
|
|
src/asynctiledataprovider.h
|
|
src/basictypes.h
|
|
src/dashboarditemglobelocation.h
|
|
src/ellipsoid.h
|
|
src/gdalwrapper.h
|
|
src/geodeticpatch.h
|
|
src/globelabelscomponent.h
|
|
src/globetranslation.h
|
|
src/globerotation.h
|
|
src/gpulayergroup.h
|
|
src/layer.h
|
|
src/layeradjustment.h
|
|
src/layergroup.h
|
|
src/layergroupid.h
|
|
src/layermanager.h
|
|
src/layerrendersettings.h
|
|
src/lrucache.h
|
|
src/lrucache.inl
|
|
src/lruthreadpool.h
|
|
src/lruthreadpool.inl
|
|
src/memoryawaretilecache.h
|
|
src/prioritizingconcurrentjobmanager.h
|
|
src/prioritizingconcurrentjobmanager.inl
|
|
src/rawtile.h
|
|
src/rawtiledatareader.h
|
|
src/renderableglobe.h
|
|
src/ringscomponent.h
|
|
src/shadowcomponent.h
|
|
src/skirtedgrid.h
|
|
src/tileindex.h
|
|
src/tileloadjob.h
|
|
src/tiletextureinitdata.h
|
|
src/tilecacheproperties.h
|
|
src/timequantizer.h
|
|
src/tileprovider/defaulttileprovider.h
|
|
src/tileprovider/imagesequencetileprovider.h
|
|
src/tileprovider/singleimagetileprovider.h
|
|
src/tileprovider/sizereferencetileprovider.h
|
|
src/tileprovider/spoutimageprovider.h
|
|
src/tileprovider/temporaltileprovider.h
|
|
src/tileprovider/texttileprovider.h
|
|
src/tileprovider/tileindextileprovider.h
|
|
src/tileprovider/tileprovider.h
|
|
src/tileprovider/tileproviderbyindex.h
|
|
src/tileprovider/tileproviderbylevel.h
|
|
)
|
|
|
|
set(SOURCE_FILES
|
|
globebrowsingmodule.cpp
|
|
globebrowsingmodule_lua.inl
|
|
src/asynctiledataprovider.cpp
|
|
src/dashboarditemglobelocation.cpp
|
|
src/ellipsoid.cpp
|
|
src/gdalwrapper.cpp
|
|
src/geodeticpatch.cpp
|
|
src/globelabelscomponent.cpp
|
|
src/globetranslation.cpp
|
|
src/globerotation.cpp
|
|
src/gpulayergroup.cpp
|
|
src/layer.cpp
|
|
src/layeradjustment.cpp
|
|
src/layergroup.cpp
|
|
src/layergroupid.cpp
|
|
src/layermanager.cpp
|
|
src/layerrendersettings.cpp
|
|
src/memoryawaretilecache.cpp
|
|
src/rawtiledatareader.cpp
|
|
src/renderableglobe.cpp
|
|
src/ringscomponent.cpp
|
|
src/shadowcomponent.cpp
|
|
src/skirtedgrid.cpp
|
|
src/tileindex.cpp
|
|
src/tileloadjob.cpp
|
|
src/tiletextureinitdata.cpp
|
|
src/timequantizer.cpp
|
|
src/tileprovider/defaulttileprovider.cpp
|
|
src/tileprovider/imagesequencetileprovider.cpp
|
|
src/tileprovider/singleimagetileprovider.cpp
|
|
src/tileprovider/sizereferencetileprovider.cpp
|
|
src/tileprovider/spoutimageprovider.cpp
|
|
src/tileprovider/temporaltileprovider.cpp
|
|
src/tileprovider/texttileprovider.cpp
|
|
src/tileprovider/tileindextileprovider.cpp
|
|
src/tileprovider/tileprovider.cpp
|
|
src/tileprovider/tileproviderbyindex.cpp
|
|
src/tileprovider/tileproviderbylevel.cpp
|
|
)
|
|
source_group("Source Files" FILES ${SOURCE_FILES})
|
|
|
|
set(SHADER_FILES
|
|
shaders/advanced_rings_vs.glsl
|
|
shaders/advanced_rings_fs.glsl
|
|
shaders/blending.glsl
|
|
shaders/globalrenderer_vs.glsl
|
|
shaders/localrenderer_vs.glsl
|
|
shaders/renderer_fs.glsl
|
|
shaders/rings_vs.glsl
|
|
shaders/rings_fs.glsl
|
|
shaders/rings_geom_vs.glsl
|
|
shaders/rings_geom_fs.glsl
|
|
shaders/texturetilemapping.glsl
|
|
shaders/tile.glsl
|
|
shaders/tileheight.glsl
|
|
shaders/tilevertexskirt.glsl
|
|
)
|
|
|
|
source_group("Shader Files" FILES ${SHADER_FILES})
|
|
|
|
create_new_module(
|
|
"GlobeBrowsing"
|
|
globebrowsing_module
|
|
STATIC
|
|
${HEADER_FILES} ${SOURCE_FILES} ${SHADER_FILES}
|
|
)
|
|
target_precompile_headers(${globebrowsing_module} PRIVATE
|
|
<modules/globebrowsing/src/tileprovider/tileprovider.h>
|
|
<modules/globebrowsing/globebrowsingmodule.h>
|
|
<future>
|
|
<map>
|
|
)
|
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gdal_data DESTINATION modules/globebrowsing)
|
|
|
|
if (WIN32)
|
|
add_library(gdal SHARED IMPORTED)
|
|
target_include_directories(gdal SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/include)
|
|
set_target_properties(gdal PROPERTIES IMPORTED_IMPLIB ${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal_i.lib)
|
|
set_target_properties(gdal PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/ext/gdal/lib/gdal241.dll)
|
|
target_link_libraries(openspace-module-globebrowsing PRIVATE gdal)
|
|
else (WIN32)
|
|
find_package(GDAL REQUIRED)
|
|
|
|
target_include_directories(openspace-module-globebrowsing SYSTEM PRIVATE ${GDAL_INCLUDE_DIR})
|
|
target_link_libraries(openspace-module-globebrowsing PRIVATE ${GDAL_LIBRARY})
|
|
mark_as_advanced(GDAL_CONFIG GDAL_INCLUDE_DIR GDAL_LIBRARY)
|
|
endif () # WIN32
|