Browse Source

Added 16 & 32-bit texture formats.

Lasse Öörni 13 years ago
parent
commit
0cd53cdee3

+ 1 - 1
Docs/Reference.dox

@@ -806,7 +806,7 @@ In addition to configuring programmatically, the PostProcess can be configured w
 
 
 \code
 \code
 <postprocess>
 <postprocess>
-    <rendertarget name="RenderTargetName" size="x y" | sizedivisor="x y" format="rgb|rgba|float" filter="true|false" />
+    <rendertarget name="RenderTargetName" size="x y" | sizedivisor="x y" format="rgb|rgba|rgba16|rgba16f|rgba32f|rg16|rg16f|rg32f|r16f|r32f" filter="true|false" />
     <parameter name="GlobalShaderParameterName" value="x y z w" />
     <parameter name="GlobalShaderParameterName" value="x y z w" />
     <pass vs="VertexShaderName" ps="PixelShaderName" output="viewport|RenderTargetName" />
     <pass vs="VertexShaderName" ps="PixelShaderName" output="viewport|RenderTargetName" />
         <texture unit="diffuse|normal|specular|emissive|environment" name="viewport|RenderTargetName|TextureName" />
         <texture unit="diffuse|normal|specular|emissive|environment" name="viewport|RenderTargetName|TextureName" />

+ 10 - 2
Docs/ScriptAPI.dox

@@ -66,8 +66,16 @@ namespace Urho3D
 - uint GetLuminanceAlphaFormat()
 - uint GetLuminanceAlphaFormat()
 - uint GetRGBFormat()
 - uint GetRGBFormat()
 - uint GetRGBAFormat()
 - uint GetRGBAFormat()
-- uint GetFloatFormat()
+- uint GetRGBA16Format()
+- uint GetRGBAFloat16Format()
+- uint GetRGBAFloat32Format()
+- uint GetRG16Format()
+- uint GetRGFloat16Format()
+- uint GetRGFloat32Format()
+- uint GetFloat16Format()
+- uint GetFloat32Format()
 - uint GetDepthStencilFormat()
 - uint GetDepthStencilFormat()
+- uint GetFormat(const String&)
 - void DelayedExecute(float, bool, const String&, const Variant[]@)
 - void DelayedExecute(float, bool, const String&, const Variant[]@)
 - void DelayedExecute(float, bool, const String&)
 - void DelayedExecute(float, bool, const String&)
 - void ClearDelayedExecute(const String& arg0 = String ( ))
 - void ClearDelayedExecute(const String& arg0 = String ( ))
@@ -1689,7 +1697,7 @@ Properties:<br>
 - Color borderColor
 - Color borderColor
 - Texture@ backupTexture
 - Texture@ backupTexture
 - bool dataLost (readonly)
 - bool dataLost (readonly)
-- RenderSurface@[] renderSurface (readonly)
+- RenderSurface@[] renderSurfaces (readonly)
 
 
 
 
 BiasParameters
 BiasParameters

+ 10 - 2
Engine/Engine/GraphicsAPI.cpp

