15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    AMD_compressed_3DC_texture
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_AMD_compressed_3DC_texture
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Aaftab Munshi
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContact
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Benj Lipchak, AMD (benj.lipchak 'at' amd.com)
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciIP Status
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Please contact AMD regarding any intellectual property questions/issues 
205bd8deadSopenharmony_ci    associated with this extension.
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciStatus
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Complete.
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciVersion
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Last Modified Date: February 26, 2008
295bd8deadSopenharmony_ci    Revision: 6
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciNumber
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    OpenGL ES Extension #39
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciDependencies
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    Written based on the wording of the OpenGL ES 1.1 specification.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciOverview
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    Two compression formats are introduced:
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    - A compression format for two component textures.  When used to store 
445bd8deadSopenharmony_ci      normal vectors, the two components are commonly used with a fragment 
455bd8deadSopenharmony_ci      shader that derives the third component.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    - A compression format for single component textures.  The single component
485bd8deadSopenharmony_ci      may be used as a luminance or an alpha value.
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    There are a large number of games that use luminance only and/or alpha only 
515bd8deadSopenharmony_ci    textures.  For example, monochrome light maps used in a few popular games 
525bd8deadSopenharmony_ci    are 8-bit luminance textures.  This extension describes a compression format
535bd8deadSopenharmony_ci    that provides a 2:1 compression ratio for 8-bit single channel textures.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    Normal maps are special textures that are used to add detail to 3D surfaces.
565bd8deadSopenharmony_ci    They are an extension of earlier "bump map" textures, which contained per-
575bd8deadSopenharmony_ci    pixel height values and were used to create the appearance of bumpiness on 
585bd8deadSopenharmony_ci    otherwise smooth surfaces.  Normal maps contain more detailed surface 
595bd8deadSopenharmony_ci    information, allowing them to represent much more complex shapes.
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    Normal mapping is one of the key features that makes the current generation
625bd8deadSopenharmony_ci    of games look so much better than earlier titles.  A limitation to the 
635bd8deadSopenharmony_ci    effectiveness of this technique is the size of the textures required.  In an 
645bd8deadSopenharmony_ci    ideal case where every surface has both a color texture map and a normal 
655bd8deadSopenharmony_ci    texture map, the texture memory and bandwidth requirements would double 
665bd8deadSopenharmony_ci    compared to using color maps alone.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    In fact, the problem is much worse because existing block based compression
695bd8deadSopenharmony_ci    methods such as DXTc, ETC, and S3TC are ineffective at compressing normal 
705bd8deadSopenharmony_ci    maps.  They tend to have trouble capturing the small edges and subtle 
715bd8deadSopenharmony_ci    curvature that normal maps are designed to capture, and they also introduce 
725bd8deadSopenharmony_ci    unsightly block artifacts.
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    Because normal maps are used to capture light reflections and realistic 
755bd8deadSopenharmony_ci    surface highlights, these problems are amplified relative to their impact on
765bd8deadSopenharmony_ci    color textures.  The results are sufficiently poor that game artists and 
775bd8deadSopenharmony_ci    developers would rather not use normal map compression at all on most 
785bd8deadSopenharmony_ci    surfaces, and instead limit themselves to lower resolution maps on selected 
795bd8deadSopenharmony_ci    parts of the rendered scene.
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    3DC provides an ideal solution to the normal map compression problem.  It 
825bd8deadSopenharmony_ci    provides up to 4:1 compression of normal maps, with image quality that is 
835bd8deadSopenharmony_ci    virtually indistinguishable from the uncompressed version.  The technique is
845bd8deadSopenharmony_ci    hardware accelerated, so the performance impact is minimal.  Thus, 
855bd8deadSopenharmony_ci    developers are freed to use higher resolution, more detailed normal maps, 
865bd8deadSopenharmony_ci    and/or use them on all of the objects in a scene rather than just a select 
875bd8deadSopenharmony_ci    few.
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ciNew Procedures and Functions
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    None.
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ciNew Tokens
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    Accepted by the <internalFormat> parameter of CompressedTexImage2D and
965bd8deadSopenharmony_ci    CompressedTexImage3DOES: 
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci        3DC_X_AMD             0x87F9
995bd8deadSopenharmony_ci        3DC_XY_AMD            0x87FA
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.3 Specification (Rasterization)
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    Add to Table 3.17:  Specific Compressed Internal Formats
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci        Compressed Internal Format         Base Internal Format
1065bd8deadSopenharmony_ci        ==========================         ====================
1075bd8deadSopenharmony_ci        3DC_X_AMD                          RGB
1085bd8deadSopenharmony_ci        3DC_XY_AMD                         RGB
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    Add to Section 3.8.3, Alternate Image Specification
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    If <internalFormat> is 3DC_X_AMD, the compressed texture is a 
1145bd8deadSopenharmony_ci    single channel compressed texture.  If <internalFormat> is 3DC_XY_AMD,
1155bd8deadSopenharmony_ci    the compressed textures contains two channels.
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    The details of these formats is not disclosed, so refer to AMD's 
1185bd8deadSopenharmony_ci    Compressonator tool in order to encode your textures offline:
1195bd8deadSopenharmony_ci    http://ati.amd.com/developer/compressonator.html
1205bd8deadSopenharmony_ci    
1215bd8deadSopenharmony_ci    3DC_X_AMD Format
1225bd8deadSopenharmony_ci    ================
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    This format compresses a 128 bit block into 64 bits, representing a 2:1
1255bd8deadSopenharmony_ci    compression ratio.  The texture lookup unit will return (x, 0, 0, 1): the 
1265bd8deadSopenharmony_ci    decoded X value in the red component, 0.0 in the green and blue components,
1275bd8deadSopenharmony_ci    and 1.0 in the alpha component.
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    3DC_XY_AMD Format
1305bd8deadSopenharmony_ci    =================
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ci    This format compresses a 512 bit block into 128 bits, representing a 4:1
1335bd8deadSopenharmony_ci    compression ratio.  The texture lookup unit will return (x, y, 0, 1): the 
1345bd8deadSopenharmony_ci    decoded X value in the red component, the decoded Y value in the green
1355bd8deadSopenharmony_ci    component, 0.0 in the blue component, and 1.0 in the alpha component.
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    Using 3DC_XY_AMD to compress normal maps requires an additional step. This 
1385bd8deadSopenharmony_ci    is because each value in a normal map is actually a 3D vector, consisting of
1395bd8deadSopenharmony_ci    3 components (x, y, z).  These values must be reduced to 2-component values
1405bd8deadSopenharmony_ci    in order to work with 3DC_XY_AMD.  Fortunately, this can be handled in a 
1415bd8deadSopenharmony_ci    simple way by assuming that all of the normal vectors have a length of 1.  
1425bd8deadSopenharmony_ci    Given the values of two components of a vector, the value of the third 
1435bd8deadSopenharmony_ci    component can be found using the following mathematical relationship: 
1445bd8deadSopenharmony_ci    z = sqrt(1 - (x*x + y*y)).  This formula can be implemented using just a
1455bd8deadSopenharmony_ci    couple of fragment shader instructions.
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ciErrors
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    INVALID_OPERATION is generated by TexImage2D, TexSubImage2D, 
1505bd8deadSopenharmony_ci    CompressedTexSubImage2D, or CopyTexSubImage2D if <internalformat> or 
1515bd8deadSopenharmony_ci    <format> is 3DC_X_AMD or 3DC_XY_AMD.
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ciNew State
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    The queries for NUM_COMPRESSED_TEXTURE_FORMATS and 
1565bd8deadSopenharmony_ci    COMPRESSED_TEXTURE_FORMATS include 3DC_X_AMD and 3DC_XY_AMD.
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ciRevision History
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    02/26/2008    Benj Lipchak     Throw INVALID_OPERATION on subimage updates.
1615bd8deadSopenharmony_ci    09/24/2007    Jon Leech        Assign extension number.
1625bd8deadSopenharmony_ci    09/05/2007    Benj Lipchak     Cosmetic changes.
1635bd8deadSopenharmony_ci    08/01/2007    Benj Lipchak     Publication readiness.
1645bd8deadSopenharmony_ci    06/02/2006    Aaftab Munshi    Added IP status.
1655bd8deadSopenharmony_ci    05/12/2006    Aaftab Munshi    First Draft.
166