• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    ARB_texture_cube_map
4
5Name Strings
6
7    GL_ARB_texture_cube_map
8
9Contact
10
11    Michael Gold, NVIDIA (gold 'at' nvidia.com)
12
13Notice
14
15    Copyright (c) 1999-2013 The Khronos Group Inc. Copyright terms at
16        http://www.khronos.org/registry/speccopyright.html
17
18Specification Update Policy
19
20    Khronos-approved extension specifications are updated in response to
21    issues and bugs prioritized by the Khronos OpenGL Working Group. For
22    extensions which have been promoted to a core Specification, fixes will
23    first appear in the latest version of that core Specification, and will
24    eventually be backported to the extension document. This policy is
25    described in more detail at
26        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
27
28Status
29
30    Complete. Approved by ARB on 12/8/1999
31
32Version
33
34    Last Modified Date: December 14, 1999
35
36Number
37
38    ARB Extension #7
39
40Dependencies
41
42    None.
43
44    Written based on the wording of the OpenGL 1.2.1 specification but
45    not dependent on it.
46
47Overview
48
49    This extension provides a new texture generation scheme for cube
50    map textures.  Instead of the current texture providing a 1D, 2D,
51    or 3D lookup into a 1D, 2D, or 3D texture image, the texture is a
52    set of six 2D images representing the faces of a cube.  The (s,t,r)
53    texture coordinates are treated as a direction vector emanating from
54    the center of a cube.  At texture generation time, the interpolated
55    per-fragment (s,t,r) selects one cube face 2D image based on the
56    largest magnitude coordinate (the major axis).  A new 2D (s,t) is
57    calculated by dividing the two other coordinates (the minor axes
58    values) by the major axis value.  Then the new (s,t) is used to
59    lookup into the selected 2D texture image face of the cube map.
60
61    Unlike a standard 1D, 2D, or 3D texture that have just one target,
62    a cube map texture has six targets, one for each of its six 2D texture
63    image cube faces.  All these targets must be consistent, complete,
64    and have equal width and height (ie, square dimensions).
65
66    This extension also provides two new texture coordinate generation modes
67    for use in conjunction with cube map texturing.  The reflection map
68    mode generates texture coordinates (s,t,r) matching the vertex's
69    eye-space reflection vector.  The reflection map mode
70    is useful for environment mapping without the singularity inherent
71    in sphere mapping.  The normal map mode generates texture coordinates
72    (s,t,r) matching the vertex's transformed eye-space
73    normal.  The normal map mode is useful for sophisticated cube
74    map texturing-based diffuse lighting models.
75
76    The intent of the new texgen functionality is that an application using
77    cube map texturing can use the new texgen modes to automatically
78    generate the reflection or normal vectors used to look up into the
79    cube map texture.
80
81    An application note:  When using cube mapping with dynamic cube
82    maps (meaning the cube map texture is re-rendered every frame),
83    by keeping the cube map's orientation pointing at the eye position,
84    the texgen-computed reflection or normal vector texture coordinates
85    can be always properly oriented for the cube map.  However if the
86    cube map is static (meaning that when view changes, the cube map
87    texture is not updated), the texture matrix must be used to rotate
88    the texgen-computed reflection or normal vector texture coordinates
89    to match the orientation of the cube map.  The rotation can be
90    computed based on two vectors: 1) the direction vector from the cube
91    map center to the eye position (both in world coordinates), and 2)
92    the cube map orientation in world coordinates.  The axis of rotation
93    is the cross product of these two vectors; the angle of rotation is
94    the arcsin of the dot product of these two vectors.
95
96Issues
97
98    Should we place the normal/reflection vector in the (s,t,r) texture
99    coordinates or (s,t,q) coordinates?
100
101      RESOLUTION:  (s,t,r).  Even if hardware uses "q" for the third
102      component, the API should claim to support generation of (s,t,r)
103      and let the texture matrix (through a concatenation with the
104      user-supplied texture matrix) move "r" into "q".
105
106    Should the texture coordinate generation functionality for cube
107    mapping be specified as a distinct extension from the actual cube
108    map texturing functionality?
109
110      RESOLUTION:  NO.  Real applications and real implementations of
111      cube mapping will tie the texgen and texture generation functionality
112      together.  Applications won't have to query two separate
113      extensions then.
114
115      While applications will almost always want to use the texgen
116      functionality for automatically generating the reflection or normal
117      vector as texture coordinates (s,t,r), this extension does permit
118      an application to manually supply the reflection or normal vector
119      through glTexCoord3f explicitly.
120
121      Note that the NV_texgen_reflection extension does "unbundle"
122      the texgen functionality from cube maps.
123
124    Should you be able to have some texture coordinates computing
125    REFLECTION_MAP_ARB and others not?  Same question with NORMAL_MAP_ARB.
126
127      RESOLUTION:  YES. This is the way that SPHERE_MAP works.  It is
128      not clear that this would ever be useful though.
129
130    Should something special be said about the handling of the q
131    texture coordinate for this spec?
132
133      RESOLUTION:  NO.  But the following paragraph is useful for
134      implementors concerned about the handling of q.
135
136      The REFLECTION_MAP_ARB and NORMAL_MAP_ARB modes are intended to supply
137      reflection and normal vectors for cube map texturing hardware.
138      When these modes are used for cube map texturing, the generated
139      texture coordinates can be thought of as an reflection vector.
140      The value of the q texture coordinate then simply scales the
141      vector but does not change its direction.  Because only the vector
142      direction (not the vector magnitude) matters for cube map texturing,
143      implementations are free to leave q undefined when any of the s,
144      t, or r texture coordinates are generated using REFLECTION_MAP_ARB
145      or NORMAL_MAP_ARB.
146
147    How should the cube faces be labeled?
148
149      RESOLUTION:  Match the render man specification's names of "px"
150      (positive X), "nx" (negative x), "py", "ny", "pz", and "nz".
151      There does not actually need to be an "ordering for the faces"
152      (Direct3D 7.0 does number their cube map faces.)  For this
153      extension, the symbolic target names (TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
154      etc) is sufficient without requiring any specific ordering.
155
156    What coordinate system convention should be used?  LHS or RHS?
157
158      RESOLUTION:  The coordinate system is left-handed if you think
159      of yourself within the cube.  The coordinate system is
160      right-handed if you think of yourself outside the cube.
161
162      This matches the convention of the RenderMan interface.  If
163      you look at Figure 12.8 (page 265) in "The RenderMan Companion",
164      think of the cube being folded up with the observer inside
165      the cube.  Then the coordinate system convention is
166      left-handed.
167
168    The spec just linearly interpolates the reflection vectors computed
169    per-vertex across polygons.  Is there a problem interpolating
170    reflection vectors in this way?
171
172      Probably.  The better approach would be to interpolate the eye
173      vector and normal vector over the polygon and perform the reflection
174      vector computation on a per-fragment basis.  Not doing so is likely
175      to lead to artifacts because angular changes in the normal vector
176      result in twice as large a change in the reflection vector as normal
177      vector changes.  The effect is likely to be reflections that become
178      glancing reflections too fast over the surface of the polygon.
179
180      Note that this is an issue for REFLECTION_MAP_ARB, but not
181      NORMAL_MAP_ARB.
182
183    What happens if an (s,t,q) is passed to cube map generation that
184    is close to (0,0,0), ie. a degenerate direction vector?
185
186      RESOLUTION:  Leave undefined what happens in this case (but
187      may not lead to GL interruption or termination).
188
189      Note that a vector close to (0,0,0) may be generated as a
190      result of the per-fragment interpolation of (s,t,r) between
191      vertices.
192
193    Do we need a distinct proxy texture mechanism for cube map
194    textures?
195
196      RESOLUTION:  YES.  Cube map textures take up six times the
197      memory as a conventional 2D image texture so proxy 2D texture
198      determinations won't be of value for a cube map texture.
199      Cube maps need their own proxy target.
200
201    Should we require the 2D texture image width and height to
202    be identical (ie, square only)?
203
204      RESOLUTION:  YES.  This limitation is quite a reasonable limitation
205      and DirectX 7 has the same limitation.
206
207      This restriction is enforced by generating an INVALID_VALUE
208      when calling TexImage2D or CopyTexImage2D with a non-equal
209      width and height.
210
211      Some consideration was given to enforcing the "squarness"
212      constraint as a texture consistency constraint.  This is
213      confusing however since the squareness is known up-front
214      at texture image specification time so it seems confusing
215      to silently report the usage error as a texture consistency
216      issue.
217
218      Texture consistency still says that all the level 0 textures
219      of all six faces must have the same square size.
220
221    If some combination of 1D, 2D, 3D, and cube map texturing is
222    enabled, which really operates?
223
224      RESOLUTION:  Cube map texturing.  In OpenGL 1.2, 3D takes
225      priority over 2D takes priority over 1D.  Cube mapping should
226      take priority over all conventional n-dimensional texturing
227      schemes.
228
229    Does anything need to be said about combining cube mapping with
230    multitexture?
231
232      RESOLUTION:  NO.  Cube mapping should be available on all texture
233      units.  The hardware should fully orthogonal in its handling of
234      cube map textures.
235
236    Does it make sense to support borders for cube map textures.
237
238      Actually, it does.  It would be nice if the texture border pixels
239      match the appropriate texels from the edges of the other cube map
240      faces that they junction with.  For this reason, we'll leave the
241      texture border capability implicitly supported.
242
243    How does mipmap level-of-detail selection work for cube map
244    textures?
245
246      The existing spec's language about LOD selection is fine.
247
248    Should the implementation dependent value for the maximum
249    texture size for a cube map be the same as MAX_TEXTURE_SIZE?
250
251      RESOLUTION: NO.  OpenGL 1.2 has a different MAX_3D_TEXTURE_SIZE
252      for 3D textures, and cube maps should take six times more space
253      than a 2D texture map of the same width & height.  The implementation
254      dependent MAX_CUBE_MAP_TEXTURE_SIZE_ARB constant should be used for
255      cube maps then.
256
257      Note that the proxy cube map texture provides a better way to
258      find out the maximum cube map texture size supported since the
259      proxy mechanism can take into account the internal format, etc.
260
261    In section 3.8.10 when the "largest magnitude coordinate direction"
262    is choosen, what happens if two or more of the coordinates (rx,ry,rz)
263    have the identical magnitude?
264
265      RESOLUTION:  Implementations can define their own rule to choose
266      the largest magnitude coordinate direction whne two or more of the
267      coordinates have the identical magnitude.  The only restriction is
268      that the rule must be deterministic and depend only on (rx,ry,rz).
269
270      In practice, (s,t,r) is interpolated across polygons so the cases
271      where |s|==|t|, etc. are pretty arbitary (the equality depends on
272      interpolation precision).  This extension could mandate a particular
273      rule, but that seems heavy-handed and there is no good reason that
274      multiple vendors should be forced to implement the same rule.
275
276    Should there be limits on the supported border modes for cube maps?
277
278      RESOLUTION:  NO. The specificiation is written so that cube map
279      texturing proceeds just like conventional 2D texture mapping once
280      the face determination is made.
281
282      Therefore, all OpenGL texture wrap modes should be supported though
283      some modes are clearly inappropriate for cube maps.  The WRAP mode
284      is almost certainly incorrect for cube maps.  Likewise, the CLAMP
285      mode without a texture border is almost certainly incorrect for cube
286      maps.  CLAMP when a texture border is present and CLAMP_TO_EDGE are
287      both reasonably suited for cube maps.  Ideally, CLAMP with a texture
288      border works best if the cube map edges can be replicated in the
289      approriate texture borders of adjacent cube map faces.  In practice,
290      CLAMP_TO_EDGE works reasonably well in most circumstances.
291
292      Perhaps another extension could support a special cube map wrap
293      mode that automatically wraps individual texel fetches to the
294      appropriate adjacent cube map face.  The benefit from such a mode
295      is small and the implementation complexity is involved so this wrap
296      mode should not be required for a basic cube map texture extension.
297
298    How is mipmap LOD selection handled for cube map textures?
299
300      RESOLUTION:  The specification is written so that cube map texturing
301      proceeds just like conventional 2D texture mapping once the face
302      determination is made.
303
304      Thereforce, the partial differentials in Section 3.8.5 (page
305      126) should be evaluated for the u and v parameters based on the
306      post-face determination s and t.
307
308    In Section 2.10.3 "Normal Transformation", there are several versions
309    of the eye-space normal vector to choose from.  Which one should
310    the NORMAL_MAP_ARB texgen mode use?
311
312       RESOLUTION:  nf.  The nf vector is the final normal, post-rescale
313       normal and post-normalize.  In practice, the rescale normal and
314       normalize operations do not change the direction of the vector
315       so the choice of which version of transformed normal is used is
316       not important for cube maps.
317
318New Procedures and Functions
319
320    None
321
322New Tokens
323
324    Accepted by the <param> parameters of TexGend, TexGenf, and TexGeni
325    when <pname> parameter is TEXTURE_GEN_MODE:
326
327        NORMAL_MAP_ARB                      0x8511
328        REFLECTION_MAP_ARB                  0x8512
329
330    When the <pname> parameter of TexGendv, TexGenfv, and TexGeniv is
331    TEXTURE_GEN_MODE, then the array <params> may also contain
332    NORMAL_MAP_ARB or REFLECTION_MAP_ARB.
333
334    Accepted by the <cap> parameter of Enable, Disable, IsEnabled, and
335    by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
336    and GetDoublev, and by the <target> parameter of BindTexture,
337    GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri,
338    TexParameterfv, and TexParameteriv:
339
340        TEXTURE_CUBE_MAP_ARB                0x8513
341
342    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
343    GetFloatv, and GetDoublev:
344
345        TEXTURE_BINDING_CUBE_MAP_ARB        0x8514
346
347    Accepted by the <target> parameter of GetTexImage,
348    GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D,
349    CopyTexImage2D, TexSubImage2D, and CopySubTexImage2D:
350
351        TEXTURE_CUBE_MAP_POSITIVE_X_ARB     0x8515
352        TEXTURE_CUBE_MAP_NEGATIVE_X_ARB     0x8516
353        TEXTURE_CUBE_MAP_POSITIVE_Y_ARB     0x8517
354        TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB     0x8518
355        TEXTURE_CUBE_MAP_POSITIVE_Z_ARB     0x8519
356        TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB     0x851A
357
358    Accepted by the <target> parameter of GetTexLevelParameteriv,
359    GetTexLevelParameterfv, GetTexParameteriv, and TexImage2D:
360
361        PROXY_TEXTURE_CUBE_MAP_ARB          0x851B
362
363    Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
364    GetIntegerv, and GetFloatv:
365
366        MAX_CUBE_MAP_TEXTURE_SIZE_ARB       0x851C
367
368Additions to Chapter 2 of the 1.2 Specification (OpenGL Operation)
369
370 --  Section 2.10.4 "Generating Texture Coordinates"
371
372      Change the last sentence in the 1st paragraph (page 37) to:
373
374      "If <pname> is TEXTURE_GEN_MODE, then either <params> points to
375      or <param> is an integer that is one of the symbolic constants
376      OBJECT_LINEAR, EYE_LINEAR, SPHERE_MAP, REFLECTION_MAP_ARB, or
377      NORMAL_MAP_ARB."
378
379      Add these paragraphs after the 4th paragraph (page 38):
380
381      "If TEXTURE_GEN_MODE indicates REFLECTION_MAP_ARB, compute the
382      reflection vector r as described for the SPHERE_MAP mode.  Then the
383      value assigned to an s coordinate (the first TexGen argument value
384      is S) is s = rx; the value assigned to a t coordinate is t = ry;
385      and the value assigned to a r coordinate is r = rz.  Calling TexGen
386      with a <coord> of Q when <pname> indicates REFLECTION_MAP_ARB
387      generates the error INVALID_ENUM.
388
389      If TEXTURE_GEN_MODE indicates NORMAL_MAP_ARB, compute the normal
390      vector nf as described in section 2.10.3.  Then the value assigned
391      to an s coordinate (the first TexGen argument value is S) is s =
392      nfx; the value assigned to a t coordinate is t = nfy; and the
393      value assigned to a r coordinate is r = nfz.  (The values nfx, nfy,
394      and nfz are the components of nf.)  Calling TexGen with a <coord>
395      of Q when <pname> indicates NORMAL_MAP_ARB generates the error
396      INVALID_ENUM.
397
398      The last paragraph's first sentence (page 38) should be changed to:
399
400      "The state required for texture coordinate generation comprises a
401      five-valued integer for each coordinate indicating coordinate
402      generation mode, ..."
403
404Additions to Chapter 3 of the 1.2 Specification (Rasterization)
405
406 --  Section 3.6.5 "Pixel Transfer Operations" under "Convolution"
407
408     Change this paragraph (page 103) to say:
409
410     ... "If CONVOLUTION_2D is enabled, the two-dimensional convolution
411     filter is applied only to the two-dimensional images passed to
412     DrawPixels, CopyPixels, ReadPixels, TexImage2D, TexSubImage2D,
413     CopyTexImage2D, CopyTexSubImage2D, and CopyTexSubImage3D, and
414     returned by GetTexImage with one of the targets TEXTURE_2D,
415     TEXTURE_CUBE_MAP_POSITIVE_X_ARB, TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
416     TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
417     TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, or TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB."
418
419 --  Section 3.8.1 "Texture Image Specification"
420
421     Change the second and third to last sentences on page 116 to:
422
423     "<target> must be one of TEXTURE_2D for a 2D texture, or one of
424     TEXTURE_CUBE_MAP_POSITIVE_X_ARB, TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
425     TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
426     TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, or TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
427     for a cube map texture.  Additionally, <target> can be either
428     PROXY_TEXTURE_2D for a 2D proxy texture or PROXY_TEXTURE_CUBE_MAP_ARB
429     for a cube map proxy texture as discussed in section 3.8.7."
430
431     Add the following paragraphs after the first paragraph on page 117:
432
433     "A 2D texture consists of a single 2D texture image.  A cube
434     map texture is a set of six 2D texture images.  The six cube map
435     texture targets form a single cube map texture though each target
436     names a distinct face of the cube map.  The TEXTURE_CUBE_MAP_*_ARB
437     targets listed above update their appropriate cube map face 2D
438     texture image.  Note that the six cube map 2D image tokens such as
439     TEXTURE_CUBE_MAP_POSITIVE_X_ARB are used when specifying, updating,
440     or querying one of a cube map's six 2D image, but when enabling
441     cube map texturing or binding to a cube map texture object (that is
442     when the cube map is accessed as a whole as opposed to a particular
443     2D image), the TEXTURE_CUBE_MAP_ARB target is specified.
444
445     When the target parameter to TexImage2D is one of the six cube map
446     2D image targets, the error INVALID_VALUE is generated if the width
447     and height parameters are not equal.
448
449     If cube map texturing is enabled at the time a primitive is
450     rasterized and if the set of six targets are not "cube complete",
451     then it is as if texture mapping were disabled.  The targets of
452     a cube map texture are "cube complete" if the array 0 of all six
453     targets have identical, positive, and square dimensions, the array
454     0 of all six targets were specified with the same internalformat,
455     and the array 0 of all six targets have the same border width."
456
457     After the 14th paragraph (page 116) add:
458
459     "In a similiar fashion, the maximum allowable width and height
460     (they must be the same) of a cube map texture must be at least
461     2^(k-lod)+2bt for image arrays level 0 through k, where k is the
462     log base 2 of MAX_CUBE_MAP_TEXTURE_SIZE_ARB."
463
464 --  Section 3.8.2 "Alternate Texture Image Specification Commands"
465
466     Update the second paragraph (page 120) to say:
467
468     ... "Currently, <target> must be
469     TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
470     TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
471     TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
472     or TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB." ...
473
474     Add after the second paragraph (page 120), the following:
475
476     "When the target parameter to CopyTexImage2D is one of the six cube
477     map 2D image targets, the error INVALID_VALUE is generated if the
478     width and height parameters are not equal."
479
480     Update the fourth paragraph (page 121) 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_CUBE_MAP_POSITIVE_X_ARB, TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
486     TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
487     TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, or TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
488     and the <target> arguments of TexSubImage3D and CopyTexSubImage3D
489     must be TEXTURE_3D." ...
490
491 --  Section 3.8.3 "Texture Parameters"
492
493     Change paragraph one (page 124) to say:
494
495     ... "<target> is the target, either TEXTURE_1D,
496     TEXTURE_2D, TEXTURE_3D, or TEXTURE_CUBE_MAP_ARB." ...
497
498     Add a final paragraph saying:
499
500     "Texture parameters for a cube map texture apply to cube map
501     as a whole; the six distinct 2D texture images use the
502     texture parameters of the cube map itself.
503
504 --  Section 3.8.5 "Texture Minification" under "Mipmapping"
505
506     Change the first full paragraph on page 130 to:
507
508     ... "If texturing is enabled for one-, two-, or three-dimensional
509     texturing but not cube map texturing (and TEXTURE_MIN_FILTER
510     is one that requires a mipmap) at the time a primitive is
511     rasterized and if the set of arrays TEXTURE_BASE_LEVEL through q =
512     min{p,TEXTURE_MAX_LEVEL} is incomplete, based on the dimensions of
513     array 0, then it is as if texture mapping were disabled."
514
515     Follow the first full paragraph on page 130 with:
516
517     "If cube map texturing is enabled and TEXTURE_MIN_FILTER is one that
518     requires mipmap levels at the time a primitive is rasterized and
519     if the set of six targets are not "mipmap cube complete", then it
520     is as if texture mapping were disabled.  The targets of a cube map
521     texture are "mipmap cube complete" if the six cube map targets are
522     "cube complete" and the set of arrays TEXTURE_BASE_LEVEL through
523     q are not incomplete (as described above)."
524
525 --  Section 3.8.7 "Texture State and Proxy State"
526
527     Change the first sentence of the first paragraph (page 131) to say:
528
529     "The state necessary for texture can be divided into two categories.
530     First, there are the nine sets of mipmap arrays (one each for the
531     one-, two-, and three-dimensional texture targets and six for the
532     cube map texture targets) and their number." ...
533
534     Change the second paragraph (page 132) to say:
535
536     "In addition to the one-, two-, three-dimensional, and the six cube
537     map sets of image arrays, the partially instantiated one-, two-,
538     and three-dimensional and one cube map sets of proxy image arrays
539     are maintained." ...
540
541     After the third paragraph (page 132) add:
542
543     "The cube map proxy arrays are operated on in the same manner
544     when TexImage2D is executed with the <target> field specified as
545     PROXY_TEXTURE_CUBE_MAP_ARB with the addition that determining that a
546     given cube map texture is supported with PROXY_TEXTURE_CUBE_MAP_ARB
547     indicates that all six of the cube map 2D images are supported.
548     Likewise, if the specified PROXY_TEXTURE_CUBE_MAP_ARB is not
549     supported, none of the six cube map 2D images are supported."
550
551     Change the second sentence of the fourth paragraph (page 132) to:
552
553     "Therefore PROXY_TEXTURE_1D, PROXY_TEXTURE_2D, PROXY_TEXTURE_3D,
554     and PROXY_TEXTURE_CUBE_MAP_ARB cannot be used as textures, and their
555     images must never be queried using GetTexImage." ...
556
557 --  Section 3.8.8 "Texture Objects"
558
559     Change the first sentence of the first paragraph (page 132) to say:
560
561     "In addition to the default textures TEXTURE_1D, TEXTURE_2D,
562     TEXTURE_3D, and TEXTURE_CUBE_MAP_ARB, named one-, two-,
563     and three-dimensional texture objects and cube map texture objects
564     can be created and operated on." ...
565
566     Change the second paragraph (page 132) to say:
567
568     "A texture object is created by binding an unused name to
569     TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, or TEXTURE_CUBE_MAP_ARB." ...
570     "If the new texture object is bound to TEXTURE_1D, TEXTURE_2D,
571     TEXTURE_3D, or TEXTURE_CUBE_MAP_ARB, it remains a one-, two-,
572     three-dimensional, or cube map texture until it is deleted."
573
574     Change the third paragraph (page 133) to say:
575
576     "BindTexture may also be used to bind an existing texture object to
577     either TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, or TEXTURE_CUBE_MAP_ARB."
578
579     Change paragraph five (page 133) to say:
580
581     "In the initial state, TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
582     and TEXTURE_CUBE_MAP have one-dimensional, two-dimensional,
583     three-dimensional, and cube map state vectors associated
584     with them respectively."  ...  "The initial, one-dimensional,
585     two-dimensional, three-dimensional, and cube map texture is therefore
586     operated upon, queried, and applied as TEXTURE_1D, TEXTUER_2D,
587     TEXTURE_3D, and TEXTURE_CUBE_MAP_ARB respectively while 0 is bound
588     to the corresponding targets."
589
590     Change paragraph six (page 133) to say:
591
592     ... "If a texture that is currently bound to one of the targets
593     TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, or TEXTURE_CUBE_MAP_ARB is
594     deleted, it is as though BindTexture has been executed with the
595     same <target> and <texture> zero." ...
596
597 --  Section 3.8.10 "Texture Application"
598
599     Replace the beginning sentences of the first paragraph (page 138)
600     with:
601
602     "Texturing is enabled or disabled using the generic Enable
603     and Disable commands, respectively, with the symbolic constants
604     TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, or TEXTURE_CUBE_MAP_ARB to enable
605     the one-dimensional, two-dimensional, three-dimensional, or cube
606     map texturing respectively.  If both two- and one-dimensional
607     textures are enabled, the two-dimensional texture is used.  If the
608     three-dimensional and either of the two- or one-dimensional textures
609     is enabled, the three-dimensional texture is used.  If the cube map
610     texture and any of the three-, two-, or one-dimensional textures is
611     enabled, then cube map texturing is used.  If texturing is disabled,
612     a rasterized fragment is passed on unaltered to the next stage of the
613     GL (although its texture coordinates may be discarded).  Otherwise,
614     a texture value is found according to the parameter values of the
615     currently bound texture image of the appropriate dimensionality.
616
617     However, when cube map texturing is enabled, the rules are
618     more complicated.  For cube map texturing, the (s,t,r) texture
619     coordinates are treated as a direction vector (rx,ry,rz) emanating
620     from the center of a cube.  (The q coordinate can be ignored since
621     it merely scales the vector without affecting the direction.) At
622     texture application time, the interpolated per-fragment (s,t,r)
623     selects one of the cube map face's 2D image based on the largest
624     magnitude coordinate direction (the major axis direction).  If two
625     or more coordinates have the identical magnitude, the implementation
626     may define the rule to disambiguate this situation.  The rule must
627     be deterministic and depend only on (rx,ry,rz).  The target column
628     in the table below explains how the major axis direction maps to
629     the 2D image of a particular cube map target.
630
631      major axis
632      direction     target                             sc     tc    ma
633      ----------    -------------------------------    ---    ---   ---
634       +rx          TEXTURE_CUBE_MAP_POSITIVE_X_ARB    -rz    -ry   rx
635       -rx          TEXTURE_CUBE_MAP_NEGATIVE_X_ARB    +rz    -ry   rx
636       +ry          TEXTURE_CUBE_MAP_POSITIVE_Y_ARB    +rx    +rz   ry
637       -ry          TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB    +rx    -rz   ry
638       +rz          TEXTURE_CUBE_MAP_POSITIVE_Z_ARB    +rx    -ry   rz
639       -rz          TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB    -rx    -ry   rz
640
641     Using the sc, tc, and ma determined by the major axis direction as
642     specified in the table above, an updated (s,t) is calculated as
643     follows
644
645        s   =   ( sc/|ma| + 1 ) / 2
646        t   =   ( tc/|ma| + 1 ) / 2
647
648     This new (s,t) is used to find a texture value in the determined
649     face's 2D texture image using the rules given in sections 3.8.5
650     and 3.8.6." ...
651
652Additions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations
653and the Frame Buffer)
654
655     None
656
657Additions to Chapter 5 of the 1.2 Specification (Special Functions)
658
659 --  Section 5.4 "Display Lists"
660
661     In the first paragraph (page 179), add PROXY_TEXTURE_CUBE_MAP_ARB
662     to the list of PROXY_* tokens.
663
664Additions to Chapter 6 of the 1.2 Specification (State and State Requests)
665
666 --  Section 6.1.3 "Enumerated Queries"
667
668     Change the fourth paragraph (page 183) to say:
669
670     "The GetTexParameter parameter <target> may be one of TEXTURE_1D,
671     TEXTURE_2D, TEXTURE_3D, or TEXTURE_CUBE_MAP_ARB, indicating the
672     currently bound one-dimensional, two-dimensional, three-dimensional,
673     or cube map texture object.  For GetTexLevelParameter,
674     <target> may be one of TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
675     TEXTURE_CUBE_MAP_POSITIVE_X_ARB, TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
676     TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
677     TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
678     PROXY_TEXTURE_1D, PROXY_TEXTURE_2D, PROXY_TEXTURE_3D, or
679     PROXY_TEXTURE_CUBE_MAP_ARB, indicating the one-dimensional
680     texture object, two-dimensional texture object, three-dimensional
681     texture object, or one of the six distinct 2D images making up
682     the cube map texture object or one-dimensional, two-dimensional,
683     three-dimensional, or cube map proxy state vector.  Note that
684     TEXTURE_CUBE_MAP_ARB is not a valid <target> parameter for
685     GetTexLevelParameter because it does not specify a particular cube
686     map face."
687
688 --  Section 6.1.4 "Texture Queries"
689
690     Change the first paragraph (page 184) to read:
691
692     ... "It is somewhat different from the other get commands; <tex>
693     is a symbolic value indicating which texture (or texture face in the
694     case of a cube map texture target name) is to be obtained.
695     TEXTURE_1D indicates a one-dimensional texture, TEXTURE_2D
696     indicates a two-dimensional texture, TEXTURE_3D indicates a
697     three-dimensional texture, and TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
698     TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
699     TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
700     and TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB indicate the respective face of
701     a cube map texture.
702
703Additions to the GLX Specification
704
705     None
706
707Errors
708
709     INVALID_ENUM is generated when TexGen is called with a <coord> of Q
710     when <pname> indicates REFLECTION_MAP_ARB or NORMAL_MAP_ARB.
711
712     INVALID_VALUE is generated when the target parameter to TexImage2D
713     or CopyTexImage2D is one of the six cube map 2D image targets and
714     the width and height parameters are not equal.
715
716New State
717
718(table 6.12, p202) add the following entries:
719
720Get Value                        Type    Get Command   Initial Value   Description           Sec    Attribute
721---------                        ----    -----------   -------------   -----------           ------ --------------
722TEXTURE_CUBE_MAP_ARB             B       IsEnabled     False           True if cube map      3.8.10 texture/enable
723                                                                       texturing is enabled
724TEXTURE_BINDING_CUBE_MAP_ARB     Z+      GetIntegerv   0               Texture object        3.8.8  texture
725                                                                       for TEXTURE_CUBE_MAP
726TEXTURE_CUBE_MAP_POSITIVE_X_ARB  nxI     GetTexImage   see 3.8         positive x face       3.8    -
727                                                                       cube map texture
728                                                                       image at lod i
729TEXTURE_CUBE_MAP_NEGATIVE_X_ARB  nxI     GetTexImage   see 3.8         negative x face       3.8    -
730                                                                       cube map texture
731                                                                       image at lod i
732TEXTURE_CUBE_MAP_POSITIVE_Y_ARB  nxI     GetTexImage   see 3.8         positive y face       3.8    -
733                                                                       cube map texture
734                                                                       image at lod i
735TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB  nxI     GetTexImage   see 3.8         negative y face       3.8    -
736                                                                       cube map texture
737                                                                       image at lod i
738TEXTURE_CUBE_MAP_POSITIVE_Z_ARB  nxI     GetTexImage   see 3.8         positive z face       3.8    -
739                                                                       cube map texture
740                                                                       image at lod i
741TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB  nxI     GetTexImage   see 3.8         negative z face       3.8    -
742                                                                       cube map texture
743                                                                       image at lod i
744
745(table 6.14, p204) change the entry for TEXTURE_GEN_MODE to:
746
747Get Value            Type    Get Command     Initial Value   Description        Sec    Attribute
748---------            ----    -----------     -------------   -----------        ------ ---------
749TEXTURE_GEN_MODE     4xZ5    GetTexGeniv     EYE_LINEAR      Function used for  2.10.4 texture
750                                                             texgen (for s,t,r,
751                                                             and q)
752
753(the type changes from 4xZ3 to 4xZ5)
754
755New Implementation Dependent State
756
757(table 6.24, p214) add the following entry:
758
759Get Value                       Type    Get Command   Minimum Value   Description           Sec    Attribute
760---------                       ----    -----------   -------------   -----------           ------ --------------
761MAX_CUBE_MAP_TEXTURE_SIZE_ARB   Z+      GetIntegerv   16              Maximum cube map      3.8.1  -
762                                                                      texture image
763                                                                      dimension
764
765Backwards Compatibility
766
767    This extension replaces EXT_texture_cube_map.  The tokens and
768    name strings now refer to ARB instead of EXT.  Enumerant values
769    are unchanged.
770