Preliminary remapping of internalFormat for GL3 core profile

This commit is contained in:
Robert Osfield 2013-10-22 18:58:15 +00:00
parent 3dba54c10a
commit b7b7186cf8

View File

@ -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;