Skip to content
Commits on Source (6)
......@@ -27,7 +27,7 @@ PROJECT(OSGEARTH)
SET(OSGEARTH_MAJOR_VERSION 2)
SET(OSGEARTH_MINOR_VERSION 10)
SET(OSGEARTH_PATCH_VERSION 1)
SET(OSGEARTH_PATCH_VERSION 2)
SET(OSGEARTH_SOVERSION 0)
SET(OSGEARTH_PLUGIN_PREFIX "")
......
include(SelectLibraryConfigurations)
include(FindPackageHandleStandardArgs)
find_path(WEBP_INCLUDE_DIR "webp/decode.h"
PATH_SUFFIXES include
)
find_library(WEBP_LIBRARY_RELEASE NAMES webp libwebp_a libwebp
HINTS "${WEBP_DIR}"
PATH_SUFFIXES "${PATH_SUFFIXES}" ${LIBRARY_PATH_SUFFIXES}
)
find_library(WEBP_LIBRARY_DEBUG NAMES webp_debug libwebp libwebp_a libwebp
HINTS "${WEBP_DIR}"
PATH_SUFFIXES "${PATH_SUFFIXES}" ${LIBRARY_PATH_SUFFIXES}
)
select_library_configurations(WEBP)
find_package_handle_standard_args(WEBP DEFAULT_MSG
WEBP_INCLUDE_DIR)
mark_as_advanced(WEBP_INCLUDE_DIR)
set( WEBP_FOUND "NO" )
if( WEBP_LIBRARY AND WEBP_INCLUDE_DIR )
set( WEBP_FOUND "YES" )
endif()
\ No newline at end of file
osgearth (2.10.1+dfsg-2) UNRELEASED; urgency=medium
osgearth (2.10.2+dfsg-1) unstable; urgency=medium
* New upstream release.
* Bump Standards-Version to 4.4.0, no changes.
* Refresh patches.
* Update symbols for amd64.
-- Bas Couwenberg <sebastic@debian.org> Wed, 10 Jul 2019 18:43:09 +0200
-- Bas Couwenberg <sebastic@debian.org> Fri, 12 Jul 2019 06:59:21 +0200
osgearth (2.10.1+dfsg-1) unstable; urgency=medium
......
# SymbolsHelper-Confirmed: 2.10.1 amd64
# SymbolsHelper-Confirmed: 2.10.2 amd64
libosgEarth.so.5 #PACKAGE# #MINVER#
* Build-Depends-Package: libosgearth-dev
_Z10TiXmlFOpenPKcS0_@Base 2.4.0
......@@ -5456,6 +5456,9 @@ libosgEarth.so.5 #PACKAGE# #MINVER#
(optional=templinst|arch=amd64 arm64 hppa kfreebsd-amd64 m68k mips64el ppc64el sh4 sparc64 x32)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrIN8osgEarth8CacheBinEEEESt10_Select1stISD_ESt4lessIS5_ESaISD_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorISD_ERS7_@Base 2.7.0
(optional=templinst|arch=amd64 arm64 armel armhf m68k mips64el ppc64el sparc64 x32)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrIN8osgEarth8CacheBinEEEESt10_Select1stISD_ESt4lessIS5_ESaISD_EE4findERS7_@Base 2.9.0
(optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrIN8osgEarth8CacheBinEEEESt10_Select1stISD_ESt4lessIS5_ESaISD_EE8_M_eraseEPSt13_Rb_tree_nodeISD_E@Base 2.7.0
(optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrINS8_10ReferencedEEEESt10_Select1stISC_ESt4lessIS5_ESaISC_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESN_IJEEEEESt17_Rb_tree_iteratorISC_ESt23_Rb_tree_const_iteratorISC_EDpOT_@Base 2.10.2
(optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrINS8_10ReferencedEEEESt10_Select1stISC_ESt4lessIS5_ESaISC_EE24_M_get_insert_unique_posERS7_@Base 2.10.2
(optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrINS8_10ReferencedEEEESt10_Select1stISC_ESt4lessIS5_ESaISC_EE29_M_get_insert_hint_unique_posESt23_Rb_tree_const_iteratorISC_ERS7_@Base 2.10.2
(optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrINS8_10ReferencedEEEESt10_Select1stISC_ESt4lessIS5_ESaISC_EE7_M_copyINSI_11_Alloc_nodeEEEPSt13_Rb_tree_nodeISC_EPKSM_PSt18_Rb_tree_node_baseRT_@Base 2.8~rc1
(optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrINS8_10ReferencedEEEESt10_Select1stISC_ESt4lessIS5_ESaISC_EE7_M_copyINSI_20_Reuse_or_alloc_nodeEEEPSt13_Rb_tree_nodeISC_EPKSM_PSt18_Rb_tree_node_baseRT_@Base 2.8~rc1
(optional=templinst)_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3osg7ref_ptrINS8_10ReferencedEEEESt10_Select1stISC_ESt4lessIS5_ESaISC_EE8_M_eraseEPSt13_Rb_tree_nodeISC_E@Base 2.7.0
......
......@@ -6,7 +6,7 @@ Author: Pirmin Kalberer <pka@sourcepole.ch>
@@ -28,7 +28,7 @@ PROJECT(OSGEARTH)
SET(OSGEARTH_MAJOR_VERSION 2)
SET(OSGEARTH_MINOR_VERSION 10)
SET(OSGEARTH_PATCH_VERSION 1)
SET(OSGEARTH_PATCH_VERSION 2)
-SET(OSGEARTH_SOVERSION 0)
+SET(OSGEARTH_SOVERSION 5)
......
......@@ -129,7 +129,7 @@ Maintainers
.. _@pelicanmapping: https://twitter.com/pelicanmapping
.. _Google+ Page: https://plus.google.com/b/104014917856468748129/104014917856468748129/posts
.. _support forum: http://forum.osgearth.osg
.. _support forum: http://forum.osgearth.org
.. _OSG Mailing List: http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
.. _OSG Forum: http://forum.openscenegraph.org
.. _Contact us: http://pelicanmapping.com/?page_id=2
......
......@@ -56,7 +56,7 @@ Lines or Annotations (FeatureNode, etc.) are not rendering. Why?
Lines render using a shader that requires some initial state to be set.
You can apply this state to your top-level camera (or anywhere else
above the geometry) like so:
above the geometry) like so::
#include <osgEarth/GLUtils>
...
......@@ -87,90 +87,6 @@ Lines or Annotations (FeatureNode, etc.) are not rendering. Why?
not place your annotations as descendants of the MapNode.
How do make the terrain transparent?
....................................
By default, the globe will be opaque white when there are no image layers, or when all the image
layers have their opacities set to zero. To make the underlying globe transparent, set the
base color of the terrain to a transparent color like so::
<map>
<options>
<terrain color="#ffffff00" ...
In code, this option is found in the ``RexTerrainEngineOptions`` class::
#include <osgEarthDrivers/engine_mp/RexTerrainEngineOptions>
using namespace osgEarth::Drivers::RexTerrainEngine;
...
RexTerrainEngineOptions options;
options.color() = osg::Vec4(1,1,1,0);
How do I set the resolution of terrain tiles?
.............................................
Each tile is a grid of vertices. The number of vertices can vary depending on source data
and settings. By default (when you have no elevation data) it is an 17x17 grid, tessellated
into triangles.
You can expressly set the terrain's tile size by using the Map options.
osgEarth will then resample all elevation data to the size you specify.
You will get best results from a tile size that is a power of 2 plus 1::
<map>
<options>
<terrain>
<tile_size>9</tile_size>
...
----
Other Terrain Formats
---------------------
Does osgEarth work with VirtualPlanetBuilder?
.............................................
VirtualPlanetBuilder_ (VPB) is a command-line terrain generation tool. Before osgEarth
came along, VPB was probably the most-used open source tool for building terrains for
OSG appliations. We mention is here because many people ask questions about loading
VPB models or transitioning from VPB to osgEarth.
osgEarth differs from VPB in that:
* VPB builds static terrain models and saves them to disk. osgEarth generates terrain on
demand as your application runs; you do not (and cannot) save a model to disk.
* Changing a VPB terrain generally requires that you rebuild the model. osgEarth does not
require a preprocessing step since it builds the terrain at run time.
* osgEarth and VPB both use *GDAL* to read many types of imagery and elevation data from
the local file system. osgEarth also supports network-based data sources through its
plug-in framework.
osgEarth has a *VPB driver* for "scraping" elevation and imagery tiles from a VPB model.
Confiugration of this driver is quite tricky and requires you to understand the details
of how VPB models are organized. You're on your own.
**Please Note** that this driver only exists as a **last resort** for people that have a VPB
model but no longer have access to the source data from which it was built. If at all
possible you should feed your source data directly into osgEarth instead of using the VPB
driver.
Can osgEarth load TerraPage or MetaFlight?
..........................................
osgEarth cannot load TerraPage (TXP) or MetaFlight. However, osgEarth does have a
"bring your own terrain" plugin that allows you to load an external model and use it as your
terrain. The caveat is that since osgEarth doesn't know anything about your terrain model, you
will not be able to use some of the features of osgEarth (like being able to add or remove layers).
For usage formation, please refer to the ``byo.earth`` example in the repo.
.. _VirtualPlanetBuilder: http://www.openscenegraph.com/index.php/documentation/tools/virtual-planet-builder
----
Community and Support
......
......@@ -939,7 +939,8 @@ CascadeDrapingDecorator::CameraLocal::traverse(osgUtil::CullVisitor* cv, Cascade
// Create a view matrix that looks straight down at the horizon plane form the eyepoint.
// This will be our view matrix for all RTT draping cameras.
osg::Matrix rttView;
osg::Vec3d rttLook = -horizonPlane.getNormal();
osg::Vec3d rttLook = -ellipsoid->computeLocalUpVector(camEye.x(), camEye.y(), camEye.z());
rttLook.normalize();
osg::Vec3d camLeft = camUp ^ camLook;
osg::Vec3d rttUp = rttLook ^ camLeft;
rttView.makeLookAt(camEye, camEye + rttLook, rttUp);
......
......@@ -135,6 +135,10 @@ Config::merge( const Config& rhs )
// add in the new values.
for( ConfigSet::const_iterator c = rhs._children.begin(); c != rhs._children.end(); ++c )
add( *c );
// merge ref map
for( RefMap::const_iterator c = rhs._refMap.begin(); c != rhs._refMap.end(); ++c )
_refMap[c->first] = c->second;
}
const Config*
......
......@@ -36,7 +36,7 @@ namespace osgEarth
//! Serializable shader that supports samplers and uniforms
//! in an earth file.
class ShaderOptions : public ConfigOptions
class OSGEARTH_EXPORT ShaderOptions : public ConfigOptions
{
public:
META_ConfigOptions(osgEarth, ShaderOptions, ConfigOptions);
......
......@@ -29,7 +29,7 @@ extern "C" {
#define OSGEARTH_MAJOR_VERSION 2
#define OSGEARTH_MINOR_VERSION 10
#define OSGEARTH_PATCH_VERSION 1
#define OSGEARTH_PATCH_VERSION 2
#define OSGEARTH_SOVERSION 0
#define OSGEARTH_RC_VERSION 0
#define OSGEARTH_DEVEL_VERSION 0 // 0 = release; >0 = interim devel version
......
......@@ -79,6 +79,7 @@ add_subdirectory(vdatum_egm96)
add_subdirectory(viewpoints)
add_subdirectory(vpb)
add_subdirectory(wcs)
add_subdirectory(webp)
add_subdirectory(wms)
add_subdirectory(xyz)
......
......@@ -178,7 +178,7 @@ namespace
texCoords->push_back( (*texCoords)[INDEX] ); \
texCoords->back().z() = (float)((int)texCoords->back().z() | VERTEX_MARKER_SKIRT); \
if ( neighbors ) neighbors->push_back( (*neighbors)[INDEX] - ((*normals)[INDEX])*(HEIGHT) ); \
if ( neighborNormals ) neighborNormals->push_back( (*neighborNormals)[INDEX] - ((*neighborNormals)[INDEX])*(HEIGHT) ); \
if ( neighborNormals ) neighborNormals->push_back( (*neighborNormals)[INDEX] ); \
}
#define addSkirtTriangles(INDEX0, INDEX1) \
......
......@@ -368,7 +368,8 @@ RexTerrainEngineNode::setMap(const Map* map, const TerrainOptions& options)
0u, // always zero, not the terrain options firstLOD
osg::minimum( _terrainOptions.maxLOD().get(), maxLOD ),
map->getProfile(),
_terrainOptions.minTileRangeFactor().get() );
_terrainOptions.minTileRangeFactor().get(),
_terrainOptions.adaptivePolarRangeFactor().get() );
// set up the initial graph
refresh();
......
......@@ -45,7 +45,8 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
_morphTerrain ( true ),
_morphImagery ( true ),
_mergesPerFrame ( 20 ),
_expirationRange ( 0 )
_expirationRange ( 0 ),
_adaptivePolarRangeFactor( true )
{
setDriver( "rex" );
fromConfig( _conf );
......@@ -108,6 +109,14 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
optional<int>& mergesPerFrame() { return _mergesPerFrame; }
const optional<int>& mergesPerFrame() const { return _mergesPerFrame; }
/**
* Whether to automatically adjust(reduce) the minTileRangeFactor with increase in
* latitude. This prevents overtessellation in the polar regions. Only works with
* a geocentric map. Defaults to true.
*/
optional<bool>& adaptivePolarRangeFactor() { return _adaptivePolarRangeFactor; }
const optional<bool>& adaptivePolarRangeFactor() const { return _adaptivePolarRangeFactor; }
/** Options for specific LODs */
std::vector<LODOptions>& lods() { return _lods; }
const std::vector<LODOptions>& lods() const { return _lods; }
......@@ -125,6 +134,7 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
conf.set( "morph_terrain", _morphTerrain );
conf.set( "morph_imagery", _morphImagery );
conf.set( "merges_per_frame", _mergesPerFrame );
conf.set( "adaptive_polar_range_factor", _adaptivePolarRangeFactor);
if (!_lods.empty()) {
Config lodsConf("lods");
......@@ -159,6 +169,7 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
conf.get( "morph_terrain", _morphTerrain );
conf.get( "morph_imagery", _morphImagery );
conf.get( "merges_per_frame", _mergesPerFrame );
conf.get( "adaptive_polar_range_factor", _adaptivePolarRangeFactor);
const Config* lods = conf.child_ptr("lods");
if (lods) {
......@@ -185,6 +196,7 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
optional<bool> _morphTerrain;
optional<bool> _morphImagery;
optional<int> _mergesPerFrame;
optional<bool> _adaptivePolarRangeFactor;
std::vector<LODOptions> _lods;
};
......
......@@ -40,13 +40,14 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
double _visibilityRange;
double _morphStart;
double _morphEnd;
unsigned _minValidTY, _maxValidTY;
};
public:
SelectionInfo() : _firstLOD(0) { }
//! Initialize the selection into LODs
void initialize(unsigned firstLod, unsigned maxLod, const Profile* profile, double mtrf);
void initialize(unsigned firstLod, unsigned maxLod, const Profile* profile, double mtrf, bool restrictPolarSubdivision);
//! Number of LODs
unsigned getNumLODs(void) const { return _lods.size(); }
......@@ -54,6 +55,12 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
//! Visibility and morphing information for a specific LOD
const LOD& getLOD(unsigned lod) const;
//! Fetch the effective visibility range and morphing range for a key
void get(const TileKey& key, float& out_range, float& out_startMorphRange, float& out_endMorphRange) const;
//! Get just the visibility range for a TileKey.
float getRange(const TileKey& key) const;
private:
std::vector<LOD> _lods;
unsigned _firstLOD;
......
......@@ -41,7 +41,7 @@ SelectionInfo::getLOD(unsigned lod) const
}
void
SelectionInfo::initialize(unsigned firstLod, unsigned maxLod, const Profile* profile, double mtrf)
SelectionInfo::initialize(unsigned firstLod, unsigned maxLod, const Profile* profile, double mtrf, bool restrictPolarSubdivision)
{
if (getNumLODs() > 0)
{
......@@ -57,29 +57,104 @@ SelectionInfo::initialize(unsigned firstLod, unsigned maxLod, const Profile* pro
_firstLOD = firstLod;
double fLodNear = 0;
float fRatio = 1.0;
unsigned numLods = maxLod + 1u;
_lods.resize(numLods);
for (unsigned lod = 0; lod <= maxLod; ++lod)
{
TileKey key(lod, 0, 0, profile);
unsigned tx, ty;
profile->getNumTiles(lod, tx, ty);
TileKey key(lod, tx/2, ty/2, profile);
GeoExtent e = key.getExtent();
GeoCircle c = e.computeBoundingGeoCircle();
double range = c.getRadius() * mtrf * 2.0;
_lods[lod]._visibilityRange = range;
_lods[lod]._minValidTY = 0;
_lods[lod]._maxValidTY = INT32_MAX;
}
double metersPerEquatorialDegree = (profile->getSRS()->getEllipsoid()->getRadiusEquator() * 2.0 * osg::PI) / 360.0;
double prevPos = 0.0;
for (int lod=(int)(numLods-1); lod>=0; --lod)
{
double span = _lods[lod]._visibilityRange - prevPos;
_lods[lod]._morphEnd = _lods[lod]._visibilityRange;
_lods[lod]._morphStart = prevPos + span*_morphStartRatio;
//prevPos = _lods[i]._morphStart; // original value
prevPos = _lods[lod]._morphEnd;
// Calc the maximum valid TY (to avoid over-subdivision at the poles)
// In a geographic map, this will effectively limit the maximum LOD
// progressively starting at about +/- 72 degrees latitude.
unsigned startLOD = 6;
if (restrictPolarSubdivision && lod >= startLOD && profile->getSRS()->isGeographic())
{
const double startAR = 0.1; // minimum allowable aspect ratio at startLOD
const double endAR = 0.4; // minimum allowable aspect ratio at maxLOD
double lodT = (double)(lod-startLOD)/(double)(numLods-1);
double minAR = startAR + (endAR-startAR)*lodT;
unsigned tx, ty;
profile->getNumTiles(lod, tx, ty);
for(int y=ty/2; y>=0; --y)
{
TileKey k(lod, 0, y, profile);
const GeoExtent& e = k.getExtent();
double lat = 0.5*(e.yMax()+e.yMin());
double width = e.width() * metersPerEquatorialDegree * cos(osg::DegreesToRadians(lat));
double height = e.height() * metersPerEquatorialDegree;
if (width/height < minAR)
{
_lods[lod]._minValidTY = osg::minimum(y+1, (int)(ty-1));
_lods[lod]._maxValidTY = (ty-1)-_lods[lod]._minValidTY;
OE_DEBUG << "LOD " << lod
<< " TY=" << ty
<< " minAR=" << minAR
<< " minTY=" << _lods[lod]._minValidTY
<< " maxTY=" << _lods[lod]._maxValidTY
<< " (+/-" << lat << " deg)"
<< std::endl;
break;
}
}
}
}
}
void
SelectionInfo::get(const TileKey& key,
float& out_range,
float& out_startMorphRange,
float& out_endMorphRange) const
{
out_range = 0.0f;
out_startMorphRange = 0.0f;
out_endMorphRange = 0.0f;
if (key.getLOD() < _lods.size())
{
const LOD& lod = _lods[key.getLOD()];
double lodNear = 0;
double prevPos = lodNear;
for (int i=(int)(numLods-1); i>=0; --i)
if (key.getTileY() >= lod._minValidTY && key.getTileY() <= lod._maxValidTY)
{
out_range = lod._visibilityRange;
out_startMorphRange = lod._morphStart;
out_endMorphRange = lod._morphEnd;
}
}
}
float
SelectionInfo::getRange(const TileKey& key) const
{
const LOD& lod = _lods[key.getLOD()];
if (key.getTileY() >= lod._minValidTY && key.getTileY() <= lod._maxValidTY)
{
_lods[i]._morphEnd = _lods[i]._visibilityRange;
_lods[i]._morphStart = prevPos + (_lods[i]._morphEnd - prevPos) * _morphStartRatio;
prevPos = _lods[i]._morphStart;
return lod._visibilityRange;
}
return 0.0f;
}
......@@ -243,7 +243,11 @@ SurfaceNode::computeBound() const
float
SurfaceNode::getPixelSizeOnScreen(osg::CullStack* cull) const
{
return cull->clampedPixelSize(getMatrix().getTrans(), _drawable->getRadius()) / cull->getLODScale();
// By using the width, the "apparent" pixel size will decrease as we
// near the poles.
double R = _drawable->getWidth()*0.5;
//double R = _drawable->getRadius() / 1.4142;
return cull->clampedPixelSize(getMatrix().getTrans(), R) / cull->getLODScale();
}
void
......
......@@ -101,6 +101,8 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
float getRadius() const { return _bboxRadius; }
float getWidth() const { return getBoundingBox().xMax() - getBoundingBox().xMin(); }
public: // osg::Drawable overrides
// These methods defer functors (like stats collection) to the underlying
......
......@@ -153,6 +153,7 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
bool _empty;
bool _isRootTile;
bool _imageUpdatesActive;
TileKey _subdivideTestKey;
osg::observer_ptr<TileNode> _eastNeighbor;
osg::observer_ptr<TileNode> _southNeighbor;
......