How to get TMS raster data float at 100 km above osgEarth surface.

classic Classic list List threaded Threaded
4 messages Options
Wojtek Lewandowski Wojtek Lewandowski
Reply | Threaded
Open this post in threaded view
|

How to get TMS raster data float at 100 km above osgEarth surface.

Hi, I am looking for advice.

I have to display some TMS/WMS data set with osgEarth earth model but the request is to either project it on the surface or draw it at some (user defined) altitude above the surface. So I am looking for some examples how to do it optimally. I presume projection will be a matter of adding new layer but I am not entirely sure how shall I tackle drawing at some altitude above the surface. Could anyone suggest some links or samples ?

Thanks in advance,
Wojtek Lewandowski
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: How to get TMS raster data float at 100 km above osgEarth surface.

Wojtek,
You can use a Layer shader to do this. I modified a layer from the hires-inset.earth example to demonstrate:

https://pastebin.com/xDH3izzi

This works with the REX terrain engine and requires osgEarth 2.9+.

(Caveat: since the shader alters the geometry, it's not subject to normal OSG culling; so you might be the tiles get culled prematurely in some situations. The Layer class has a hook for altering a tile's bounding box but that is not integrated into the earth file right now.)

Hope this helps!

Glenn Waldron / Pelican Mapping
Wojtek Lewandowski Wojtek Lewandowski
Reply | Threaded
Open this post in threaded view
|

Re: How to get TMS raster data float at 100 km above osgEarth surface.

Thanks for quick aswer. Unfortuantely we are still using osgEarth 2.8 and MP driver.  I believe we ported some REX related code to have tesselation shaders working with MP, though. So I will try, maybe it will just work for us.
But in case I cannot use it, will I have to render 2 MapNodes in 2.8 ? 1 for earth and 2 for TMS floating above earth ?

Cheers,
Wojtek Lewandowski

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: How to get TMS raster data float at 100 km above osgEarth surface.

Per-layer shaders like that won't work in MP. Sorry! You are probably stuck using 2 mapnodes.
Glenn Waldron / Pelican Mapping