gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.51k stars 779 forks source link

osgEarth displays white globe with REX engine until first lods can be created #778

Closed KingArthur10 closed 7 years ago

KingArthur10 commented 8 years ago

When using a .earth file with slow data loading, osgEarth quickly loads with a white globe until data can be rendered. This is different from previous behavior where the globe doesn't load until the first lod(s) can be rendered.

This new bahavior makes it very difficult to have a smooth user experience, especially with multiple osgEarth instances in your program (eg NightshadeNG). Need a method to load the data before rendering the initial globe.

gwaldron commented 8 years ago

This is by design; we're not opposed to providing some kind of pre-load approach down the line but not for a 2.8 tag.

KingArthur10 commented 8 years ago

Just to clarify, I'm saying that both the MP and REX engines behave the same in this respect. This is a change in behavior for the MP engine.

gwaldron commented 8 years ago

AFAIK, there has been no change in the way MP loads its first LOD. Can you set OSGEARTH_NOTIFY_LEVEL=INFO and post the output of a simple run (with MP)? Thanks.

KingArthur10 commented 8 years ago

[osgEarth] [Map] cache=none; policy=read-write; bin=no [osgEarth] [engine_mp driver] Activated! [osgEarth] [Capabilities] Detected hardware capabilities: [osgEarth] [Capabilities] Vendor = NVIDIA Corporation [osgEarth] [Capabilities] Renderer = GeForce GTX 980/PCIe/SSE2 [osgEarth] [Capabilities] Version = 4.5.0 NVIDIA 352.63 [osgEarth] [Capabilities] Max GPU texture units = 32 [osgEarth] [Capabilities] Max GPU texture coord indices = 8 [osgEarth] [Capabilities] Max GPU attributes = 16 [osgEarth] [Capabilities] Depth buffer bits = 24 [osgEarth] [Capabilities] Max texture size = 16384 [osgEarth] [Capabilities] Max lights = 8 [osgEarth] [Capabilities] GLSL = yes [osgEarth] [Capabilities] GLSL Version = 450 [osgEarth] [Capabilities] Texture arrays = yes [osgEarth] [Capabilities] 3D textures = yes [osgEarth] [Capabilities] Multitexturing = yes [osgEarth] [Capabilities] draw instanced = yes [osgEarth] [Capabilities] uniform buffer objects = yes [osgEarth] [Capabilities] NPOT textures = yes [osgEarth] [Capabilities] Texture buffers = yes [osgEarth] [Capabilities] Texture buffer max size = 134217728 [osgEarth] [Capabilities] Transform feedback = yes [osgEarth] [Capabilities] Compression = ARB S3 RG [osgEarth] [Map] Map profile is: [srs=unnamed ellipse, min=-180,-90 max=180,90 lod0=2,1 vdatum=geodetic] [osgEarth] [TextureCompositor] Texture unit 0 reserved for MP Engine Primary [osgEarth] [TextureCompositor] Texture unit 1 reserved for MP Engine Secondary [osgEarth] [TextureCompositor] Texture unit 2 reserved for MP Normal Maps [osgEarth] [MPTerrainEngineNode] Creating 2 root keys.. [osgEarth] [MPTerrainEngineNode] Edge normalization is OFF [osgEarth] [DrapingTechnique] Using texture size = 2048 [osgEarth] [ClampingTechnique] Using texture size = 4096 [osgEarth] [MapNode] Adding ellipsoid uniforms. [osgEarth] [TerrainLayer] Layer "imagery" Creating "gdal" driver [osgEarth] [TerrainLayer] Layer "imagery" Override profile: [srs=unnamed ellipse, min=-180,-90 max=180,90 lod0=2,1 vdatum=geodetic] [osgEarth] [GDAL driver] Identified 1 files: [osgEarth] [GDAL driver] /mnt/data/data-ae964740-4ac1-4bf1-b4de-94871f94b28a/mercury/mercury-imagery-messenger-color.tif [osgEarth] [GDAL driver] Resolution= 0.0058712245x0.0058904379 max=0.0058712245 [osgEarth] [GDAL driver] /mnt/data/data-ae964740-4ac1-4bf1-b4de-94871f94b28a/mercury/mercury-imagery-messenger-color.tif max Data Level: 7 [osgEarth] [TerrainLayer] Layer "imagery" Profile=[srs=unnamed ellipse, min=-180,-90 max=180,90 lod0=2,1 vdatum=geodetic] [osgEarth] [TerrainLayer] Layer "imagery" cache=none; policy=read-write; bin=no [osgEarth] [TerrainLayer] Layer "" Creating "gdal" driver [osgEarth] [TerrainLayer] Layer "" Override profile: [srs=unnamed ellipse, min=-180,-90 max=180,90 lod0=2,1 vdatum=geodetic] [osgEarth] [GDAL driver] Identified 1 files: [osgEarth] [GDAL driver] /mnt/data/data-ae964740-4ac1-4bf1-b4de-94871f94b28a/mercury/mercury-elevation-messenger-global.tif [osgEarth] [GDAL driver] Resolution= 0.015625x0.015625 max=0.015625 [osgEarth] [GDAL driver] /mnt/data/data-ae964740-4ac1-4bf1-b4de-94871f94b28a/mercury/mercury-elevation-messenger-global.tif max Data Level: 6 [osgEarth] [TerrainLayer] Layer "" Profile=[srs=unnamed ellipse, min=-180,-90 max=180,90 lod0=2,1 vdatum=geodetic] [osgEarth] [TerrainLayer] Layer "" cache=none; policy=read-write; bin=no [osgEarth] [TerrainLayer] Layer "" Creating "gdal" driver [osgEarth] [TerrainLayer] Layer "" Override profile: [srs=unnamed ellipse, min=-180,-90 max=180,90 lod0=2,1 vdatum=geodetic] [osgEarth] [GDAL driver] Identified 1 files: [osgEarth] [GDAL driver] /mnt/data/data-ae964740-4ac1-4bf1-b4de-94871f94b28a/mercury/mercury-elevation-messenger-global.tif [osgEarth] [GDAL driver] Resolution= 0.015625x0.015625 max=0.015625 [osgEarth] [GDAL driver] /mnt/data/data-ae964740-4ac1-4bf1-b4de-94871f94b28a/mercury/mercury-elevation-messenger-global.tif max Data Level: 6 [osgEarth] [TerrainLayer] Layer "" Profile=[srs=unnamed ellipse, min=-180,-90 max=180,90 lod0=2,1 vdatum=geodetic]

