mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-20 19:21:00 -06:00
Enable TileProvider to provide Nth highest resolution tile
This commit is contained in:
@@ -166,18 +166,23 @@ namespace openspace {
|
||||
auto tileProvider = it->get();
|
||||
// Get the texture that should be used for rendering
|
||||
Tile tile = tileProvider->getHighestResolutionTile(chunk.index());
|
||||
Tile tileParent1 = tileProvider->getHighestResolutionParentTile(chunk.index(), 1);
|
||||
Tile tileParent2 = tileProvider->getHighestResolutionParentTile(chunk.index(), 2);
|
||||
|
||||
if (tile.texture == nullptr ||
|
||||
tileParent1.texture == nullptr ||
|
||||
tileParent2.texture == nullptr)
|
||||
{
|
||||
Tile tileParent1 = tileProvider->getHighestResolutionTile(chunk.index(), 1);
|
||||
Tile tileParent2 = tileProvider->getHighestResolutionTile(chunk.index(), 2);
|
||||
|
||||
if (tile.texture == nullptr) {
|
||||
// don't render if no tile was available
|
||||
programObject->deactivate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (tileParent1.texture == nullptr) {
|
||||
tileParent1 = tile;
|
||||
}
|
||||
if (tileParent2.texture == nullptr) {
|
||||
tileParent2 = tileParent1;
|
||||
}
|
||||
|
||||
|
||||
TileDepthTransform depthTransform = tileProvider->depthTransform();
|
||||
|
||||
// The texture needs a unit to sample from
|
||||
@@ -247,19 +252,23 @@ namespace openspace {
|
||||
auto tileProvider = it->get();
|
||||
// Get the texture that should be used for rendering
|
||||
Tile tile = tileProvider->getHighestResolutionTile(chunk.index());
|
||||
Tile tileParent1 = tileProvider->getHighestResolutionParentTile(chunk.index(), 1);
|
||||
Tile tileParent2 = tileProvider->getHighestResolutionParentTile(chunk.index(), 2);
|
||||
Tile tileParent1 = tileProvider->getHighestResolutionTile(chunk.index(), 1);
|
||||
Tile tileParent2 = tileProvider->getHighestResolutionTile(chunk.index(), 2);
|
||||
|
||||
|
||||
if (tile.texture == nullptr ||
|
||||
tileParent1.texture == nullptr ||
|
||||
tileParent2.texture == nullptr)
|
||||
{
|
||||
if (tile.texture == nullptr) {
|
||||
// don't render if no tile was available
|
||||
programObject->deactivate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (tileParent1.texture == nullptr) {
|
||||
tileParent1 = tile;
|
||||
}
|
||||
if (tileParent2.texture == nullptr) {
|
||||
tileParent2 = tileParent1;
|
||||
}
|
||||
|
||||
// The texture needs a unit to sample from
|
||||
texUnitColor[i].activate();
|
||||
tile.texture->bind();
|
||||
@@ -410,18 +419,22 @@ namespace openspace {
|
||||
auto tileProvider = it->get();
|
||||
// Get the texture that should be used for rendering
|
||||
Tile tile = tileProvider->getHighestResolutionTile(chunk.index());
|
||||
Tile tileParent1 = tileProvider->getHighestResolutionParentTile(chunk.index(), 1);
|
||||
Tile tileParent2 = tileProvider->getHighestResolutionParentTile(chunk.index(), 2);
|
||||
Tile tileParent1 = tileProvider->getHighestResolutionTile(chunk.index(), 1);
|
||||
Tile tileParent2 = tileProvider->getHighestResolutionTile(chunk.index(), 2);
|
||||
|
||||
if (tile.texture == nullptr ||
|
||||
tileParent1.texture == nullptr ||
|
||||
tileParent2.texture == nullptr)
|
||||
{
|
||||
if (tile.texture == nullptr) {
|
||||
// don't render if no tile was available
|
||||
programObject->deactivate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (tileParent1.texture == nullptr) {
|
||||
tileParent1 = tile;
|
||||
}
|
||||
if (tileParent2.texture == nullptr) {
|
||||
tileParent2 = tileParent1;
|
||||
}
|
||||
|
||||
TileDepthTransform depthTransform = tileProvider->depthTransform();
|
||||
|
||||
// The texture needs a unit to sample from
|
||||
@@ -490,19 +503,23 @@ namespace openspace {
|
||||
auto tileProvider = it->get();
|
||||
// Get the texture that should be used for rendering
|
||||
Tile tile = tileProvider->getHighestResolutionTile(chunk.index());
|
||||
Tile tileParent1 = tileProvider->getHighestResolutionParentTile(chunk.index(), 1);
|
||||
Tile tileParent2 = tileProvider->getHighestResolutionParentTile(chunk.index(), 2);
|
||||
Tile tileParent1 = tileProvider->getHighestResolutionTile(chunk.index(), 1);
|
||||
Tile tileParent2 = tileProvider->getHighestResolutionTile(chunk.index(), 2);
|
||||
|
||||
|
||||
if (tile.texture == nullptr ||
|
||||
tileParent1.texture == nullptr ||
|
||||
tileParent2.texture == nullptr)
|
||||
{
|
||||
if (tile.texture == nullptr) {
|
||||
// don't render if no tile was available
|
||||
programObject->deactivate();
|
||||
return;
|
||||
}
|
||||
|
||||
if (tileParent1.texture == nullptr) {
|
||||
tileParent1 = tile;
|
||||
}
|
||||
if (tileParent2.texture == nullptr) {
|
||||
tileParent2 = tileParent1;
|
||||
}
|
||||
|
||||
// The texture needs a unit to sample from
|
||||
texUnitColor[i].activate();
|
||||
tile.texture->bind();
|
||||
|
||||
Reference in New Issue
Block a user