Added remapping of internal texture formats to GL_RGBA etc when just the number of components is used i.e.

1 -> GL_ALPHA,
  2 -> GL_LUMINANCE_ALPHA
  3 -> GL_RGB
  4 -> GL_RGBA
This commit is contained in:
Robert Osfield
2009-11-06 18:06:16 +00:00
parent aa2bb575c4
commit 7fb88a83ff

View File

@@ -1397,6 +1397,13 @@ void Texture::computeInternalFormatWithImage(const osg::Image& image) const
}
_internalFormat = internalFormat;
// GLES doesn't cope with internal formats of 1,2,3 and 4 so map them to the appropriate equivilants.
if (_internalFormat==1) _internalFormat = GL_ALPHA;
if (_internalFormat==2) _internalFormat = GL_LUMINANCE_ALPHA;
if (_internalFormat==3) _internalFormat = GL_RGB;
if (_internalFormat==4) _internalFormat = GL_RGBA;
computeInternalFormatType();
//osg::notify(osg::NOTICE)<<"Internal format="<<std::hex<<internalFormat<<std::dec<<std::endl;