Added TerrainNode::setColorFilter(layerNum,Filter) to allow developers to set
what type of texture filter to use, either LINEAER and NEAREST.
This commit is contained in:
@@ -49,6 +49,7 @@ void GeometryTechnique::init()
|
||||
osgTerrain::Layer* elevationLayer = _terrainNode->getElevationLayer();
|
||||
osgTerrain::Layer* colorLayer = _terrainNode->getColorLayer(0);
|
||||
osg::TransferFunction* colorTF = _terrainNode->getColorTransferFunction(0);
|
||||
osgTerrain::TerrainNode::Filter filter = _terrainNode->getColorFilter(0);
|
||||
|
||||
// if the elevationLayer and colorLayer are the same, and there is colorTF then
|
||||
// simply assing as a texture coordinate.
|
||||
@@ -286,6 +287,8 @@ void GeometryTechnique::init()
|
||||
texture2D->setResizeNonPowerOfTwoHint(false);
|
||||
stateset->setTextureAttributeAndModes(color_index, texture2D, osg::StateAttribute::ON);
|
||||
|
||||
texture2D->setFilter(osg::Texture::MAG_FILTER, filter==TerrainNode::LINEAR ? osg::Texture::LINEAR : osg::Texture::NEAREST);
|
||||
|
||||
if (tf)
|
||||
{
|
||||
// up the precision of hte internal texture format to its maximum.
|
||||
|
||||
@@ -81,6 +81,13 @@ void TerrainNode::setColorTransferFunction(unsigned int i, osg::TransferFunction
|
||||
_colorLayers[i].transferFunction = tf;
|
||||
}
|
||||
|
||||
void TerrainNode::setColorFilter(unsigned int i, Filter filter)
|
||||
{
|
||||
if (_colorLayers.size() <= i) _colorLayers.resize(i+1);
|
||||
|
||||
_colorLayers[i].filter = filter;
|
||||
}
|
||||
|
||||
osg::BoundingSphere TerrainNode::computeBound() const
|
||||
{
|
||||
osg::BoundingSphere bs;
|
||||
|
||||
Reference in New Issue
Block a user