1Name 2 3 EXT_texture_rg 4 5Name Strings 6 7 GL_EXT_texture_rg 8 9Contributors 10 11 Contributors to ARB_texture_rg, on which this extension is based 12 Kyle Haughey 13 Richard Schreyer 14 15Contact 16 17 Benj Lipchak, Apple (lipchak 'at' apple.com) 18 19Status 20 21 Complete 22 23Version 24 25 Date: July 22, 2011 26 Revision: 3 27 28Number 29 30 OpenGL ES Extension #103 31 32Dependencies 33 34 Requires OpenGL ES 2.0. 35 36 Written based on the wording of the OpenGL ES 2.0.25 Full Specification 37 (November 2, 2010). 38 39 OES_texture_float affects the definition of this extension. 40 41 OES_texture_half_float affects the definition of this extension. 42 43 APPLE_framebuffer_multisample affects the definition of this extension. 44 45Overview 46 47 Historically one- and two-component textures have been specified in OpenGL 48 ES using the luminance or luminance-alpha (L/LA) formats. With the advent 49 of programmable shaders and render-to-texture capabilities these legacy 50 formats carry some historical artifacts which are no longer useful. 51 52 For example, when sampling from such textures, the luminance values are 53 replicated across the color components. This is no longer necessary with 54 programmable shaders. 55 56 It is also desirable to be able to render to one- and two-component format 57 textures using capabilities such as framebuffer objects (FBO), but 58 rendering to L/LA formats is under-specified (specifically how to map 59 R/G/B/A values to L/A texture channels). 60 61 This extension adds new base internal formats for one-component RED and 62 two-component RG (red green) textures as well as sized RED and RG internal 63 formats for renderbuffers. The RED and RG texture formats can be used for 64 both texturing and rendering into with framebuffer objects. 65 66New Procedures and Functions 67 68 None 69 70New Tokens 71 72 Accepted by the <internalformat> parameter of TexImage2D and CopyTexImage2D, 73 and the <format> parameter of TexImage2D, TexSubImage2D, and ReadPixels: 74 75 RED_EXT 0x1903 76 RG_EXT 0x8227 77 78 Accepted by the <internalformat> parameter of RenderbufferStorage and 79 RenderbufferStorageMultisampleAPPLE: 80 81 R8_EXT 0x8229 82 RG8_EXT 0x822B 83 84Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL ES Operation) 85 86 None 87 88Additions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization) 89 90 (Add the following to Table 3.3: "TexImage2D and ReadPixels formats") 91 92 Format Name Element Meaning and Order Target Buffer 93 ----------- ------------------------- ------------- 94 RED_EXT R Color 95 RG_EXT R, G Color 96 97 (Add the following to Table 3.4: "Valid pixel format and type combinations") 98 (as modified by OES_texture_float and OES_texture_half_float) 99 100 Format Type Bytes per Pixel 101 ----------- ------------------------- --------------- 102 RED_EXT FLOAT 4 103 RED_EXT HALF_FLOAT_OES 2 104 RED_EXT UNSIGNED_BYTE 1 105 RG_EXT FLOAT 8 106 RG_EXT HALF_FLOAT_OES 4 107 RG_EXT UNSIGNED_BYTE 2 108 109 (Add the following to Table 3.8: "Conversion from RGBA and depth pixel 110 components to internal texture") 111 112 Base Internal Format RGBA Internal Components 113 -------------------- ------ ------------------- 114 RED_EXT R R 115 RG_EXT R,G R,G 116 117 (Modify Table 3.9: "CopyTexImage internal format/color buffer combinations") 118 119 Texture Format 120 Color Buffer A L LA R RG RGB RGBA 121 ------------ - - -- - -- --- ---- 122 A X 123 R X X 124 RG X X X 125 RGB X X X X 126 RGBA X X X X X X X 127 128 (Add the following to Table 3.12: "Correspondence of filtered texture 129 components to texture source color components") 130 131 Texture Base Texture source color 132 Internal Format C_s A_s 133 --------------- ------------- ------ 134 RED_EXT (R_t, 0, 0) 1 135 RG_EXT (R_t, G_t, 0) 1 136 137Additions to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment 138Operations and the Framebuffer) 139 140 In section 4.3.1 "Reading Pixels", subsection "Obtaining Pixels from the 141 Framebuffer", modify the last sentence to read: 142 143 "If the framebuffer does not support G, B, or A values then the G, B, and A 144 values that are obtained are 0.0, 0.0, and 1.0 respectively." 145 146 In section 4.4.5 "Framebuffer Completeness", modify the last sentence of 147 the second paragraph to read: 148 149 "Color-renderable formats contain red, and possibly green, blue, and alpha 150 components; depth-renderable formats contain depth components; and 151 stencil-renderable formats contain stencil components." 152 153 (Add the following to Table 4.5: "Renderbuffer image formats, showing their 154 renderable type (color-, depth-, or stencil-renderable) and the number of 155 bits each format contains for color (R, G, B, A), depth (D), and stencil 156 (S) components") 157 158 Sized Internal Renderable Type R bits G bits B bits A bits D bits S bits 159 Format 160 -------------- ---------------- ------ ------ ------ ------ ------ ------ 161 R8_EXT color-renderable 8 162 RG8_EXT color-renderable 8 8 163 164Additions to Chapter 5 of the OpenGL ES 2.0 Specification (Special Functions) 165 166 None 167 168Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State 169Requests) 170 171 None 172 173Dependencies on OES_texture_float 174 175 If OES_texture_float is not supported, then omit the rows of 176 Table 3.4 that have Type FLOAT. 177 178Dependencies on OES_texture_half_float 179 180 If OES_texture_half_float is not supported, then omit the rows of 181 Table 3.4 that have Type HALF_FLOAT_OES. 182 183Dependencies on APPLE_framebuffer_multisample 184 185 If APPLE_framebuffer_multisample is not supported, then all references to 186 RenderbufferStorageMultisampleAPPLE should be ignored. 187 188Revision History 189 190 #1 February 22, 2011, khaughey 191 - initial version adapted from ARB_texture_rg. 192 #2 June 16, 2011, benj 193 - add interaction with APPLE_framebuffer_multisample 194 #3 July 22, 2011, benj 195 - rename from APPLE to EXT 196