From 72b3ce7ac65f360b87465c79bf742af0d254e675 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 19 Nov 2009 12:39:04 +0000 Subject: [PATCH] From Tugkan Calapoglu, "we started to have problems with textures after a recent svn update. I was able to follow the problem until following addition to Texture.cpp: // 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; The problem is that internal format "1" corresponds to GL_LUMINANCE, not GL_ALPHA. I double checked this from the Red Book. Fixed version is attached to the email." --- src/osg/Texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 9f27f02c4..2e9671749 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -1402,7 +1402,7 @@ 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==1) _internalFormat = GL_LUMINANCE; if (_internalFormat==2) _internalFormat = GL_LUMINANCE_ALPHA; if (_internalFormat==3) _internalFormat = GL_RGB; if (_internalFormat==4) _internalFormat = GL_RGBA;