15bd8deadSopenharmony_ci
25bd8deadSopenharmony_ciName
35bd8deadSopenharmony_ci
45bd8deadSopenharmony_ci    SGIX_pixel_texture_bits
55bd8deadSopenharmony_ci
65bd8deadSopenharmony_ciName Strings
75bd8deadSopenharmony_ci
85bd8deadSopenharmony_ci    GL_SGIX_pixel_texture_bits
95bd8deadSopenharmony_ci
105bd8deadSopenharmony_ciVersion
115bd8deadSopenharmony_ci
125bd8deadSopenharmony_ci    $Date: 1998/10/01 23:30:18 $ $Revision: 1.11 $
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciNumber
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    127
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciDependencies
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    GL_SGIS_pixel_texture
215bd8deadSopenharmony_ci    can be implemented in parallel with SGIX_pixel_texture_lod
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciOverview
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    The pixel_texture extension causes the "convert to fragment"
265bd8deadSopenharmony_ci    stage of the pixel pipeline to derive the fragment's texture
275bd8deadSopenharmony_ci    coordinates from the pixel group's color components.
285bd8deadSopenharmony_ci    At this stage in the pixel pipeline, the color components have
295bd8deadSopenharmony_ci    been converted into the framebuffer format.  These
305bd8deadSopenharmony_ci    framebuffer format values are used to produce texture coordinates
315bd8deadSopenharmony_ci    of exactly the same value.  The internal representation of
325bd8deadSopenharmony_ci    texture coordinates is intentionally left vague in the spec
335bd8deadSopenharmony_ci    so implementations can choose whatever they like.
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    This works well when the frame buffer format for
365bd8deadSopenharmony_ci    a color component is a fixed point value in the range [0,1].
375bd8deadSopenharmony_ci    However, if SGIX_color_range is supported, the framebuffer
385bd8deadSopenharmony_ci    format can be floating point, and the values are not
395bd8deadSopenharmony_ci    a linear ramp.  This means that the texture must be
405bd8deadSopenharmony_ci    large and sparsely populated in order to ensure that
415bd8deadSopenharmony_ci    each texture coordinate value reaches a unique texel.
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    This extension allows the application to specify that
445bd8deadSopenharmony_ci    the color component be treated like an unsigned integer
455bd8deadSopenharmony_ci    with the same number of bits as are in the framebuffer format,
465bd8deadSopenharmony_ci    which makes each texel in the texture accessible through
475bd8deadSopenharmony_ci    the texture lookup equations with a texture whose size
485bd8deadSopenharmony_ci    is 2^n in each dimension, where n is the number of bits in
495bd8deadSopenharmony_ci    the framebuffer format.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    The application must know the exact frambuffer format
525bd8deadSopenharmony_ci    in order to define the texture correctly.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    For example, this approach allows the implementation of
555bd8deadSopenharmony_ci    a bit-preserving 1D lookup table for the s10e5 bali pixel format.
565bd8deadSopenharmony_ci    It specifies a mapping of the s10e5 pixel format to a texture
575bd8deadSopenharmony_ci    coordinate index in a manner that allows one texel to be
585bd8deadSopenharmony_ci    mapped to each of the 64K bit patterns possible in the
595bd8deadSopenharmony_ci    s10e5 format.
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    The motivation is to allow the shader toolkit to implement
625bd8deadSopenharmony_ci    functions, e.g., cos(x), with a copy pixels
635bd8deadSopenharmony_ci    and pixel texture enabled in a way that preserves as
645bd8deadSopenharmony_ci    much accuracy as possible.
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ciIP Status
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    Silicon Graphics has filed for patent protection for some of the
695bd8deadSopenharmony_ci    techniques described in this extension document.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ciIssues
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    * Could we define a separate scale factor so that we don't
745bd8deadSopenharmony_ci      necessarily have to specify that we convert to the framebuffer
755bd8deadSopenharmony_ci      format?
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci      There isn't much need to mention the framebuffer format
785bd8deadSopenharmony_ci      here; we just need to specify how we're going to interpret
795bd8deadSopenharmony_ci      the bits.  However, the application must use a texture
805bd8deadSopenharmony_ci      that corresponds to the framebuffer format.
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    * To get to the exact center of a texel, we need to add
835bd8deadSopenharmony_ci      0.5 to the calculation after the conversion to unsigned
845bd8deadSopenharmony_ci      int and before the divide by 2^m-1.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci      This is not necessary because the equations for calculating
875bd8deadSopenharmony_ci      the 2x2 square of texels when TEXTURE_MIN_FILTER is LINEAR
885bd8deadSopenharmony_ci      do it.  (Section 3.8 in the spec.)
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ciNew Procedures and Functions
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci    None
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ciNew Tokens
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    Accepted by the <pname> parameter of PixelTexGenParameteriSGIX and
975bd8deadSopenharmony_ci    PixelTexGenParameterivSGIX:
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci        COLOR_TO_TEXTURE_COORD_SGIX
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci    Accepted by the <param> parameter of PixelTexGenParameteriSGIX and
1025bd8deadSopenharmony_ci    PixelTexGenParameterivSGIX:
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci        COLOR_BIT_PATTERN_SGIX
1055bd8deadSopenharmony_ci        COLOR_VALUE_SGIX
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci    None
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization)
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    This extension, similar to the pixel_texture.spec modifies the
1145bd8deadSopenharmony_ci    "Conversion to Fragments" subsection of section 3.6.3 (Rasterization
1155bd8deadSopenharmony_ci    of Pixel Rectangles) of the GL Specification. Immediately following
1165bd8deadSopenharmony_ci    the text added by the pixel_texture.spec, insert the following:
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    If the PixelTexGenParameterSGIX param COLOR_TO_TEXTURE_COORD_SGIX
1195bd8deadSopenharmony_ci    is set to COLOR_BIT_PATTERN_SGIX, the mapping from r,g,b,a
1205bd8deadSopenharmony_ci    to s,t,r,q is altered.
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci    At this stage, final color processing has been performed and the
1235bd8deadSopenharmony_ci    r,g,b,a values are in the form that matches the framebuffer.
1245bd8deadSopenharmony_ci    To map the red color value to the s texture coordinate the
1255bd8deadSopenharmony_ci    m bits of red, interpreted as an integer in the range [0,2^m-1], are
1265bd8deadSopenharmony_ci    divided by 2^m-1 to obtain an s coordinate in the range [0,1].
1275bd8deadSopenharmony_ci    Green and Blue are mapped similarly.  The q texture coordinate
1285bd8deadSopenharmony_ci    is set to one if a divide by q is in effect.  If TEXTURE_4D_SGIS
1295bd8deadSopenharmony_ci    is enabled, Alpha is mapped to q in the same way Red is
1305bd8deadSopenharmony_ci    mapped to s.
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ci    If the PixelTexGenParameterSGIX param COLOR_TO_TEXTURE_COORD_SGIX
1335bd8deadSopenharmony_ci    is set to COLOR_VALUE_SGIX, the r,g,b,a values are used
1345bd8deadSopenharmony_ci    to produce floating point values for s,t,r,q.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
1375bd8deadSopenharmony_ciand the Frame Buffer)
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    None
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci
1425bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions)
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    None
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests)
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    None
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ciAdditions to the GLX Specification
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    XXX
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ciErrors
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ciNew State
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci    The following is added to Table 6.16. Pixels.
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    Get Value                           Get Command                     Type    Initial Value                   Attrib
1615bd8deadSopenharmony_ci    ---------                           -----------                     ----    -------------                   ------
1625bd8deadSopenharmony_ci    COLOR_TO_TEXTURE_COORD_SGIX         GetPixelTexGenParameterivSGIS   Z2      COLOR_VALUE_SGIX                pixel
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ciNew Implementation Dependent State
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    None
167