diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 3569d16f3..bca59088b 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -1458,6 +1458,18 @@ void Texture::computeInternalFormatWithImage(const osg::Image& image) const case(GL_RGBA8_OES) : internalFormat = GL_RGBA; break; default: break; } +#elif defined(OSG_GL3_AVAILABLE) + switch(internalFormat) + { + case(GL_INTENSITY) : internalFormat = GL_RED; break; // should it be swizzled to match RGBA(INTENSITY, INTENSITY, INTENSITY, INTENSITY)? + case(GL_LUMINANCE) : internalFormat = GL_RED; break; // should it be swizzled to match RGBA(LUMINANCE, LUMINANCE, LUMINANCE, 1.0)? + case(1) : internalFormat = GL_RED; break; // or sould this be GL_ALPHA? + case(2) : internalFormat = GL_RG; break; // should we assume GL_LUMINANCE_ALPHA? + case(GL_LUMINANCE_ALPHA) : internalFormat = GL_RB; break; // should it be swizlled to match RGAB(LUMUNIANCE, LUMINANCE, LUMINANCE, ALPHA)? + case(3) : internalFormat = GL_RGB; break; + case(4) : internalFormat = GL_RGBA; break; + default: break; + } #endif _internalFormat = internalFormat;