• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3     ARB_texture_rectangle
4
5Name Strings
6
7     GL_ARB_texture_rectangle
8
9Contributors
10
11     Pat Brown
12     Daniel Ginsburg
13     Michael Gold
14     Mark J. Kilgard
15     Jon Leech
16     Bill Licea-Kane
17     Barthold Lichtenbelt
18     Benjamin Lipchak
19     Brian Paul
20     John Rosasco
21     Jeremy Sandmel
22     Geoff Stahl
23
24Contact
25
26     Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com)
27     Geoff Stahl, Apple Computer (gstahl 'at' apple.com)
28
29Notice
30
31    Copyright (c) 2004-2013 The Khronos Group Inc. Copyright terms at
32        http://www.khronos.org/registry/speccopyright.html
33
34Specification Update Policy
35
36    Khronos-approved extension specifications are updated in response to
37    issues and bugs prioritized by the Khronos OpenGL Working Group. For
38    extensions which have been promoted to a core Specification, fixes will
39    first appear in the latest version of that core Specification, and will
40    eventually be backported to the extension document. This policy is
41    described in more detail at
42        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
43
44Status
45
46     Complete. Approved by the ARB on June 8, 2004.
47
48     Amended language re-voted by the ARB on November 3, 2005.
49
50     Functionally identical to EXT_texture_rectangle and
51     NV_texture_rectangle extensions currently shipping, except for
52     the additions to the OpenGL Shading Language.
53
54Version
55
56     Date: October 4, 2005
57     Revision: 1.21
58
59Number
60
61     ARB Extension #38
62
63Dependencies
64
65     OpenGL 1.1 is required
66
67     OpenGL 1.4 (or ARB_texture_mirrored_repeat) affects the definition
68     of this extension.
69
70     ARB_texture_non_power_of_two trivially affects the definition of
71     this extension.
72
73     ATI_texture_mirror_once affects the definition of this extension.
74
75     EXT_paletted_texture affects the definition of this extension.
76
77     EXT_texture_compression_s3tc affects the definition of this
78     extension.
79
80     EXT_texture_mirror_clamp affects the definition of this extension.
81
82     The OpenGL Shading Language specification (provided by OpenGL 2.0
83     and/or ARB_shader_objects) interacts with this extension.
84
85     This extension is written against the OpenGL 2.0 specification.
86
87Overview
88
89     OpenGL texturing is limited to images with power-of-two dimensions
90     and an optional 1-texel border.  The ARB_texture_rectangle extension
91     adds a new texture target that supports 2D textures without requiring
92     power-of-two dimensions.
93
94     Non-power-of-two sized (NPOTS) textures are useful for storing video
95     images that do not have power-of-two sized (POTS).  Re-sampling
96     artifacts are avoided and less texture memory may be required by
97     using non-power-of-two sized textures.  Non-power-of-two sized
98     textures are also useful for shadow maps and window-space texturing.
99
100     However, non-power-of-two sized textures have limitations that
101     do not apply to power-of-two sized textures.  NPOTS textures may
102     not use mipmap filtering; POTS textures support both mipmapped
103     and non-mipmapped filtering.  NPOTS textures support only the
104     GL_CLAMP, GL_CLAMP_TO_EDGE, and GL_CLAMP_TO_BORDER wrap modes;
105     POTS textures support GL_CLAMP_TO_EDGE, GL_REPEAT, GL_CLAMP,
106     GL_MIRRORED_REPEAT, and GL_CLAMP_TO_BORDER (and GL_MIRROR_CLAMP_ATI
107     and GL_MIRROR_CLAMP_TO_EDGE_ATI if ATI_texture_mirror_once is
108     supported) .  NPOTS textures do not support an optional 1-texel
109     border; POTS textures do support an optional 1-texel border.
110
111     NPOTS textures are accessed by dimension-dependent (aka
112     non-normalized) texture coordinates.  So instead of thinking of
113     the texture image lying in a [0..1]x[0..1] range, the NPOTS texture
114     image lies in a [0..w]x[0..h] range.
115
116     This extension adds a new texture target and related state (proxy,
117     binding, max texture size).
118
119Issues
120
121  1) Should rectangular textures simply be an extension to the 2D texture
122     target that allows non-power-of-two widths and heights?
123
124     No.  The rectangular texture is an entirely new texture target type
125     called GL_TEXTURE_RECTANGLE_ARB.  This is because while the texture
126     rectangle target relaxes the power-of-two dimensions requirements of
127     the texture 2D target, it also has limitations such as the absence of
128     both mipmapping and the GL_REPEAT and GL_MIRRORED_REPEAT wrap modes.
129     Additionally, rectangular textures do not use [0..1] normalized
130     texture coordinates.
131
132     The texture rectangle is an analogue to the pixel rectangle primitive
133     (see section 3.6 titled "Pixel Rectangles" in the core specification)
134     and the framebuffer.  Just as the pixel rectangle primitive and
135     the framebuffer are accessed by integer-ized dimension-dependent 2D
136     coordinates, so is the texture rectangle.  Just as pixel rectangles
137     and the framebuffer do not have mipmaps, nor do texture rectangles.
138
139  2) Should 1D, 2D, 3D, or cube map textures be allowed to be NPOTS by
140     this extension?
141
142     No.  The ARB_texture_non_power_of_two extension relaxes the
143     power-of-two restrictions for these conventional texture targets to
144     support NPOTS while maintaining the normalized texture coordinates.
145
146  3) How is the image of a rectangular texture specified?
147
148     Using the standard OpenGL API for specifying a 2D texture
149     image: glTexImage2D, glSubTexImage2D, glCopyTexImage2D,
150     and glCopySubTexImage2D.  The target for these commands is
151     GL_TEXTURE_RECTANGLE_ARB though.
152
153     This is similar to how the texture cube map functionality uses the 2D
154     texture image specification API though with its own texture target.
155
156     The texture target GL_TEXTURE_RECTANGLE_ARB should also
157     be used for glGetTexImage, glGetTexLevelParameteriv, and
158     glGetTexLevelParameterfv.
159
160  4) Should anything be said about performance?
161
162     No, but developers should not be surprised if conventional POTS
163     textures will render slightly faster than texture rectangle textures.
164     This is particularly likely to be true when texture rectangle
165     textures are minified leading to texture cache thrashing due to
166     lack of support for mipmaps.
167
168  5) Is mipmap filtering permitted?
169
170     Mipmap filtering is not permitted.  Since this is the case the
171     default minification filter for GL_TEXTURE_RECTANGLE_ARB targets is
172     GL_LINEAR.
173
174  6) What texture wrap modes are allowed and what is the default
175     state?
176
177     Only the GL_CLAMP, GL_CLAMP_TO_EDGE, and CLAMP_TO_BORDER
178     wrap modes are allowed.  CLAMP_TO_EDGE is the default state.
179     GL_REPEAT and GL_MIRRORED_REPEAT are not supported with the
180     GL_TEXTURE_RECTANGLE_ARB texture target.
181
182  7) Are texture borders supported?
183
184     Borders are not supported.
185
186  8) Are paletted textures supported?
187
188     Paletted rectangular textures are not supported.
189
190  9) Can compressed texture images be specified for a rectangular texture?
191
192     The generic texture compression internal formats introduced by
193     ARB_texture_compression are supported for rectangular textures
194     because the image is not presented as compressed data and the
195     ARB_texture_compression extension always permits generic texture
196     compression internal formats to be stored in uncompressed form.
197     Implementations are free to support generic compression internal
198     formats for rectangular textures if supported but such support is
199     not required.
200
201     This extensions makes a blanket statement that specific compressed
202     internal formats for use with glCompressedTexImage<n>D are NOT
203     supported for rectangular textures.  This is because several existing
204     hardware implementations of texture compression formats such as S3TC
205     are not designed for compressing rectangular textures.  This does
206     not preclude future texture compression extensions from supporting
207     compressed internal formats that do work with rectangular extensions
208     (by relaxing the current blanket error condition).
209
210 10) How are rectangular textures enabled?
211
212     Rectangular textures are enabled by enabling the
213     GL_TEXTURE_RECTANGLE_ARB texture target via glEnable
214     (GL_TEXTURE_RECTANGLE_ARB). This enable is prioritized above
215     GL_TEXTURE_2D and below GL_TEXTURE_3D.
216
217     From lowest priority to highest priority: GL_TEXTURE_1D,
218     GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_3D,
219     GL_TEXTURE_CUBE_MAP.
220
221 11) How are texture coordinates addressed for rectangular textures?
222
223     Texture coordinates are addressed without being normalized from
224     [0..1], instead [0..w] and [0..h] are used, where w and h are width
225     and height of the texture respectively.
226
227 12) How should applications determine the available maximum texture
228     dimensions available?
229
230     Implementation dependent rectangular texture size limitations are
231     queried using the GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB parameter and
232     may be different that standard texture size limits.
233
234 13) How does the handling of the R texture component differ from
235     the handling of S and T?
236
237     The R texture coordinate for rectangular textures is handled
238     as it would be for standard two dimensional textures.  Thus the
239     coordinates range from [0..1] and the wrapping mode is unchanged
240     from the default.
241
242 14) Does this extension work with OpenGL 1.4's shadow mapping?
243
244     Yes.  The one non-obvious allowance to support OpenGL 1.4's shadow
245     mapping is that the R texture coordinate wrap mode remains UNCHANGED
246     for rectangular textures.  Clamping of the R texture coordinate
247     for rectangular textures uses the standard [0,1] interval rather
248     than the [0,w_s] or [0,h_s] intervals as in the case of S and T.
249     This is because R represents a depth value in the [0,1] range
250     whether using a 2D or rectangular texture.
251
252 15) How does this extension interact with GLSL based on the "OpenGL
253     Shading Language Extension Conventions"?
254
255     Unfortunately, this extension was specified and implemented
256     contemporaneously with the GLSL Extension Conventions and because
257     of this timing does not follow its guidance for #extension and
258     adornment of new GLSL names.  Because this extension has both an
259     API interaction (adding a new rectangle texture target) and a GLSL
260     interaction (functions and sampler types for accessing texture
261     rectangles), you can't practically use the GLSL texture rectangle
262     functionality without the API functionality.  For this reason,
263     detecting the GL_ARB_texture_rectangle string is sufficient for
264     assuming the GLSL functionality is present.
265
266     Conceptually, you can consider the declaration
267     #extension GL_ARB_texture_rectangle : require, to allow support
268     for texture rectangles, to be implicitly prepended to every
269     GLSL shader when ARB_texture_rectangle is advertised.
270
271     All future GLSL extensions should follow the "OpenGL Shading Language
272     Extension Conventions" however.
273
274 16) How can a GLSL shader tell if this extension is supported?
275
276     "GL_ARB_texture_rectangle" preprocessor macro is predefined to be 1.
277
278 17) Should GL_SAMPLER_2D_RECT_ARB and GL_SAMPLER_2D_RECT_SHADOW_ARB be
279     returned by the "type" parameter of glGetActiveUniformARB when
280     returning the type of a sampler2DRect or sampler2DRectShadow sampler
281     uniform?
282
283     Yes, there is already language in the ARB_shader_objects extension
284     saying this so there's no additional language added to this
285     extension.  The language is missing from OpenGL 2.0 so we add the
286     ARB_shader_objects language as part of this specification too.
287
288 18) Can a shader still turn off support for this extension?
289
290     Yes, a shader can still include all variations of
291     #extension GL_ARB_texture_rectangle in its source code. This
292     includes #extension GL_ARB_texture_rectangle : disable, to
293     disable support for it.
294
295
296New Procedures and Functions
297
298    None
299
300New Tokens
301
302    Accepted by the <cap> parameter of Enable, Disable and IsEnabled;
303    by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
304    and GetDoublev; and by the <target> parameter of BindTexture,
305    GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri,
306    TexParameterfv and TexParameteriv:
307
308    TEXTURE_RECTANGLE_ARB            0x84F5
309
310    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
311    GetFloatv and GetDoublev:
312
313    TEXTURE_BINDING_RECTANGLE_ARB    0x84F6
314
315    Accepted by the <target> parameter of GetTexLevelParameteriv,
316    GetTexLevelParameterfv, GetTexParameteriv and TexImage2D:
317
318    PROXY_TEXTURE_RECTANGLE_ARB      0x84F7
319
320    Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
321    GetIntegerv and GetFloatv:
322
323    MAX_RECTANGLE_TEXTURE_SIZE_ARB   0x84F8
324
325    Accepted by the <target> parameter of GetTexImage,
326    GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D,
327    CopyTexImage2D, TexSubImage2D and CopySubTexImage2D:
328
329    TEXTURE_RECTANGLE_ARB
330
331    Returned by <type> parameter of GetActiveUniform when the location
332    <index> for program object <program> is of type sampler2DRect:
333
334    SAMPLER_2D_RECT_ARB              0x8B63
335
336    Returned by <type> parameter of GetActiveUniform when the location
337    <index> for program object <program> is of type sampler2DRectShadow:
338
339    SAMPLER_2D_RECT_SHADOW_ARB       0x8B64
340
341Additions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
342
343  - (2.15.3, pg. 80-81) "Uniform Variables" under "Shader Variables"
344
345    Add SAMPLER_2D_RECT_ARB and SAMPLER_2D_RECT_SHADOW_ARB to the list
346    of returned types in the sentence starting "The type returned can
347    be any of ..."
348
349  - (2.15.4, pg. 86) "Texture Access" under "Shader Execution"
350
351    Replace the three bullets with the following language:
352
353        "...the results of a texture lookup are undefined if:
354
355        * The sampler used in a texture lookup function is of type
356        sampler1D or sampler2D or sampler2DRect, and the texture object's
357        internal format is DEPTH_COMPONENT, and the TEXTURE_COMPARE_MODE
358        is not NONE.
359
360        * The sampler used in a texture lookup function is of type
361        sampler1DShadow or sampler2DShadow or sampler2DRectShadow,
362        and the texture object's internal format is DEPTH_COMPONENT,
363        and the TEXTURE_COMPARE_MODE is NONE.
364
365        * The sampler used in a texture lookup function is of type
366        sampler1DShadow or sampler2DShadow or sampler2DRectShadow,
367        and the texture object's internal format is not DEPTH_COMPONENT."
368
369Additions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
370
371    These changes describe use of the TEXTURE_RECTANGLE_ARB texture
372    target, supported formats, texture dimensions, and texture proxies:
373
374  - (3.6.3, pg. 118)  "Pixel Transfer Modes" under "Color Table
375    Specification" or the ColorTableEXT description in the
376    EXT_paletted_texture specification
377
378    If EXT_paletted_texture is supported, add the following statement
379    after paragraph 5 of the sub-section:
380
381    "The error INVALID_ENUM is generated if the target to ColorTable (or
382    ColorTableEXT or the various ColorTable and ColorTableEXT alternative
383    commands) is TEXTURE_RECTANGLE_ARB or PROXY_TEXTURE_RECTANGLE_ARB."
384
385  - (3.8.1, p. 151) "Texture Image Specification"
386
387    Change the first sentence of the fourth paragraph on this page to:
388
389    Textures with a base internal format of DEPTH COMPONENT are supported
390    by texture image specification commands only if target is TEXTURE_1D,
391    TEXTURE_2D, TEXTURE_RECTANGLE_ARB, PROXY_TEXTURE_1D, PROXY_TEXTURE_2D
392    or PROXY_TEXTURE_RECTANGLE_ARB.
393
394  - (3.8.1, pg. 156) "Texture Image Specification"
395
396    Add a sentence to the middle of the 20th paragraph of the
397    section (first paragraph on the page), directly after "... for
398    image arrays of level 0 through k, where k is the log base 2 of
399    MAX_TEXTURE_SIZE." reading:
400
401    "The maximum allowable width of a rectangular texture image,
402    and the maximum allowable height of a rectangular texture
403    image, must be at least the implementation-dependent value of
404    MAX_RECTANGLE_TEXTURE_SIZE_ARB."
405
406  - (3.8.1, pg. 156) "Texture Image Specification"
407
408    In the 22th paragraph of this section (sixth paragraph on the page),
409    change the sentence following "The command void TexImage2D ... a
410    two-dimensional texture image." through the rest of the paragraph
411    in the section describing two-dimensional texturing to read:
412
413    "<target> must be one of TEXTURE_2D for a two-dimensional texture,
414    or one of TEXTURE_RECTANGLE_ARB for a rectangle texture, or one
415    of TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,
416    TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,
417    TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z for a cube
418    map texture. Additionally, <target> may be either PROXY_TEXTURE_2D
419    for a two-dimensional proxy texture, PROXY_TEXTURE_RECTANGLE_ARB for
420    a rectangle proxy texture or PROXY_TEXTURE_CUBE_MAP for a cube map
421    proxy texture as discussed in section 3.8.10. The other parameters
422    match the corresponding parameters of TexImage3D."
423
424    Add this paragraph following the above two-dimensional texturing
425    introduction, reading:
426
427    When the target is TEXTURE_RECTANGLE_ARB, the INVALID_VALUE error is
428    generated if border is any value other than zero or the level is any
429    value other than zero. In the case of a rectangular texture, ws and
430    hs equal the specified width and height respectively of the
431    rectangular texture image while ds is 1."
432
433    If EXT_paletted_texture is supported, add this paragraph too:
434
435    "Rectangular textures do not support paletted formats. The error
436    INVALID_ENUM is generated if the target is TEXTURE_RECTANGLE_ARB or
437    PROXY_TEXTURE_RECTANGLE_ARB and the format is COLOR_INDEX or the
438    internal format is COLOR_INDEX or one of the COLOR_INDEX<n>_EXT
439    internal formats."
440
441  - (3.8.1, pg. 156) "Texture Image Specification"
442
443    Amend the fourth paragraph on the page to read:
444
445    "A two-dimensional texture consists of a single two-dimensional
446    texture image. A rectangle texture consists of a single 2D texture
447    image. A cube map texture is a set of six two-dimensional texture
448    images. The six cube map texture targets form a single cube map
449    texture though each target names a distinct face of the cube
450    map. The TEXTURE_CUBE_MAP_* targets listed above update their
451    appropriate cube map face 2D texture image.  The six cube map
452    two-dimensional image tokens such as TEXTURE_CUBE_MAP_POSITIVE_X
453    are used when specifying, updating, or querying one of a cube map's
454    six two-dimensional images, but when enabling cube map texturing
455    or binding to a cube map texture object (that is when the cube map
456    is accessed as a whole as opposed to a particular two-dimensional
457    image), the TEXTURE_CUBE_MAP target is specified."
458
459  - (3.8.1, pg. 157) "Texture Image Specification"
460
461    Append to the end of the third to the last paragraph in the section:
462
463    "A rectangular texture array has depth ds=1, with height hs and
464    width ws defined by the specified image height and width
465    parameters."
466
467  - (3.8.2, pg. 159) "Alternate Texture Image Specification Commands"
468
469    Add TEXTURE_RECTANGLE_ARB to the target list of the second paragraph
470    of the section to say:
471
472    ... "Currently, <target> must be TEXTURE_2D, TEXTURE_RECTANGLE_ARB,
473    TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,
474    TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,
475    TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z." ...
476
477  - (3.8.2, pg. 160) "Alternate Texture Image Specification Commands"
478
479    Add TEXTURE_RECTANGLE_ARB to the target list in the fifth paragraph
480    of the section to say:
481
482    ... "Currently the target arguments of TexSubImage1D and
483    CopyTexSubImage1D must be TEXTURE_1D, the <target> arguments of
484    TexSubImage2D and CopyTexSubImage2D must be one of TEXTURE_2D,
485    TEXTURE_RECTANGLE_ARB, TEXTURE_CUBE_MAP_POSITIVE_X,
486    TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y,
487    TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or
488    TEXTURE_CUBE_MAP_NEGATIVE_Z, and the <target> arguments of
489    TexSubImage3D and CopyTexSubImage3D must be TEXTURE_3D." ...
490
491    Also append to the end of this paragraph:
492
493    "If target is TEXTURE_RECTANGLE_ARB and level is not zero, the error
494    INVALID_VALUE is generated."
495
496  - (3.8.3, pg. 164) "Compressed Texture Images"
497
498    Add the following paragraph after the second paragraph in the
499    section, which introduces the CompressedTexImage<n>D commands:
500
501    "The error INVALID_ENUM is generated if the target parameter to one
502    of the CompressedTexImage<n>D commands is TEXTURE_RECTANGLE_ARB or
503    PROXY_TEXTURE_RECTANGLE_ARB."
504
505    Add the following paragraph after introducing the
506    CompressedTexSubImage<n>D commands:
507
508    "The error INVALID_ENUM is generated if the target parameter to one
509    of the CompressedTexSubImage<n>D commands is TEXTURE_RECTANGLE_ARB
510    or PROXY_TEXTURE_RECTANGLE_ARB."
511
512  - (3.8.4, pg. 166) "Texture Parameters"
513
514    Add TEXTURE_RECTANGLE_ARB to paragraph one to say:
515
516    ... "<target> is the target, either TEXTURE_1D, TEXTURE_2D,
517    TEXTURE_RECTANGLE_ARB, TEXTURE_3D, or TEXTURE_CUBE_MAP." ...
518
519  - (3.8.4, pg. 168) "Texture Parameters"
520
521    Add the following paragraph to the end of the section:
522
523    "Certain texture parameter values may not be specified for
524    textures with a target of TEXTURE_RECTANGLE_ARB. The error
525    INVALID_ENUM is generated if the target is TEXTURE_RECTANGLE_ARB
526    and the TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R
527    parameter is set to REPEAT, MIRRORED_REPEAT,
528    MIRROR_CLAMP_EXT (MIRROR_CLAMP_ATI), MIRROR_CLAMP_TO_EDGE_EXT
529    (MIRROR_CLAMP_TO_EDGE_ATI) or MIRROR_CLAMP_TO_BORDER_EXT. The error
530    INVALID_ENUM is generated if the target is TEXTURE_RECTANGLE_ARB
531    and the TEXTURE_MIN_FILTER is set to a value other than
532    NEAREST or LINEAR (no mipmap filtering is permitted). The error
533    INVALID_ENUM is generated if the target is TEXTURE_RECTANGLE_ARB
534    and TEXTURE_BASE_LEVEL is set to any value other than zero."
535
536  - (3.8.7, pg. 170) "Texture Wrap Modes"
537
538    Add this final additional paragraph:
539
540    "Texture coordinates are clamped differently for rectangular
541    textures. The r texture coordinate is wrapped as described above.
542    When the texture target is TEXTURE_RECTANGLE_ARB, the s and t
543    coordinates are wrapped as follows: CLAMP causes the s coordinate
544    to be clamped to the range [0, wt]. CLAMP causes the t coordinate
545    to be clamped to the range [0, ht]. CLAMP_TO_EDGE causes the s
546    coordinate to be clamped to the range [0.5, wt-0.5]. CLAMP_TO_EDGE
547    causes the t coordinate to be clamped to the range [0.5, ht - 0.5].
548    CLAMP_TO_BORDER causes the s coordinate to be clamped to the range
549    [-0.5, wt + 0.5]. CLAMP_TO_BORDER causes the t coordinate to be
550    clamped to the range [-0.5, ht + 0.5]."
551
552  - (3.8.8, pg. 171) "Texture Minification"
553
554    Under the "Scale Factor and Level of Detail" sub-section, change the
555    fourth paragraph in the subsection to read:
556
557    "Let s(x,y) be the function that associates an s texture coordinate
558    with each set of window coordinates (x,y) that lie within a primitive;
559    define t(x,y) and r(x,y) analogously.  For non-rectangular textures,
560    let u(x,y) = wt * s(x,y), v(x,y) = ht * t(x,y), and w(x,y) = dt *
561    r(x,y), where wt, ht, and dt are as defined by equations 3.15,
562    3.16, and 3.17 with ws, hs, and ds equal to the width, height,
563    and depth of the image array whose level is level_base.  However,
564    for rectangular textures let u(x, y) = s(x, y), v(x, y) = t(x, y),
565    and w(x, y) = r(x, y)."
566
567  - (3.8.8, pg. 173) "Texture Minification"
568
569    Update the last sentence in the first partial paragraph on the page
570    to read:
571
572    "Depending on whether the texture's target is rectangular or
573    non-rectangular, this means the texel at location (i,j,k) becomes
574    the texture value, with i given by
575
576            / floor (u),    s < 1 and non-rectangular texture
577            |
578    i =     | wt - 1,      s == 1 and non-rectangular texture (3.19)
579            |
580            | floor(u)      s < wt and rectangular texture
581            |
582            \ wt-1         s >= wt and rectangular texture
583
584    (Recall that if TEXTURE_WRAP_S is REPEAT, then 0 <= s < 1.)
585    Similarly, j is found as
586
587            / floor(v),     t < 1 and non-rectangular texture
588            |
589    j =     | ht - 1,      t == 1 and non-rectangular texture (3.20)
590            |
591            | floor(v)      t < ht and rectangular texture
592            |
593            \ ht-1         t >= ht and rectangular texture
594
595    and k is found as
596
597            / floor (w),    r < 1
598    k =     |                                               (3.21)
599            \ dt - 1,      r == 1"
600
601  - (3.8.8, pg. 171) "Texture Minification"
602
603    Change the last sentence in the first partial paragraph on the page,
604    directly after equation 3.21 to read:
605
606    "For a two-dimensional or rectangular texture, k is irrelevant; the
607    texel at location (i,j) becomes the texture value."
608
609  - (3.8.8, pg. 174) "Texture Minification"
610
611    Change the sentence preceding equation 3.26:
612
613    "For a two-dimensional or rectangular texture,"
614
615  - (3.8.8, pg. 175) "Mipmapping"
616
617    Follow the paragraph on the page which ends with "...  must be
618    defined, as discussed in section 3.8.10." with:
619
620    "Rectangular textures do not support mipmapping (it is an error to
621    specify a minification filter that requires mipmapping)."
622
623  - (3.8.11, pg. 178) "Texture State and Proxy State"
624
625    Change the first sentence of the first paragraph to say:
626
627    "The state necessary for texture can be divided into two categories.
628    First, there are the ten sets of mipmap arrays (one each for the
629    one-, two-, and three-dimensional texture targets, one for the
630    rectangular texture target (though the rectangular texture target
631    has only one mipmap level), and six for the cube map texture
632    targets) and their number." ...
633
634  - (3.8.11, pg. 179) "Texture State and Proxy State"
635
636    Change the sixth and fifth to last sentences of the first paragraph
637    to say:
638
639    "In the initial state, the value assigned to TEXTURE_MIN_FILTER is
640    NEAREST_MIPMAP_LINEAR, except for rectangular textures where the
641    initial value is LINEAR, and the value for TEXTURE_MAG_FILTER is
642    LINEAR. s, t, and r warp modes are all set to REPEAT, except for
643    rectangular textures where the initial value is CLAMP_TO_EDGE."
644
645  - (3.8.11, pg. 179) "Texture State and Proxy State"
646
647    Change the second paragraph of the section to say:
648
649    "In addition to the one-, two-, three-dimensional, rectangular, and
650    the six cube map sets of image arrays, the partially instantiated
651    one-, two-, and three-dimensional, rectangular, and one cube map
652    sets of proxy image arrays are maintained." ...
653
654  - (3.8.11, pg. 179) "Texture State and Proxy State"
655
656    Change the third paragraph to:
657
658    "One- and two-dimensional and rectangular proxy arrays are operated
659    on in the same way when TexImage1D is executed with target specified
660    as PROXY_TEXTURE_1D, or TexImage2D is executed with target specified
661    as PROXY_TEXTURE_2D or PROXY_TEXTURE_RECTANGLE_ARB."
662
663  - (3.8.11, pg. 180) "Texture State and Proxy State"
664
665    Change the second sentence of the fifth paragraph of the section to:
666
667    "Therefore PROXY_TEXTURE_1D, PROXY_TEXTURE_2D,
668    PROXY_TEXTURE_RECTANGLE_ARB, PROXY_TEXTURE_3D, and
669    PROXY_TEXTURE_CUBE_MAP cannot be used as textures, and their images
670    must never be queried using GetTexImage." ...
671
672  - (3.8.12, pg. 156) "Texture Objects"
673
674    Change the first sentence of the first paragraph to say:
675
676    "In addition to the default textures TEXTURE_1D, TEXTURE_2D,
677    TEXTURE_RECTANGLE_ARB, TEXTURE_3D, and TEXTURE_CUBE_MAP, named
678    one-dimensional, two-dimensional, rectangular, and three-dimensional
679    texture objects and cube map texture objects can be created and
680    operated on." ...
681
682  - (3.8.12, pg. 180) "Texture Objects"
683
684    Change the second paragraph in the section to say:
685
686    "A texture object is created by binding an unused name to
687    TEXTURE_1D, TEXTURE_2D, TEXTURE_RECTANGLE_ARB, TEXTURE_3D, or
688    TEXTURE_CUBE_MAP." ... "If the new texture object is bound to
689    TEXTURE_1D, TEXTURE_2D, TEXTURE_RECTANGLE_ARB, TEXTURE_3D, or
690    TEXTURE_CUBE_MAP, it remains a one-dimensional, two-dimensional,
691    rectangular, three-dimensional, or cube map texture until it is
692    deleted."
693
694  - (3.8.12, pg. 180) "Texture Objects"
695
696    Change the third paragraph to say:
697
698    "BindTexture may also be used to bind an existing texture object to
699    either TEXTURE_1D, TEXTURE_2D, TEXTURE_RECTANGLE_ARB, TEXTURE_3D, or
700    TEXTURE_CUBE_MAP."
701
702  - (3.8.12, pg. 180) "Texture Objects"
703
704    Change paragraph five of the section to say:
705
706    "In the initial state, TEXTURE_1D, TEXTURE_2D,
707    TEXTURE_RECTANGLE_ARB, TEXTURE_3D, and TEXTURE_CUBE_MAP have
708    one-dimensional, two-dimensional, rectangular, three-dimensional,
709    and cube map state vectors associated with them respectively." ...
710    "The initial, one-dimensional, two-dimensional, rectangular,
711    three-dimensional, and cube map texture is therefore operated upon,
712    queried, and applied as TEXTURE_1D, TEXTURE_2D,
713    TEXTURE_RECTANGLE_ARB, TEXTURE_3D, and TEXTURE_CUBE_MAP respectively
714    while 0 is bound to the corresponding targets."
715
716  - (3.8.12, pg. 181) "Texture Objects"
717
718    Change paragraph six of the section to say:
719
720    ... "If a texture that is currently bound to one of the targets
721    TEXTURE_1D, TEXTURE_2D, TEXTURE_RECTANGLE_ARB, TEXTURE_3D, or
722    TEXTURE_CUBE_MAP is deleted, it is as though BindTexture has been
723    executed with the same <target> and <texture> zero." ...
724
725  - (3.8.15 pg. 189) "Texture Application"
726
727    Replace the beginning sentences of the first paragraph with:
728
729    "Texturing is enabled or disabled using the generic Enable and
730    Disable commands, respectively, with the symbolic constants
731    TEXTURE_1D, TEXTURE_2D, TEXTURE_RECTANGLE_ARB, TEXTURE_3D, or
732    TEXTURE_CUBE_MAP to enable the one-dimensional, two-dimensional,
733    rectangular, three-dimensional, or cube map texturing respectively.
734    If both two- and one-dimensional textures are enabled, the
735    two-dimensional texture is used. If the rectangular and either of
736    the two- or one-dimensional textures is enabled, the rectangular
737    texture is used. If the three-dimensional and any of the
738    rectangular, two-dimensional, or one-dimensional textures is
739    enabled, the three-dimensional texture is used. If the cube map
740    texture and any of the three-dimensional, rectangular,
741    two-dimensional, or one-dimensional textures is enabled, then cube
742    map texturing is used.
743
744  - (3.11.2, pg. 195) "Texture Access" under "Shader Execution"
745
746    Replace the three bullets with the following language:
747
748        "...the results of a texture lookup are undefined if:
749
750        * The sampler used in a texture lookup function is of type
751        sampler1D or sampler2D or sampler2DRect, and the texture object's
752        internal format is DEPTH_COMPONENT, and the TEXTURE_COMPARE_MODE
753        is not NONE.
754
755        * The sampler used in a texture lookup function is of type
756        sampler1DShadow or sampler2DShadow or sampler2DRectShadow,
757        and the texture object's internal format is DEPTH_COMPONENT,
758        and the TEXTURE_COMPARE_MODE is NONE.
759
760        * The sampler used in a texture lookup function is of type
761        sampler1DShadow or sampler2DShadow or sampler2DRectShadow,
762        and the texture object's internal format is not DEPTH_COMPONENT."
763
764Additions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment
765Operations and the Framebuffer)
766
767    None
768
769Additions to Chapter 5 of the OpenGL 2.0 Specification (Special
770Functions)
771
772  - (5.4, pg. 242) "Display Lists"
773
774    In the third to last paragraph of the section, add
775    PROXY_TEXTURE_RECTANGLE_ARB to the list of PROXY_* tokens.
776
777Additions to Chapter 6 of the OpenGL 2.0 Specification (State and State
778Requests)
779
780  - (6.1.3, pg. 247) "Enumerated Queries"
781
782    Change the fourth paragraph to say:
783
784    "The GetTexParameter parameter <target> may be one of TEXTURE_1D,
785    TEXTURE_2D, TEXTURE_RECTANGLE_ARB, TEXTURE_3D, or TEXTURE_CUBE_MAP,
786    indicating the currently bound one-dimensional, two-dimensional,
787    rectangular, three-dimensional, or cube map texture object. For
788    GetTexLevelParameter, <target> may be one of TEXTURE_1D, TEXTURE_2D,
789    TEXTURE_RECTANGLE_ARB, TEXTURE_3D, TEXTURE_CUBE_MAP_POSITIVE_X,
790    TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y,
791    TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z,
792    TEXTURE_CUBE_MAP_NEGATIVE_Z, PROXY_TEXTURE_1D, PROXY_TEXTURE_2D,
793    PROXY_TEXTURE_RECTANGLE_ARB, PROXY_TEXTURE_3D, or
794    PROXY_TEXTURE_CUBE_MAP, indicating the one-dimensional texture
795    object, two-dimensional texture object, rectangular texture object,
796    three-dimensional texture object, or one of the six distinct 2D
797    images making up the cube map texture object or one-dimensional,
798    two-dimensional, rectangular, three-dimensional, or cube map proxy
799    state vector. Note that TEXTURE_CUBE_MAP is not a valid <target>
800    parameter for GetTexLevelParameter because it does not specify a
801    particular cube map face."
802
803  - (6.1.4, pg. 248) "Texture Queries"
804
805    Change the first paragraph to read:
806
807    ... "It is somewhat different from the other get commands; <tex> is
808    a symbolic value indicating which texture (or texture face in the
809    case of a cube map texture target name) is to be obtained.
810    TEXTURE_1D indicates a one-dimensional texture, TEXTURE_2D indicates
811    a two-dimensional texture, TEXTURE_RECTANGLE_ARB indicates a
812    rectangular texture, TEXTURE_3D indicates a three-dimensional
813    texture, and TEXTURE_CUBE_MAP_POSITIVE_X,
814    TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y,
815    TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, and
816    TEXTURE_CUBE_MAP_NEGATIVE_Z indicate the respective face of a cube
817    map texture."
818
819  - (6.1.4, pg. 249) "Texture Queries"
820
821    Add a final sentence to the fourth paragraph of the section,
822    immediately after ... "or DEPTH COMPONENT causes the error INVALID
823    ENUM.":
824
825    "Calling GetTexImage with a lod not zero when the tex is
826    TEXTURE_RECTANGLE_ARB causes the error INVALID_VALUE."
827
828Additions to version 1.10.59 of the OpenGL Shading Language specification
829
830    A new preprocessor #define is added to the OpenGL Shading Language:
831
832        #define GL_ARB_texture_rectangle 1
833
834    Change the second to last paragraph on page 12 (#extension directive):
835
836    The initial state of the compiler is as if the directive
837
838        #extension all : disable
839
840    was issued, telling the compiler that all error and warning reporting
841    must be done according to this specification, ignoring any extensions.
842    The only execption to this rule is the GL_ARB_texture_rectangle
843    extension. If the string "GL_ARB_texture_rectangle" is present in the
844    EXTENSIONS string, as queried with GetString(), then the compiler will
845    behave as if
846
847        #extension GL_ARB_texture_rectangle : require
848
849    is present in the shader.
850
851    Add the following (previously reserved) keywords to the first part of
852    section 3.6 on page 14:
853
854        sampler2DRect
855        sampler2DRectShadow
856
857    Add to section 8.7 "Texture Lookup Functions"
858
859    Syntax:
860
861        vec4 texture2DRect(sampler2DRect sampler, vec2 coord)
862        vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord)
863        vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord)
864
865    Description:
866
867        "Use the texture coordinate coord to do a texture lookup in the
868        rectangle texture currently bound to sampler.  For the projective
869        ("Proj") version, the texture coordinate (coord.s, coord.t) is
870        divided by the last component of coord.  The third component of
871        coord is ignored for the vec4 coord variant.
872
873        No "bias" parameter or "Lod" suffixed functions for rectangle
874        textures are supported because mipmaps are not allowed for
875        rectangular textures."
876
877    Syntax:
878
879        vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord)
880        vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord)
881
882     Description
883
884        "Use texture coordinate coord to do a depth comparison lookup on
885        the rectangular depth texture bound to sampler, as described in
886        section 3.8.14 of version 2.0 of the OpenGL specification. The 3rd
887        component of coord (coord.p) is used as the R value. The texture
888        bound to sampler must be a depth texture, or results are undefined.
889        For the projective version ("Proj"), the texture coordinate
890        (coord.s, coord.t, coord.p) is divided by the last component of
891        coord, giving a R value of coord.p / coord.q.
892
893        No "bias" parameter or "Lod" suffixed functions for rectangle
894        textures are supported because mipmaps are not allowed for
895        rectangle textures."
896
897Additions to the GLX Specification
898
899    None
900
901GLX Protocol
902
903    None
904
905Dependencies on OpenGL 1.4 and ARB_texture_mirrored_repeat
906
907    If OpenGL 1.4 (or ARB_mirrored_repeat) is not supported, references
908    to the MIRRORED_REPEAT (or MIRRORED_REPEAT_ARB) wrap mode in this
909    document should be ignored.
910
911Dependencies on ATI_texture_mirror_once
912
913    If ATI_texture_mirror_once is not supported, references to the
914    MIRROR_CLAMP_ATI and MIRROR_CLAMP_TO_EDGE_ATI wrap modes in this
915    document should be ignored.
916
917Dependencies on EXT_paletted_texture
918
919    If EXT_paletted_texture is not supported, references to the
920    COLOR_INDEX, COLOR_INDEX<n>_EXT, ColorTable, and ColorTableEXT
921    should be ignored.
922
923Dependencies on EXT_texture_compression_s3tc
924
925    If EXT_texture_compression_s3tc is not supported, references
926    to CompressedTexImage2D and CompressedTexSubImageARB and the
927    COMPRESSED_*_S3TC_DXT*_EXT enumerants should be ignored.
928
929Dependencies on EXT_texture_mirror_clamp
930
931    If EXT_texture_mirror_clamp is not supported, references to the
932    MIRROR_CLAMP_EXT, MIRROR_CLAMP_TO_EDGE_EXT, and
933    MIRROR_CLAMP_TO_BORDER_EXT wrap modes in this document should be
934    ignored.
935
936Errors
937
938    INVALID_ENUM is generated when ColorTable (or ColorTableEXT or the
939    various ColorTable and ColorTableEXT alternative commands) is called
940    and the target is TEXTURE_RECTANGLE_ARB or
941    PROXY_TEXTURE_RECTANGLE_ARB.
942
943    INVALID_ENUM is generated when TexImage2D is called and the target
944    is TEXTURE_RECTANGLE_ARB or PROXY_TEXTURE_RECTANGLE_ARB and the
945    format is COLOR_INDEX or the internalformat is COLOR_INDEX or one of
946    the COLOR_INDEX<n>_EXT internal formats.
947
948    INVALID_VALUE is generated when TexImage2D is called when the target
949    is TEXTURE_RECTANGLE_ARB if border is any value other than zero or
950    the level is any value other than zero.
951
952    INVALID_VALUE is generated when TexImage2D is called when the target
953    is TEXTURE_RECTANGLE_ARB if the width is less than zero or the
954    height is less than zero.
955
956    INVALID_VALUE is generated when TexSubImage2D or CopyTexSubImage2D
957    is called when the target is TEXTURE_RECTANGLE_ARB if the level is
958    any value other than zero.
959
960    INVALID_ENUM is generated when one of the CompressedTexImage<n>D
961    commands is called when the target parameter is
962    TEXTURE_RECTANGLE_ARB or PROXY_TEXTURE_RECTANGLE_ARB.
963
964    INVALID_ENUM is generated when one of the CompressedTexSubImage<n>D
965    commands is called when the target parameter is TEXTURE_RECTANGLE_ARB
966    or PROXY_TEXTURE_RECTANGLE_ARB.
967
968    INVALID_ENUM is generated when TexParameter is called with a target
969    of TEXTURE_RECTANGLE_ARB and the TEXTURE_WRAP_S, TEXTURE_WRAP_T,
970    or TEXTURE_WRAP_R parameter is set to REPEAT, MIRRORED_REPEAT,
971    MIRROR_CLAMP_ATI, or MIRROR_CLAMP_TO_EDGE_ATI.
972
973    INVALID_ENUM is generated when TexParameter is called with a target
974    of TEXTURE_RECTANGLE_ARB and the TEXTURE_MIN_FILTER is set to a
975    value other than NEAREST or LINEAR.
976
977    INVALID_VALUE is generated when TexParameter is called with a target
978    of TEXTURE_RECTANGLE_ARB and the TEXTURE_BASE_LEVEL is set to any
979    value other than zero.
980
981    INVALID_VALUE is generated when GetTexImage is called with a lod not
982    zero when the tex is TEXTURE_RECTANGLE_ARB.
983
984New State
985
986  - (Table 6.15, Texture Objects, pg. 241) amend/add the following entries:
987
988    Get Value                      Type      Get Command  Initial Value   Description            Sec     Attribute
989    -----------------------------  -------   -----------  -------------   ---------------------  ------  --------------
990    TEXTURE_RECTANGLE_ARB          2* x B    IsEnabled    False           True if rectangular    3.8.15  texture/enable
991                                                                          texturing is enabled
992
993    TEXTURE_BINDING_RECTANGLE_ARB  2* x Z+   GetIntegerv  0               Texture object         3.8.11  texture
994                                                                          for texture rectangle
995
996    TEXTURE_RECTANGLE_ARB          n x I     GetTexImage  see 3.8         rectangular texture    3.8     -
997                                                                          image for lod 0
998
999
1000  - (Table 6.16, Texture Objects (cont.), pg. 242) amend/add the following entries:
1001
1002    Get Value             Type    Get Command       Initial Value     Description           Sec    Attribute
1003    ------------------    -----   --------------    --------------    -------------------   -----  --------------
1004    TEXTURE_MIN_FILTER    n x Z6  GetTexParameter   See 3.8 except    Texture minification  3.8.8  texture
1005                                                    for rectangular   function
1006                                                    which is
1007                                                    LINEAR
1008
1009    TEXTURE_WRAP_S        n x Z5  GetTexParameter   REPEAT except     Texture wrap mode S   3.8.7  texture
1010                                                    for rectangular
1011                                                    which is
1012                                                    CLAMP_TO_EDGE
1013
1014    TEXTURE_WRAP_T        n x Z5  GetTexParameter   REPEAT except     Texture wrap mode T   3.8.7  texture
1015                                                    for rectangular   (2D, 3D, cubemap,
1016                                                    which is          rectangle textures
1017                                                    CLAMP_TO_EDGE     only)
1018
1019    TEXTURE_WRAP_R        n x Z5  GetTexParameter   REPEAT except     Texture wrap mode R   3.8.7  texture
1020                                                    for rectangular   (3D textures only)
1021                                                    which is
1022                                                    CLAMP_TO_EDGE
1023
1024New Implementation Dependent State
1025
1026  - (Table 6.28, Implementation Dependent Values, pg. 254) add the following entry:
1027
1028    Get Value                       Type    Get Command   Minimum Value   Description           Sec    Attribute
1029    --------                        ----    -----------   -------------   -----------           -----  --------------
1030    MAX_RECTANGLE_TEXTURE_SIZE_ARB   Z+     GetIntegerv   64              Maximum rectangular   3.8.1  -
1031                                                                          texture image
1032                                                                          dimension
1033
1034Backwards Compatibility
1035
1036    This extension is semantically equivalent to EXT_texture_rectangle
1037    and NV_texture_rectangle.  The tokens, and name strings now refer
1038    to ARB instead of EXT or NV.  Enumerant values are unchanged.
1039
1040Revision History
1041
1042    3/5/2004 - Updated page numbers and other numbers to reflect OpenGL
1043    1.5; removed bogus "Convolution" language saying how glGetTexImage
1044    applies convolution (language was in 1.2.1 but removed in 1.3).
1045    ARB_texture_non_power_of_two and EXT_texture_mirror_clamp interactions
1046    added.
1047
1048    2/23/2005 - Fix the GLSL interaction:  1) GLSL functions require
1049    a vector (not scalar) parameter for the texture coordinate set: 2)
1050    The actual reserved types are sampler2DRect and sampler2DRectShadow
1051    (not samplerRect and samplerRectShadow); and 3) the shadow functions
1052    were missing.
1053
1054    7/8/2005 - Further fixes to GLSL interaction based on ARB meeting
1055    discussion: 1) Add OpenGL 2.0 language interaction for when
1056    shadow accesses are defined for rectangle textures; 2) add an
1057    issue to document the discussion; 3) bumped revision to 1.1; 4)
1058    documented GLSL preprocessor define; 5) documented sampler enums;
1059    and generally update the specification page numbers to be written
1060    against OpenGL 2.0.  Also added to the contributors list.
1061
1062    7/15/2005 - This is revision 1.2.
1063    1) Allow loading of DEPTH_COMPENENT textures for rectangular
1064    texture targets. 2) Switched some of the paramters ws, hs, ds for wt, ht,
1065    dt, and vice-versa to be in line with the cleanup already done in the
1066    OpenGL 2.0 specification. 3) Added issue 18. 4) Deleted the 'dependencies
1067    on ARB_texture_non_power_of_two' section since that is core OpenGL
1068    2.0 functionality. 5) Removed some redundant language. 6) Added language
1069    describing changes to the GLSL spec explaining the #extension behavior.
1070    7) Added to the contributors list and sorted it by last name.
1071
1072    10/4/2005 - Revision 1.21 - Whitespace cleanup
1073