KingArthur10 commented 8 years ago

As a note, this issue is displaying using osgviewer and our application. The info above comes from launching osgviewer.

gwaldron commented 8 years ago

Do you have an earth file I can use to reproduce (or at least look at)?

KingArthur10 commented 8 years ago
<map name="earth" type="geocentric" version="2"> 

   <image name="imagery" driver="gdal">
      <url>mercury/mercury-imagery-messenger-color.tif</url>
      <profile><srs>+proj=latlong +a=2439700.0 +rf=9999999999</srs></profile>
   </image>

   <heightfield driver="gdal">
      <url>mercury/mercury-elevation-messenger-global.tif</url>
      <profile><srs>+proj=latlong +a=2439700.0 +rf=9999999999</srs></profile>
      <max_level>3</max_level>
   </heightfield>
   <heightfield driver="gdal">
      <url>mercury/mercury-elevation-messenger-global.tif</url>
      <profile><srs>+proj=latlong +a=2439700.0 +rf=9999999999</srs></profile>
      <min_level>4</min_level>
   </heightfield>

   <options>
      <profile>
        <srs>+proj=latlong +a=2439700.0 +rf=9999999999</srs>
      </profile>
      <terrain driver="mp" tile_pixel_size="128" range_mode="PIXEL_SIZE_ON_SCREEN">
         <normal_maps>true</normal_maps>
         <incremental_update>true</incremental_update>
         <quick_release_gl_objects>false</quick_release_gl_objects>
         <cluster_culling>true</cluster_culling>
         <premultiplied_alpha>false</premultiplied_alpha>
         <vertical_scale>1</vertical_scale>
         <lighting>true</lighting>
         <min_lod>14</min_lod>
      </terrain>
   </options>

</map>
KingArthur10 commented 8 years ago

I can try to make the data available to you if you need. It's about 5GB.

KingArthur10 commented 8 years ago

Looks like it has to do with incremental_update changing behavior. If I take that out, then it no longer has a white globe upon startup. It didn't behave this way in 2.7. I'm going to see if that change will be acceptable for our performance. Can you think of major side effects?

jasonbeverage commented 8 years ago

Arthur I would just take it out if it's not working for you. incremental_update will only effect how the terrain loads data when map model changes occur (like adding/removing a layer). In general you might be a better visual experience just leaving it off anyway if you don't want random tiles paging in when you change the map model

On Thu, Aug 25, 2016 at 1:41 PM KingArthur10 notifications@github.com wrote:

Looks like it has to do with incremental_update changing behavior. If I take that out, then it no longer has a white globe upon startup. It didn't behave this way in 2.7. I'm going to see if that change will be acceptable for our performance. Can you think of major side effects?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gwaldron/osgearth/issues/778#issuecomment-242477254, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT74tU2gbI8oW5K_v8DW-5ulU2yps69ks5qjdPdgaJpZM4Jscr1 .

gwaldron commented 7 years ago

Fixed- rex will preload the first LOD before rendering