15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    SGIS_sharpen_texture
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_SGIS_sharpen_texture
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciVersion
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    $Date: 1995/07/09 06:48:51 $ $Revision: 1.16 $
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNumber
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    22
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciDependencies
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    EXT_texture is required
205bd8deadSopenharmony_ci    EXT_texture3D affects the definition of this extension
215bd8deadSopenharmony_ci    EXT_texture_object affects the definition of this extension
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciOverview
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    This extension introduces texture magnification filters that sharpen
265bd8deadSopenharmony_ci    the resulting image by extrapolating from the level 1 image to the
275bd8deadSopenharmony_ci    level 0 image.  Sharpening can be enabled for all color channels, for
285bd8deadSopenharmony_ci    the alpha channel only, or for the red, green, and blue channels only.
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciNew Procedures and Functions
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    void SharpenTexFuncSGIS(enum target,
335bd8deadSopenharmony_ci			    sizei n,
345bd8deadSopenharmony_ci			    const float* points);
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    void GetSharpenTexFuncSGIS(enum target,
375bd8deadSopenharmony_ci			       float* points);
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciNew Tokens
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    Accepted by the <param> parameter of TexParameteri and TexParameterf,
425bd8deadSopenharmony_ci    and by the <params> parameter of TexParameteriv and TexParameterfv, when
435bd8deadSopenharmony_ci    their <pname> parameter is TEXTURE_MAG_FILTER:
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci	LINEAR_SHARPEN_SGIS
465bd8deadSopenharmony_ci	LINEAR_SHARPEN_ALPHA_SGIS
475bd8deadSopenharmony_ci	LINEAR_SHARPEN_COLOR_SGIS
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetTexParameteriv and
505bd8deadSopenharmony_ci    GetTexParameterfv:
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci	SHARPEN_TEXTURE_FUNC_POINTS_SGIS
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    None
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization)
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    GL Specification Table 3.7 is updated as follows:
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci	Name				Type	    Legal Values
635bd8deadSopenharmony_ci	----				----	    ------------
645bd8deadSopenharmony_ci	TEXTURE_WRAP_S			integer     CLAMP, REPEAT
655bd8deadSopenharmony_ci	TEXTURE_WRAP_T			integer     CLAMP, REPEAT
665bd8deadSopenharmony_ci	TEXTURE_WRAP_R_EXT		integer     CLAMP, REPEAT
675bd8deadSopenharmony_ci	TEXTURE_MIN_FILTER		integer     NEAREST, LINEAR,
685bd8deadSopenharmony_ci						    NEAREST_MIPMAP_NEAREST,
695bd8deadSopenharmony_ci						    NEAREST_MIPMAP_LINEAR,
705bd8deadSopenharmony_ci						    LINEAR_MIPMAP_NEAREST,
715bd8deadSopenharmony_ci						    LINEAR_MIPMAP_LINEAR,
725bd8deadSopenharmony_ci						    FILTER4_SGIS
735bd8deadSopenharmony_ci	TEXTURE_MAG_FILTER		integer     NEAREST, LINEAR,
745bd8deadSopenharmony_ci						    FILTER4_SGIS,
755bd8deadSopenharmony_ci						    LINEAR_DETAIL_SGIS,
765bd8deadSopenharmony_ci						    LINEAR_DETAIL_ALPHA_SGIS,
775bd8deadSopenharmony_ci						    LINEAR_DETAIL_COLOR_SGIS,
785bd8deadSopenharmony_ci						    LINEAR_SHARPEN_SGIS,
795bd8deadSopenharmony_ci						    LINEAR_SHARPEN_ALPHA_SGIS,
805bd8deadSopenharmony_ci						    LINEAR_SHARPEN_COLOR_SGIS
815bd8deadSopenharmony_ci	TEXTURE_BORDER_COLOR		4 floats    any 4 values in [0,1]
825bd8deadSopenharmony_ci	DETAIL_TEXTURE_LEVEL_SGIS	integer     any non-negative integer
835bd8deadSopenharmony_ci	DETAIL_TEXTURE_MODE_SGIS	integer     ADD, MODULATE
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci	Table 3.7: Texture parameters and their values.
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    3.8.2.2 Texture magnification with sharpening
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    Three additional texture magnification filters are defined for texture
905bd8deadSopenharmony_ci    magnification.  These values, which are assigned to TEXTURE_MAG_FILTER,
915bd8deadSopenharmony_ci    are LINEAR_SHARPEN_SGIS, LINEAR_SHARPEN_ALPHA_SGIS, and
925bd8deadSopenharmony_ci    LINEAR_SHARPEN_COLOR_SGIS.	All three filters sample the level 0
935bd8deadSopenharmony_ci    texture array exactly as it would be sampled with filter mode LINEAR.
945bd8deadSopenharmony_ci    If texture levels 0 and 1 are "complete", as described in the Mipmapping
955bd8deadSopenharmony_ci    portion of Section 3.8.1 (Texture Minification) of the GL Specification,
965bd8deadSopenharmony_ci    the level 1 array of the texture is also linearly sampled, just as though
975bd8deadSopenharmony_ci    mipmap minification was being performed with LOD (the level of detail
985bd8deadSopenharmony_ci    parameter) valued near 1.0.  If levels 0 and 1 are not complete, it is
995bd8deadSopenharmony_ci    as though the magnification texture filter was LINEAR.  (Although
1005bd8deadSopenharmony_ci    querying the magnification filter value will return the value as
1015bd8deadSopenharmony_ci    specified.)
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    The texture value computed from the level 0 array (T0) and the
1045bd8deadSopenharmony_ci    value computed from the level one array (T1) are combined to compute
1055bd8deadSopenharmony_ci    the final texture value (T):
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci	T' = ((1 + F(LOD)) * T0) - (F(LOD) * T1)
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci	     / 0      T' < 0
1105bd8deadSopenharmony_ci	T = <  T'     0 <= T' <= 1
1115bd8deadSopenharmony_ci	     \ 1      T' > 1
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    F is a function of the level-of-detail parameter LOD, which is
1145bd8deadSopenharmony_ci    represented by the Greek character lambda in the GL Specification.
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    The function F of level-of-detail parameter LOD is specified by
1175bd8deadSopenharmony_ci    calling SharpenTexFuncSGIS with <target> set to TEXTURE_1D, TEXTURE_2D,
1185bd8deadSopenharmony_ci    or TEXTURE_3D_EXT, <points> pointing at an array of pairs of floating
1195bd8deadSopenharmony_ci    point values, and <n> set to the number of value pairs in <points>.  The
1205bd8deadSopenharmony_ci    first value of each value pair in <points> specifies a value of LOD, and
1215bd8deadSopenharmony_ci    the second value of each value pair specifies the corresponding function
1225bd8deadSopenharmony_ci    value.  The order in which the points are specified is not significant.
1235bd8deadSopenharmony_ci    The <n> value pairs in <points> completely specify the function,
1245bd8deadSopenharmony_ci    replacing any previous specification that may have existed.  Since
1255bd8deadSopenharmony_ci    negative values of LOD correspond to magnification and positive values
1265bd8deadSopenharmony_ci    correspond to minification, the points should have negative values for
1275bd8deadSopenharmony_ci    LOD (though it is not an error to specify positive values).
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    Function F is evaluated by sorting the value pairs specified by
1305bd8deadSopenharmony_ci    SharpenTexFuncSGIS by LOD value, then fitting a curve through these
1315bd8deadSopenharmony_ci    points.  This curve may be linear between adjacent points, or it may be
1325bd8deadSopenharmony_ci    smoothed, but it will pass exactly through the points, limited only by
1335bd8deadSopenharmony_ci    the resolution of the implementation.  The value pair with the lowest
1345bd8deadSopenharmony_ci    LOD value specifies the function value F for all values of LOD less than
1355bd8deadSopenharmony_ci    or equal to that pair's LOD.  Likewise, the value pair with the greatest
1365bd8deadSopenharmony_ci    LOD value specifies the function value F for all values of LOD greater
1375bd8deadSopenharmony_ci    than or equal to that pair's LOD.  F is undefined if two or more value
1385bd8deadSopenharmony_ci    pairs have the same LOD value.
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    If the texture magnification filter is LINEAR_SHARPEN_SGIS, then both
1415bd8deadSopenharmony_ci    the color and the alpha components of T are computed as described
1425bd8deadSopenharmony_ci    in the equations above.  If the filter is LINEAR_SHARPEN_COLOR_SGIS,
1435bd8deadSopenharmony_ci    then all components of T other than alpha are computed as described
1445bd8deadSopenharmony_ci    above, and the alpha component of T is computed as if the texture
1455bd8deadSopenharmony_ci    magnification filter were LINEAR.  Finally, if the filter is
1465bd8deadSopenharmony_ci    LINEAR_SHARPEN_ALPHA_SGIS, the alpha component of T is computed as
1475bd8deadSopenharmony_ci    described in the equations above, and all other components of T
1485bd8deadSopenharmony_ci    are computed as if the texture magnification filter were LINEAR.
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ci    Minification vs. Magnification
1515bd8deadSopenharmony_ci    ------------------------------
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    If the magnification filter is given by LINEAR_SHARPEN_SGIS,
1545bd8deadSopenharmony_ci    LINEAR_SHARPEN_ALPHA_SGIS, or LINEAR_SHARPEN_COLOR_SGIS, and the
1555bd8deadSopenharmony_ci    minification filter is given by NEAREST_MIPMAP_NEAREST or
1565bd8deadSopenharmony_ci    LINEAR_MIPMAP_NEAREST, then c = 0.5.  The parameter c is used to
1575bd8deadSopenharmony_ci    determine whether minification or magnification filtering is done,
1585bd8deadSopenharmony_ci    as described in Section 3.8.2 of the GL Specification (Texture
1595bd8deadSopenharmony_ci    Magnification).
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
1625bd8deadSopenharmony_ciand the Framebuffer)
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci    None
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions)
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci    GetSharpenTexFuncSGIS is not included in display lists.
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests)
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    The number of points in the sharpen texture function specification of
1735bd8deadSopenharmony_ci    a texture is queried by calling GetTexParameteriv or GetTexParameterfv
1745bd8deadSopenharmony_ci    with <target> set to the target of the desired texture and <pname> set
1755bd8deadSopenharmony_ci    to SHARPEN_TEXTURE_FUNC_POINTS_SGIS.  The function
1765bd8deadSopenharmony_ci    GetSharpenTexFuncSGIS returns in <points> all of the points in the
1775bd8deadSopenharmony_ci    sharpen texture function of texture <target>.
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ciAdditions to the GLX Specification
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci    None
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ciGLX Protocol
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    Two new GLX protocol commands are added.
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci	 SharpenTexFuncSGIS
1885bd8deadSopenharmony_ci	     2		 12+4*2*n	 rendering command length
1895bd8deadSopenharmony_ci	     2		 2052		 rendering command opcode
1905bd8deadSopenharmony_ci	     4		 ENUM		 target
1915bd8deadSopenharmony_ci	     4		 INT32		 n
1925bd8deadSopenharmony_ci	     4*2*n	 LISTofFLOAT	 points
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci	 GetSharpenTexFuncSGIS
1955bd8deadSopenharmony_ci	     1		 CARD8		 opcode (X assigned)
1965bd8deadSopenharmony_ci	     1		 17		 GLX opcode (glXVendorPrivateWithReply)
1975bd8deadSopenharmony_ci	     2		 4		 request length
1985bd8deadSopenharmony_ci	     4		 4097		 vendor specific opcode
1995bd8deadSopenharmony_ci	     4		 GLX_CONTEXT_TAG context tag
2005bd8deadSopenharmony_ci	     4		 ENUM		 target
2015bd8deadSopenharmony_ci	   =>
2025bd8deadSopenharmony_ci	     1		 1		 reply
2035bd8deadSopenharmony_ci	     1				 unused
2045bd8deadSopenharmony_ci	     2		 CARD16		 sequence number
2055bd8deadSopenharmony_ci	     4		 n		 reply length, m = n
2065bd8deadSopenharmony_ci	     4				 unused
2075bd8deadSopenharmony_ci	     4		 CARD32		 n
2085bd8deadSopenharmony_ci	     16				 unused
2095bd8deadSopenharmony_ci	     n*4	 LISTofFLOAT32	 points
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci	 Note that n may be zero, indicating that a GL error occurred.
2125bd8deadSopenharmony_ci	 Other n must be even and n >= 2.
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ciDependencies on EXT_texture
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci    EXT_texture is required.
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ciDependencies on EXT_texture3D
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    If EXT_texture3D is not implemented, references in this specification
2215bd8deadSopenharmony_ci    to TEXTURE_3D_EXT are invalid, and should be ignored.
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ciDependencies on EXT_texture_object
2245bd8deadSopenharmony_ci
2255bd8deadSopenharmony_ci    If EXT_texture_object is implemented, the state values named
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci	SHARPEN_TEXTURE_FUNC_POINTS_SGIS
2285bd8deadSopenharmony_ci	<SHARPEN_TEXTURE_FUNC>
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    are added to the state vector of each texture object. When an attribute
2315bd8deadSopenharmony_ci    set that includes texture information is popped, the bindings and
2325bd8deadSopenharmony_ci    enables are first restored to their pushed values, then the bound
2335bd8deadSopenharmony_ci    textures have their sharpen parameters restored to their pushed values.
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ciErrors
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci    INVALID_ENUM is generated if SharpenTexFuncSGIS or
2385bd8deadSopenharmony_ci    GetSharpenTexFuncSGIS parameter <target> is not TEXTURE_1D, TEXTURE_2D,
2395bd8deadSopenharmony_ci    or TEXTURE_3D_EXT.
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci    INVALID_VALUE is generated if SharpenTexFuncSGIS parameter <n> is
2425bd8deadSopenharmony_ci    negative.
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci    INVALID_OPERATION is generated if SharpenTexFuncSGIS or
2455bd8deadSopenharmony_ci    GetSharpenTexFuncSGIS is executed between execution of Begin and the
2465bd8deadSopenharmony_ci    corresponding execution to End.
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ciNew State
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    Get Value				Get Command		Type		Initial Value	Attribute
2515bd8deadSopenharmony_ci    ---------				-----------		----		-------------	---------
2525bd8deadSopenharmony_ci    SHARPEN_TEXTURE_FUNC_POINTS_SGIS	GetTexParameteriv	n x Z+		2		texture
2535bd8deadSopenharmony_ci    <SHARPEN_TEXTURE_FUNC>		GetSharpenTexFuncSGIS	n x m x R	{0, 0}, {-4, 1} texture
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ciNew Implementation Dependent State
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci    None
258