• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    SGIS_multitexture
4
5Name Strings
6
7    GL_SGIS_multitexture
8
9Version
10
11    $Date: 1998/10/15 00:54:19 $ $Revision: 1.20 $
12
13Number
14
15    116
16
17Dependencies
18
19    OpenGL 1.1 is required
20    EXT_texture3D affects the definition of this extension.
21    SGIS_texture4D affects the definition of this extension.
22    SGIS_texture_border_clamp affects the definition of this extension.
23    SGI_texture_color_table affects the definition of this extension.
24    SGIS_texture_edge_clamp affects the definition of this extension.
25    SGIX_texture_add_env affects the definition of this extension.
26    SGIS_texture_filter4 affects the definition of this extension.
27    SGIS_texture_lod affects the definition of this extension.
28    SGIX_texture_lod_bias affects the definition of this extension.
29    SGIX_texture_scale_bias affects the definition of this extension.
30    SGIS_texture_select affects the definition of this extension.
31    SGIS_detail_texture affects the definition of this extension.
32    SGIS_sharpen_texture affects the definition of this extension.
33    SGIX_shadow affects the definition of this extension.
34    SGIX_shadow_ambient affects the definition of this extension.
35    SGIX_clipmap affects the definition of this extension.
36    SGIS_point_line_texgen affects the definition of this extension.
37
38Overview
39
40    This extension adds support for multiple active textures.  The texture
41    capabilities are symmetric for all active textures.  Any texture capability
42    extension supported for one texture must be supported for all active
43    textures.  Each active texture has its own state vector which includes
44    texture image and filtering parameters and texture environment application.
45
46    The texture environments are applied in a pipelined fashion whereby the
47    output of one texture environment is used as the input fragment color for
48    the texture environment for the next active texture.  Changes to texture
49    state other than texture coordinates are routed through a selector which
50    controls which instance of texture state is affected.
51
52              +-----+
53     Cf ----->|     |    +-----+                pipelined texture
54              | TE0 |--->|     |                environment
55    Ct0 ----->|     |    | TE1 |    +-----+
56              +-----+    |     |--->|     |
57    Ct1 ---------------->|     |    | TE2 |    +-----+
58                         +-----+    |     |--->|     |
59    Ct2 --------------------------->|     |    | TE3 |
60                                    +-----+    |     |--> cf'
61    Ct3 -------------------------------------->|     |
62                                               +-----+
63                .
64                .
65                .
66
67        Ct<i> = texture color from texture lookup <i>
68        Cf    = fragment color
69        TE    = texture environment
70
71    Texture coordinate set, texture coordinate evaluator state, texture
72    generation function, and texture matrix are replicated independently of
73    the texture rasterization state and may differ in number from the
74    number of textures which can be active during rasterization.
75    Post-transform texture coordinates sets are associated with a texture
76    rasterization unit by binding them to a texture environment and they may
77    be multicast to several texture rasterization units.
78
79    The specification is written using four active textures and four
80    sets of texture coordinates though the actual number supported is
81    implementation dependent and can be larger or smaller than four.
82
83Issues
84
85    *  MultiTexCoord is an annoying name
86
87    *  alternatives for supplying fine grain texcoord
88
89        1. Tex<k>Coord<n><T>[v|f](<T> data);
90
91           a. efficient, no error checking required
92           d. adds *a lot* of new commands
93
94        2. MultiTexCoord<n><T>[v|f](enum target, <T> data);
95
96           a. only a small number of commands added
97           a. can be fairly efficient (may need hw tweak)
98           d. needs range checking for <target>
99
100        3. reuse TexCoord command and add SelectTextureCoordSetSGIS(enum target)
101           to control routing
102
103           a. only add one new commands
104           d. adds a lot of function call overhead when using multiple
105              textures
106           d. need to range check <target>
107
108    *  seems a little hacky to have SelectTextureSGIS control texture matrix
109       since that is part of transform state and to have it control evaluator
110       state yet SELECTED_TEXTURE itself is part of texture state.
111
112    *  SelectTextureSGIS probably should not affect client state such as
113       the vertex array state.
114
115        it doesn't any more
116
117    *  mechanism to replicate input texcoords across multiple texture paths
118       could be done with a pre-transform multicast or post-transform
119       multicast.
120
121        done using TEXTURE_ENV_COORD_SET_SGIS texture parameter
122        which is a post-transform mechanism.
123
124       RESOLVED: leave the coord source binding separate from
125       the texture object state => needs a new command to set it.
126
127    *  need proxy/macro object to handle resource constraints
128        save for another extension?
129
130    *  still need a way to route textures to lighting block :(
131
132        defined in light_texture.spec
133
134    *  should there be a post-filter colortable per texture?
135
136    *  should the number of textures and the number of texture
137       coordinate paths be decoupled?
138        RESOLVED: yes
139        There are some issues with this.  We choose to break
140        texture state into 3 pieces:
141            1. client state deal with issuing texture coordinates
142               from the application
143            2. transform state which includes texgen, texture
144               matrix, evaluation maps, and texture coordinate
145               retrieval from Gets and Feedback.
146            3. rasterization state which includes texture
147               images, filter parameters and environment.
148        2 & 3 are both server state.  there is an implication
149        that 1 and 2 are a little more tightly coupled and
150        equal in number but we need to keep the client
151        state separate.
152        There is some clumsyness with referring to the 2nd
153        group of state as transform state.  There is a problem
154        that the texgen state is part of the texture state
155        used in PushAttrib and PopAttrib so some finessing
156        is required.
157
158    *  special treatment of name 0?
159
160        RESOLVED: no
161
162    *  more texture environment functions, SUBTRACT, ...?
163        leading candidates are SUBTRACT and REVERSE_SUBTRACT
164        could also make a new version of environment which is
165        similar to blending.
166
167        RESOLVED: new environment, see texture_env.spec
168
169    * more general combination of texture results?
170
171        RESOLVED: do them in add-on specs
172
173    * allow texture environment computation to do something
174      even when texture is disabled. This contradicts the current
175      specification of texturing (the difference would show
176      up in the REPLACE environment), so we redefine this
177      behavior in a new environment (see texture_env.spec)
178
179    * support for interleaved arrays
180
181      add a command which acts as a multiplier on the current
182      interleaved array token causing the texture coordinate
183      array to have <n> contiguous texture coords of the same
184      type and format.
185
186    * some clarifications:
187
188      SelectTextureCoordSetSGIS affects client state only and
189      affects the commands TexCoord<n>{T}[v], TexCoordPointer,
190      EnableClientState, and DisableClientState.  Display lists
191      contain texture coordinates for which the binding is fully
192      resolved to one of TEXTURE0_SGIS ..  TEXTURE<n>_SGIS.
193
194      I chose to remove MultiTexCoordPointerSGIS as it was difficult
195      to also include tokens which would make it possible to call
196      Enable/DisableClientState with a token corresponding to the
197      appropriate texture coordinate set, so SelectTextureCoordSetSGIS
198      is required to manipulate the array state.  To maintain symmetry,
199      I made all commands use SelectTextureCoordSetSGIS and the
200      MultiTexCoord<n>{T}[v]SGIS commands are added to help with
201      performance.  An alternative would be to have both
202      MultiTexCoordPointerSGIS and add new tokens
203      TEXTURE_COORD_ARRAY0_SGIS .. TEXTURE_COORD_ARRAY<n>_SGIS and
204      not give TEXTURE_COORD_ARRAY0_SGIS the same value as
205      TEXTURE_COORD_ARRAY, so that we can have the relationship
206      TEXTURE_COORD_ARRAY<i>_SGIS = TEXTURE_COORD_ARRAY0_SGIS+i.
207      This still might cause some confusion/asymmetry if the <target>
208      parameter of MultiTexCoordPointerSGIS/MultiTexCoord<n>{T}[v]SGIS
209      is TEXTURE0_SGIS .. TEXTURE<n>_SGIS but EnableClientState/
210      DisableClientState use TEXTURE_COORD_ARRAY0_SGIS ..
211      TEXTURE_COORD_ARRAY<n>_SGIS
212
213
214
215New Procedures and Functions
216
217    void MultiTexCoord{1234}{sifd}SGIS(enum target, T coords);
218    void MultiTexCoord{1234}{sifd}vSGIS(enum target, T coords);
219
220    void InterleavedTextureCoordSetsSGIS(int factor);
221
222    void SelectTextureSGIS(enum target);
223
224    void SelectTextureCoordSetSGIS(enum target);
225
226    void SelectTextureTransformSGIS(enum target);
227
228New Tokens
229
230    Accepted by the <pname> parameters of GetBooleanv, GetIntegerv,
231    GetFloatv, and GetDoublev:
232
233    SELECTED_TEXTURE_SGIS                       0x83C0
234    SELECTED_TEXTURE_COORD_SET_SGIS             0x83C1
235    SELECTED_TEXTURE_TRANSFORM_SGIS             0x83C2
236    MAX_TEXTURES_SGIS                           0x83C3
237    MAX_TEXTURE_COORD_SETS_SGIS                 0x83C4
238    TEXTURE_COORD_SET_INTERLEAVE_FACTOR_SGIS    0x83C5
239
240    Accepted by the <pname> parameter of TexEnvi, TexEnvf,
241    TexEnviv, TexEnvfv, GetTexEnviv, and GetTexEnvfv:
242
243    TEXTURE_ENV_COORD_SET_SGIS                  0x83C6
244
245    Accepted by the <target> parameter of SelectTextureSGIS,
246    SelectTextureTransformSGIS, SelectTextureCoordSetSGIS,
247    MultiTexCoord<n>{T}[v]SGIS, and the <param> of TexParameteri and
248    TexParameterf, and the <params> parameter of TexParameteriv, and
249    TexParameterfv:
250
251    TEXTURE0_SGIS                               0x83C7
252    TEXTURE1_SGIS                               0x83C8
253    TEXTURE2_SGIS                               0x83C9
254    TEXTURE3_SGIS                               0x83CA
255    <reserve enums for 32>
256
257Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
258
259    Section 2.6 Begin/End Paradigm
260
261    <amend paragraph 2 & 3>
262
263    Each vertex is specified with two, three, or four coordinates.  In
264    addition, a current normal, current texture coordinate set, and current
265    color may be used in processing each vertex.  Normals are used by the GL in
266    lighting calculations; the current normal is a three-dimensional vector
267    that may be set by sending three coordinates that specify it.  Texture
268    coordinates determine how a texture image is mapped onto a primitive.
269    Multiple sets of texture coordinates may be used to specify how multiple
270    texture images are mapped onto a primitive.  The number of texture
271    coordinate sets supported is implementation dependent but must be at least
272    one.
273
274    A color is associated with each vertex as it is specified. This associated
275    color is either the current color or a color produced by lighting
276    depending on whether or not lighting is enabled. Texture coordinates are
277    similarly associated with each vertex.  Multiple sets of texture coordinates
278    may be associated with a vertex.  Figure 2.2 summarizes the association of
279    auxiliary data with a transformed vertex to produce a processed vertex.
280
281    <amend figure 2.2 to include multiple texcoord processing blocks
282     (current texcoords, texgen, texture matrix)>
283
284    <amend paragraph 6>
285    Before a color has been assigned to a vertex, the state required by a vertex
286    is the vertex's coordinates, the current normal, and the current texture
287    coordinate sets.  Once color has been assigned, however, the current normal
288    is no longer needed. Because color assignment is done vertex-by-vertex, a
289    processed vertex comprises the vertex's coordinates, its assigned color,
290    and its texture coordinate sets.
291
292
293
294    Section 2.7 Vertex Specifications <texture coordinates>
295
296    <amend paragraph 2>
297
298    Current values are used in associating auxiliary data with a vertex
299    as described in section 2.6.  A current value may be changed at any time
300    by issuing an appropriate command.  The commands
301
302    void TexCoord{1234}{sifd}(T coords);
303    void TexCoord{1234}{sifd}v(T coords);
304
305    specify the current homogeneous texture coordinates, named s,t,r, and q.
306    The TexCoord1 family of commands set the s coordinate to the provided
307    single argument while setting t and r to 0 and q to 1.  Similarly,
308    TexCoord2 sets s and t to the specified values, r to 0, and q to 1;
309    TexCoord3 sets s, t, and r, with q set to 1, and TexCoord4 sets all four
310    texture coordinates.
311
312    Implementations may support more than 1 set of texture
313    coordinates.  The MultiTexCoord family of commands takes the
314    coordinate set to be modified as the <target> parameter.  The
315    <target> parameter is one of TEXTURE0_SGIS through
316    TEXTURE3_SGIS. If a <target> parameter greater than the number of
317    supported coordinate sets is specified, the command has no effect.
318    The command
319
320    void SelectTextureCoordSetSGIS(enum target);
321
322    is used to change the texture coordinate set modified by the TexCoord*
323    family of commands.  <target> is one of TEXTURE0_SGIS through TEXTURE3_SGIS
324    corresponding to the texture coordinate set to be modified by the TexCoord
325    commands.  The current coordinate set selection is part of client state rather
326    than server state.
327
328
329    Section 2.8 Vertex Arrays
330
331    <amend paragraph 1>
332
333    The vertex specification commands in section 2.7 accept data in almost any
334    format, but their use requires many command executions to specify even
335    simple geometry.  Vertex data may also be placed in arrays that are stored
336    in the client's address space. Blocks of data in these arrays may be used
337    to specify multiple geometric primitives through the execution of a single
338    GL command.  The client may specify 6 or more arrays at once: one each to
339    store vertex coordinates, edge flags, colors, color indices, normals and
340    one or more texture coordinate sets. The commands
341
342    void EdgeFlagPointer(sizei stride, void *pointer);
343    void VertexPointer(int size, enum type, sizei stride, void *pointer);
344    void ColorPointer(int size, enum type, sizei stride, void *pointer);
345    void IndexPointer(enum type, sizei stride, void *pointer);
346    void NormalPointer(enum type, sizei stride, void *pointer);
347    void TexCoordPointer(int size, enum type, sizei stride, void *pointer);
348
349    ...
350
351    <insert this paragraph> between paragraph 2 & 3>
352
353    In implementations which support more than one set of texture coordinates,
354    the command SelectTextureCoordSetSGIS is used to select the vertex array
355    parameters to be modified by the TexCoordPointer command and the array
356    affected by client state enable and disable commands with the
357    TEXTURE_COORD_ARRAY parameter.
358
359    <modify the section on interleaved arrays as follows>
360
361        The commands
362
363        void InterleavedArrays(enum format, sizei stride,
364            void *pointer) ;
365
366        void InterleavedTextureCoordSetsSGIS(int factor) ;
367
368    efficiently initializes the six arrays and their enables to one of 14
369    configurations. <format> must be one 14 symbolic constants: V2F, V3F,
370    C4UB_V2F, C4UB_V3F, C3F_V3F, N3F_V3F, C4F_N3F_V3F, T2F_V3F, T4F_V4F,
371    T2F_C4UB_V3F, T2F_C3F_V3F, T2F_N3F_V3F, T2F_C4F_N3F_V3F, T4F_C4F_N3F_V4F.
372    <factor> is an integer between 1 and SELECTED_TEXTURE_COORD_SET_SGIS
373    and specifies how many texture coordinate sets are enabled as part
374    of the InterleavedArrays command.
375
376        The effect of
377
378            InterleavedArrays(format, stride, pointer);
379            InterleavedTextureCoordSetsSGIS(factor);
380
381    is the same as the effect of the command sequence
382
383           <copy command sequence from 1.1 spec, but change the part dealing
384            with texture coords to>
385
386            GetIntegerv(SELECTED_TEXTURE_COORD_SET_SGIS, &x);
387            if (<et>) {
388                for(i = 0; i < factor; i++) {
389                    SelectTextureCoordSetSGIS(TEXTURE0_SGIS+i);
390                    EnableClientState(TEXTURE_COORD_ARRAY);
391                    TexCoordPointer(st, FLOAT, str, <pointer>+i*pc);
392                }
393                for(i = factor; i < MAX_TEXTURE_COORD_SETS_SGIS; i++) {
394                    SelectTextureCoordSetSGIS(TEXTURE0_SGIS+i);
395                    DisableClientState(TEXTURE_COORD_ARRAY);
396                }
397            } else {
398                for(i = 0; i < MAX_TEXTURE_COORD_SETS_SGIS; i++) {
399                    SelectTextureCoordSetSGIS(TEXTURE0_SGIS+i);
400                    DisableClientState(TEXTURE_COORD_ARRAY);
401                }
402            }
403            SelectTextureCoordSetSGIS(x);
404            pc *= factor;
405
406
407    If the number of supported is texture coordinate sets,
408    MAX_TEXTURE_COORD_SETS_SGIS, is <k>, then the client state require to
409    implement vertex arrays consists of five plus <k> boolean values, five
410    plus <k> integer stride values, four plus <k> constants representing array
411    types, and three plus <k> integers representing values per element.  In the
412    initial state, the boolean values are each disabled, the memory pointers
413    are each null, the strides are each zero, the array types are each FLOAT,
414    and the integers representing values per element are each four.
415
416
417    Section 2.10.2 Matrices
418
419    <amend paragraph 8 texture matrix>
420
421    There is another 4x4 matrix that is applied to texture coordinates.
422    This matrix is applied as
423
424                | m1 m5 m9  m13 | |s|
425                | m2 m6 m10 m14 | |t| ,
426                | m3 m7 m11 m15 | |r|
427                | m4 m8 m12 m16 | |q|
428
429    where the left matrix is the current texture matrix.  The Matrix is applied
430    to the coordinates resulting from texture coordinate generation which
431    (which may simply be the current texture coordinates), and the resulting
432    transformed coordinates become the texture coordinates associated with a
433    vertex.  Setting the matrix mode to TEXTURE causes the already described
434    matrix operations to apply to the texture matrix stack.
435
436    For implementations which support more than one set of texture coordinates,
437    there is a corresponding texture matrix stack for each coordinate set. Each
438    stack has the same depth. The texture matrix stack which is affected by the
439    matrix operations is set using the SelectTextureTransformSGIS command.
440
441    There is a stack of matrices for each of the matrix modes.  For MODELVIEW
442    mode, the stack depth is at least 32 (that is, there is a stack of at least
443    32 model-view matrices). For other modes, the depth is at least 2.  Texture
444    matrix stacks for all texture coordinate sets have the same depth.
445
446        void PushMatrix( void );
447
448    pushes the stack down by one, duplicating the current matrix in both the
449    top of the stack and the entry below it.
450
451        void PopMatrix( void );
452
453    pops the top entry off of the stack, replacing the current matrix with the
454    matrix that was the second entry in the stack.  The pushing or popping
455    takes place on the stack corresponding to the current matrix mode.  Popping
456    a matrix off a stack with only one entry generates the error STACK_UNDERFLOW;
457    pushing a matrix onto a full stack generates STACK_OVERFLOW.
458
459    When the current matrix mode is TEXTURE, the texture matrix stack corresponding
460    to the currently selected textured is pushed or popped.
461
462    The state required to implement transformations consists of a three-value
463    integer indicating the current matrix mode, a stack of at least two 4x4
464    matrices for PROJECTION and one stack of at least two 4x4 matrices for
465    each set of texture coordinates, TEXTURE, as well as associated stack pointers,
466    and a stack of at least 32 4x4 matrices with an associated stack pointer for
467    MODELVIEW.  Initially, there is only one matrix on each stack and all
468    matrices are set to the identity.  The initial matrix mode is MODELVIEW.
469
470    Section 2.10.4 Generating texture coordinates
471
472    <amend paragraph 4>
473
474    The state required for texture coordinate generation for each set of
475    texture coordinates supported by the implementation comprises a
476    three-valued integer for each coordinate indicating coordinate generation
477    mode, and a bit for each coordinate to indicate whether texture coordinate
478    generation is enabled or disabled.  In addition, four coefficients are
479    required for the four coordinates for each of EYE_LINEAR and
480    OBJECT_LINEAR.  The initial state has the texture generation function
481    disabled for all texture coordinates.  The initial values of p_i for s
482    except p_1 which is one; for t all the p_i are zero except p_2, which is
483    1.  The values of p_i for r and q are all zero.  These values of p_i apply
484    for both the EYE_LINEAR and OBJECT_LINEAR versions.  Initially all texture
485    generation modes are EYE_LINEAR.
486
487    Section 2.12  Current Raster Position
488
489    <amend paragraph 2>
490
491    The current raster position consists of three window coordinates x_w,
492    y_w, and z_w, a clip coordinate w_c value, and eye coordinate distance,
493    a valid bit, and associated data consisting op a color and texture
494    coordinate sets.  It is set using one of the RasterPos commands:
495    ...
496
497    <amend paragraph 5>
498
499    The current raster position requires five single-precision floating-point
500    values for its x_w, y_w, and z_w window coordinates, its w_c clip
501    coordinate, and its eye coordinate distance, a single valid bit, a color
502    (RGBA and color index), and texture coordinates for each set of texture
503    coordinates supported by the implementation.  In the initial state, the
504    coordinates and texture coordinates and both (0,0,0,1), the eye coordinate
505    distance is 0, the valid bit is set, the associated RGBA color is (1,1,1,1)
506    and the associated color index is 1. In RGBA mode, the associated color
507    index always has its initial value; in color index mode, the RGBA color
508    always maintains its initial value.
509
510
511Additions to Chapter 3 of the 1.1 Specification (Rasterization)
512
513    Section 3.8 Texturing
514
515    <amend paragraphs 1 & 2>
516
517    Texturing maps a portion of one or more specified images onto each
518    primitive for which texturing is enabled.  This mapping is accomplished by
519    using the color of an image at the location indicated by a fragment's
520    (s,t,r) coordinates to modify the fragment's RGBA color (r is currently
521    ignored).  An implementation may support texturing using more than one
522    image at a time.  In this case the fragment carries multiple sets of
523    texture coordinates (s,t,r) which are used to index separate images to
524    produce color values which are collectively used to modify the fragment's
525    RGBA color.  Texturing is specified only for RGBA mode; its use in color
526    index mode is undefined.  The following subsections (up to and including
527    Section 3.8.5) specify the GL operation with a single texture and Section
528    3.8.6 specifies the details of how multiple textures interact.
529
530    The GL provides a means to specify the details of how texturing of a
531    primitive is effected. These details include specifications of the image to
532    be texture mapped, the means by which the image is filtered when applied to
533    the primitive, and the function that determines what RGBA value is produced
534    given a fragment color and an image value.
535
536
537    Section 3.8.4 Texture Objects
538
539    <add this paragraph to the end of the section>
540
541    The texture object name space is shared amongst all textures in multiple
542    texture implementations.   A texture object may be bound to more than one
543    texture target simultaneously, though they must all be of the same type
544    (e.g., TEXTURE_1D, TEXTURE_2D).  After a texture object is bound, any GL
545    operations on that target also affect any other target to which the same
546    texture object is bound.
547
548
549    Section 3.8.5 Texture Environments and Texture Functions
550
551    <amend the second half of paragraph 1>
552    The possible environment parameters are TEXTURE_ENV_MODE,
553    TEXTURE_ENV_COLOR, and TEXTURE_ENV_COORD_SET_SGIS.  TEXTURE_ENV_MODE may be
554    set to one of REPLACE, MODULATE, DECAL, or BLEND; TEXTURE_ENV_COLOR is set
555    to an RGBA color by providing four single-precision floating-point values
556    in the range [0,1](values outside this range are clamped to it).  If
557    integers are provided for TEXTURE_ENV_COLOR, then they are converted to
558    floating-point as specified in Table 2.6 for signed integers.
559    TEXTURE_ENV_COORD_SET_SGIS may be set to one of TEXTURE0_SGIS ..
560    TEXTURE<n>_SGIS where <n> is one less than the number of supported
561    texture coordinate sets.  If a floating-point value is provided, then it
562    is rounded to the nearest integer.
563
564    <insert before paragraph 3>
565
566    The value of TEXTURE_ENV_COORD_SET_SGIS specifies which set of fragment
567    texture coordinates are used to determine the texture value used in
568    the texture function.  The same set of texture coordinates may
569    be simultaneously used by multiple textures.
570
571    <replace paragraph 3>
572
573    The state required for the current texture environment consists of the
574    four-valued integer indicating the texture function, four floating-
575    point TEXTURE_ENV_COLOR values, and one MAX_TEXTURE_COORD_SETS_SGIS-valued
576    integer indicating the texture coordinate set binding. In the initial
577    state, the texture function is given by MODULATE, TEXTURE_ENV_COLOR is
578    (0,0,0,0), and texture coordinate set is TEXTURE0_SGIS.
579
580
581    Section 3.8.6 Texture Application <replace with this>
582
583    Texturing is enabled or disabled using the generic Enable and Disable
584    commands, respectively, with the symbolic constant TEXTURE_1D or TEXTURE_2D
585    to enable the one-dimensional or two-dimensional texture, respectively.  If
586    both the one- and two-dimensional textures are enabled, the two-dimensional
587    texture is used.  If all texturing is disabled, a rasterized fragment is
588    passed unaltered to the next stage of the GL (although its texture
589    coordinates may be discarded).  Otherwise, a texture value is found
590    according to the parameter values of the currently bound texture image of
591    the appropriate dimensionality using the rules given in sections 3.8.1 and
592    3.8.2.  This texture value is used along with the incoming fragment in
593    computing the texture function indicated by the currently bound texture
594    environment.  The result of this function replaces the incoming fragment's
595    R, G, B, and A values.  These are the color values passed to subsequent
596    operations.  Other data associated with the incoming fragment remain
597    unchanged, except that the texture coordinates may be discarded.
598
599    When multiple textures are supported, additional textures are each paired
600    with an environment function.  The second texture function is computed
601    using the texture value from the second texture, the fragment resulting
602    from the first texture function computation and the environment function
603    currently bound to the second texture.  If there is a third texture, the
604    fragment resulting from the second texture function is combined with the
605    third texture value using the environment function bound to the third
606    texture and so on.  Texturing is enabled and disabled individually for each
607    texture.  If texturing is disabled for one of the textures, then the
608    fragment result from the previous stage is passed unaltered to the next
609    stage.
610
611
612Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
613and the Framebuffer)
614
615
616Additions to Chapter 5 of the 1.1 Specification (Special Functions)
617
618    Section 5.1 Evaluators
619
620    <amend second part of paragraph 2 to indicate that the evaluator
621    map modified is affected by SELECTED_TEXTURE_TRANSFORM_SGIS when the
622    the type parameter is one of the texture coordinates.>
623
624    <amend paragraph 7>
625
626    The evaluation of a defined map is enabled or disabled with Enable and
627    Disable using the constant corresponding to the map as described
628    above.  In implementations which support multiple texture coordinates the
629    affected texture evaluator map is further qualified by the value of
630    SELECTED_TEXTURE_TRANSFORM_SGIS.  The error INVALID_VALUE results if
631    either ustride or vstride is less than k, or if u1 is equal to u2, or
632    if v1 is equal to v2.
633
634
635    Section 5.3 Feedback
636
637    <amend bottom of paragraph 2>
638
639    The texture coordinates and colors returned are these resulting from the
640    clipping operations described in (section 2.13.8).  Only one set of texture
641    coordinates is returned even for implementations which support multiple
642    texture coordinates.  The texture coordinate set returned is the the one
643    corresponding to the value of SELECTED_TEXTURE_TRANSFORM_SGIS.
644
645
646Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
647
648    <add this paragraph after paragraph 14 regarding multi-valued state variables>
649
650    When multiple textures are supported, most texture state variables are
651    further qualified by the value of SELECTED_TEXTURE_TRANSFORM_SGIS or
652    SELECTED_TEXTURE_SGIS to determine which server texture state vector is
653    queried.  Client texture state variables such as texture coordinate
654    array pointers are qualified with SELECTED_TEXTURE_COORD_SET_SGIS.
655    Tables 6.5 through 6.22 indicate those state variables which are
656    qualified by SELECTED_TEXTURE_TRANSFORM_SGIS, SELECTED_TEXTURE_SGIS or
657    SELECTED_TEXTURE_COORD_SET_SGIS during state queries.
658
659    <add this paragraph after paragraph 16 regarding the TEXTURE_BIT>
660
661    When multiple textures are supported, operations on groups containing
662    replicated texture state push or pop all versions of texture state
663    within that group.  When server state for a group is pushed all state
664    in the group corresponding to TEXTURE0_SGIS is pushed first, followed by
665    state corresponding to TEXTURE1_SGIS, and so on up to and including the
666    state corresponding to TEXTURE<n>_SGIS where <n> is the value of
667    max{MAX_TEXTURES_SGIS, MAX_TEXTURE_COORD_SETS_SGIS}.  If state does
668    not exist for an attribute (this can occur when MAX_TEXTURES_SGIS is
669    not equal to MAX_TEXTURE_COORD_SETS_SGIS) then it is ignored.
670    When server state for a group is popped the replicated texture state is
671    restored in the opposite order that it was pushed, starting with state
672    corresponding to TEXTURE<n>_SGIS and ending with TEXTURE0_SGIS.
673    Identical rules are observed for client texture state push and pop
674    operations.
675
676    <rename vertex_array attribute group to vertex>
677
678
679Additions to the GLX Specification
680
681    None
682
683GLX Protocol
684
685    TBD
686
687Dependencies on EXT_texture3D
688
689    If EXT_texture3D is not supported than the functionality and state
690    associated with EXT_texture3D does not exist and is therefore not
691    extended.
692
693Dependencies on SGIS_texture4D
694
695    If SGIS_texture4D is not supported than the functionality and state
696    associated with SGIS_texture4D does not exist and is therefore not
697    extended.
698
699Dependencies on SGIS_texture_border_clamp
700
701    If SGIS_texture_border_clamp is not supported than the functionality and
702    state associated with SGIS_texture_border_clamp does not exist and is
703    therefore not extended.
704
705Dependencies on SGI_texture_color_table
706
707    If SGI_texture_color_table is not supported than the functionality and
708    state associated with SGI_texture_color_table does not exist and is
709    therefore not extended.
710
711Dependencies on SGIS_texture_edge_clamp
712
713    If SGIS_texture_edge_clamp is not supported than the functionality and
714    state associated with SGIS_texture_edge_clamp does not exist and is
715    therefore not extended.
716
717Dependencies on SGIX_texture_add_env
718
719    If SGIX_texture_add_env is not supported than the functionality and
720    state associated with SGIX_texture_add_env does not exist and is
721    therefore not extended.
722
723Dependencies on SGIS_texture_filter4
724
725    If SGIS_texture_filter4 is not supported than the functionality and
726    state associated with SGIS_texture_filter4 does not exist and is
727    therefore not extended.
728
729Dependencies on SGIS_texture_lod
730
731    If SGIS_texture_lod is not supported than the functionality and state
732    associated with SGIS_texture_lod does not exist and is therefore not
733    extended.
734
735Dependencies on SGIX_texture_lod_bias
736
737    If SGIX_texture_lod_bias is not supported than the functionality and
738    state associated with SGIX_texture_lod_bias does not exist and is
739    therefore not extended.
740
741Dependencies on SGIX_texture_scale_bias
742
743    If SGIX_texture_scale_bias is not supported than the functionality and
744    state associated with SGIX_texture_scale_bias does not exist and is
745    therefore not extended.
746
747Dependencies on SGIS_texture_select
748
749    If SGIS_texture_select is not supported than the functionality and state
750    associated with SGIS_texture_select does not exist and is therefore not
751    extended.
752
753Dependencies on SGIS_detail_texture
754
755    If SGIS_detail_texture is not supported than the functionality and state
756    associated with SGIS_detail_texture does not exist and is therefore not
757    extended.
758
759Dependencies on SGIS_sharpen_texture
760
761    If SGIS_sharpen_texture is not supported than the functionality and
762    state associated with SGIS_sharpen_texture does not exist and is
763    therefore not extended.
764
765Dependencies on SGIX_shadow
766
767    If SGIX_shadow is not supported than the functionality and state
768    associated with SGIX_shadow does not exist and is therefore not
769    extended.
770
771Dependencies on SGIX_shadow_ambient
772
773    If SGIX_shadow_ambient is not supported than the functionality and state
774    associated with SGIX_shadow_ambient does not exist and is therefore not
775    extended.
776
777Dependencies on SGIX_clipmap
778
779    If SGIX_clipmap is not supported than the functionality and state
780    associated with SGIX_clipmap does not exist and is therefore not
781    extended.
782
783Dependencies on SGIS_point_line_texgen
784
785    If SGIS_point_line_texgen is not supported than the functionality and
786    state associated with SGIS_point_line_texgen does not exist and is
787    therefore not extended.
788
789
790Errors
791
792    INVALID_ENUM is generated if SelectTextureSGIS,
793    SelectTextureTransformSGIS, SelectTextureCoordSetSGIS,
794    MultiTexCoord<n>{T}[v]SGIS, or MultiTexCoordPointer parameter <target> is
795    not TEXTURE0_SGIS .. TEXTURE3_SGIS.
796
797    INVALID_OPERATION is generated if SelectTextureCoordSetSGIS or
798    SelectTextureTransformSGIS parameter <target> is one of TEXTURE0_SGIS
799    .. TEXTURE3_SGIS and <target> is greater or equal than the number of
800    available textures coordinate sets.
801
802    INVALID_VALUE is generated if InterleavedTextureCoordSetsSGIS parameter
803    <factor> is not between 1 and MAX_TEXTURE_COORD_SETS_SGIS.
804
805    INVALID_OPERATION is generated if SelectTextureSGIS parameter <target> is
806    one of TEXTURE0_SGIS .. TEXTURE3_SGIS and <target> is greater or equal than
807    the number of available textures.
808
809    INVALID_ENUM is generated if TexEnv{T}[v] parameter <pname> is
810    TEXTURE_ENV_COORD_SET_SGIS and the <param> parameter is not one of
811    TEXTURE0_SGIS .. TEXTURE3_SGIS.
812
813    INVALID_OPERATION is generated if TexEnv{T}[v] parameter <pname>
814    is TEXTURE_ENV_COORD_SET_SGIS and the <param> parameter is greater or equal
815    than the number of available textures coordinate sets.
816
817    INVALID_OPERATION is generated if SelectTextureSGIS or
818    SelectTextureTransformSGIS is executed between execution of Begin and the
819    corresponding execution of End.
820
821    INVALID_OPERATION is generated if SelectTextureCoordSetSGIS or
822    MultiTexCoordPointerSGIS  is executed between execution of Begin and the
823    corresponding execution of End, but some implementations may not generate
824    the error.  In such cases the result of executing these commands is
825    undefined.
826
827New State
828
829    Get Value                           Get Command             Type            Initial Value           Attribute
830    ---------                           -----------             ----            -------------           ---------
831    SELECTED_TEXTURE_SGIS               GetIntegerv             Z4              TEXTURE0_SGIS           texture
832    SELECTED_TEXTURE_TRANSFORM_SGIS     GetIntegerv             Z4              TEXTURE0_SGIS           texture
833    SELECTED_TEXTURE_COORD_SET_SGIS     GetIntegerv             Z4              TEXTURE0_SGIS           vertex
834    TEXTURE_COORD_SET_INTERLEAVE_FACTOR_SGIS    GetIntegerv     Z4              1                       vertex
835
836Replicated State
837
838    Get Value                           Get Command             Type            Initial Value           Attribute
839    ---------                           -----------             ----            -------------           ---------
840  x CURRENT_TEXTURE_COORDS              GetFloatv               1* x T          (0,0,0,1)               current
841  x CURRENT_RASTER_TEXTURE_COORDS       GetFloatv               1* x T          (0,0,0,1)               current
842
843  c TEXTURE_COORD_ARRAY                 IsEnabled               1* x B          False                   vertex-array
844  c TEXTURE_COORD_ARRAY_SIZE            GetIntegerv             1* x Z+         0                       vertex-array
845  c TEXTURE_COORD_ARRAY_TYPE            GetIntegerv             1* x Z4         FLOAT                   vertex-array
846  c TEXTURE_COORD_ARRAY_STRIDE          GetIntegerv             1* x Z+         0                       vertex-array
847  c TEXTURE_COORD_ARRAY_POINTER         GetPointerv             1* x Y          0                       vertex-array
848
849  x TEXTURE_MATRIX                      GetFloatv               1* x 2* x M4    Identity                -
850  x TEXTURE_STACK_DEPTH                 GetIntegerv             1* x Z+         1                       -
851
852    TEXTURE_1D                          IsEnabled               1* x B          False                   texture/enable
853    TEXTURE_2D                          IsEnabled               1* x B          False                   texture/enable
854    TEXTURE_3D_EXT                      IsEnabled               1* x B          False                   texture/enable
855    TEXTURE_4D_SGIS                     IsEnabled               1* x B          False                   texture/enable
856    TEXTURE_BINDING_1D                  GetIntegerv             1* x Z+         0                       texture
857    TEXTURE_BINDING_2D                  GetIntegerv             1* x Z+         0                       texture
858    TEXTURE_BINDING_3D_EXT              GetIntegerv             1* x Z+         0                       texture
859    TEXTURE_BINDING_4D_SGIS             GetIntegerv             1* x Z+         0                       texture
860    TEXTURE                             GetTexImage             1* x n x I      see sec 3.8             -
861    TEXTURE_WIDTH                       GetTexLevelParameter    1* x n x Z+     0                       -
862    TEXTURE_HEIGHT                      GetTexLevelParameter    1* x n x Z+     0                       -
863   +TEXTURE_DEPTH_EXT                   GetTexLevelParameter    1* x n x Z+     0                       -
864    TEXTURE_BORDER                      GetTexLevelParameter    1* x n x Z+     0                       -
865    TEXTURE_INTERNAL_FORMAT             GetTexLevelParameter    1* x n x Z+     0                       -
866    (TEXTURE_COMPONENTS)
867    TEXTURE_RED_SIZE                    GetTexLevelParameter    1* x n x Z+     0                       -
868    TEXTURE_GREEN_SIZE                  GetTexLevelParameter    1* x n x Z+     0                       -
869    TEXTURE_BLUE_SIZE                   GetTexLevelParameter    1* x n x Z+     0                       -
870    TEXTURE_ALPHA_SIZE                  GetTexLevelParameter    1* x n x Z+     0                       -
871    TEXTURE_LUMINANCE_SIZE              GetTexLevelParameter    1* x n x Z+     0                       -
872    TEXTURE_INTENISTY_SIZE              GetTexLevelParameter    1* x n x Z+     0                       -
873    TEXTURE_BORDER_COLOR                GetTexParameter         1* x 2+ x C     (0,0,0,0)               texture
874    TEXTURE_MIN_FILTER                  GetTexParameter         1* x 2+ x Z6    see sec 3.8             texture
875    TEXTURE_MAG_FILTER                  GetTexParameter         1* x 2+ x Z2    see sec 3.8             texture
876    TEXTURE_WRAP_S                      GetTexParameter         1* x 2+ x Z2    REPEAT                  texture
877    TEXTURE_WRAP_T                      GetTexParameter         1* x 2+ x Z2    REPEAT                  texture
878   +TEXTURE_WRAP_R_EXT                  GetTexParameter         1* x 2+ x Z2    REPEAT                  texture
879   +TEXTURE_WRAP_Q_SGIS                 GetTexParameter         1* x 2+ x Z2    REPEAT                  texture
880    TEXTURE_PRIORITY                    GetTexParameterfv       1* x 2+ x R[0,1]        1               texture
881    TEXTURE_RESIDENT                    GetTexParameterfv       1* x 2+ x B     False                   texture
882
883   +TEXTURE_MIN_LOD_SGIS                GetTexParameterfv       1* x n x R      -1000                   texture
884   +TEXTURE_MAX_LOD_SGIS                GetTexParameterfv       1* x n x R      1000                    texture
885   +TEXTURE_BASE_LEVEL_SGIS             GetTexParameteriv       1* x n x R      0                       texture
886   +TEXTURE_MAX_LEVEL_SGIS              GetTexParameteriv       1* x n x R      1000                    texture
887
888   +TEXTURE_LOD_BIAS_S_SGIX             GetTexParameterfv       1* x n x R      0                       texture
889   +TEXTURE_LOD_BIAS_T_SGIX             GetTexParameterfv       1* x n x R      0                       texture
890   +TEXTURE_LOD_BIAS_R_SGIX             GetTexParameterfv       1* x n x R      0                       texture
891
892   +TEXTURE_FILTER4_FUNC_SGIS           GetTexFilterFuncSGIS    1* x 2 x Size x R       see text        texture
893
894   +DETAIL_TEXTURE_2D_BINDING_SGIS      GetIntegerv             1* x Z+         0                       texture
895   +DETAIL_TEXTURE_LEVEL_SGIS           GetTexParameteriv       1* x n x Z-     -4                      texture
896   +DETAIL_TEXTURE_MODE_SGIS            GetTexParameteriv       1* x n x Z2     ADD                     texture
897   +DETAIL_TEXTURE_FUNC_POINTS_SGIS     GetTexParameteriv       1* x n x Z+     2                       texture
898   +<DETAIL_TEXTURE_FUNC>               GetDetailTexFuncSGIS    1* x n x m x R  {0, 0}, {-4, 1}         texture
899
900   +SHARPEN_TEXTURE_FUNC_POINTS_SGIS    GetTexParameteriv       1* x n x Z+     2                       texture
901   +<SHARPEN_TEXTURE_FUNC>              GetSharpenTexFuncSGIS   1* x n x m x R  {0, 0}, {-4, 1}         texture
902
903   +TEXTURE_COMPARE_SGIX                GetTexParameter[if]v    1* x B          False                   texture
904   +TEXTURE_COMPARE_OPERATOR_SGIX       GetTexParameter[if]v    1* x Z_2        TEXTURE_LEQUAL_R_SGIX   texture
905
906   +SHADOW_AMBIENT_SGIX                 GetTexParameter[if]v    1* x R[0,1]     0.0                     texture
907
908   +TEXTURE_CLIPMAP_FRAME_SGIX          GetTexParameterf        1* x Z+         0                       texture
909   +TEXTURE_CLIPMAP_CENTER_SGIX         GetTexParameterfv       1* x 2 x Z+     0,0                     texture
910   +TEXTURE_CLIPMAP_OFFSET_SGIX         GetTexParameterfv       1* x 2 x Z+     0,0                     texture
911   +TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX  GetTexParameterfv       1* x 3 x Z+     0,0,0                   texture
912
913   +DUAL_TEXTURE_SELECT_SGIS            GetTexParameter         1* x n x 3 x Z2 0                       texture
914   +QUAD_TEXTURE_SELECT_SGIS            GetTexParameter         1* x n x 3 x Z4 0                       texture
915
916   +POST_TEXTURE_FILTER_BIAS_SGIX       GetTexParameterfv       1* x n x 4 x R  (0,0,0,0)               texture
917   +POST_TEXTURE_FILTER_SCALE_SGIX      GetTexParameterfv       1* x n x 4 x R  (1,1,1,1)               texture
918
919    TEXTURE_COLOR_TABLE_SGI             IsEnabled                       B               False           texture/enable
920   +COLOR_TABLE                         GetColorTableSGI                4 x I           empty           -
921   +COLOR_TABLE_FORMAT_SGI              GetColorTableParameterivSGI     2 x 4 x Z38     RGBA            -
922   +COLOR_TABLE_WIDTH_SGI               GetColorTableParameterivSGI     2 x 4 x Z+      0               -
923   +COLOR_TABLE_RED_SIZE_SGI            GetColorTableParameterivSGI     2 x 4 x Z+      0               -
924   +COLOR_TABLE_GREEN_SIZE_SGI          GetColorTableParameterivSGI     2 x 4 x Z+      0               -
925   +COLOR_TABLE_BLUE_SIZE_SGI           GetColorTableParameterivSGI     2 x 4 x Z+      0               -
926   +COLOR_TABLE_ALPHA_SIZE_SGI          GetColorTableParameterivSGI     2 x 4 x Z+      0               -
927   +COLOR_TABLE_LUMINANCE_SIZE_SGI      GetColorTableParameterivSGI     2 x 4 x Z+      0               -
928   +COLOR_TABLE_INTENSITY_SIZE_SGI      GetColorTableParameterivSGI     2 x 4 x Z+      0               -
929   +COLOR_TABLE_SCALE_SGI               GetColorTableParameterfvSGI     4 x R4          (1,1,1,1)       pixel
930   +COLOR_TABLE_BIAS_SGI                GetColorTableParameterfvSGI     4 x R4          (0,0,0,0)       pixel
931
932    TEXTURE_ENV_MODE                    GetTexEnviv             1* x Z4         MODULATE                texture
933    TEXTURE_ENV_COLOR                   GetTexEnviv             1* x C          (0,0,0,0)               texture
934    TEXTURE_ENV_COORD_SET_SGIS          GetTexEnviv             1* x Z4         see sec 3.8             texture
935  x TEXTURE_GEN_x                       IsEnabled               1* x 4 x B      False                   texture/enable
936  x EYE_PLANE                           GetTexGenfv             1* x 4 x R4     see sec 2.10.4          texture
937  x OBJECT_PLANE                        GetTexGenfv             1* x 4 x R4     see sec 2.10.4          texture
938  x TEXTURE_GEN_MODE                    GetTexGeniv             1* x 4 x Z3     EYE_LINEAR              texture
939
940   +TEXTURE_ENV_BIAS_SGIX               GetFloatv               1* x C          (0,0,0,0)               texture
941
942  x+EYE_POINT_SGIS                      GetTexGeniv             1* x 4 x R      (0,0,0,1)               texture
943  x+OBJECT_POINT_SGIS                   GetTexGeniv             1* x 4 x R      (0,0,0,1)               texture
944  x+EYE_LINE_SGIS                       GetTexGeniv             1* x 7 x R      (0,0,0,1,0,0,1)         texture
945  x+OBJECT_LINE_SGIS                    GetTexGeniv             1* x 7 x R      (0,0,0,1,0,0,1)         texture
946
947  x ORDER                               GetMapiv                (k+9) x Z8*     1                       -
948  x ORDER                               GetMapiv                (k+9) x 2 x Z8* 1,1                     -
949  x COEFF                               GetMapfv                (k+9) x 8* x Rn see sec 5.1             -
950  x COEFF                               GetMapfv                (k+9) x 8* x 8* x Rn    see sec 5.1             -
951  x DOMAIN                              GetMapfv                (k+9) x 2 x R   see sec 5.1             -
952  x DOMAIN                              GetMapfv                (k+9) x 4 x R   see sec 5.1             -
953  x MAP1_x                              IsEnabled               (k+9) x B       False                   -
954  x MAP2_x                              IsEnabled               (k+9) x B       False                   -
955
956+ = state defined in another extension.
957x = state qualified by SELECTED_TEXTURE_TRANSFORM_SGIS
958c = state qualified by SELECTED_TEXTURE_COORD_SET_SGIS
959
960New Implementation Dependent State
961
962    Get Value                           Get Command             Type            Minimum Value
963    ---------                           -----------             ----            -------------
964    MAX_TEXTURES_SGIS                   GetIntegerv             Z+              1
965    MAX_TEXTURE_COORD_SETS_SGIS         GetIntegerv             Z+              1
966