Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BasicTerrain Sector calculation issue (performance issue) #216

Open
ComBatVision opened this issue Oct 12, 2018 · 1 comment
Open

BasicTerrain Sector calculation issue (performance issue) #216

ComBatVision opened this issue Oct 12, 2018 · 1 comment

Comments

@ComBatVision
Copy link

ComBatVision commented Oct 12, 2018

Something wrong with terrain tessellation.

Each time, when terrain level of details changed by user, BasicTessellator adds some top level tiles to current tiles collection by mistake and cause situation, when BasicTerrain contains wrong Sector value (e.g. half globe -90 to 90, even if you are looking on a small terrain part from small altitude). This situation disappears after all detailed tiles become loaded and than top level tiles start to be ignored.

Wrong sector value cause to render useless drawables, which are based on terrain sector clipping.

WWJ version does not have this issue and always return correct dc.getViewingSector size. But WWA returns -90 to 90 degree sector on every details change.

To reproduce this place break point in BasicTessellator loop on top level tiles:

        // Subdivide the top level tiles until the desired resolution is achieved in each part of the scene.
        for (int idx = 0, len = this.topLevelTiles.size(); idx < len; idx++) {
            this.addTileOrDescendants(rc, (TerrainTile) this.topLevelTiles.get(idx));
        }

and check what tiles to be added into collection.

You will find that sometimes condition tile.mustSubdivide(rc, this.detailControl) for several top level tiles return false and this tile is added to the tile list together with detailed tiles subdivided from other top level tiles. This top level tile will union with terrain Sector and override its values by -90 to 90 degrees even if you are looking very close to the ground.

@ComBatVision
Copy link
Author

Furthermore, BasicTesselator is based on Terrain Coverage timestamp to recalculate outdated tiles after next part of terrain is loaded by retriever. This approach is very performance ineffective, because after any part of terrain is downloaded - all visible tiles are recalculated from elevation model, even when this tiles are not related to the downloaded terrain part and therefore do not require recalculation. It cause huge freezes on recalculation of all tiles each time until all part of terrain completely loaded.

How no reproduce - just disable internet connection on device and you will see no lags. When you enable internet and start moving to new area frame rendering takes 1,5 seconds because of all tiles invalidation on each frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant