home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / OpenGL / opengldoc / glspec / sharpen_texture.spec < prev    next >
Encoding:
Text File  |  1996-11-11  |  8.4 KB  |  227 lines

  1. Name
  2.  
  3.     SGIS_sharpen_texture
  4.  
  5. Name Strings
  6.  
  7.     GL_SGIS_sharpen_texture
  8.  
  9. Version
  10.  
  11.     $Date: 1996/04/02 00:08:41 $ $Revision: 1.2 $
  12.  
  13. Number
  14.  
  15.     22
  16.  
  17. Dependencies
  18.  
  19.     EXT_texture is required
  20.     EXT_texture3D affects the definition of this extension
  21.     EXT_texture_object affects the definition of this extension
  22.  
  23. Overview
  24.  
  25.     This extension introduces texture magnification filters that sharpen
  26.     the resulting image by extrapolating from the level 1 image to the
  27.     level 0 image.  Sharpening can be enabled for all color channels, for
  28.     the alpha channel only, or for the red, green, and blue channels only.
  29.  
  30. New Procedures and Functions
  31.  
  32.     void SharpenTexFuncSGIS(enum target,
  33.                 sizei n,
  34.                 const float* points);
  35.  
  36.     void GetSharpenTexFuncSGIS(enum target,
  37.                    float* points);
  38.  
  39. New Tokens
  40.  
  41.     Accepted by the <param> parameter of TexParameteri and TexParameterf,
  42.     and by the <params> parameter of TexParameteriv and TexParameterfv, when
  43.     their <pname> parameter is TEXTURE_MAG_FILTER:
  44.  
  45.     LINEAR_SHARPEN_SGIS
  46.     LINEAR_SHARPEN_ALPHA_SGIS
  47.     LINEAR_SHARPEN_COLOR_SGIS
  48.  
  49.     Accepted by the <pname> parameter of GetTexParameteriv and
  50.     GetTexParameterfv:
  51.  
  52.     SHARPEN_TEXTURE_FUNC_POINTS_SGIS
  53.  
  54. Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
  55.  
  56.     None
  57.  
  58. Additions to Chapter 3 of the 1.0 Specification (Rasterization)
  59.  
  60.     GL Specification Table 3.7 is updated as follows:
  61.  
  62.     Name                Type        Legal Values
  63.     ----                ----        ------------
  64.     TEXTURE_WRAP_S            integer        CLAMP, REPEAT
  65.     TEXTURE_WRAP_T            integer        CLAMP, REPEAT
  66.     TEXTURE_WRAP_R_EXT        integer        CLAMP, REPEAT
  67.     TEXTURE_MIN_FILTER        integer        NEAREST, LINEAR,
  68.                             NEAREST_MIPMAP_NEAREST,
  69.                             NEAREST_MIPMAP_LINEAR,
  70.                             LINEAR_MIPMAP_NEAREST,
  71.                             LINEAR_MIPMAP_LINEAR,
  72.                             FILTER4_SGIS
  73.     TEXTURE_MAG_FILTER        integer        NEAREST, LINEAR,
  74.                             FILTER4_SGIS,
  75.                             LINEAR_DETAIL_SGIS,
  76.                             LINEAR_DETAIL_ALPHA_SGIS,
  77.                             LINEAR_DETAIL_COLOR_SGIS,
  78.                             LINEAR_SHARPEN_SGIS,
  79.                             LINEAR_SHARPEN_ALPHA_SGIS,
  80.                             LINEAR_SHARPEN_COLOR_SGIS
  81.     TEXTURE_BORDER_COLOR        4 floats    any 4 values in [0,1]
  82.     DETAIL_TEXTURE_LEVEL_SGIS    integer        any non-negative integer
  83.     DETAIL_TEXTURE_MODE_SGIS    integer        ADD, MODULATE
  84.  
  85.     Table 3.7: Texture parameters and their values.
  86.  
  87.     3.8.2.2 Texture magnification with sharpening
  88.  
  89.     Three additional texture magnification filters are defined for texture
  90.     magnification.  These values, which are assigned to TEXTURE_MAG_FILTER,
  91.     are LINEAR_SHARPEN_SGIS, LINEAR_SHARPEN_ALPHA_SGIS, and
  92.     LINEAR_SHARPEN_COLOR_SGIS.  All three filters sample the level 0
  93.     texture array exactly as it would be sampled with filter mode LINEAR.
  94.     If texture levels 0 and 1 are "complete", as described in the Mipmapping
  95.     portion of Section 3.8.1 (Texture Minification) of the GL Specification,
  96.     the level 1 array of the texture is also linearly sampled, just as though
  97.     mipmap minification was being performed with LOD (the level of detail
  98.     parameter) valued near 1.0.  If levels 0 and 1 are not complete, it is
  99.     as though the magnification texture filter was LINEAR.  (Although
  100.     querying the magnification filter value will return the value as
  101.     specified.)
  102.  
  103.     The texture value computed from the level 0 array (T0) and the
  104.     value computed from the level one array (T1) are combined to compute
  105.     the final texture value (T):
  106.  
  107.     T' = ((1 + F(LOD)) * T0) - (F(LOD) * T1)
  108.  
  109.          / 0      T' < 0
  110.     T = <  T'     0 <= T' <= 1
  111.          \ 1      T' > 1
  112.  
  113.     F is a function of the level-of-detail parameter LOD, which is
  114.     represented by the Greek character lambda in the GL Specification.
  115.  
  116.     The function F of level-of-detail parameter LOD is specified by
  117.     calling SharpenTexFuncSGIS with <target> set to TEXTURE_1D, TEXTURE_2D,
  118.     or TEXTURE_3D_EXT, <points> pointing at an array of pairs of floating
  119.     point values, and <n> set to the number of value pairs in <points>.  The
  120.     first value of each value pair in <points> specifies a value of LOD, and
  121.     the second value of each value pair specifies the corresponding function
  122.     value.  The order in which the points are specified is not significant.
  123.     The <n> value pairs in <points> completely specify the function,
  124.     replacing any previous specification that may have existed.  Since
  125.     negative values of LOD correspond to magnification and positive values
  126.     correspond to minification, the points should have negative values for
  127.     LOD (though it is not an error to specify positive values).
  128.  
  129.     Function F is evaluated by sorting the value pairs specified by
  130.     SharpenTexFuncSGIS by LOD value, then fitting a curve through these
  131.     points.  This curve may be linear between adjacent points, or it may be
  132.     smoothed, but it will pass exactly through the points, limited only by
  133.     the resolution of the implementation.  The value pair with the lowest
  134.     LOD value specifies the function value F for all values of LOD less than
  135.     or equal to that pair's LOD.  Likewise, the value pair with the greatest
  136.     LOD value specifies the function value F for all values of LOD greater
  137.     than or equal to that pair's LOD.  F is undefined if two or more value
  138.     pairs have the same LOD value.
  139.  
  140.     If the texture magnification filter is LINEAR_SHARPEN_SGIS, then both
  141.     the color and the alpha components of T are computed as described
  142.     in the equations above.  If the filter is LINEAR_SHARPEN_COLOR_SGIS,
  143.     then all components of T other than alpha are computed as described
  144.     above, and the alpha component of T is computed as if the texture
  145.     magnification filter were LINEAR.  Finally, if the filter is
  146.     LINEAR_SHARPEN_ALPHA_SGIS, the alpha component of T is computed as
  147.     described in the equations above, and all other components of T
  148.     are computed as if the texture magnification filter were LINEAR.
  149.  
  150.     Minification vs. Magnification
  151.     ------------------------------
  152.  
  153.     If the magnification filter is given by LINEAR_SHARPEN_SGIS,
  154.     LINEAR_SHARPEN_ALPHA_SGIS, or LINEAR_SHARPEN_COLOR_SGIS, and the
  155.     minification filter is given by NEAREST_MIPMAP_NEAREST or
  156.     LINEAR_MIPMAP_NEAREST, then c = 0.5.  The parameter c is used to
  157.     determine whether minification or magnification filtering is done,
  158.     as described in Section 3.8.2 of the GL Specification (Texture
  159.     Magnification).
  160.  
  161. Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
  162. and the Framebuffer)
  163.  
  164.     None
  165.  
  166. Additions to Chapter 5 of the 1.0 Specification (Special Functions)
  167.  
  168.     GetSharpenTexFuncSGIS is not included in display lists.
  169.  
  170. Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
  171.  
  172.     The number of points in the sharpen texture function specification of
  173.     a texture is queried by calling GetTexParameteriv or GetTexParameterfv
  174.     with <target> set to the target of the desired texture and <pname> set
  175.     to SHARPEN_TEXTURE_FUNC_POINTS_SGIS.  The function
  176.     GetSharpenTexFuncSGIS returns in <points> all of the points in the
  177.     sharpen texture function of texture <target>.
  178.  
  179. Additions to the GLX Specification
  180.  
  181.     None
  182.  
  183. Dependencies on EXT_texture
  184.  
  185.     EXT_texture is required.
  186.  
  187. Dependencies on EXT_texture3D
  188.  
  189.     If EXT_texture3D is not implemented, references in this specification
  190.     to TEXTURE_3D_EXT are invalid, and should be ignored.
  191.  
  192. Dependencies on EXT_texture_object
  193.  
  194.     If EXT_texture_object is implemented, the state values named
  195.  
  196.     SHARPEN_TEXTURE_FUNC_POINTS_SGIS
  197.     <SHARPEN_TEXTURE_FUNC>
  198.  
  199.     are added to the state vector of each texture object. When an attribute
  200.     set that includes texture information is popped, the bindings and
  201.     enables are first restored to their pushed values, then the bound
  202.     textures have their sharpen parameters restored to their pushed values.
  203.  
  204. Errors
  205.  
  206.     INVALID_ENUM is generated if SharpenTexFuncSGIS or
  207.     GetSharpenTexFuncSGIS parameter <target> is not TEXTURE_1D, TEXTURE_2D,
  208.     or TEXTURE_3D_EXT.
  209.  
  210.     INVALID_VALUE is generated if SharpenTexFuncSGIS parameter <n> is
  211.     negative.
  212.  
  213.     INVALID_OPERATION is generated if SharpenTexFuncSGIS or
  214.     GetSharpenTexFuncSGIS is executed between execution of Begin and the
  215.     corresponding execution to End.
  216.  
  217. New State
  218.  
  219.     Get Value                Get Command        Type        Initial Value    Attribute
  220.     ---------                -----------        ----        -------------    ---------
  221.     SHARPEN_TEXTURE_FUNC_POINTS_SGIS    GetTexParameteriv    n x Z+        2        texture
  222.     <SHARPEN_TEXTURE_FUNC>        GetSharpenTexFuncSGIS    n x m x R    {0, 0}, {-4, 1}    texture
  223.  
  224. New Implementation Dependent State
  225.  
  226.     None
  227.