mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-19 19:39:30 -06:00
Height map overlay working but needs to be used for height sampling on cpu.
This commit is contained in:
@@ -129,15 +129,15 @@ return {
|
||||
FilePath = "map_service_configs/mercury/OnMercuryElevationGaskell.xml",
|
||||
},
|
||||
{
|
||||
Name = "West_Candor_Chasma_DEM_longlat_global",
|
||||
Name = "West_Candor_Chasma_DEM_longlat_global1",
|
||||
FilePath = "map_datasets/West_Candor_Chasma_DEM_longlat_global.vrt",
|
||||
}
|
||||
},
|
||||
HeightMapOverlays = {
|
||||
{
|
||||
Name = "West_Candor_Chasma_DEM_longlat_global",
|
||||
Name = "West_Candor_Chasma_DEM_longlat_global2",
|
||||
FilePath = "map_datasets/West_Candor_Chasma_DEM_longlat_global.vrt",
|
||||
}
|
||||
},
|
||||
},
|
||||
WaterMasks = {
|
||||
{
|
||||
|
||||
@@ -288,6 +288,23 @@ namespace openspace {
|
||||
i++;
|
||||
}
|
||||
|
||||
// Go through all the height map overlays and set depth tranforms
|
||||
i = 0;
|
||||
it = tileProviders[LayeredTextures::HeightMapOverlays].begin();
|
||||
end = tileProviders[LayeredTextures::HeightMapOverlays].end();
|
||||
for (; it != end; it++) {
|
||||
auto tileProvider = *it;
|
||||
|
||||
TileDepthTransform depthTransform = tileProvider->depthTransform();
|
||||
setDepthTransformUniforms(
|
||||
programUniformHandler,
|
||||
LayeredTextures::TextureCategory::HeightMapOverlays,
|
||||
LayeredTextureShaderUniformIdHandler::BlendLayerSuffix::none,
|
||||
i,
|
||||
depthTransform);
|
||||
i++;
|
||||
}
|
||||
|
||||
// The length of the skirts is proportional to its size
|
||||
programObject->setUniform("skirtLength", min(static_cast<float>(chunk.surfacePatch().halfSize().lat * 1000000), 8700.0f));
|
||||
programObject->setUniform("xSegments", _grid->xSegments());
|
||||
|
||||
@@ -93,8 +93,6 @@ void main()
|
||||
#endif // USE_HEIGHTMAP
|
||||
|
||||
#if USE_HEIGHTMAP_OVERLAY
|
||||
// Calculate desired level based on distance to the vertex on the ellipsoid
|
||||
// Before any heightmapping is done
|
||||
height = calculateHeightOverlay(
|
||||
height,
|
||||
in_uv,
|
||||
|
||||
@@ -123,7 +123,7 @@ float calculateHeightOverlay(
|
||||
|
||||
float heightSample = getTransformedTexVal(heightOverlayTiles[#{i}].depthTransform, untransformedHeightSample.r);
|
||||
if (untransformedHeightSample.g > 0.5)
|
||||
height = heightSample;
|
||||
height = heightSample;
|
||||
}
|
||||
#endfor
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace openspace {
|
||||
else if (i == LayeredTextures::Overlays) {
|
||||
initData.minimumPixelSize = textureInitDictionary.value<double>("OverlayMinimumSize");
|
||||
}
|
||||
else if (i == LayeredTextures::HeightMaps) {
|
||||
else if (i == LayeredTextures::HeightMaps || i == LayeredTextures::HeightMapOverlays) {
|
||||
initData.minimumPixelSize = textureInitDictionary.value<double>("HeightMapMinimumSize");
|
||||
}
|
||||
else {
|
||||
@@ -73,7 +73,9 @@ namespace openspace {
|
||||
initData.threads = 1;
|
||||
initData.cacheSize = 500;
|
||||
initData.framesUntilRequestQueueFlush = 60;
|
||||
initData.preprocessTiles = i == LayeredTextures::HeightMaps; // Only preprocess height maps.
|
||||
initData.preprocessTiles =
|
||||
i == LayeredTextures::HeightMaps ||
|
||||
i == LayeredTextures::HeightMapOverlays; // Only preprocess height maps.
|
||||
|
||||
initTexures(
|
||||
_layerCategories[i],
|
||||
|
||||
Reference in New Issue
Block a user