15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci     EXT_texenv_op
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci     GL_EXT_texenv_op
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci     Tom Frisinger (tfrisinger 'at' atitech.com)
125bd8deadSopenharmony_ci     Michael Gold (gold 'at' nvidia.com)
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciStatus
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    XXX - Not complete yet!!!
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciVersion
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    $Date: 1999/12/28 01:40:34 $ $Revision: 1.4 $
215bd8deadSopenharmony_ci    ATI Date: 1999/03/02 12:00:00  Revision: 1.1
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciNumber
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci     XXX
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciDependencies
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    OpenGL 1.1 is required.
305bd8deadSopenharmony_ci    ARB_multitexture is required.
315bd8deadSopenharmony_ci    This specification is written against the OpenGL 1.2 specification.
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciOverview
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci     The EXT_texenv_op extension defines a more expressive means for
365bd8deadSopenharmony_ci     programming the operations performed by the texture environment. It
375bd8deadSopenharmony_ci     defines new texture environment equations and allows explicit control
385bd8deadSopenharmony_ci     over the operands to the new equations. This explicit control can be
395bd8deadSopenharmony_ci     independently applied to the alpha and RGB color fragments.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciIssues
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci   * Should we include f, iv, and fv versions of the TexEnvOperand call.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci        No, there seems to be no compelling reason to do so.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci   * Should we try to wrap this entire interface into TexEnv or at least
485bd8deadSopenharmony_ci     the specification of the operation?
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci        Move operation specification into TexEnv, but keep TexEnvOperandiEXT
515bd8deadSopenharmony_ci        for operand specification.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci   * Should a stage argument be added to TexEnvOperandiEXT to decouple from
545bd8deadSopenharmony_ci     the current unit selector?
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci        No. This goes against the ARB_multitexture implementation. We
575bd8deadSopenharmony_ci        have however allowed TEXTUREn_ARB as a value to the source
585bd8deadSopenharmony_ci        parameter of TexEnvOperandiEXT. This allows the texture fragment
595bd8deadSopenharmony_ci        to come from the texture bound to any legal texture unit stage.
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci   * Should a generic scale and bias term be added?
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci        Allow scales of 1.0, 2.0, and 4.0 to be applied to the output of
645bd8deadSopenharmony_ci        each stage. The scales can be independently applied to RGB and
655bd8deadSopenharmony_ci        Alpha. Generic biasing isn't allowed. However the ADD_SIGNED_EXT
665bd8deadSopenharmony_ci        operation effectively allows a bias of -0.5.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci   * Should alpha and RGB operands be completely orthogonal?
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci     Yes.
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci   * This spec becomes much more powerful when ARB_multitexture is
735bd8deadSopenharmony_ci     available. However, it seemed like having the new texture environment
745bd8deadSopenharmony_ci     functions and control over operands available to implementations that
755bd8deadSopenharmony_ci     don't support ARB_multitexture could be useful.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci        Make ARB_multitexture required. We define PREVIOUS_EXT to be
785bd8deadSopenharmony_ci        INCOMING_EXT for the texture unit 0 case so we could loosen up the
795bd8deadSopenharmony_ci        spec if need be.
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci   * IDENTITY_EXT and ONE_MINUS_EXT are the legal values to the mapping
825bd8deadSopenharmony_ci     parameter of TexEnvOperandiEXT. Other names such as COPY, INVERT, or
835bd8deadSopenharmony_ci     COMPLEMENT_EXT may or may not be more appropriate.
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci        Keep IDENTITY_EXT and ONE_MINUS_EXT they seem to be as good as any.
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci   * Should a third operand be introduced such that the blending operations
885bd8deadSopenharmony_ci     could be generalized to the following equation?
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci       Cv = CopA*(1- CopC) + CopB* CopC
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci        Yes, this is the INTERPOLATE_EXT operation. Interpolation in the
935bd8deadSopenharmony_ci        alpha channel is also permitted.
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci  *  Should we make the OpenGL 1.1 modes programmable? For example should
965bd8deadSopenharmony_ci     setting the env. mode to MODULATE have the effect of changing the
975bd8deadSopenharmony_ci     TEXTURE_ENV_MODE_ALPHA_EXT, TEXTURE_ENV_MODE_RGB_EXT, OPERANDS, and
985bd8deadSopenharmony_ci     possibly the OPERATIONS to a given state that would correspond with
995bd8deadSopenharmony_ci     tables 3.18 and 3.19?
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci        Instead of this approach, we decided to go with the
1025bd8deadSopenharmony_ci        non-programmable approach. For example MODULATE works as it
1035bd8deadSopenharmony_ci        always did according to table 3.18 and 3.19 and does not change
1045bd8deadSopenharmony_ci        TEXTURE_ENV_MODE_ALPHA_EXT, TEXTURE_ENV_MODE_RGB_EXT, OPERAND,
1055bd8deadSopenharmony_ci        or OPERATION state. This adds a small amount of burden to the
1065bd8deadSopenharmony_ci        driver but seems more consistent.
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci   * ALPHA_SCALE and RGB_SCALE_EXT accept only 1.0, 2.0 and 4.0. This look
1095bd8deadSopenharmony_ci     like we are really doing a shift. Should the value be restricted to an
1105bd8deadSopenharmony_ci     integer and indicate a shift instead of a scale?
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci        There is no reason to limit the domain of SCALE to an integer,
1135bd8deadSopenharmony_ci        even if we only support integral values today. Lets keep it a
1145bd8deadSopenharmony_ci        floating point value to allow future generalization.
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ciNew Procedures and Functions
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci     void TexEnvOperandiEXT(enum pname, int source, int mapping,
1195bd8deadSopenharmony_ci                            int component);
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci     void GetTexEnvOperandivEXT(enum pname, enum query, int *param);
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ciNew Tokens
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ci     Accepted by <pname> parameter of TexEnvf, TexEnvi, TexEnvfv, TexEnviv,
1265bd8deadSopenharmony_ci     GetTexEnviv, and GetTexEnvfv:
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci        TEXTURE_ENV_MODE_ALPHA_EXT                    0x8570
1295bd8deadSopenharmony_ci        TEXTURE_ENV_MODE_RGB_EXT                      0x8571
1305bd8deadSopenharmony_ci        RGB_SCALE_EXT                                 0x8572
1315bd8deadSopenharmony_ci        ALPHA_OPERATION_EXT                           0x8590
1325bd8deadSopenharmony_ci        RGB_OPERATION_EXT                             0x8598
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci     Accepted by the <param> parameter of TexEnvf, TexEnvi, TexEnvfv, and
1355bd8deadSopenharmony_ci     TexEnviv when the <pname> parameter is TEXTURE_ENV_MODE,
1365bd8deadSopenharmony_ci     TEXTURE_ENV_MODE_ALPHA_EXT, or TEXTURE_ENV_MODE_RGB_EXT:
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci        A_TIMES_B_OP_C_EXT                            0x8573
1395bd8deadSopenharmony_ci        INTERPOLATE_EXT                               0x8574
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci     Accepted by the <param> parameter of TexEnvf, TexEnvi, TexEnvfv, and
1425bd8deadSopenharmony_ci     TexEnviv when the <pname> parameter is ALPHA_OPERATION_EXT or
1435bd8deadSopenharmony_ci     RGB_OPERATION_EXT:
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci        ADD_SIGNED_EXT                                0x8575
1465bd8deadSopenharmony_ci        SUTRACT_EXT                                   0x8576
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci     Accepted by the <pname> parameter of TexEnvOperandiEXT and
1495bd8deadSopenharmony_ci     GetTexEnvOperandivEXT:
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci        ALPHA_OPERAND_A_EXT                           0x8580
1525bd8deadSopenharmony_ci        ALPHA_OPERAND_B_EXT                           0x8581
1535bd8deadSopenharmony_ci        ALPHA_OPERAND_C_EXT                           0x8582
1545bd8deadSopenharmony_ci        RGB_OPERAND_A_EXT                             0x8588
1555bd8deadSopenharmony_ci        RGB_OPERAND_B_EXT                             0x8589
1565bd8deadSopenharmony_ci        RGB_OPERAND_C_EXT                             0x858A
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci     Accepted by the source parameter to TexEnvOperandiExt:
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci        CONSTANT_EXT                                  0x8577
1615bd8deadSopenharmony_ci        INCOMING_EXT                                  0x8578
1625bd8deadSopenharmony_ci        PREVIOUS_EXT                                  0x8579
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci     Accepted by the mapping parameter to TexEnvOperandiExt:
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci        IDENTITY_EXT                                  0x857A
1675bd8deadSopenharmony_ci        ONE_MINUS_EXT                                 0x857B
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci     Accepted by the query parameter to GetTexEnvOperandivEXT:
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci        SOURCE_EXT                                    0x857C
1725bd8deadSopenharmony_ci        MAPPING_EXT                                   0x857D
1735bd8deadSopenharmony_ci        COMPONENT_EXT                                 0x857E
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ciAdditions to Chapter 1 of the GL Specification (Introduction)
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci     None
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ciAdditions to Chapter 2 of the GL Specification (OpenGL Operation)
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci     None
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ciAdditions to Chapter 3 of the GL Specification (Rasterization)
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci     Function             Operation         Equation
1865bd8deadSopenharmony_ci     --------             ---------         --------
1875bd8deadSopenharmony_ci     INTERPOLATE_EXT                        Av = AopA * (1-AopC) + AopB * AopC
1885bd8deadSopenharmony_ci     A_TIMES_B_OP_C_EXT   ADD               Av = AopA * AopB + AopC
1895bd8deadSopenharmony_ci                          ADD_SIGNED_EXT    Av = AopA * AopB + AopC - 0.5
1905bd8deadSopenharmony_ci                          SUBTRACT_EXT      Av = AopA * AopB - AopC
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci     Table 3.20: Alpha texture environment functions, operations and equations
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci     Function             Operation         Equation
1965bd8deadSopenharmony_ci     --------             ---------         --------
1975bd8deadSopenharmony_ci     INTERPOLATE_EXT                        Cv = CopA * (1-CopC) + CopB * CopC
1985bd8deadSopenharmony_ci     A_TIMES_B_OP_C_EXT   ADD               Cv = CopA * CopB + CopC
1995bd8deadSopenharmony_ci                          ADD_SIGNED_EXT    Cv = CopA * CopB + CopC - 0.5
2005bd8deadSopenharmony_ci                          SUBTRACT_EXT      Cv = CopA * CopB - CopC
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci     Table 3.21: RGB texture environment functions, operations and equations
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci     Operand                     Source             Mapping          Component
2065bd8deadSopenharmony_ci     -------                     ------             -------          ---------
2075bd8deadSopenharmony_ci     ALPHA_OPERAND_A_EXT         TEXTURE            IDENTITY_EXT     ALPHA
2085bd8deadSopenharmony_ci     ALPHA_OPERAND_B_EXT         TEXTUREn_ARB       ONE_MINUS_EXT
2095bd8deadSopenharmony_ci     ALPHA_OPERAND_C_EXT         CONSTANT_EXT
2105bd8deadSopenharmony_ci                                 INCOMING_EXT
2115bd8deadSopenharmony_ci                                 PREVIOUS_EXT
2125bd8deadSopenharmony_ci                                 ZERO
2135bd8deadSopenharmony_ci     RGB_OPERAND_A_EXT           TEXTURE            IDENTITY_EXT     ALPHA
2145bd8deadSopenharmony_ci     RGB_OPERAND_B_EXT           TEXTUREn_ARB       ONE_MINUS_EXT    RGB
2155bd8deadSopenharmony_ci     RGB_OPERAND_C_EXT           CONSTANT_EXT
2165bd8deadSopenharmony_ci                                 INCOMING_EXT
2175bd8deadSopenharmony_ci                                 PREVIOUS_EXT
2185bd8deadSopenharmony_ci                                 ZERO
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci     Table 3.22: Inputs to TexEnvOperandiEXT
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci     Texture                          LUMINANCE
2245bd8deadSopenharmony_ci     Format      ALPHA     LUMINANCE    ALPHA     INTENSITY   RGB    RGBA
2255bd8deadSopenharmony_ci     -------     -----     ---------  ----------  ---------   ---    ----
2265bd8deadSopenharmony_ci     RGB          1.0       Lt         Lt          It          Ct     Ct
2275bd8deadSopenharmony_ci     ALPHA        At        1.0        At          It          1.0    At
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ci     Table 3.23: Texture fragment sources
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci3.8.9 Texture Environments and Texture Functions
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci     The command
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci        void TexEnv{if}( enum target, enum pname, T param ) ;
2365bd8deadSopenharmony_ci        void TexEnv{if}v( enum target, enum pname, T params ) ;
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci     sets parameters of the texture environment that specifies how texture
2395bd8deadSopenharmony_ci     values are interpreted when texturing a fragment. target must
2405bd8deadSopenharmony_ci     currently be the symbolic constant TEXTURE_ENV. pname is a symbolic
2415bd8deadSopenharmony_ci     constant indicating the parameter to be set. In the first form of the
2425bd8deadSopenharmony_ci     command, param is a value to which to set a single-valued parameter;
2435bd8deadSopenharmony_ci     in the second form, params is a pointer to an array of parameters:
2445bd8deadSopenharmony_ci     either a single symbolic constant or a value or group of values to
2455bd8deadSopenharmony_ci     which the parameter should be set. The possible environment parameters
2465bd8deadSopenharmony_ci     are TEXTURE_ENV_MODE, TEXTURE_ENV_MODE_ALPHA_EXT,
2475bd8deadSopenharmony_ci     TEXTURE_ENV_MODE_RGB_EXT, ALPHA_OPERATION_EXT, RGB_OPERATION_EXT,
2485bd8deadSopenharmony_ci     ALPHA_SCALE_EXT, RGB_SCALE_EXT, and TEXTURE_ENV_COLOR.
2495bd8deadSopenharmony_ci     TEXTURE_ENV_MODE, TEXTURE_ENV_MODE_ALPHA_EXT, and
2505bd8deadSopenharmony_ci     TEXTURE_ENV_MODE_RGB_EXT may be set to one of REPLACE, MODULATE,
2515bd8deadSopenharmony_ci     DECAL, BLEND, A_TIMES_B_OP_C_EXT, or INTERPOLATE_EXT;
2525bd8deadSopenharmony_ci     ALPHA_OPERATION_EXT and RGB_OPERATION_EXT may be set to one of ADD,
2535bd8deadSopenharmony_ci     ADD_SIGNED_EXT, SUBTRACT_EXT; ALPHA_SCALE and RGB_SCALE_EXT are
2545bd8deadSopenharmony_ci     single-precision floating point values that may have a value of 1.0,
2555bd8deadSopenharmony_ci     2.0, or 4.0. TEXTURE_ENV_COLOR is set to an RGBA color providing four
2565bd8deadSopenharmony_ci     single-precision floating-point values in the range [0, 1] (values
2575bd8deadSopenharmony_ci     outside this range are clamped to it). If integers are provided for
2585bd8deadSopenharmony_ci     TEXTURE_ENV_COLOR, then they are converted to floating-point as
2595bd8deadSopenharmony_ci     specified in table 2.6 for signed integers.
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci     The value of TEXTURE_ENV_MODE specifies an implicit texture function
2625bd8deadSopenharmony_ci     if it is REPLACE, MODULATE, DECAL, or BLEND. The result of this
2635bd8deadSopenharmony_ci     function depends on the fragment and the texture array value. The
2645bd8deadSopenharmony_ci     precise form of the function depends on the base internal formats of
2655bd8deadSopenharmony_ci     the texture arrays that were last specified. In the following two
2665bd8deadSopenharmony_ci     tables, Rf, Gf, Bf, and Af are the primary color components of the
2675bd8deadSopenharmony_ci     incoming fragment; Rt, Gt, Bt, At, Lt, and It are the filtered texture
2685bd8deadSopenharmony_ci     values; Rc, Gc, Bc, and Ac are the texture environment color values;
2695bd8deadSopenharmony_ci     and Rv, Gv, Bv, and Av are the primary color components computed by
2705bd8deadSopenharmony_ci     the texture function. All of these color values are in the range [0,
2715bd8deadSopenharmony_ci     1]. The REPLACE and MODULATE texture functions are specified in table
2725bd8deadSopenharmony_ci     3.18, and the DECAL and BLEND texture functions are specified in table
2735bd8deadSopenharmony_ci     3.19.
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci     The texture function used to generate the Alpha component (Av) and the
2765bd8deadSopenharmony_ci     RGB component (Rv, Gv, Bv) can be independently specified using
2775bd8deadSopenharmony_ci     TEXTURE_ENV_MODE_ALPHA_EXT and TEXTURE_ENV_MODE_RGB_EXT respectively.
2785bd8deadSopenharmony_ci     The alpha component will be computed in accordance to the alpha
2795bd8deadSopenharmony_ci     equation for the given alpha texture function as specified in tables
2805bd8deadSopenharmony_ci     3.18 and 3.19. The RGB components will be computed in accordance to
2815bd8deadSopenharmony_ci     the RGB equations for the given RGB texture function as specified in
2825bd8deadSopenharmony_ci     tables 3.18 and 3.19. Queries to TEXTURE_ENV_MODE are supported for
2835bd8deadSopenharmony_ci     compatibility and are equivalent to querying TEXTURE_ENV_MODE_RGB_EXT.
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci     The value of TEXTURE_ENV_MODE, TEXTURE_ENV_MODE_ALPHA_EXT, or
2865bd8deadSopenharmony_ci     TEXTURE_ENV_MODE_RGB_EXT specifies an explicit texture function if it
2875bd8deadSopenharmony_ci     is INTERPOLATE_EXT or A_TIMES_B_OP_C_EXT. Specifying TEXTURE_ENV_MODE
2885bd8deadSopenharmony_ci     with a value of INTERPOLATE_EXT or A_TIMES_B_OP_C_EXT will result in
2895bd8deadSopenharmony_ci     the setting of both TEXTURE_ENV_MODE_ALPHA_EXT and
2905bd8deadSopenharmony_ci     TEXTURE_ENV_MODE_RGB_EXT to the given value. The result of this
2915bd8deadSopenharmony_ci     function depends on the currently selected operands and in the case of
2925bd8deadSopenharmony_ci     A_TIMES_B_OP_C_EXT the operation. In tables 3.20, 3.21, 3.22, and 3.23
2935bd8deadSopenharmony_ci     the following variables are used:
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci     AopA = ALPHA_OPERAND_A_EXT
2965bd8deadSopenharmony_ci     AopB = ALPHA_OPERAND_B_EXT
2975bd8deadSopenharmony_ci     AopC = ALPHA_OPERAND_C_EXT
2985bd8deadSopenharmony_ci     CopA = RGB_OPERAND_A_EXT
2995bd8deadSopenharmony_ci     CopB = RGB_OPERAND_B_EXT
3005bd8deadSopenharmony_ci     CopC = RGB_OPERAND_C_EXT
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ci     All of these color and alpha values are clamped to the range [0,1].
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ci     and:
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci     Ac, Af, At, Av, Ct, It, and Lt have the same meaning as in tables 3.18
3075bd8deadSopenharmony_ci     and 3.19.
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci     See tables 3.20 and 3.21 for the specifics of the texture functions.
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci     ALPHA_OPERATION_EXT specifies the texture environment operation to be
3125bd8deadSopenharmony_ci     applied to the alpha component of the color fragment.
3135bd8deadSopenharmony_ci     RGB_OPERATION_EXT specifies the texture environment operation to be
3145bd8deadSopenharmony_ci     applied to the RGB component of the color fragment. This operation is
3155bd8deadSopenharmony_ci     only applicable when the texture environment mode is A_TIMES_B_OP_C
3165bd8deadSopenharmony_ci     and can have a value of ADD, ADD_SIGNED_EXT, or SUBTRACT_EXT. See
3175bd8deadSopenharmony_ci     tables 3.20 and 3.21 for texture operation equations.
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci     The values for ALPHA_SCALE and RGB_SCALE_EXT specify the amount of
3205bd8deadSopenharmony_ci     scaling to be applied to the Alpha and RGB output of each texture unit
3215bd8deadSopenharmony_ci     stage. Valid values are 1.0, 2.0, and 4.0. Scaling happens prior to
3225bd8deadSopenharmony_ci     clamping of Rv, Gv, Bv, and Av to the range [0,1].
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ci     The command
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ci        void TexEnvOperandiEXT(enum pname, int source, int mapping, int
3275bd8deadSopenharmony_ci                               component);
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci     is used to set the operands to the texture function operation. <pname>
3305bd8deadSopenharmony_ci     is a symbolic constant indicating the parameter to be set; the
3315bd8deadSopenharmony_ci     possible constants and corresponding parameters are summarized in
3325bd8deadSopenharmony_ci     table 3.22.
3335bd8deadSopenharmony_ci
3345bd8deadSopenharmony_ci     When <pname> is set to ALPHA_OPERAND_l_EXT, the alpha component of
3355bd8deadSopenharmony_ci     operand l is modified. When <pname> is set to RGB_OPERAND_l_EXT, the RGB
3365bd8deadSopenharmony_ci     component of operand l is modified.
3375bd8deadSopenharmony_ci
3385bd8deadSopenharmony_ci     <source> specifies the source of the operand data. TEXTURE specifies to
3395bd8deadSopenharmony_ci     use the filtered texture fragment from the current texture unit as an
3405bd8deadSopenharmony_ci     operand. TEXTUREn_ARB specifies to use the filtered texture fragment
3415bd8deadSopenharmony_ci     from the nth texture unit. When <source> is set to TEXTURE or
3425bd8deadSopenharmony_ci     TEXTUREn_ARB the value of the texture fragment depends on the base
3435bd8deadSopenharmony_ci     internal formats of the texture arrays that were last specified (see
3445bd8deadSopenharmony_ci     Table 3.23). CONSTANT_EXT specifies to use the constant texture
3455bd8deadSopenharmony_ci     environment color as the fragment. INCOMING_EXT specifies to use the
3465bd8deadSopenharmony_ci     incoming fragment color. PREVIOUS_EXT indicates that the input to the
3475bd8deadSopenharmony_ci     operand comes from the specified output of the previous texture unit.
3485bd8deadSopenharmony_ci     If the current selected texture unit is texture unit 0, then
3495bd8deadSopenharmony_ci     PREVIOUS_EXT has the same meaning as INCOMING_EXT (i.e. the input to
3505bd8deadSopenharmony_ci     operand is the incoming fragment).
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci     <mapping> specifies what operation will be done to the source fragment
3535bd8deadSopenharmony_ci     prior to its use as an operand. IDENTITY_EXT specifies that no
3545bd8deadSopenharmony_ci     operation will be done on the fragment. ONE_MINUS specifies that 1.0
3555bd8deadSopenharmony_ci     minus the fragment color will be used as an operand.
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci     <component> specifies which part of the source fragment color to use.
3585bd8deadSopenharmony_ci     <component> must be ALPHA when pname is ALPHA_OPERAND_l_EXT. Valid
3595bd8deadSopenharmony_ci     values for <component> are ALPHA and RGB when <pname> is
3605bd8deadSopenharmony_ci     RGB_OPERAND_l_EXT.
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ci     The state required for the current texture environment consists of two
3635bd8deadSopenharmony_ci     six-valued integers indicating the texture rgb and alpha functions;
3645bd8deadSopenharmony_ci     the four floating-point TEXTURE_ENV_COLOR values; two three-valued
3655bd8deadSopenharmony_ci     integers representing the RGB and ALPHA operations; two floating point
3665bd8deadSopenharmony_ci     RGB_SCALE_EXT and ALPHA_SCALE values; six n-valued integers
3675bd8deadSopenharmony_ci     representing the RGB and ALPHA OPERAND A,B and C values, where n
3685bd8deadSopenharmony_ci     equals five plus the number of texture units; six two-valued integers
3695bd8deadSopenharmony_ci     representing the operand mappings; and three two-valued integers
3705bd8deadSopenharmony_ci     representing the component selection of the RGB_OPERANDs. In the
3715bd8deadSopenharmony_ci     initial state, the texture RGB and ALPHA functions are MODULATE; the
3725bd8deadSopenharmony_ci     TEXTURE_ENV_COLOR is (0,0,0,0); the RGB and ALPHA operations are ADD;
3735bd8deadSopenharmony_ci     the RGB and ALPHA scales are 1.0; the RGB_OPERAND_A_EXT and
3745bd8deadSopenharmony_ci     ALPHA_OPERAND_A_EXT sources are both PREVIOUS_EXT; the
3755bd8deadSopenharmony_ci     RGB_OPERAND_B_EXT and ALPHA_OPERAND_B_EXT sources are both TEXTURE;
3765bd8deadSopenharmony_ci     the RGB_OPERAND_C_EXT and ALPHA_OPERAND_C_EXT sources are both ZERO;
3775bd8deadSopenharmony_ci     all operand mappings are IDENTITY_EXT; all RGB operand components are
3785bd8deadSopenharmony_ci     RGB; and all ALPHA operand mappings are ALPHA.
3795bd8deadSopenharmony_ci
3805bd8deadSopenharmony_ciAdditions to Chapter 4 of the GL Specification (Per-Fragment
3815bd8deadSopenharmony_ciOperations and the Framebuffer)
3825bd8deadSopenharmony_ci
3835bd8deadSopenharmony_ci     None
3845bd8deadSopenharmony_ci
3855bd8deadSopenharmony_ciAdditions to Chapter 5 of the GL Specification (Special Functions)
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci     None
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ciAdditions to Chapter 6 of the GL Specification (State and State Requests)
3905bd8deadSopenharmony_ci
3915bd8deadSopenharmony_ci     3. Enumerated Queries
3925bd8deadSopenharmony_ci
3935bd8deadSopenharmony_ci        void GetTexEnvOperandivEXT(enum pname, enum query, int *param);
3945bd8deadSopenharmony_ci
3955bd8deadSopenharmony_ci     GetTexEnvOperandivEXT places information about <query> (a symbolic
3965bd8deadSopenharmony_ci     constant) for <pname> (also symbolic constant) in <param>.
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ciAdditions to the GLX Specification
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci     None
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ciGLX Protocol
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ci     TBD
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ciErrors
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci     INVALID_ENUM is generated when target or pname parameters of TexEnvi
4095bd8deadSopenharmony_ci     or TexEnvf are not one of the accepted defined values, or when params
4105bd8deadSopenharmony_ci     should have a defined constant value (based on the value of pname) and
4115bd8deadSopenharmony_ci     does not.
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci     INVALID_ENUM is generated when pname, source, mapping, or component
4145bd8deadSopenharmony_ci     parameters of TexEnvOperandiEXT are not one of the accepted defined
4155bd8deadSopenharmony_ci     values.
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci     INVALID_ENUM is generated when pname parameter of
4185bd8deadSopenharmony_ci     GetTexEnvOperandEXTiv is not one of the accepted defined values.
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci     INVALID_OPERATION is generated if TexEnvOperandiEXT, or
4215bd8deadSopenharmony_ci     GetTexEnvOperandivEXT are executed between execution of Begin and the
4225bd8deadSopenharmony_ci     corresponding execution of End.
4235bd8deadSopenharmony_ci
4245bd8deadSopenharmony_ciNew State
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci     All new state belongs to Section 3.8.9. All new state has an attribute
4275bd8deadSopenharmony_ci     of 'texture'. These are additions/modifications to table 6.14.
4285bd8deadSopenharmony_ci
4295bd8deadSopenharmony_ci
4305bd8deadSopenharmony_ci  Get Value                   Type   Get Command            Initial Value
4315bd8deadSopenharmony_ci  ---------                   ----   -----------            ------------ 
4325bd8deadSopenharmony_ci  TEXTURE_ENV_MODE_ALPHA_EXT  Z6     GetTexEnviv            MODULATE     
4335bd8deadSopenharmony_ci  TEXTURE_ENV_MODE_RGB_EXT    Z6     GetTexEnviv            MODULATE 
4345bd8deadSopenharmony_ci  ALPHA_SCALE                 R      GetTexEnvfv            1.0      
4355bd8deadSopenharmony_ci  RGB_SCALE_EXT               R      GetTexEnvfv            1.0      
4365bd8deadSopenharmony_ci  ALPHA_OPERATION_EXT         Z3     GetTexEnviv            ADD      
4375bd8deadSopenharmony_ci  RGB_OPERATION_EXT           Z3     GetTexEnviv            ADD      
4385bd8deadSopenharmony_ci  SOURCE_EXT                  6 X    GetTexEnvOperandivEXT  PREVIOUS_EXT for
4395bd8deadSopenharmony_ci                              Z6                            ALPHA_OPERAND_A_EXT
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ci                                                            PREVIOUS_EXT for
4425bd8deadSopenharmony_ci                                                            RGB_OPERAND_A_EXT
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci                                                            TEXTURE for
4455bd8deadSopenharmony_ci                                                            ALPHA_OPERAND_B_EXT
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci                                                            TEXTURE for
4485bd8deadSopenharmony_ci                                                            RGB_OPERAND_B_EXT
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ci                                                            ZERO for
4515bd8deadSopenharmony_ci                                                            ALPHA_OPERAND_C_EXT
4525bd8deadSopenharmony_ci
4535bd8deadSopenharmony_ci                                                            ZERO for
4545bd8deadSopenharmony_ci                                                            RGB_OPERAND_C_EXT
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ci  MAPPING_EXT                 6 X    GetTexEnvOperandivEXT  IDENTITY_EXT for
4575bd8deadSopenharmony_ci                              Z2                            ALPHA_OPERAND_A_EXT
4585bd8deadSopenharmony_ci
4595bd8deadSopenharmony_ci                                                            IDENTITY_EXT for
4605bd8deadSopenharmony_ci                                                            RGB_OPERAND_A_EXT
4615bd8deadSopenharmony_ci
4625bd8deadSopenharmony_ci                                                            IDENTITY_EXT for
4635bd8deadSopenharmony_ci                                                            ALPHA_OPERAND_B_EXT
4645bd8deadSopenharmony_ci
4655bd8deadSopenharmony_ci                                                            IDENTITY_EXT for
4665bd8deadSopenharmony_ci                                                            RGB_OPERAND_B_EXT
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ci                                                            IDENTITY_EXT for
4695bd8deadSopenharmony_ci                                                            ALPHA_OPERAND_C_EXT
4705bd8deadSopenharmony_ci
4715bd8deadSopenharmony_ci                                                            IDENTITY_EXT for
4725bd8deadSopenharmony_ci                                                            RGB_OPERAND_C_EXT
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ci  COMPONENT_EXT               6 X    GetTexEnvOperandivEXT  ALPHA for
4755bd8deadSopenharmony_ci                              Z2                            ALPHA_OPERAND_A_EXT
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci                                                            RGB for
4785bd8deadSopenharmony_ci                                                            RGB_OPERAND_A_EXT
4795bd8deadSopenharmony_ci
4805bd8deadSopenharmony_ci                                                            ALPHA for
4815bd8deadSopenharmony_ci                                                            ALPHA_OPERAND_B_EXT
4825bd8deadSopenharmony_ci
4835bd8deadSopenharmony_ci                                                            RGB for
4845bd8deadSopenharmony_ci                                                            RGB_OPERAND_B_EXT
4855bd8deadSopenharmony_ci
4865bd8deadSopenharmony_ci                                                            ALPHA for
4875bd8deadSopenharmony_ci                                                            ALPHA_OPERAND_C_EXT
4885bd8deadSopenharmony_ci
4895bd8deadSopenharmony_ci                                                            RGB for
4905bd8deadSopenharmony_ci                                                            RGB_OPERAND_C_EXT
4915bd8deadSopenharmony_ci
4925bd8deadSopenharmony_ci     Table 6.14: Texture Environment and Generation
4935bd8deadSopenharmony_ci
4945bd8deadSopenharmony_ciNew Implementation Dependent State
4955bd8deadSopenharmony_ci
4965bd8deadSopenharmony_ci     None
497