#include "myTerrainTechnique.h" #include using namespace osgTerrain; myTerrainTechnique::myTerrainTechnique(void) : osgTerrain::GeometryTechnique() { //OSG_ALWAYS<init() calls technique->generateGeometry() which creates the drawable according to the heightfield. To modify the height, the heightfield must be modified prior to the original techniques init() function. To modiy the drawable shape (e.g. Cutting wholes in the area), the function technique->generateGeometry() must be modified. */ HeightFieldLayer* hfl = dynamic_cast( getTerrainTile()->getElevationLayer() ); osg::HeightField* h = hfl->getHeightField(); h->setHeight( 0,0, 1000); //OpenThreads::Thread::microSleep( 50000 ); / To simulate some complex tile modification. /* ImageLayer* il = dynamic_cast( getTerrainTile()->getColorLayer(0) ); osg::Image* img = il->getImage(); //img->setInternalTextureFormat( GL_RGBA ); if( img->getPixelFormat() == GL_RGBA ) OSG_ALWAYS << "Format ist RGBA" << std::endl; if( img->getPixelFormat() == GL_RGB ) OSG_ALWAYS << "Format ist RGB" << std::endl; if( img->getPixelFormat() == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ) OSG_ALWAYS << "Format ist GL_COMPRESSED_RGB_S3TC_DXT1_EXT" << std::endl;*/ GeometryTechnique::init(dirtyMask, assumeMultiThreaded); }