From "Matthew Roberso, I've attached a small fix to the src/osgWrappers/serializers/osg/Texture2DArray.cpp against the svn head r11965 it simply calls setTextureDepth before attempting to load the individual textures into the array. Currently without that the loading fails with the following printout "Warning: Texture2DArray::setImage(..) failed, the given layer number is bigger then the size of the texture array." and the texture array is empty if loaded from an osga/b."
This commit is contained in:
parent
e9cd13f120
commit
9c0e56d7a0
@ -11,6 +11,7 @@ static bool checkImages( const osg::Texture2DArray& tex )
|
|||||||
static bool readImages( osgDB::InputStream& is, osg::Texture2DArray& tex )
|
static bool readImages( osgDB::InputStream& is, osg::Texture2DArray& tex )
|
||||||
{
|
{
|
||||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||||
|
tex.setTextureDepth(size);
|
||||||
for ( unsigned int i=0; i<size; ++i )
|
for ( unsigned int i=0; i<size; ++i )
|
||||||
{
|
{
|
||||||
osg::Image* image = is.readImage();
|
osg::Image* image = is.readImage();
|
||||||
|
Loading…
Reference in New Issue
Block a user