@@ -275,15 +275,23 @@ static void RegisterTextures(asIScriptEngine* engine)
     RegisterTexture<TextureCube>(engine, "TextureCube");
     RegisterTexture<TextureCube>(engine, "TextureCube");
     engine->RegisterObjectMethod("TextureCube", "bool SetSize(int, uint, TextureUsage usage = TEXTURE_STATIC)", asMETHOD(TextureCube, SetSize), asCALL_THISCALL);
     engine->RegisterObjectMethod("TextureCube", "bool SetSize(int, uint, TextureUsage usage = TEXTURE_STATIC)", asMETHOD(TextureCube, SetSize), asCALL_THISCALL);
     engine->RegisterObjectMethod("TextureCube", "bool Load(CubeMapFace, Image@+, bool useAlpha = false)", asFUNCTION(TextureCubeLoad), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("TextureCube", "bool Load(CubeMapFace, Image@+, bool useAlpha = false)", asFUNCTION(TextureCubeLoad), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod("TextureCube", "RenderSurface@+ get_renderSurface(CubeMapFace) const", asMETHOD(TextureCube, GetRenderSurface), asCALL_THISCALL);
+    engine->RegisterObjectMethod("TextureCube", "RenderSurface@+ get_renderSurfaces(CubeMapFace) const", asMETHOD(TextureCube, GetRenderSurface), asCALL_THISCALL);
     
     
     engine->RegisterGlobalFunction("uint GetAlphaFormat()", asFUNCTION(Graphics::GetAlphaFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetAlphaFormat()", asFUNCTION(Graphics::GetAlphaFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetLuminanceFormat()", asFUNCTION(Graphics::GetLuminanceFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetLuminanceFormat()", asFUNCTION(Graphics::GetLuminanceFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetLuminanceAlphaFormat()", asFUNCTION(Graphics::GetLuminanceAlphaFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetLuminanceAlphaFormat()", asFUNCTION(Graphics::GetLuminanceAlphaFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetRGBFormat()", asFUNCTION(Graphics::GetRGBFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetRGBFormat()", asFUNCTION(Graphics::GetRGBFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetRGBAFormat()", asFUNCTION(Graphics::GetRGBAFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetRGBAFormat()", asFUNCTION(Graphics::GetRGBAFormat), asCALL_CDECL);
-    engine->RegisterGlobalFunction("uint GetFloatFormat()", asFUNCTION(Graphics::GetFloatFormat), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetRGBA16Format()", asFUNCTION(Graphics::GetRGBA16Format), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetRGBAFloat16Format()", asFUNCTION(Graphics::GetRGBAFloat16Format), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetRGBAFloat32Format()", asFUNCTION(Graphics::GetRGBAFloat32Format), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetRG16Format()", asFUNCTION(Graphics::GetRG16Format), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetRGFloat16Format()", asFUNCTION(Graphics::GetRGFloat16Format), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetRGFloat32Format()", asFUNCTION(Graphics::GetRGFloat32Format), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetFloat16Format()", asFUNCTION(Graphics::GetFloat16Format), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetFloat32Format()", asFUNCTION(Graphics::GetFloat32Format), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetDepthStencilFormat()", asFUNCTION(Graphics::GetDepthStencilFormat), asCALL_CDECL);
     engine->RegisterGlobalFunction("uint GetDepthStencilFormat()", asFUNCTION(Graphics::GetDepthStencilFormat), asCALL_CDECL);
+    engine->RegisterGlobalFunction("uint GetFormat(const String&in)", asFUNCTIONPR(Graphics::GetFormat, (const String&), unsigned), asCALL_CDECL);
 }
 }
 
 
 static Material* MaterialClone(const String& cloneName, Material* ptr)
 static Material* MaterialClone(const String& cloneName, Material* ptr)

+ 72 - 1
Engine/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -1935,7 +1935,42 @@ unsigned Graphics::GetRGBAFormat()
     return D3DFMT_A8R8G8B8;
     return D3DFMT_A8R8G8B8;
 }
 }
 
 
-unsigned Graphics::GetFloatFormat()
+unsigned Graphics::GetRGBA16Format()
+{
+    return D3DFMT_A16B16G16R16;
+}
+
+unsigned Graphics::GetRGBAFloat16Format()
+{
+    return D3DFMT_A16B16G16R16F;
+}
+
+unsigned Graphics::GetRGBAFloat32Format()
+{
+    return D3DFMT_A32B32G32R32F;
+}
+
+unsigned Graphics::GetRG16Format()
+{
+    return D3DFMT_G16R16;
+}
+
+unsigned Graphics::GetRGFloat16Format()
+{
+    return D3DFMT_G16R16F;
+}
+
+unsigned Graphics::GetRGFloat32Format()
+{
+    return D3DFMT_G32R32F;
+}
+
+unsigned Graphics::GetFloat16Format()
+{
+    return D3DFMT_R16F;
+}
+
+unsigned Graphics::GetFloat32Format()
 {
 {
     return D3DFMT_R32F;
     return D3DFMT_R32F;
 }
 }
@@ -1950,6 +1985,42 @@ unsigned Graphics::GetDepthStencilFormat()
     return depthStencilFormat;
     return depthStencilFormat;
 }
 }
 
 
+unsigned Graphics::GetFormat(const String& formatName)
+{
+    String nameLower = formatName.ToLower().Trimmed();
+    
+    if (nameLower == "a")
+        return GetAlphaFormat();
+    if (nameLower == "l")
+        return GetLuminanceFormat();
+    if (nameLower == "la")
+        return GetLuminanceAlphaFormat();
+    if (nameLower == "rgb")
+        return GetRGBFormat();
+    if (nameLower == "rgba")
+        return GetRGBAFormat();
+    if (nameLower == "rgba16")
+        return GetRGBA16Format();
+    if (nameLower == "rgba16f")
+        return GetRGBAFloat16Format();
+    if (nameLower == "rgba32f")
+        return GetRGBAFloat32Format();
+    if (nameLower == "rg16")
+        return GetRG16Format();
+    if (nameLower == "rg16f")
+        return GetRGFloat16Format();
+    if (nameLower == "rg32f")
+        return GetRGFloat32Format();
+    if (nameLower == "r16f")
+        return GetFloat16Format();
+    if (nameLower == "r32f" || nameLower == "float")
+        return GetFloat32Format();
+    if (nameLower == "d24s8")
+        return GetDepthStencilFormat();
+    
+    return GetRGBFormat();
+}
+
 bool Graphics::OpenWindow(int width, int height)
 bool Graphics::OpenWindow(int width, int height)
 {
 {
     if (!externalWindow_)
     if (!externalWindow_)

+ 18 - 2
Engine/Graphics/Direct3D9/D3D9Graphics.h

@@ -339,12 +339,28 @@ public:
     static unsigned GetRGBFormat();
     static unsigned GetRGBFormat();
     /// Return the API-specific RGBA texture format.
     /// Return the API-specific RGBA texture format.
     static unsigned GetRGBAFormat();
     static unsigned GetRGBAFormat();
-    /// Return the API-specific single channel float texture format.
-    static unsigned GetFloatFormat();
+    /// Return the API-specific RGBA 16-bit texture format.
+    static unsigned GetRGBA16Format();
+    /// Return the API-specific RGBA 16-bit float texture format.
+    static unsigned GetRGBAFloat16Format();
+    /// Return the API-specific RGBA 32-bit float texture format.
+    static unsigned GetRGBAFloat32Format();
+    /// Return the API-specific RG 16-bit texture format.
+    static unsigned GetRG16Format();
+    /// Return the API-specific RG 16-bit float texture format.
+    static unsigned GetRGFloat16Format();
+    /// Return the API-specific RG 32-bit float texture format.
+    static unsigned GetRGFloat32Format();
+    /// Return the API-specific single channel 16-bit float texture format.
+    static unsigned GetFloat16Format();
+    /// Return the API-specific single channel 32-bit float texture format.
+    static unsigned GetFloat32Format();
     /// Return the API-specific linear depth texture format.
     /// Return the API-specific linear depth texture format.
     static unsigned GetLinearDepthFormat();
     static unsigned GetLinearDepthFormat();
     /// Return the API-specific hardware depth-stencil texture format.
     /// Return the API-specific hardware depth-stencil texture format.
     static unsigned GetDepthStencilFormat();
     static unsigned GetDepthStencilFormat();
+    /// Return the API-specific texture format from a textual description, for example "rgb".
+    static unsigned GetFormat(const String& formatName);
     
     
 private:
 private:
     /// Create the application window.
     /// Create the application window.

+ 11 - 0
Engine/Graphics/Direct3D9/D3D9Texture.cpp

@@ -159,6 +159,7 @@ unsigned Texture::GetRowDataSize(int width) const
     case D3DFMT_R5G6B5:
     case D3DFMT_R5G6B5:
     case D3DFMT_A4R4G4B4:
     case D3DFMT_A4R4G4B4:
     case D3DFMT_A8L8:
     case D3DFMT_A8L8:
+    case D3DFMT_R16F:
         return width * 2;
         return width * 2;
 
 
     case D3DFMT_X8R8G8B8:
     case D3DFMT_X8R8G8B8:
@@ -166,10 +167,20 @@ unsigned Texture::GetRowDataSize(int width) const
         return width * 3;
         return width * 3;
 
 
     case D3DFMT_A8R8G8B8:
     case D3DFMT_A8R8G8B8:
+    case D3DFMT_G16R16:
     case D3DFMT_R32F:
     case D3DFMT_R32F:
+    case D3DFMT_G16R16F:
     case D3DFMT_D24S8:
     case D3DFMT_D24S8:
+    case D3DFMT_D32:
         return width * 4;
         return width * 4;
         
         
+    case D3DFMT_A16B16G16R16:
+    case D3DFMT_A16B16G16R16F:
+        return width * 8;
+        
+    case D3DFMT_A32B32G32R32F:
+        return width * 16;
+        
     case D3DFMT_DXT1:
     case D3DFMT_DXT1:
         return ((width + 3) >> 2) * 8;
         return ((width + 3) >> 2) * 8;
         
         

+ 96 - 1
Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -1993,7 +1993,66 @@ unsigned Graphics::GetRGBAFormat()
     return GL_RGBA;
     return GL_RGBA;
 }
 }
 
 
-unsigned Graphics::GetFloatFormat()
+unsigned Graphics::GetRGBA16Format()
+{
+    return GL_RGBA16;
+}
+
+unsigned Graphics::GetRGBAFloat16Format()
+{
+    #ifndef GL_ES_VERSION_2_0
+    return GL_RGBA16F_ARB;
+    #else
+    return GL_RGBA16;
+    #endif
+}
+
+unsigned Graphics::GetRGBAFloat32Format()
+{
+    #ifndef GL_ES_VERSION_2_0
+    return GL_RGBA32F_ARB;
+    #else
+    return GL_RGBA16;
+    #endif
+}
+
+unsigned Graphics::GetRG16Format()
+{
+    #ifndef GL_ES_VERSION_2_0
+    return GL_RG16;
+    #else
+    return 0;
+    #endif
+}
+
+unsigned Graphics::GetRGFloat16Format()
+{
+    #ifndef GL_ES_VERSION_2_0
+    return GL_RG16F;
+    #else
+    return 0;
+    #endif
+}
+
+unsigned Graphics::GetRGFloat32Format()
+{
+    #ifndef GL_ES_VERSION_2_0
+    return GL_RG32F;
+    #else
+    return 0;
+    #endif
+}
+
+unsigned Graphics::GetFloat16Format()
+{
+    #ifndef GL_ES_VERSION_2_0
+    return GL_LUMINANCE16F_ARB;
+    #else
+    return GL_LUMINANCE;
+    #endif
+}
+
+unsigned Graphics::GetFloat32Format()
 {
 {
     #ifndef GL_ES_VERSION_2_0
     #ifndef GL_ES_VERSION_2_0
     return GL_LUMINANCE32F_ARB;
     return GL_LUMINANCE32F_ARB;
@@ -2018,6 +2077,42 @@ unsigned Graphics::GetDepthStencilFormat()
     #endif
     #endif
 }
 }
 
 
+unsigned Graphics::GetFormat(const String& formatName)
+{
+    String nameLower = formatName.ToLower().Trimmed();
+    
+    if (nameLower == "a")
+        return GetAlphaFormat();
+    if (nameLower == "l")
+        return GetLuminanceFormat();
+    if (nameLower == "la")
+        return GetLuminanceAlphaFormat();
+    if (nameLower == "rgb")
+        return GetRGBFormat();
+    if (nameLower == "rgba")
+        return GetRGBAFormat();
+    if (nameLower == "rgba16")
+        return GetRGBA16Format();
+    if (nameLower == "rgba16f")
+        return GetRGBAFloat16Format();
+    if (nameLower == "rgba32f")
+        return GetRGBAFloat32Format();
+    if (nameLower == "rg16")
+        return GetRG16Format();
+    if (nameLower == "rg16f")
+        return GetRGFloat16Format();
+    if (nameLower == "rg32f")
+        return GetRGFloat32Format();
+    if (nameLower == "r16f")
+        return GetFloat16Format();
+    if (nameLower == "r32f" || nameLower == "float")
+        return GetFloat32Format();
+    if (nameLower == "d24s8")
+        return GetDepthStencilFormat();
+    
+    return GetRGBFormat();
+}
+
 void Graphics::CheckFeatureSupport()
 void Graphics::CheckFeatureSupport()
 {
 {
     // Check supported features: light pre-pass, deferred rendering and hardware depth texture
     // Check supported features: light pre-pass, deferred rendering and hardware depth texture

+ 18 - 2
Engine/Graphics/OpenGL/OGLGraphics.h

@@ -358,12 +358,28 @@ public:
     static unsigned GetRGBFormat();
     static unsigned GetRGBFormat();
     /// Return the API-specific RGBA texture format.
     /// Return the API-specific RGBA texture format.
     static unsigned GetRGBAFormat();
     static unsigned GetRGBAFormat();
-    /// Return the API-specific single channel float texture format.
-    static unsigned GetFloatFormat();
+    /// Return the API-specific RGBA 16-bit texture format.
+    static unsigned GetRGBA16Format();
+    /// Return the API-specific RGBA 16-bit float texture format.
+    static unsigned GetRGBAFloat16Format();
+    /// Return the API-specific RGBA 32-bit float texture format.
+    static unsigned GetRGBAFloat32Format();
+    /// Return the API-specific RG 16-bit texture format.
+    static unsigned GetRG16Format();
+    /// Return the API-specific RG 16-bit float texture format.
+    static unsigned GetRGFloat16Format();
+    /// Return the API-specific RG 32-bit float texture format.
+    static unsigned GetRGFloat32Format();
+    /// Return the API-specific single channel 16-bit float texture format.
+    static unsigned GetFloat16Format();
+    /// Return the API-specific single channel 32-bit float texture format.
+    static unsigned GetFloat32Format();
     /// Return the API-specific linear depth texture format.
     /// Return the API-specific linear depth texture format.
     static unsigned GetLinearDepthFormat();
     static unsigned GetLinearDepthFormat();
     /// Return the API-specific hardware depth-stencil texture format.
     /// Return the API-specific hardware depth-stencil texture format.
     static unsigned GetDepthStencilFormat();
     static unsigned GetDepthStencilFormat();
+    /// Return the API-specific texture format from a textual description, for example "rgb".
+    static unsigned GetFormat(const String& formatName);
     
     
 private:
 private:
     /// Check supported rendering features.
     /// Check supported rendering features.

+ 26 - 3
Engine/Graphics/OpenGL/OGLTexture.cpp

@@ -261,11 +261,22 @@ unsigned Texture::GetRowDataSize(int width) const
         
         
     case GL_RGBA:
     case GL_RGBA:
     #ifndef GL_ES_VERSION_2_0
     #ifndef GL_ES_VERSION_2_0
+    case GL_LUMINANCE16F_ARB:
     case GL_LUMINANCE32F_ARB:
     case GL_LUMINANCE32F_ARB:
     case GL_DEPTH24_STENCIL8_EXT:
     case GL_DEPTH24_STENCIL8_EXT:
+    case GL_RG16:
     #endif
     #endif
         return width * 4;
         return width * 4;
         
         
+    case GL_RGBA16:
+        return width * 8;
+        
+    #ifndef GL_ES_VERSION_2_0
+    case GL_RGBA16F_ARB:
+    case GL_RGBA32F_ARB:
+        return width * 16;
+    #endif
+    
     case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
     case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
         return ((width + 3) >> 2) * 8;
         return ((width + 3) >> 2) * 8;
         
         
@@ -299,12 +310,19 @@ unsigned Texture::GetExternalFormat(unsigned format)
         return GL_DEPTH_COMPONENT;
         return GL_DEPTH_COMPONENT;
     else if (format == GL_DEPTH24_STENCIL8_EXT)
     else if (format == GL_DEPTH24_STENCIL8_EXT)
         return GL_DEPTH_STENCIL_EXT;
         return GL_DEPTH_STENCIL_EXT;
-    else if (format == GL_LUMINANCE32F_ARB)
+    else if (format == GL_LUMINANCE16F_ARB || format == GL_LUMINANCE32F_ARB)
         return GL_LUMINANCE;
         return GL_LUMINANCE;
+    else if (format == GL_RG16 || format == GL_RG16F || format == GL_RG32F)
+        return GL_RG;
+    else if (format == GL_RGBA16 || format == GL_RGBA16F_ARB || format == GL_RGBA32F_ARB)
+        return GL_RGBA;
     else
     else
         return format;
         return format;
     #else
     #else
-    return format;
+    if (format == GL_RGBA16)
+        return GL_RGBA;
+    else
+        return format;
     #endif
     #endif
 }
 }
 
 
@@ -313,12 +331,17 @@ unsigned Texture::GetDataType(unsigned format)
     #ifndef GL_ES_VERSION_2_0
     #ifndef GL_ES_VERSION_2_0
     if (format == GL_DEPTH24_STENCIL8_EXT)
     if (format == GL_DEPTH24_STENCIL8_EXT)
         return GL_UNSIGNED_INT_24_8_EXT;
         return GL_UNSIGNED_INT_24_8_EXT;
+    else if (format == GL_RG16 || format == GL_RGBA16)
+        return GL_UNSIGNED_SHORT;
+    else if (format == GL_LUMINANCE16F_ARB || format == GL_LUMINANCE32F_ARB || format == GL_RGBA16F_ARB ||
+        format == GL_RGBA32F_ARB)
+        return GL_FLOAT;
     else
     else
         return GL_UNSIGNED_BYTE;
         return GL_UNSIGNED_BYTE;
     #else
     #else
     if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_COMPONENT24_OES)
     if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_COMPONENT24_OES)
         return GL_UNSIGNED_INT;
         return GL_UNSIGNED_INT;
-    else if (format == GL_DEPTH_COMPONENT16)
+    else if (format == GL_DEPTH_COMPONENT16 || format == GL_RGBA16)
         return GL_UNSIGNED_SHORT;
         return GL_UNSIGNED_SHORT;
     else
     else
         return GL_UNSIGNED_BYTE;
         return GL_UNSIGNED_BYTE;

+ 2 - 6
Engine/Graphics/PostProcess.cpp

@@ -130,12 +130,8 @@ bool PostProcess::LoadParameters(XMLFile* file)
     {
     {
         String name = rtElem.GetAttribute("name");
         String name = rtElem.GetAttribute("name");
         
         
-        unsigned format = Graphics::GetRGBFormat();
-        String formatName = rtElem.GetAttributeLower("format");
-        if (formatName == "rgba")
-            format = Graphics::GetRGBAFormat();
-        else if (formatName == "float")
-            format = Graphics::GetFloatFormat();
+        String formatName = rtElem.GetAttribute("format");
+        unsigned format = Graphics::GetFormat(formatName);
         
         
         bool sizeDivisor = false;
         bool sizeDivisor = false;
         bool filtered = false;
         bool filtered = false;

+ 30 - 0
ThirdParty/GLee/GLee.h

@@ -2216,6 +2216,36 @@ GLEE_EXTERN GLboolean _GLEE_EXT_texture_filter_anisotropic;
 #define GL_LUMINANCE16F_ARB                                0x881E
 #define GL_LUMINANCE16F_ARB                                0x881E
 #endif
 #endif
 
 
+/* GL_ARB_texture_rg */
+
+#ifndef GL_ARB_texture_rg
+#define GL_ARB_texture_rg 1
+#define __GLEE_GL_ARB_texture_rg 1
+/* Constants */
+#define GL_RG                                              0x8227
+#define GL_RG_INTEGER                                      0x8228
+#define GL_R8                                              0x8229
+#define GL_R16                                             0x822A
+#define GL_RG8                                             0x822B
+#define GL_RG16                                            0x822C
+#define GL_R16F                                            0x822D
+#define GL_R32F                                            0x822E
+#define GL_RG16F                                           0x822F
+#define GL_RG32F                                           0x8230
+#define GL_R8I                                             0x8231
+#define GL_R8UI                                            0x8232
+#define GL_R16I                                            0x8233
+#define GL_R16UI                                           0x8234
+#define GL_R32I                                            0x8235
+#define GL_R32UI                                           0x8236
+#define GL_RG8I                                            0x8237
+#define GL_RG8UI                                           0x8238
+#define GL_RG16I                                           0x8239
+#define GL_RG16UI                                          0x823A
+#define GL_RG32I                                           0x823B
+#define GL_RG32UI                                          0x823C
+#endif 
+
 /*****************************************************************
 /*****************************************************************
  * GLee functions
  * GLee functions
  *****************************************************************/
  *****************************************************************/