irr: Add support for some RG texture formats
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13628 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
8f0f150c4a
commit
0588b4252e
@ -11,3 +11,4 @@ The following changes have been made:
|
|||||||
- texture override
|
- texture override
|
||||||
- non-triangle VBO support
|
- non-triangle VBO support
|
||||||
- extension order mismatch
|
- extension order mismatch
|
||||||
|
- support for some RG texture formats
|
||||||
|
@ -111,6 +111,14 @@ public:
|
|||||||
return 24;
|
return 24;
|
||||||
case ECF_A8R8G8B8:
|
case ECF_A8R8G8B8:
|
||||||
return 32;
|
return 32;
|
||||||
|
case ECF_R8:
|
||||||
|
return 8;
|
||||||
|
case ECF_R8G8:
|
||||||
|
return 16;
|
||||||
|
case ECF_R16:
|
||||||
|
return 16;
|
||||||
|
case ECF_R16G16:
|
||||||
|
return 32;
|
||||||
case ECF_R16F:
|
case ECF_R16F:
|
||||||
return 16;
|
return 16;
|
||||||
case ECF_G16R16F:
|
case ECF_G16R16F:
|
||||||
|
@ -31,6 +31,12 @@ namespace video
|
|||||||
//! Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
|
//! Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
|
||||||
ECF_A8R8G8B8,
|
ECF_A8R8G8B8,
|
||||||
|
|
||||||
|
//! The normalized non-float formats from the _rg extension
|
||||||
|
ECF_R8,
|
||||||
|
ECF_R8G8,
|
||||||
|
ECF_R16,
|
||||||
|
ECF_R16G16,
|
||||||
|
|
||||||
/** Floating Point formats. The following formats may only be used for render target textures. */
|
/** Floating Point formats. The following formats may only be used for render target textures. */
|
||||||
|
|
||||||
//! 16 bit floating point format using 16 bits for the red channel.
|
//! 16 bit floating point format using 16 bits for the red channel.
|
||||||
|
@ -4425,6 +4425,23 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE
|
|||||||
else
|
else
|
||||||
type = GL_UNSIGNED_BYTE;
|
type = GL_UNSIGNED_BYTE;
|
||||||
break;
|
break;
|
||||||
|
case ECF_R8G8:
|
||||||
|
// GL_ARB_texture_rg is considered always available in headers. No ifdefs.
|
||||||
|
fmt = GL_RG;
|
||||||
|
type = GL_UNSIGNED_BYTE;
|
||||||
|
break;
|
||||||
|
case ECF_R16G16:
|
||||||
|
fmt = GL_RG;
|
||||||
|
type = GL_UNSIGNED_SHORT;
|
||||||
|
break;
|
||||||
|
case ECF_R8:
|
||||||
|
fmt = GL_RED;
|
||||||
|
type = GL_UNSIGNED_BYTE;
|
||||||
|
break;
|
||||||
|
case ECF_R16:
|
||||||
|
fmt = GL_RED;
|
||||||
|
type = GL_UNSIGNED_SHORT;
|
||||||
|
break;
|
||||||
case ECF_R16F:
|
case ECF_R16F:
|
||||||
if (FeatureAvailable[IRR_ARB_texture_rg])
|
if (FeatureAvailable[IRR_ARB_texture_rg])
|
||||||
fmt = GL_RED;
|
fmt = GL_RED;
|
||||||
|
@ -159,6 +159,28 @@ GLint COpenGLTexture::getOpenGLFormatAndParametersFromColorFormat(ECOLOR_FORMAT
|
|||||||
type=GL_UNSIGNED_INT_8_8_8_8_REV;
|
type=GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||||
internalformat = GL_RGBA;
|
internalformat = GL_RGBA;
|
||||||
break;
|
break;
|
||||||
|
// _rg formats.
|
||||||
|
case ECF_R8:
|
||||||
|
colorformat = GL_RED;
|
||||||
|
type = GL_UNSIGNED_BYTE;
|
||||||
|
internalformat = GL_R8;
|
||||||
|
break;
|
||||||
|
case ECF_R16:
|
||||||
|
colorformat = GL_RED;
|
||||||
|
type = GL_UNSIGNED_SHORT;
|
||||||
|
internalformat = GL_R16;
|
||||||
|
break;
|
||||||
|
case ECF_R8G8:
|
||||||
|
colorformat = GL_RG;
|
||||||
|
type = GL_UNSIGNED_BYTE;
|
||||||
|
internalformat = GL_RG8;
|
||||||
|
break;
|
||||||
|
case ECF_R16G16:
|
||||||
|
colorformat = GL_RG;
|
||||||
|
type = GL_UNSIGNED_SHORT;
|
||||||
|
internalformat = GL_RG16;
|
||||||
|
break;
|
||||||
|
|
||||||
// Floating Point texture formats. Thanks to Patryk "Nadro" Nadrowski.
|
// Floating Point texture formats. Thanks to Patryk "Nadro" Nadrowski.
|
||||||
case ECF_R16F:
|
case ECF_R16F:
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user