15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_texture_snorm 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_texture_snorm 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Bill Licea-Kane, AMD 125bd8deadSopenharmony_ci Jon Leech, Khronos 135bd8deadSopenharmony_ci Mais Alnasser, AMD 145bd8deadSopenharmony_ci Nick Haemel, AMD 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ciContact 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ci Bill Licea-Kane, (bill.licea-kane 'at' amd.com) 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ciStatus 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ci Draft for OpenGL 3.1 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ciVersion 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ci Last Modified Date: 2009-07-10 275bd8deadSopenharmony_ci Revision: 5 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ciNumber 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci 365 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciDependencies 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci OpenGL 3.0 is required. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci This extension is written against the OpenGL 3.0 specification. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciOverview 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci Fixed-point textures in unextended OpenGL have integer components, 425bd8deadSopenharmony_ci but those values are taken to represent floating-point values in 435bd8deadSopenharmony_ci the range [0.0,1.0]. These integer components are considered 445bd8deadSopenharmony_ci "unsigned normalized" integers. When such a texture is accessed by 455bd8deadSopenharmony_ci a shader or by fixed-function fragment processing, floating-point 465bd8deadSopenharmony_ci values are returned in the range [0.0,1.0]. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension provides a set of new "signed normalized" integer 495bd8deadSopenharmony_ci texture formats. These are taken to represent a floating-point 505bd8deadSopenharmony_ci value in the range [-1.0,1.0] with an exact 0.0. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ciNew Procedures and Functions 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci None 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ciNew Tokens 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci Accepted by the <internalFormat> parameter of TexImage1D, 605bd8deadSopenharmony_ci TexImage2D, and TexImage3D: 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci base internal formats 635bd8deadSopenharmony_ci RED_SNORM 0x8F90 645bd8deadSopenharmony_ci RG_SNORM 0x8F91 655bd8deadSopenharmony_ci RGB_SNORM 0x8F92 665bd8deadSopenharmony_ci RGBA_SNORM 0x8F93 675bd8deadSopenharmony_ci ALPHA_SNORM 0x9010 685bd8deadSopenharmony_ci LUMINANCE_SNORM 0x9011 695bd8deadSopenharmony_ci LUMINANCE_ALPHA_SNORM 0x9012 705bd8deadSopenharmony_ci INTENSITY_SNORM 0x9013 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci sized internal formats 745bd8deadSopenharmony_ci R8_SNORM 0x8F94 755bd8deadSopenharmony_ci RG8_SNORM 0x8F95 765bd8deadSopenharmony_ci RGB8_SNORM 0x8F96 775bd8deadSopenharmony_ci RGBA8_SNORM 0x8F97 785bd8deadSopenharmony_ci ALPHA8_SNORM 0x9014 795bd8deadSopenharmony_ci LUMINANCE8_SNORM 0x9015 805bd8deadSopenharmony_ci LUMINANCE8_ALPHA8_SNORM 0x9016 815bd8deadSopenharmony_ci INTENSITY8_SNORM 0x9017 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci R16_SNORM 0x8F98 845bd8deadSopenharmony_ci RG16_SNORM 0x8F99 855bd8deadSopenharmony_ci RGB16_SNORM 0x8F9A 865bd8deadSopenharmony_ci RGBA16_SNORM 0x8F9B 875bd8deadSopenharmony_ci ALPHA16_SNORM 0x9018 885bd8deadSopenharmony_ci LUMINANCE16_SNORM 0x9019 895bd8deadSopenharmony_ci LUMINANCE16_ALPHA16_SNORM 0x901A 905bd8deadSopenharmony_ci INTENSITY16_SNORM 0x901B 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci Returned by GetTexLevelParmeter 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci SIGNED_NORMALIZED 0x8F9C 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 3.0 Specification (OpenGL Operation) 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci Modify Section 2.19 Colors and Coloring, p. 74 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci Replace Table 2.10: Component Conversions: 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci GL Type of <c> Conversion to internal floating-point 1035bd8deadSopenharmony_ci unsigned normalized, signed normalized 1045bd8deadSopenharmony_ci -------------- ------------------------------------- 1055bd8deadSopenharmony_ci ubyte <c>/(2^8-1), <c>/(2^7-1) 1065bd8deadSopenharmony_ci byte (2<c>+1)/(2^8-1), max ( <c>/(2^7-1), -1.0 ) 1075bd8deadSopenharmony_ci ushort <c>/(2^16-1), <c>/(2^15-1) 1085bd8deadSopenharmony_ci short (2<c>+1)/(2^16-1), max ( <c>/(2^15-1), -1.0 ) 1095bd8deadSopenharmony_ci uint <c>/(2^32-1), <c>/(2^31-1) 1105bd8deadSopenharmony_ci int (2<c>+1)/(2^32-1), max ( <c>/(2^31-1), -1.0 ) 1115bd8deadSopenharmony_ci half <c> 1125bd8deadSopenharmony_ci float <c> 1135bd8deadSopenharmony_ci double <c> 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci Modify Section 3.9 (Texturing), p. 175 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci Modify second paragraph: 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci The internal data type of a texture may be signed normalized 1235bd8deadSopenharmony_ci fixed-point, unsigned normalized fixed-point, floating-point, 1245bd8deadSopenharmony_ci signed integer or unsigned integer, depending on the internal 1255bd8deadSopenharmony_ci format of the texture. The correspondence between internal format 1265bd8deadSopenharmony_ci and the internal data type is given in tables 3.16-3.18. 1275bd8deadSopenharmony_ci Fixed-point and floating-point textures return a floating-point 1285bd8deadSopenharmony_ci value and integer textures return signed or unsigned integer 1295bd8deadSopenharmony_ci values. When a fragment shader is active, the shader is responsible 1305bd8deadSopenharmony_ci for interpreting the result of a texture lookup as the correct data 1315bd8deadSopenharmony_ci type, otherwise the result is undefined. When not using a fragment 1325bd8deadSopenharmony_ci shader, unsigned floating-point texture values are assumed, and the 1335bd8deadSopenharmony_ci results of using either signed normalized fixed-point or integer 1345bd8deadSopenharmony_ci textures in this case are undefined. 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci Modify Section 3.9.1 (Texture Image Specification), p. 176 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci (modify last paragraph beginning p. 176): 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci The selected groups are processed exactly as for DrawPixels, 1415bd8deadSopenharmony_ci stopping just before final conversion. If the <internalformat> of 1425bd8deadSopenharmony_ci the texture is integer, the components are clamped to the 1435bd8deadSopenharmony_ci representable range of the internal format: for signed formats, 1445bd8deadSopenharmony_ci this is [-2^(n-1), 2^(n-1)-1] where n is the number of bits per 1455bd8deadSopenharmony_ci component; for unsigned formats, the range is [0, 2^n-1]. For R, G, 1465bd8deadSopenharmony_ci B, and A, if the <internalformat> of the texture is fixed-point, 1475bd8deadSopenharmony_ci the components are clamped to the representable range of the 1485bd8deadSopenharmony_ci internal format: for signed normalized formats, this is [-1.0, 1495bd8deadSopenharmony_ci 1.0]; for unsigned normalized formats, this is [0.0, 1.0]. 1505bd8deadSopenharmony_ci Otherwise, the components are not modified. 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci (add the following required Color formats (texture-only), p. 179) 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci - R16_SNORM, RG16_SNORM, RGB16_SNORM, RGBA16_SNORM, 1565bd8deadSopenharmony_ci R8_SNORM, RG8_SNORM, RGB8_SNORM, RGBA8_SNORM 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ci (add the following to table 3.16, beginning p. 181) 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci Sized Base R G B A L I 1615bd8deadSopenharmony_ci Internal Format Internal Format bits bits bits bits bits bits 1625bd8deadSopenharmony_ci ----------------------- --------------------- ---- ---- ---- ---- ---- ---- 1635bd8deadSopenharmony_ci R8_SNORM R_SNORM 8 1645bd8deadSopenharmony_ci RG8_SNORM RG_SNORM 8 8 1655bd8deadSopenharmony_ci RGB8_SNORM RGB_SNORM 8 8 8 1665bd8deadSopenharmony_ci RGBA8_SNORM RGBA_SNORM 8 8 8 8 1675bd8deadSopenharmony_ci ALPHA8_SNORM ALPHA8_SNORM 8 1685bd8deadSopenharmony_ci LUMINANCE8_SNORM LUMINANCE8_SNORM 8 1695bd8deadSopenharmony_ci LUMINANCE8_ALPHA8_SNORM LUMINANCE8_ALPHA8_SNORM 8 8 1705bd8deadSopenharmony_ci INTENSITY8_SNORM INTENSITY8_SNORM 8 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci R16_SNORM R_SNORM 16 1735bd8deadSopenharmony_ci RG16_SNORM RG_SNORM 16 16 1745bd8deadSopenharmony_ci RGB16_SNORM RGB_SNORm 16 16 16 1755bd8deadSopenharmony_ci RGBA16_SNORM RGBA_SNORM 16 16 16 16 1765bd8deadSopenharmony_ci ALPHA8_SNORM ALPHA8_SNORM 16 1775bd8deadSopenharmony_ci LUMINANCE16_SNORM LUMINANCE16_SNORM 16 1785bd8deadSopenharmony_ci LUMINANCE16_ALPHA16_SNORM LUMINANCE16_ALPHA16_SNORM 16 16 1795bd8deadSopenharmony_ci INTENSITY16_SNORM INTENSITY16_SNORM 16 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci Table 3.16: Correspondence of sized internal formats to base 1825bd8deadSopenharmony_ci internal formats, internal data type and desired component 1835bd8deadSopenharmony_ci resolutions for each sized internal format. The component 1845bd8deadSopenharmony_ci resolution prefix indicates the internal data type: <f> is floating 1855bd8deadSopenharmony_ci point, <i> is signed integer, <ui> is unsigned integer, and no 1865bd8deadSopenharmony_ci prefix is signed or unsigned normalized fixed-point. 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci Modify Section 3.12.2 Shader Execution 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ci (modify Shader Outputs paragraph, p. 234) 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci XXXXX - Is this section broken? 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci The OpenGL Shading Language specification describes the values that 1955bd8deadSopenharmony_ci may be output by a fragment shader. These outputs are split into 1965bd8deadSopenharmony_ci two categories, user-defined varying out variables and built-in 1975bd8deadSopenharmony_ci variables. The built-in variables are gl_FragColor, gl_FragData[n], 1985bd8deadSopenharmony_ci and gl_FragDepth. If fragment color clamping is enabled and the 1995bd8deadSopenharmony_ci color buffer has a unsigned normalized fixed-point format, signed 2005bd8deadSopenharmony_ci normalized fixed-point format, or floating-point format, the final 2015bd8deadSopenharmony_ci fragment color, fragment data, or varying out variable values 2025bd8deadSopenharmony_ci written by a fragment shader are clamped to the range [0, 1] and 2035bd8deadSopenharmony_ci are optionally converted to normalized fixed-point as described in 2045bd8deadSopenharmony_ci section 2.19.9. 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment 2085bd8deadSopenharmony_ciOperations and the Frame Buffer) 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci Modify Chapter 4 Introduction, (p. 239) 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci (modify second paragraph, p. 239) 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci Each pixel in a color buffer consists of either a single unsigned 2155bd8deadSopenharmony_ci integer color index or up to four color components. The four color 2165bd8deadSopenharmony_ci components are named R, G, B, and A, in that order; color buffers 2175bd8deadSopenharmony_ci are not required to have all four color components. R, G, B, and A 2185bd8deadSopenharmony_ci components may be represented as unsigned normalized fixed-point, 2195bd8deadSopenharmony_ci signed normalized fixed-point, floating-point, signed integer, or 2205bd8deadSopenharmony_ci unsigned integer values; all components must have the same 2215bd8deadSopenharmony_ci representation.... 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ci XXXX - Clear section needs changing? 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and 2275bd8deadSopenharmony_ciState Requests) 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci Modify Section 6.1.3 (Enumerated Queries), p. 318 2305bd8deadSopenharmony_ci 2315bd8deadSopenharmony_ci (Modify beginning paragraph starting on p. 318) 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci For texture images with uncompressed internal formats, queries of 2345bd8deadSopenharmony_ci value of TEXTURE_RED_TYPE, TEXTURE_GREEN_TYPE, TEXTURE_BLUE_TYPE, 2355bd8deadSopenharmony_ci TEXTURE_ALPHA_TYPE, TEXTURE_LUMINANCE_TYPE, TEXTURE_DEPTH_TYPE, 2365bd8deadSopenharmony_ci and TEXTURE_INTENSITY_TYPE return the data type used to store the 2375bd8deadSopenharmony_ci component. Types NONE, UNSIGNED_NORMALIZED, SIGNED_NORMALIZED, 2385bd8deadSopenharmony_ci FLOAT, INT,and UNSIGNED_INT respectively indicate missing, 2395bd8deadSopenharmony_ci unsigned normalized integer, signed normalized integer, 2405bd8deadSopenharmony_ci floating-point, signed unnormalized integer, and unsigned 2415bd8deadSopenharmony_ci unnormalized integer components.... 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ciGLX Protocol 2445bd8deadSopenharmony_ci 2455bd8deadSopenharmony_ci TBD 2465bd8deadSopenharmony_ci 2475bd8deadSopenharmony_ciErrors 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci 2505bd8deadSopenharmony_ciIssues 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci 1 - Should the internalformat enums contain an underscore? 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci RESOLVED: Yes. _SNORM internal format modifier is nearly 2555bd8deadSopenharmony_ci unreadable without it. (Especially for sized formats.) 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci 2 - What are the required signed normalized formats? 2585bd8deadSopenharmony_ci 2595bd8deadSopenharmony_ci RESOLVED: We require 8 and 16 bit R, RG, RGB, RGBA texturing. 2605bd8deadSopenharmony_ci It follows that these are filterable. 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci We are silent about requiring R, RG, RBA and RGBA rendering. 2635bd8deadSopenharmony_ci This is an implementation choice. Note that some "OpenGL 3.0 2645bd8deadSopenharmony_ci target hardware" (multiple implementations) have blending 2655bd8deadSopenharmony_ci limitations with signed normalized color formats. We are 2665bd8deadSopenharmony_ci restricted to "OpenGL 3.0 target hardware" for 3.1 candidates. 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ci 3 - Shader outputs broken? 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci Final color processing (Chapter 2), Clamping (Several) and 2715bd8deadSopenharmony_ci conversion to framebuffer are intertwined at several places 2725bd8deadSopenharmony_ci in the spec now. Some of the statements in this section 2735bd8deadSopenharmony_ci appear to conflict with statements in other sections. 2745bd8deadSopenharmony_ci 2755bd8deadSopenharmony_ci 4 - Clear? 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ci Do we need to be able to clear a signed normalized fixed-point 2785bd8deadSopenharmony_ci buffer to the full range of [-1.0,1.0]? If so, any changes 2795bd8deadSopenharmony_ci needed here? 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ci 5 - Should this "extension spec" be updated to accurately reflect the 2825bd8deadSopenharmony_ci final 3.0 -> 3.1 deltas? 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ci Resolved - Ideally, but not now. Jon made many major structural 2855bd8deadSopenharmony_ci changes to the core spec in 3.0 -> 3.1. See the core 3.1 spec 2865bd8deadSopenharmony_ci with differences tracked for details. 2875bd8deadSopenharmony_ci 2885bd8deadSopenharmony_ci 2895bd8deadSopenharmony_ciRevision History: 2905bd8deadSopenharmony_ci 2915bd8deadSopenharmony_ci Date: 2009-07-10 2925bd8deadSopenharmony_ci Revision: 5 (Jon Leech) 2935bd8deadSopenharmony_ci Assign extension number, minor formatting cleanups for registry. 2945bd8deadSopenharmony_ci 2955bd8deadSopenharmony_ci Date: 2009-04-29 2965bd8deadSopenharmony_ci Revision: 4 (gsellers) 2975bd8deadSopenharmony_ci Add contributors. 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ci Date: 2009-04-22 3005bd8deadSopenharmony_ci Revision: 3 (wwlk) 3015bd8deadSopenharmony_ci Add token values, for R,RG,RGB, RGBA and for "legacy" formats 3025bd8deadSopenharmony_ci alpha, luminace, luminance alpha and intensity. 3035bd8deadSopenharmony_ci Added unsigned conversions. 3045bd8deadSopenharmony_ci Fixed typos in enums: 3055bd8deadSopenharmony_ci LUMINANCE_ALPHA8_SNORM -> LUMINANCE8_ALPHA8_SNORM 3065bd8deadSopenharmony_ci LUMINANCE_ALPHA16_SNORM -> LUMINANCE16_ALPHA16_SNORM 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci Date: 2009-03-17 3095bd8deadSopenharmony_ci Revision: 2 (wwlk) 3105bd8deadSopenharmony_ci Fixed enum inconsistencies 3115bd8deadSopenharmony_ci 3125bd8deadSopenharmony_ci Date: 2008-10-30 3135bd8deadSopenharmony_ci Revision: 1 (wwlk) 3145bd8deadSopenharmony_ci Initial version 3155bd8deadSopenharmony_ci 3165bd8deadSopenharmony_ci 3175bd8deadSopenharmony_ci 318