From Brad Christiansen and Robert Osfield, "I have added the new function as suggested. The change was made against trunk from an hour or so ago. I haven't tested the performance yet (and probably won't get a chance till next week) but I have checked my terrains still work. I defaulted the equalization to off as I thought this was best until we can look into why there is the performance hit.
", note from Robert, tweaked the names and enabled the code path.
This commit is contained in:
@@ -29,8 +29,6 @@
|
||||
|
||||
using namespace osgTerrain;
|
||||
|
||||
#define NEW_COORD_CODE
|
||||
|
||||
GeometryTechnique::GeometryTechnique()
|
||||
{
|
||||
setFilterBias(0);
|
||||
@@ -880,8 +878,7 @@ void GeometryTechnique::generateGeometry(BufferData& buffer, Locator* masterLoca
|
||||
//
|
||||
VNG.populateCenter(elevationLayer, layerToTexCoordMap);
|
||||
|
||||
#if 1
|
||||
if (terrain)
|
||||
if (terrain && terrain->getEqualizeBoundaries())
|
||||
{
|
||||
TileID tileID = _terrainTile->getTileID();
|
||||
|
||||
@@ -997,7 +994,6 @@ void GeometryTechnique::generateGeometry(BufferData& buffer, Locator* masterLoca
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
osg::ref_ptr<osg::Vec3Array> skirtVectors = new osg::Vec3Array((*VNG._normals));
|
||||
|
||||
@@ -25,7 +25,8 @@ using namespace osgTerrain;
|
||||
Terrain::Terrain():
|
||||
_sampleRatio(1.0),
|
||||
_verticalScale(1.0),
|
||||
_blendingPolicy(TerrainTile::INHERIT)
|
||||
_blendingPolicy(TerrainTile::INHERIT),
|
||||
_equalizeBoundaries(false)
|
||||
{
|
||||
setNumChildrenRequiringUpdateTraversal(1);
|
||||
_terrainTechnique = new GeometryTechnique;
|
||||
@@ -36,6 +37,7 @@ Terrain::Terrain(const Terrain& ts, const osg::CopyOp& copyop):
|
||||
_sampleRatio(ts._sampleRatio),
|
||||
_verticalScale(ts._verticalScale),
|
||||
_blendingPolicy(ts._blendingPolicy),
|
||||
_equalizeBoundaries(ts._equalizeBoundaries),
|
||||
_terrainTechnique(ts._terrainTechnique)
|
||||
{
|
||||
setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1);
|
||||
@@ -71,6 +73,13 @@ void Terrain::setVerticalScale(float scale)
|
||||
dirtyRegisteredTiles();
|
||||
}
|
||||
|
||||
void Terrain::setEqualizeBoundaries(bool equalizeBoundaries)
|
||||
{
|
||||
if(_equalizeBoundaries == equalizeBoundaries) return;
|
||||
_equalizeBoundaries = equalizeBoundaries;
|
||||
dirtyRegisteredTiles();
|
||||
}
|
||||
|
||||
void Terrain::setBlendingPolicy(TerrainTile::BlendingPolicy policy)
|
||||
{
|
||||
if (_blendingPolicy == policy) return;
|
||||
|
||||
Reference in New Issue
Block a user