Hi Ceo, osgTerrain::TerrainTile defers the implementation of the subgraph that does the rendering to the osgTerrain::TerrainTechnique implementation assigned to the TerrainTile, the file IO also just writes out the high level detailsof the TerrainTile and not the subgrpah created by the TerrainTechnique so there is mean to directly achieve what you want using existing classes.
The default implementation used in the GeometryTechnique, but if this isn't doing what you require then creating your own TerrainTechnique subclass would be appropriate - you could have this assign the texture units exactly how you need. You could even just subclass from GeometryTechnique to leverage much of its scene building functionality. Robert. On 13 May 2012 10:15, Cao Wenjie <wybbz...@hotmail.com> wrote: > Hi, > > I have a terrain scene load from a terrain.osg file, I can see data like > hightField and imageLayer in the terrain.osg file. > > So, when I use osgDB::readNodeFile to load the terrain, osg will auto > generate the TerrainTile -> Tile -> Geode -> Geometry scene graph for me base > on those data, right? > > Problem is, after I changed the geode's stateset of a tile, like, give the > geode a new textureUnit. Save the root node of terrain to a newTerrain.osg > will not contain data relate to the changes. > > newTerrain.osg only have data as the old terrain.osg file, but nothing > related to textureUnit change. > > I know I can save the geode node to a geode.osg file which contain info of > textureUnit change. But how to merge the geode.osg file to the newTerrain.osg > file, so when I load the newTerrain.osg, it will auto load the corresponding > geode.osg and add it to the right position in the scene graph? > > > ... > > Thank you! > > Cheers, > Cao > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=47663#47663 > > > > > > _______________________________________________ > 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