15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_texture_expand_normal
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_texture_expand_normal
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNotice
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Copyright NVIDIA Corporation, 2002.
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciIP Status
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    NVIDIA Proprietary.
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciStatus
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Implemented, November 2002
245bd8deadSopenharmony_ci    Shipping in Release 40 NVIDIA driver for CineFX hardware, January 2003.
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciVersion
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Last Modified:      2005/06/16
295bd8deadSopenharmony_ci    NVIDIA Revision:    4
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciNumber
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    286
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciSupport
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    NVIDIA plans to discontinue this extension for future GPU
385bd8deadSopenharmony_ci    architectures.  Support for NV3x (GeForce FX), NV4x (GeForce 6
395bd8deadSopenharmony_ci    Series), and G7x (GeForce 7x00) architectures will continue.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    As an alternative to the EXT_texture_expand_normal functionality,
425bd8deadSopenharmony_ci    developers can either use the signed fixed-point texture formats
435bd8deadSopenharmony_ci    provided by NV_texture_shader (such as GL_SIGNED_RGBA8_NV) or perform
445bd8deadSopenharmony_ci    the "expand normal" operation with shader instructions (typically
455bd8deadSopenharmony_ci    just a MAD)..
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ciDependencies
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    OpenGL 1.1 is required.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciOverview
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension provides a remapping mode where unsigned texture
545bd8deadSopenharmony_ci    components (in the range [0,1]) can be treated as though they
555bd8deadSopenharmony_ci    contained signed data (in the range [-1,+1]).  This allows
565bd8deadSopenharmony_ci    applications to easily encode signed data into unsigned texture
575bd8deadSopenharmony_ci    formats.
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    The functionality of this extension is nearly identical to the
605bd8deadSopenharmony_ci    EXPAND_NORMAL_NV remapping mode provided in the NV_register_combiners
615bd8deadSopenharmony_ci    extension, although it applies even if register combiners are used.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciIssues
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    (1) When is the remapping applied?
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci      RESOLVED:  It would be possible to remap after loading each texel,
685bd8deadSopenharmony_ci      remap after all filtering is done, or something in between.
695bd8deadSopenharmony_ci      Ignoring implementation-dependent rounding errors, it really
705bd8deadSopenharmony_ci      doesn't matter.
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci      The spec language says that the remapping is applied after filtering
735bd8deadSopenharmony_ci      texel values within each level.  For LINEAR_MIPMAP_LINEAR, this
745bd8deadSopenharmony_ci      means that the remapping is "done" twice.  This approach was chosen
755bd8deadSopenharmony_ci      solely to simplify the spec language, and does not necessarily
765bd8deadSopenharmony_ci      reflect NVIDIA's implementation.
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    (2) Should the remapping mode apply to textures with signed
795bd8deadSopenharmony_ci    components?
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci      RESOLVED:  No -- the EXPAND_NORMAL_NV mapping is ignored for
825bd8deadSopenharmony_ci      such textures.
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci    (3) NV_texture_shader provides several internal formats with a mix
855bd8deadSopenharmony_ci    of signed and unsigned components.  For example, the base formats
865bd8deadSopenharmony_ci    DSDT_MAG_NV, and DSDT_MAG_INTENSITY_NV have this property, and
875bd8deadSopenharmony_ci    there is a variant of RGBA where the RGB components are signed,
885bd8deadSopenharmony_ci    but the A component is unsigned.  What should happen in this case?
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci      RESOLVED:  The unsigned components are remapped; the signed
915bd8deadSopenharmony_ci      components are unmodified.
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci    (4) What should be said about signed fixed-point precision and range
945bd8deadSopenharmony_ci    of actual implementations?
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci      RESOLVED:  The fundamental problem is that it is not possible
975bd8deadSopenharmony_ci      to derive a linear mapping taking unsigned values that exactly
985bd8deadSopenharmony_ci      represents -1.0, 0.0, and +1.0.
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci      The mapping chosen for current NVIDIA implementations does not
1015bd8deadSopenharmony_ci      exactly represent +1.0.  For an n-bit fixed-point component,
1025bd8deadSopenharmony_ci      0 maps to -1.0, 2^(n-1) maps to 0.0, and 2^n-1 (maximum value)
1035bd8deadSopenharmony_ci      maps to 1.0 - 1/(2^(n-1)).  This same conversion is applied to
1045bd8deadSopenharmony_ci      stored textures using the signed texture types in NV_texture_shader.
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci      This specification is written using the conventional OpenGL mapping
1075bd8deadSopenharmony_ci      where -1.0 and +1.0 can be represented exactly, but 0.0 can not.
1085bd8deadSopenharmony_ci      The specification is simpler and avoids precision-dependent language
1095bd8deadSopenharmony_ci      describing the mapping.  We expect some leeway in how the remapping
1105bd8deadSopenharmony_ci      is applied.
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci      This issue is discussed in more detail in the issues section
1135bd8deadSopenharmony_ci      of the NV_texture_shader specification (the question is phrased
1145bd8deadSopenharmony_ci      identically).
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    (5) Are texture border color components remapped?
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci      RESOLVED:  Yes -- if the border values are used for filtering,
1195bd8deadSopenharmony_ci      border color components are remapped identically to normal texel
1205bd8deadSopenharmony_ci      components.
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ciNew Procedures and Functions
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    None.
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ciNew Tokens
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    Accepted by the <pname> parameters of TexParameteri,
1295bd8deadSopenharmony_ci    TexParameteriv, TexParameterf, TexParameterfv, GetTexParameteri,
1305bd8deadSopenharmony_ci    and GetTexParameteriv:
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ci        TEXTURE_UNSIGNED_REMAP_MODE_NV               0x888F
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    None.
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
1415bd8deadSopenharmony_ci
1425bd8deadSopenharmony_ci    Modify Section 3.8.4, Texture Parameters, p.135
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    (modify Table 3.19, p. 137)
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci        Name                Type   Legal Values
1475bd8deadSopenharmony_ci        -----------------   ----   ----------------------
1485bd8deadSopenharmony_ci        TEXTURE_UNSIGNED_   enum   EXPAND_NORMAL_NV, NONE
1495bd8deadSopenharmony_ci          REMAP_MODE_NV
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    Modify Section 3.8.8,  Texture Minification, p.140
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci    (add after the last paragraph before the "Mipmapping" subsection,
1555bd8deadSopenharmony_ci    p. 144)
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    After the texture filter is applied, the filtered texture values are
1585bd8deadSopenharmony_ci    optionally rescaled, converting unsigned texture components encoded
1595bd8deadSopenharmony_ci    in the range [0,1] to signed values in the range [-1,+1].  If the
1605bd8deadSopenharmony_ci    texture parameter TEXTURE_UNSIGNED_REMAP_MODE_NV is EXPAND_NORMAL_NV,
1615bd8deadSopenharmony_ci    the filtered values for each unsigned component of the texture is
1625bd8deadSopenharmony_ci    transformed by
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci        tau = 2 * tau - 1.
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    For components
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
1695bd8deadSopenharmony_ciOperations and the Frame Buffer)
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    None.
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    None.
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.4 Specification (State and
1805bd8deadSopenharmony_ciState Requests)
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci    None.
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.4 Specification (Invariance)
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci    None.
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    None.
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ciGLX Protocol
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci    None.
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ciErrors
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    None.
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ciNew State
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci(add to table 6.15, p. 230)
2075bd8deadSopenharmony_ci                                                         Initial
2085bd8deadSopenharmony_ciGet Value                       Type  Get Command        Value   Description         Sec.   Attribute
2095bd8deadSopenharmony_ci------------------------------  ----  -----------------  ------- ------------------  -----  ---------
2105bd8deadSopenharmony_ciTEXTURE_UNSIGNED_REMAP_MODE_NV  nxZ2  GetTexParameteriv  NONE    unsigned component  3.8.8  texture
2115bd8deadSopenharmony_ci                                                                 remapping
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ciRevision History
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ciRev.    Date    Author   Changes
2175bd8deadSopenharmony_ci----  -------- --------  --------------------------------------------
2185bd8deadSopenharmony_ci 4    06/14/05  mjk      Add to-be-discontinued "Status" message and
2195bd8deadSopenharmony_ci                         discussion of alternatives.
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci 3    10/07/02  pbrown   Minor wording changes on precision issues -- this
2225bd8deadSopenharmony_ci                         remapping should produce roughly the same results
2235bd8deadSopenharmony_ci                         as storing the texture in signed form.
2245bd8deadSopenharmony_ci
2255bd8deadSopenharmony_ci 2    10/07/02  pbrown   Added issue about where the remapping is applied,
2265bd8deadSopenharmony_ci                         and what happens to border colors.
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci 1    10/07/02  pbrown   Initial revision.
229