1Name 2 3 NV_render_texture_rectangle 4 5Name Strings 6 7 WGL_NV_render_texture_rectangle 8 9Contact 10 11 Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com) 12 13Notice 14 15 Copyright NVIDIA Corporation, 2001, 2002. 16 17Status 18 19 Shipping, March 2002. 20 21Version 22 23 Last Modified Date: 2003/01/08 24 NVIDIA Revision: 7 25 26Number 27 28 264 29 30Dependencies 31 32 OpenGL 1.1 is required. 33 34 WGL_ARB_render_texture is required. 35 36 GL_NV_texture_rectangle is required. 37 38 The extension is written against the OpenGL 1.2.1 Specification. 39 40Overview 41 42 This extension allows a color buffer with non-power-of-two dimensions to 43 be used for both rendering and texturing. It is built upon the 44 ARB_render_texture extension; the only addition in this extension is the 45 ability to bind a texture to a texture rectangle target, as provided 46 through the NV_texture_rectangle extension. 47 48Issues 49 50 What is the interaction of this spec and the WGL_MIPMAP_TEXTURE_ARB 51 attribute? 52 53 RESOLVED: NV_texture_rectangle doesn't support mipmaps, so it's kind of 54 stupid to allocate them. Trying will result in an error. 55 56 Should there be separate pixel format attributes for 57 BIND_TO_TEXTURE_RECTANGLE_RGB and RGBA? Or is a simple 58 BIND_TO_TEXTURE_RECTANGLE attribute sufficient? 59 60 RESOLVED: Separate capabilities. There may be pixel formats where 61 rendered texture rectangles are supported, but conventional textures are 62 not. If a single BIND_TO_TEXTURE_RECTANGLE attribute were used, there 63 would be no cue for RGB/RGBA binding support, and the existing 64 attributes would signal the ability to render to conventional textures. 65 66 Alternately, pixel formats could be constrained so that the only 67 render-texture capable formats are those that support all allowable 68 targets. 69 70Implementation Notes 71 72 None. 73 74New Procedures and Functions 75 76 None. 77 78New Tokens 79 80 Accepted by the <piAttributes> parameter of wglGetPixelFormatAttribivARB, 81 wglGetPixelFormatAttribfvARB, and the <piAttribIList> and <pfAttribIList> 82 parameters of wglChoosePixelFormatARB: 83 84 WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 85 WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 86 87 Accepted as a value in the <piAttribList> parameter of wglCreatePbufferARB 88 and returned in the value parameter of wglQueryPbufferARB when 89 <iAttribute> is WGL_TEXTURE_TARGET_ARB: 90 91 WGL_TEXTURE_RECTANGLE_NV 0x20A2 92 93Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) 94 95 None. 96 97Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 98 99 None. 100 101Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 102Operations and the Frame Buffer) 103 104 None. 105 106Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 107 108 None. 109 110Additions to Chapter 6 of the OpenGL 1.2.1 Specification (State and State 111Requests) 112 113 None. 114 115Additions to the WGL Specification 116 117 First, close your eyes and pretend that a WGL specification actually 118 existed. Maybe if we all concentrate hard enough, one will magically 119 appear. 120 121 These modifications are relative to the ARB_render_texture spec. 122 123 Add to the description of <piAttributes> in wglGetPixelFormatAttribivARB 124 and <pfAttributes> in wglGetPixelFormatfv: 125 126 WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 127 WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 128 129 True if the color buffers can be bound as RGB/RGBA textures using the 130 texture rectangle target. Currently only pbuffers can be bound as 131 textures so this attribute will only be TRUE if WGL_DRAW_TO_PBUFFER is 132 also TRUE. It is possible to bind a RGBA visual to a RGB texture in 133 which case the values in the alpha component of the visual are ignored 134 when the color buffer is used as a RGB texture. 135 136 Add new table entries to match criteria in description of 137 wglChoosePixelFormatARB: 138 139 Attribute Type Match Criteria 140 141 WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV boolean exact 142 WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV boolean exact 143 144 Modify wglCreatePbufferARB: 145 146 The following attributes are supported by wglCreatePbufferARB: 147 148 ... 149 150 WGL_TEXTURE_TARGET_ARB 151 152 This attribute indicates the target for the texture that will be 153 created when the pbuffer is created with a texture format other than 154 WGL_NO_TEXTURE_ARB. This attribute can be set to WGL_NO_TEXTURE_ARB, 155 WGL_TEXTURE_1D_ARB, WGL_TEXTURE_2D_ARB, WGL_TEXTURE_CUBE_MAP_ARB, or 156 WGL_TEXTURE_RECTANGLE_NV. The default value is WGL_NO_TEXTURE_ARB. 157 158 (Modify power-of-two error for wglCreatePbufferARB) 159 160 ERROR_INVALID_DATA The pixel format attribute 161 WGL_TEXTURE_TARGET_ARB is WGL_TEXTURE_1D_ARB, 162 WGL_TEXTURE_2D_ARB, or 163 WGL_TEXTURE_CUBE_MAP_ARB, and WGL_PBUFFER_WIDTH 164 and/or WGL_PBUFFER_HEIGHT is not a power of 165 two. 166 167 (Add new wglCreatePbufferARB error) 168 169 ERROR_INVALID_DATA WGL_TEXTURE_TARGET_ARB is 170 WGL_TEXTURE_RECTANGLE_NV 171 and WGL_MIPMAP_TEXTURE_ARB is non-zero. 172 173 (Add wglCreatePbufferARB errors missing from the ARB_render_texture spec) 174 175 ERROR_INVALID_DATA WGL_TEXTURE_FORMAT_ARB is WGL_TEXTURE_RGB_NV, 176 WGL_TEXTURE_TARGET_ARB is 177 WGL_TEXTURE_RECTANGLE_NV, and the 178 WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV attribute 179 is not set in the pixel format. 180 181 ERROR_INVALID_DATA WGL_TEXTURE_FORMAT_ARB is WGL_TEXTURE_RGB_NV, 182 WGL_TEXTURE_TARGET_ARB is not 183 WGL_TEXTURE_RECTANGLE_NV, and the 184 WGL_BIND_TO_TEXTURE_RGB_NV attribute is not set 185 in the pixel format. 186 187 ERROR_INVALID_DATA WGL_TEXTURE_FORMAT_ARB is WGL_TEXTURE_RGBA_NV, 188 WGL_TEXTURE_TARGET_ARB is 189 WGL_TEXTURE_RECTANGLE_NV, and the 190 WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV attribute 191 is not set in the pixel format. 192 193 ERROR_INVALID_DATA WGL_TEXTURE_FORMAT_ARB is WGL_TEXTURE_RGBA_NV, 194 WGL_TEXTURE_TARGET_ARB is not 195 WGL_TEXTURE_RECTANGLE_NV, and the 196 WGL_BIND_TO_TEXTURE_RGBA_NV attribute is not 197 set in the pixel format. 198 199 Modify wglBindTexImageARB (only adding verbiage for supporting texture 200 rectangles): 201 202 The command 203 204 BOOL wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer) 205 206 defines a one-dimensional texture image, a two-dimensional 207 texture image, a two-dimensional texture rectangle image, or a set of 208 two-dimensional cube map texture images... 209 210 The texture targets are derived... If the texture target is 211 WGL_TEXTURE_2D_ARB, then <iBuffer> defines a 2D texture for the 212 current 2D texture object. If the texture target is 213 WGL_TEXTURE_RECTANGLE_NV, then <iBuffer> defines a texture rectangle 214 for the current texture rectangle object. If the texture target is 215 WGL_TEXTURE_1D_ARB, then <iBuffer> defines a 1D texture for the 216 current 1D texture object. 217 218 219New State 220 221 None 222 223Revision History 224 225 None 226