Dynamically loaded ImageLayers load behavior

classic Classic list List threaded Threaded
5 messages Options
ceranco ceranco
Reply | Threaded
Open this post in threaded view
|

Dynamically loaded ImageLayers load behavior

Hi friends,

I've update my application from osgEarth 2.9 / OpenSceneGraph 3.6 to osgEarth 2.10 / OpenSceneGraph 3.6.3, and the behavior of dynamically loaded ImageLayers has changed.

Before, the image would load all at once and be a little blurry for a while, but now the image loads in patches(tiles) and if i zoom out while it is loading it appears and disappears rapidly.
Furthermore, when I load 2 ImageLayers at once, for example a base layer and an inset of a country above it then the part of base layer underneath the inset won't load (so the white earth is seen) until the inset loads as well.

Unfortunately I can't share screenshots...

I've tried using the MP terrain engine instead of Rex, but it didn't help.

Does anyone know why this happens?

Thanks,
Eran Cohen
Eran Cohen
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically loaded ImageLayers load behavior

Ceranco,

In osgEarth 2.10 the default mode is for the terrain data loader to prioritize the visible LODs. You can disable this and use the old-style "one LOD at a time" mode by setting the "progressive" terrain option to true:

<map>
   <options>
      <terrain progressive="true" ...

Hope this helps.
Glenn Waldron / Pelican Mapping
ceranco ceranco
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically loaded ImageLayers load behavior

Hi Glenn,

I tried using progressive in code:

RexTerrainEngineOptions opt;
opt.progressive() = true;

auto map = new Map{opt};
auto mapNode = new MapNode {map}

but I couldn't see any difference in the loading of the layers, meaning that if I load the layer when zoomed in, but then zoom out, the layer flickers in and out.

Also, the problem of loading 2 different layers one after another persists.
It looks to me like the first layer begins loading, and then when the second layer begins loading the first layer gets stuck until the second layer loads.
This leads to the globe looking like this for a couple of seconds:

   


In the previous version (2.9) the layers loaded one after another without a problem.
Eran Cohen
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically loaded ImageLayers load behavior

Eran,
The correct setup procedure looks is as follows:

RexTerrainEngineOptions terrainOpt;
terrainOpt.progressive() = true;
...
MapNodeOptions mapNodeOpt(terrainOpt);
...
map = new Map();
mapNode = new MapNode(map, mapNodeOpt);

I realize this is somewhat "roundabout" which is another motivation for the API changes coming in 3.0 :)
Glenn Waldron / Pelican Mapping
ceranco ceranco
Reply | Threaded
Open this post in threaded view
|

Re: Dynamically loaded ImageLayers load behavior

Hi Glenn,

It works as expected now!
Thank you very much, and I'll be looking forward to the upgrade.

Eran Cohen
Eran Cohen