Hi,

I have discovered a piece of missing functionality in the new serializer for 
osgTerrain::ImageLayers. The issue is that all optional layers are loaded when 
an osgb file is loaded regardless of weather they should be or not.

The relevant piece of code for the the .ive format is in  (in osgDB_ive) "void 
ImageLayer::read(DataInputStream* in)" at line 64:

bool deferExternalLayerLoading = 
osgTerrain::TerrainTile::getTileLoadedCallback().valid() ? 
        
osgTerrain::TerrainTile::getTileLoadedCallback()->deferExternalLayerLoading() : 
false;
// Should we read image data from stream
IncludeImageMode includeImg = (IncludeImageMode)in->readChar();
    
if (includeImg==IMAGE_REFERENCE_FILE && deferExternalLayerLoading)
{
  setFileName(in->readString());
}
  else
{
  setImage(in->readImage(includeImg));
}

The new serializer simple adds an image serializer for an ImageLayer with no 
similar checks. 

I have had a quick look at coding a fix but have to admit I still dont fully 
understand how the new system works in such cases. If anyone can give me some 
pointers on how to go about adding this functionality that would be greatly 
apprecaited as at the momment I am having to covert my terrain databases back 
to .ive.

For reference, I discovered the issue as my osgb databses where laoding alot 
slower than my ive based ones. The reason was that all optional layers were 
being loaded even if they weren't active.


Cheers,
Brad

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to