Re: [osg-users] openGL error with osgEarth?

2010-04-29 Thread Glenn Waldron
Akilan,
You are probably running out of texture units. In multitexture mode,
osgEarth uses one per layer. Try using multipass mode instead:

MapEngineProperties props;
props.layeringTechnique() = MapEngineProperties::LAYERING_MULTIPASS;
MapNode* node = new MapNode( map, props );


Glenn Waldron : Pelican Mapping : +1.703.652.4791


On Thu, Apr 29, 2010 at 12:10 AM, Akilan Thangamani 
akilan.thangam...@gmail.com wrote:

 Hi Jason,

 In fact, I create the map through program.What the program does is that as
 and when some new tif file arrives at particular folder which I am
 monitoring continuously thru callback, I add the file to the already created
 map. It works well for some 2-3 tile addition. When it goes beyond that it
 throws the openGL error. Have a look at my code. Is there any other way to
 do the same.

 Akilan. A

 Code:

 

 class monitorCallback : public osg::NodeCallback
 {
 public:

monitorCallback(osgEarth* map)
{
_map=map;
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
//
// look for any new tif arrival at specific folder
//
.
.
if(new_tif)
{
sprintf(name, tile_%d, tif_cnt);
osgEarth::Config conf;
conf.add(url, new_tif);//new tif name with
 relative path
_map-addMapLayer( new osgEarth::MapLayer(name,
 osgEarth::MapLayer::TYPE_IMAGE, gdal, conf ) );
}
   }

osgEarth::Map* _map;
 };



 int main(int argc, char* argv[])

 {

_chdir(curr_dir);
osgViewer::Viewer* viewer=new osgViewer::Viewer;
osg::Group* root=new osg::Group;

osgEarth::Map* map = new
 osgEarth::Map(osgEarth::Map::CSTYPE_GEOCENTRIC);

// Cache
map-setCache(new TMSCache(cache));

// World
   {
  osgEarth::Config conf;
  conf.add( url, ../data/world.tif );
  map-addMapLayer( new osgEarth::MapLayer(WORLD,
 osgEarth::MapLayer::TYPE_IMAGE, gdal, conf ) );

}
  root-setUpdateCallback(new monitorCallback(map));

osgEarth::MapNode* mapNode=new osgEarth::MapNode(map);
mapNode-setNodeMask( 0x01 );
viewer-setCameraManipulator(new osgEarthUtil::EarthManipulator);
viewer-addEventHandler( new osgViewer::StatsHandler() );
viewer-addEventHandler( new osgViewer::ThreadingHandler() );
viewer-setSceneData(root);
viewer-run();
return 0;

 }




 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=27417#27417





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] openGL error with osgEarth?

2010-04-28 Thread Akilan Thangamani
Hi Jason,

In fact, I create the map through program.What the program does is that as and 
when some new tif file arrives at particular folder which I am monitoring 
continuously thru callback, I add the file to the already created map. It works 
well for some 2-3 tile addition. When it goes beyond that it throws the openGL 
error. Have a look at my code. Is there any other way to do the same.

Akilan. A

Code:



class monitorCallback : public osg::NodeCallback
{
public:

monitorCallback(osgEarth* map)
{
_map=map;
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
//
// look for any new tif arrival at specific folder
//
.
.
if(new_tif)
{
sprintf(name, tile_%d, tif_cnt);
osgEarth::Config conf;
conf.add(url, new_tif);//new tif name with relative 
path
_map-addMapLayer( new osgEarth::MapLayer(name, 
osgEarth::MapLayer::TYPE_IMAGE, gdal, conf ) );
}
   }

osgEarth::Map* _map;
};



int main(int argc, char* argv[])

{

_chdir(curr_dir);
osgViewer::Viewer* viewer=new osgViewer::Viewer;
osg::Group* root=new osg::Group;

osgEarth::Map* map = new 
osgEarth::Map(osgEarth::Map::CSTYPE_GEOCENTRIC);

// Cache
map-setCache(new TMSCache(cache));

// World
   {
  osgEarth::Config conf;
  conf.add( url, ../data/world.tif );
  map-addMapLayer( new osgEarth::MapLayer(WORLD, 
osgEarth::MapLayer::TYPE_IMAGE, gdal, conf ) );

}
  root-setUpdateCallback(new monitorCallback(map));

osgEarth::MapNode* mapNode=new osgEarth::MapNode(map);
mapNode-setNodeMask( 0x01 );
viewer-setCameraManipulator(new osgEarthUtil::EarthManipulator);
viewer-addEventHandler( new osgViewer::StatsHandler() );
viewer-addEventHandler( new osgViewer::ThreadingHandler() );
viewer-setSceneData(root);
viewer-run();
return 0;

} 




--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27417#27417





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] openGL error with osgEarth?

2010-04-27 Thread Jason Beverage
Hi Akilan,

Can you post the earth files you are seeing errors on?  Perhaps you
are specifying more image layers than you have texture units.

Jason

On Tue, Apr 27, 2010 at 5:36 AM, Akilan Thangamani
akilan.thangam...@gmail.com wrote:
 Hi,

 When I run some of my .earth files, I m getting warning saying,
 detected openGL error, invalid enumerator, after RenderBin::draw(,).
 I m not sure why this error is caused?

 Akilan. A

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=27305#27305





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org