15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_texture_env_combine4
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_texture_env_combine4
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Michael Gold, NVIDIA Corporation (gold 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNotice
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Copyright NVIDIA Corporation, 1999, 2000, 2001.
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciIP Status
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    NVIDIA Proprietary.
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciVersion
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    NVIDIA date: January 18, 2001
245bd8deadSopenharmony_ci    Version:     14
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciNumber
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    195
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciDependencies
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    EXT_texture_env_combine is required and is modified by this extension
335bd8deadSopenharmony_ci    ARB_multitexture affects the definition of this extension
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciOverview
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    New texture environment function COMBINE4_NV allows programmable
385bd8deadSopenharmony_ci    texture combiner operations, including
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci        ADD                     Arg0 * Arg1 + Arg2 * Arg3
415bd8deadSopenharmony_ci        ADD_SIGNED_EXT          Arg0 * Arg1 + Arg2 * Arg3 - 0.5
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    where Arg0, Arg1, Arg2 and Arg3 are derived from
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci        ZERO                    the value 0
465bd8deadSopenharmony_ci        PRIMARY_COLOR_EXT       primary color of incoming fragment
475bd8deadSopenharmony_ci        TEXTURE                 texture color of corresponding texture unit
485bd8deadSopenharmony_ci        CONSTANT_EXT            texture environment constant color
495bd8deadSopenharmony_ci        PREVIOUS_EXT            result of previous texture environment; on
505bd8deadSopenharmony_ci                                texture unit 0, this maps to PRIMARY_COLOR_EXT
515bd8deadSopenharmony_ci        TEXTURE<n>_ARB          texture color of the <n>th texture unit
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    In addition, the result may be scaled by 1.0, 2.0 or 4.0.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ciIssues
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    None
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ciNew Procedures and Functions
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    None
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciNew Tokens
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    Accepted by the <params> parameter of TexEnvf, TexEnvi, TexEnvfv, and
665bd8deadSopenharmony_ci    TexEnviv when the <pname> parameter value is TEXTURE_ENV_MODE
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci        COMBINE4_NV                                     0x8503
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetTexEnvfv, GetTexEnviv,
715bd8deadSopenharmony_ci    TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the <target> parameter
725bd8deadSopenharmony_ci    value is TEXTURE_ENV
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci        SOURCE3_RGB_NV                                  0x8583
755bd8deadSopenharmony_ci        SOURCE3_ALPHA_NV                                0x858B
765bd8deadSopenharmony_ci        OPERAND3_RGB_NV                                 0x8593
775bd8deadSopenharmony_ci        OPERAND3_ALPHA_NV                               0x859B
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    Accepted by the <params> parameter of TexEnvf, TexEnvi, TexEnvfv, and
805bd8deadSopenharmony_ci    TexEnviv when the <pname> parameter value is SOURCE0_RGB_EXT,
815bd8deadSopenharmony_ci    SOURCE1_RGB_EXT, SOURCE2_RGB_EXT, SOURCE3_RGB_NV, SOURCE0_ALPHA_EXT,
825bd8deadSopenharmony_ci    SOURCE1_ALPHA_EXT, SOURCE2_ALPHA_EXT, or SOURCE3_ALPHA_NV
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci        ZERO
855bd8deadSopenharmony_ci        TEXTURE<n>_ARB
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    where <n> is in the range 0 to NUMBER_OF_TEXTURE_UNITS_ARB-1.
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    Accepted by the <params> parameter of TexEnvf, TexEnvi, TexEnvfv, and
905bd8deadSopenharmony_ci    TexEnviv when the <pname> parameter value is OPERAND0_RGB_EXT,
915bd8deadSopenharmony_ci    OPERAND1_RGB_EXT, OPERAND2_RGB_EXT or OPERAND3_RGB_NV
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci        SRC_COLOR
945bd8deadSopenharmony_ci        ONE_MINUS_SRC_COLOR
955bd8deadSopenharmony_ci        SRC_ALPHA
965bd8deadSopenharmony_ci        ONE_MINUS_SRC_ALPHA     
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    Accepted by the <params> parameter of TexEnvf, TexEnvi, TexEnvfv, and
995bd8deadSopenharmony_ci    TexEnviv when the <pname> parameter value is OPERAND0_ALPHA_EXT,
1005bd8deadSopenharmony_ci    OPERAND1_ALPHA_EXT, OPERAND2_ALPHA_EXT, or OPERAND3_ALPHA_NV
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci        SRC_ALPHA
1035bd8deadSopenharmony_ci        ONE_MINUS_SRC_ALPHA     
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation)
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    None
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2 Specification (Rasterization)
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    Added to subsection 3.8.9, before the paragraph describing the state
1125bd8deadSopenharmony_ci    requirements:
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci    If the value of TEXTURE_ENV_MODE is COMBINE4_NV, the form of the
1155bd8deadSopenharmony_ci    texture function depends on the values of COMBINE_RGB_EXT and
1165bd8deadSopenharmony_ci    COMBINE_ALPHA_EXT, according to table 3.21.  The RGB and ALPHA results
1175bd8deadSopenharmony_ci    of the texture function are then multiplied by the values of
1185bd8deadSopenharmony_ci    RGB_SCALE_EXT and ALPHA_SCALE, respectively.  The results are clamped
1195bd8deadSopenharmony_ci    to [0,1].  If the value of COMBINE_RGB_EXT or COMBINE_ALPHA_EXT is not
1205bd8deadSopenharmony_ci    one of the listed values, the result is undefined.
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci        COMBINE_RGB_EXT or
1235bd8deadSopenharmony_ci        COMBINE_ALPHA_EXT       Texture Function
1245bd8deadSopenharmony_ci        ------------------      ----------------
1255bd8deadSopenharmony_ci        ADD                     Arg0 * Arg1 + Arg2 * Arg3
1265bd8deadSopenharmony_ci        ADD_SIGNED_EXT          Arg0 * Arg1 + Arg2 * Arg3 - 0.5
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci        Table 3.21: COMBINE4_NV texture functions
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci    The arguments Arg0, Arg1, Arg2 and Arg3 are determined by the values
1315bd8deadSopenharmony_ci    of SOURCE<n>_RGB_EXT, SOURCE<n>_ALPHA_EXT, OPERAND<n>_RGB_EXT and
1325bd8deadSopenharmony_ci    OPERAND<n>_ALPHA_EXT.  In the following two tables, Ct and At are the
1335bd8deadSopenharmony_ci    filtered texture RGB and alpha values; Cc and Ac are the texture
1345bd8deadSopenharmony_ci    environment RGB and alpha values; Cf and Af are the RGB and alpha of
1355bd8deadSopenharmony_ci    the primary color of the incoming fragment; and Cp and Ap are the RGB
1365bd8deadSopenharmony_ci    and alpha values resulting from the previous texture environment.  On
1375bd8deadSopenharmony_ci    texture environment 0, Cp and Ap are identical to Cf and Af,
1385bd8deadSopenharmony_ci    respectively.  Ct<n> and At<n> are the filtered texture RGB and alpha
1395bd8deadSopenharmony_ci    values from the texture bound to the <n>th texture unit.  If the <n>th
1405bd8deadSopenharmony_ci    texture unit is disabled, the value of each component is 1.  The
1415bd8deadSopenharmony_ci    relationship is described in tables 3.22 and 3.23.
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci        SOURCE<n>_RGB_EXT       OPERAND<n>_RGB_EXT      Argument
1445bd8deadSopenharmony_ci        -----------------       --------------          --------
1455bd8deadSopenharmony_ci        ZERO                    SRC_COLOR               0
1465bd8deadSopenharmony_ci                                ONE_MINUS_SRC_COLOR     1
1475bd8deadSopenharmony_ci                                SRC_ALPHA               0
1485bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     1
1495bd8deadSopenharmony_ci        TEXTURE                 SRC_COLOR               Ct
1505bd8deadSopenharmony_ci                                ONE_MINUS_SRC_COLOR     (1-Ct)
1515bd8deadSopenharmony_ci                                SRC_ALPHA               At
1525bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-At)
1535bd8deadSopenharmony_ci        CONSTANT_EXT            SRC_COLOR               Cc
1545bd8deadSopenharmony_ci                                ONE_MINUS_SRC_COLOR     (1-Cc)
1555bd8deadSopenharmony_ci                                SRC_ALPHA               Ac
1565bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-Ac)
1575bd8deadSopenharmony_ci        PRIMARY_COLOR_EXT       SRC_COLOR               Cf
1585bd8deadSopenharmony_ci                                ONE_MINUS_SRC_COLOR     (1-Cf)
1595bd8deadSopenharmony_ci                                SRC_ALPHA               Af
1605bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-Af)
1615bd8deadSopenharmony_ci        PREVIOUS_EXT            SRC_COLOR               Cp
1625bd8deadSopenharmony_ci                                ONE_MINUS_SRC_COLOR     (1-Cp)
1635bd8deadSopenharmony_ci                                SRC_ALPHA               Ap
1645bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-Ap)
1655bd8deadSopenharmony_ci        TEXTURE<n>_ARB          SRC_COLOR               Ct<n>
1665bd8deadSopenharmony_ci                                ONE_MINUS_SRC_COLOR     (1-Ct<n>)
1675bd8deadSopenharmony_ci                                SRC_ALPHA               At<n>
1685bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-At<n>)
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci        Table 3.22: Arguments for COMBINE_RGB_EXT functions
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci        SOURCE<n>_ALPHA_EXT     OPERAND<n>_ALPHA_EXT    Argument
1735bd8deadSopenharmony_ci        -----------------       --------------          --------
1745bd8deadSopenharmony_ci        ZERO                    SRC_ALPHA               0
1755bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     1
1765bd8deadSopenharmony_ci        TEXTURE                 SRC_ALPHA               At
1775bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-At)
1785bd8deadSopenharmony_ci        CONSTANT_EXT            SRC_ALPHA               Ac
1795bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-Ac)
1805bd8deadSopenharmony_ci        PRIMARY_COLOR_EXT       SRC_ALPHA               Af
1815bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-Af)
1825bd8deadSopenharmony_ci        PREVIOUS_EXT            SRC_ALPHA               Ap
1835bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-Ap)
1845bd8deadSopenharmony_ci        TEXTURE<n>_ARB          SRC_ALPHA               At<n>
1855bd8deadSopenharmony_ci                                ONE_MINUS_SRC_ALPHA     (1-At<n>)
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci        Table 3.23: Arguments for COMBINE_ALPHA_EXT functions
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2 Specification (Per-Fragment Operations
1905bd8deadSopenharmony_ciand the Framebuffer)
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    None
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.2 Specification (Special Functions)
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci    None
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.2 Specification (State and State Requests)
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    None
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci    None
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ciGLX Protocol
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ci    None
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ciErrors
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci    INVALID_ENUM is generated if <params> value for SOURCE0_RGB_EXT,
2135bd8deadSopenharmony_ci    SOURCE1_RGB_EXT, SOURCE2_RGB_EXT, SOURCE3_RGB_NV, SOURCE0_ALPHA_EXT,
2145bd8deadSopenharmony_ci    SOURCE1_ALPHA_EXT, SOURCE2_ALPHA_EXT or SOURCE3_ALPHA_NV is not one of
2155bd8deadSopenharmony_ci    ZERO, TEXTURE, CONSTANT_EXT, PRIMARY_COLOR_EXT, PREVIOUS_EXT or
2165bd8deadSopenharmony_ci    TEXTURE<n>_ARB, where <n> is in the range 0 to
2175bd8deadSopenharmony_ci    NUMBER_OF_TEXTURE_UNITS_ARB-1.
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    INVALID_ENUM is generated if <params> value for OPERAND0_RGB_EXT,
2205bd8deadSopenharmony_ci    OPERAND1_RGB_EXT, OPERAND2_RGB_EXT or OPERAND3_RGB_NV is not one of
2215bd8deadSopenharmony_ci    SRC_COLOR, ONE_MINUS_SRC_COLOR, SRC_ALPHA or ONE_MINUS_SRC_ALPHA.
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci    INVALID_ENUM is generated if <params> value for OPERAND0_ALPHA_EXT
2245bd8deadSopenharmony_ci    OPERAND1_ALPHA_EXT, OPERAND2_ALPHA_EXT, or OPERAND3_ALPHA_NV is not
2255bd8deadSopenharmony_ci    one of SRC_ALPHA or ONE_MINUS_SRC_ALPHA.
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ciModifications to EXT_texture_env_combine
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ci    This extension relaxes the restrictions on SOURCE<n>_RGB_EXT,
2305bd8deadSopenharmony_ci    SOURCE<n>_ALPHA_EXT, OPERAND<n>_RGB_EXT and OPERAND<n>_ALPHA_EXT for
2315bd8deadSopenharmony_ci    use with EXT_texture_env_combine.  All params specified by Table 3.22
2325bd8deadSopenharmony_ci    and Table 3.23 are valid.
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ciDependencies on ARB_multitexture
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci    If ARB_multitexture is not implemented, all references to
2375bd8deadSopenharmony_ci    TEXTURE<n>_ARB and NUMBER_OF_TEXTURE_UNITS_ARB are deleted.
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ciNew State
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci Get Value           Get Command    Type      Initial Value        Attribute
2425bd8deadSopenharmony_ci ---------           -----------    ----      -------------        ---------
2435bd8deadSopenharmony_ci SOURCE3_RGB_NV      GetTexEnviv    n x Z5+n  ZERO                 texture
2445bd8deadSopenharmony_ci SOURCE3_ALPHA_NV    GetTexEnviv    n x Z5+n  ZERO                 texture
2455bd8deadSopenharmony_ci OPERAND3_RGB_NV     GetTexEnviv    n x Z2    ONE_MINUS_SRC_COLOR  texture
2465bd8deadSopenharmony_ci OPERAND3_ALPHA_NV   GetTexEnviv    n x Z2    ONE_MINUS_SRC_ALPHA  texture
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ciNew Implementation Dependent State
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    None
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ciNVIDIA Implementation Details
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ci    Because of a hardware limitation, TNT, TNT2, GeForce, and Quadro
2555bd8deadSopenharmony_ci    treat "scale by 4.0" with the COMBINE_RGB_EXT or COMBINE_ALPHA_EXT
2565bd8deadSopenharmony_ci    mode of ADD_SIGNED_EXT as "scale by 2.0".
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ciRevision History
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci    2/22/00 mjk - added NVIDIA Implementation Details
2615bd8deadSopenharmony_ci
262