15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_depth_buffer_float 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_depth_buffer_float 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Pierre Boudier 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContact 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Pierre Boudier, AMD pierre.boudier 'at' amd.com) 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciNotice 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Copyright (c) 2008-2013 The Khronos Group Inc. Copyright terms at 205bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciSpecification Update Policy 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 255bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 265bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 275bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 285bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 295bd8deadSopenharmony_ci described in more detail at 305bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciStatus 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Approved by the ARB on July 11, 2008 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ciVersion 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci Last Modified Date: October 18, 2012 395bd8deadSopenharmony_ci Revision: 7 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciNumber 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci ARB Extension #43 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ciDependencies 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci OpenGL 2.0 is required. 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci ARB_color_buffer_float is required. 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci EXT_packed_depth_stencil is required. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci ARB_framebuffer_object is required. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci This extension modifies EXT_depth_bounds_test. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci This extension modifies NV_copy_depth_to_color. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci This extension is written against the OpenGL 2.0 specification. 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ciOverview 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci This extension provides new texture internal formats whose depth 645bd8deadSopenharmony_ci components are stored as 32-bit floating-point values, rather than the 655bd8deadSopenharmony_ci normalized unsigned integers used in existing depth formats. 665bd8deadSopenharmony_ci Floating-point depth textures support all the functionality supported for 675bd8deadSopenharmony_ci fixed-point depth textures, including shadow mapping and rendering support 685bd8deadSopenharmony_ci via EXT_framebuffer_object. Floating-point depth textures can store 695bd8deadSopenharmony_ci values outside the range [0,1]. 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci Additionally, this extension provides new packed depth/stencil pixel 725bd8deadSopenharmony_ci formats (see EXT_packed_depth_stencil) that have 64-bit pixels consisting 735bd8deadSopenharmony_ci of a 32-bit floating-point depth value, 8 bits of stencil, and 24 unused 745bd8deadSopenharmony_ci bites. A packed depth/stencil texture internal format is also provided. 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ci This extension does not provide support for WGL or GLX pixel formats with 775bd8deadSopenharmony_ci floating-point depth buffers. The existing (but not commonly used) 785bd8deadSopenharmony_ci WGL_EXT_depth_float extension could be used for this purpose. 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ciNew Procedures and Functions 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci None 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ciNew Tokens 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci Accepted by the <internalformat> parameter of TexImage1D, TexImage2D, 885bd8deadSopenharmony_ci TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT, 895bd8deadSopenharmony_ci and returned in the <data> parameter of GetTexLevelParameter and 905bd8deadSopenharmony_ci GetRenderbufferParameterivEXT: 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci DEPTH_COMPONENT32F 0x8CAC 935bd8deadSopenharmony_ci DEPTH32F_STENCIL8 0x8CAD 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci Accepted by the <type> parameter of DrawPixels, ReadPixels, TexImage1D, 965bd8deadSopenharmony_ci TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and 975bd8deadSopenharmony_ci GetTexImage: 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation) 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci Modify Section 2.11.1 (Controling the Viewport), p. 41 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci (modify second paragraph) The factor and offset applied to z_d 1065bd8deadSopenharmony_ci encoded by n and f are set using 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci void DepthRange(clampd n, clampd f); 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci z_w is represented as either fixed-point or floating-point 1115bd8deadSopenharmony_ci depending on whether the framebuffer's depth buffer uses 1125bd8deadSopenharmony_ci fixed-point or floating-point representation. If the depth buffer 1135bd8deadSopenharmony_ci uses fixed-point representation, we assume that the representation 1145bd8deadSopenharmony_ci used represents each value k/(2^m - 1), where k is in 1155bd8deadSopenharmony_ci {0,1,...,2^m-1}, as k (e.g. 1.0 is represented in binary as a 1165bd8deadSopenharmony_ci string of all ones). The parameters n and f are clamped to [0, 1] 1175bd8deadSopenharmony_ci when using DepthRange. When n and f are applied to z_d, they are 1185bd8deadSopenharmony_ci clamped to the range appropriate given the depth buffer's representation. 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci Modify Section 3.5.5 (Depth Offset), p. 112 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci (modify third paragraph) The minimum resolvable difference r is 1255bd8deadSopenharmony_ci an implementation dependent parameter that depends on the depth 1265bd8deadSopenharmony_ci buffer representation. It is the smallest difference in window 1275bd8deadSopenharmony_ci coordinate z values that is guaranteed to remain distinct 1285bd8deadSopenharmony_ci throughout polygon rasterization and in the depth buffer. All 1295bd8deadSopenharmony_ci pairs of fragments generated by the rasterization of two polygons 1305bd8deadSopenharmony_ci with otherwise identical vertices, but z_w values that differ by r, 1315bd8deadSopenharmony_ci will have distinct depth values. 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci For fixed-point depth buffer representations, r is constant 1345bd8deadSopenharmony_ci throughout the range of the entire depth buffer. For 1355bd8deadSopenharmony_ci floating-point depth buffers, there is no single minimum resolvable 1365bd8deadSopenharmony_ci difference. In this case, the minimum resolvable difference for a 1375bd8deadSopenharmony_ci given polygon is dependent on the maximum exponent, e, in the range 1385bd8deadSopenharmony_ci of z values spanned by the primitive. If n is the number of bits 1395bd8deadSopenharmony_ci in the floating-point mantissa, the minimum resolvable difference, 1405bd8deadSopenharmony_ci r, for the given primitive is defined as 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci r = 2^(e - n). (3.11) 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci (modify fourth paragraph) The offset value o for a polygon is 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci o = m * factor + r * units. (3.12) 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci m is computed as described above. If the depth buffer uses a 1495bd8deadSopenharmony_ci fixed-point representation, m is a function of depth values in the 1505bd8deadSopenharmony_ci range [0, 1], and o is applied to depth values in the same range. 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci (modify last paragraph) For fixed-point depth buffers, fragment 1535bd8deadSopenharmony_ci depth values are always limited to the range [0, 1], either by 1545bd8deadSopenharmony_ci clamping after offset addition is performed (preferred), or by 1555bd8deadSopenharmony_ci clamping the vertex values used in the rasterization of the 1565bd8deadSopenharmony_ci polygons. Fragment depth values are clamped when the depth 1575bd8deadSopenharmony_ci buffer uses a floating-point representation. 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci Add a row to table 3.5, p. 128 1615bd8deadSopenharmony_ci 1625bd8deadSopenharmony_ci type Parameter GL Type Special 1635bd8deadSopenharmony_ci ------------------------------ ------- ------- 1645bd8deadSopenharmony_ci ... ... ... 1655bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV N/A Yes 1665bd8deadSopenharmony_ci ... ... ... 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci Modify Section 3.6.4 (Rasterization of Pixel Rectangles), p. 128 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci (modify second paragraph as updated by EXT_packed_depth_stencil) 1725bd8deadSopenharmony_ci ... If the GL is in color index mode and <format> is not one of 1735bd8deadSopenharmony_ci COLOR_INDEX, STENCIL_INDEX, DEPTH_COMPONENT, or DEPTH_STENCIL_EXT, 1745bd8deadSopenharmony_ci then the error INVALID_OPERATION occurs. If <type> is BITMAP and 1755bd8deadSopenharmony_ci <format> is not COLOR_INDEX or STENCIL_INDEX then the error 1765bd8deadSopenharmony_ci INVALID_ENUM occurs. If <format> is DEPTH_STENCIL_EXT and <type> 1775bd8deadSopenharmony_ci is not UNSIGNED_INT_24_8_EXT or FLOAT_32_UNSIGNED_INT_24_8_REV, 1785bd8deadSopenharmony_ci then the error INVALID_ENUM occurs. Some additional constraints 1795bd8deadSopenharmony_ci on the combinations of <format> and <type> values that are accepted 1805bd8deadSopenharmony_ci are discussed below. 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci (modify fifth paragraph of "Unpacking," p 130. as updated by 1835bd8deadSopenharmony_ci EXT_packed_depth_stencil) Calling DrawPixels with a <type> of 1845bd8deadSopenharmony_ci UNSIGNED_BYTE_3_3_2, ..., UNSIGNED_INT_2_10_10_10_REV, or 1855bd8deadSopenharmony_ci UNSIGNED_INT_24_8_EXT is a special case in which all the components 1865bd8deadSopenharmony_ci of each group are packed into a single unsigned byte, unsigned 1875bd8deadSopenharmony_ci short, or unsigned int, depending on the type. If <type> is 1885bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV, the components of each group 1895bd8deadSopenharmony_ci are two 32-bit words. The first word contains the float component. 1905bd8deadSopenharmony_ci The second word contains packed 24-bit and 8-bit components. 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci Add two rows to table 3.8, p. 132 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci type Parameter GL Type Components Pixel Formats 1965bd8deadSopenharmony_ci ------------------------------ ------- ---------- ------------- 1975bd8deadSopenharmony_ci ... ... ... ... 1985bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV N/A 2 DEPTH_STENCIL_EXT 1995bd8deadSopenharmony_ci ... ... ... ... 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci Add a row to table 3.11, p. 134 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV: 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci 31 30 29 28 ... 4 3 2 1 0 31 30 29 ... 9 8 7 6 5 ... 2 1 0 2075bd8deadSopenharmony_ci +-------------------------+ +--------------------------------+ 2085bd8deadSopenharmony_ci | Float Component | | 2nd Component | 1st Component | 2095bd8deadSopenharmony_ci +-------------------------+ +--------------------------------+ 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci (modify last paragraph of "Final Conversion," p. 136) For a depth 2135bd8deadSopenharmony_ci component, an element is processed according to the depth buffer's 2145bd8deadSopenharmony_ci representation. For fixed-point depth buffers, the element is first 2155bd8deadSopenharmony_ci clamped to [0, 1] and then converted to fixed-point as if it were a 2165bd8deadSopenharmony_ci window z value (see section 2.11.1, Controling the Viewport). 2175bd8deadSopenharmony_ci Conversion is not necessary when the depth buffer uses 2185bd8deadSopenharmony_ci a floating-point representation, but clamping is. 2195bd8deadSopenharmony_ci 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci Modify Section 3.8.1 (Texture Image Specification), p. 150 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci (modify the second paragraph, p. 151, as modified by 2245bd8deadSopenharmony_ci ARB_color_buffer_float) The selected groups are processed exactly 2255bd8deadSopenharmony_ci as for DrawPixels, stopping just before final conversion. Each R, 2265bd8deadSopenharmony_ci G, B, A, or depth value so generated is clamped based on the 2275bd8deadSopenharmony_ci component type in the <internalFormat>. Fixed-point and Floating-point 2285bd8deadSopenharmony_ci components are clamped to [0, 1]. 2295bd8deadSopenharmony_ci 32-bit floating-point components are in the standard IEEE float format. 2305bd8deadSopenharmony_ci 16-bit floating-point components have 1 sign bit, 5 exponent bits, 2315bd8deadSopenharmony_ci and 10 mantissa bits. Stencil index values are masked by 2^n-1 2325bd8deadSopenharmony_ci where n is the number of stencil bits in the internal format 2335bd8deadSopenharmony_ci resolution (see below). If the base internal format is 2345bd8deadSopenharmony_ci DEPTH_STENCIL_EXT and <format> is not DEPTH_STENCIL_EXT, then the 2355bd8deadSopenharmony_ci values of the stencil index texture components are undefined. 2365bd8deadSopenharmony_ci 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci Add two rows to table 3.16, p. 154 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ci Sized Base R G B A L I D S 2415bd8deadSopenharmony_ci Internal Format InternalFormat bits bits bits bits bits bits bits bits 2425bd8deadSopenharmony_ci ------------------ ----------------- ---- ---- ---- ---- ---- ---- ---- ---- 2435bd8deadSopenharmony_ci ... ... ... ... ... ... ... ... ... ... 2445bd8deadSopenharmony_ci DEPTH_COMPONENT32F DEPTH_COMPONENT f32 2455bd8deadSopenharmony_ci DEPTH32F_STENCIL8 DEPTH_STENCIL_EXT f32 8 2465bd8deadSopenharmony_ci ... ... ... ... ... ... ... ... ... ... 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci Modify Section 3.8.14 (Texture Comparison Modes), p. 185 2505bd8deadSopenharmony_ci 2515bd8deadSopenharmony_ci (modify second paragraph of "Depth Texture Comparison Mode," p. 2525bd8deadSopenharmony_ci 188) 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci Let D_t be the depth texture value, and R be the interpolated 2555bd8deadSopenharmony_ci texture coordinate. If the texture's internal format indicates a 2565bd8deadSopenharmony_ci fixed-point depth texture, then D_t and R are clamped to [0, 1]; 2575bd8deadSopenharmony_ci otherwise no clamping is performed. The effective texture value L_t, 2585bd8deadSopenharmony_ci I_t, or A_t is computed as follows: 2595bd8deadSopenharmony_ci 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci Modify Section 3.11.2 (Shader Execution), p. 194 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ci (modify first paragraph of "Shader Outputs," p, 196, as modified by 2645bd8deadSopenharmony_ci ARB_color_buffer_float) The OpenGL Shading Language specification 2655bd8deadSopenharmony_ci describes the values that may be output by a fragment shader. 2665bd8deadSopenharmony_ci These are gl_FragColor, gl_FragData[n], and gl_FragDepth. If 2675bd8deadSopenharmony_ci fragment clamping is enabled, the final fragment color values or 2685bd8deadSopenharmony_ci the final fragment data values written by a fragment shader are 2695bd8deadSopenharmony_ci clamped to the range [0, 1] and then may be converted to 2705bd8deadSopenharmony_ci fixed-point as described in section 2.14.9. If fragment clamping 2715bd8deadSopenharmony_ci is disabled, the final fragment color values or the final fragment 2725bd8deadSopenharmony_ci data values are not modified. For fixed-point depth buffers the 2735bd8deadSopenharmony_ci final fragment depth written by a fragment shader is first clamped 2745bd8deadSopenharmony_ci to [0, 1] and then converted to fixed-point as if it were a window 2755bd8deadSopenharmony_ci z value (see section 2.11.1). Conversion is not applied for floating-point 2765bd8deadSopenharmony_ci depth buffers. Note that the depth range computation is not applied here. 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci 2795bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment 2805bd8deadSopenharmony_ciOperations and the Frame Buffer) 2815bd8deadSopenharmony_ci 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci (modify third paragraph in the introduction, p. 198, as modified by 2845bd8deadSopenharmony_ci ARB_color_buffer_float) Color buffers consist of either unsigned 2855bd8deadSopenharmony_ci integer color indices, R, G, B and optionally A unsigned integer 2865bd8deadSopenharmony_ci values, or R, G, B, and optionally A floating-point values. Depth 2875bd8deadSopenharmony_ci buffers consist of either unsigned integer values of the format 2885bd8deadSopenharmony_ci described in section 2.11.1, or floating-point values. The number 2895bd8deadSopenharmony_ci of bitplanes... 2905bd8deadSopenharmony_ci 2915bd8deadSopenharmony_ci 2925bd8deadSopenharmony_ci Modify Section 4.2.3 (Clearing the Buffers), p. 215 2935bd8deadSopenharmony_ci 2945bd8deadSopenharmony_ci (modify fourth paragraph) 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ci The functions 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ci void ClearDepth(clampd d); 2995bd8deadSopenharmony_ci 3005bd8deadSopenharmony_ci are used to set the depth value used when clearing the depth buffer. 3015bd8deadSopenharmony_ci ClearDepth takes a floating-point value that is clamped to the range 3025bd8deadSopenharmony_ci [0, 1]. When clearing a fixed-point depth buffer, the depth clear 3035bd8deadSopenharmony_ci value is clamped to the range [0, 1], and converted to fixed-point 3045bd8deadSopenharmony_ci according to the rules for a window z value given in section 2.11.1. 3055bd8deadSopenharmony_ci No conversion are applied when clearing a floating-point 3065bd8deadSopenharmony_ci depth buffer. 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci Modify Section 4.3.1 (Writing to the Stencil Buffer), p. 218 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ci (modify paragraph added by EXT_packed_depth_stencil, p. 219) 3115bd8deadSopenharmony_ci If the <format> is DEPTH_STENCIL_EXT, then values are taken from 3125bd8deadSopenharmony_ci both the depth buffer and the stencil buffer. If there is no depth 3135bd8deadSopenharmony_ci buffer or if there is no stencil buffer, then the error 3145bd8deadSopenharmony_ci INVALID_OPERATION occurs. If the <type> parameter is not 3155bd8deadSopenharmony_ci UNSIGNED_INT_24_8_EXT, or FLOAT_32_UNSIGNED_INT_24_8_REV then 3165bd8deadSopenharmony_ci the error INVALID_ENUM occurs. 3175bd8deadSopenharmony_ci 3185bd8deadSopenharmony_ci 3195bd8deadSopenharmony_ci Modify Section 4.3.2 (Reading Pixels), p. 219 3205bd8deadSopenharmony_ci 3215bd8deadSopenharmony_ci (modify "Conversion of Depth values," p. 222, as modified by 3225bd8deadSopenharmony_ci EXT_packed_depth_stencil) This step only applies if <format> is 3235bd8deadSopenharmony_ci DEPTH_COMPONENT or DEPTH_STENCIL_EXT and the depth buffer uses a 3245bd8deadSopenharmony_ci fixed-point representation. An element taken from the depth buffer 3255bd8deadSopenharmony_ci is taken to be a fixed-point value in [0, 1] with m bits, where 3265bd8deadSopenharmony_ci m is the number of bits in the depth buffer (see section 2.11.1). 3275bd8deadSopenharmony_ci No conversion is necessary if <format> is DEPTH_COMPONENT or 3285bd8deadSopenharmony_ci DEPTH_STENCIL_EXT and the depth buffer uses a floating-point 3295bd8deadSopenharmony_ci representation. 3305bd8deadSopenharmony_ci 3315bd8deadSopenharmony_ci 3325bd8deadSopenharmony_ci Add a row to table 4.6, p. 223 3335bd8deadSopenharmony_ci 3345bd8deadSopenharmony_ci type Parameter Index Mask 3355bd8deadSopenharmony_ci ------------------------------ ---------- 3365bd8deadSopenharmony_ci ... ... 3375bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV 2^8-1 3385bd8deadSopenharmony_ci 3395bd8deadSopenharmony_ci 3405bd8deadSopenharmony_ci Add a row to table 4.7, p. 224 3415bd8deadSopenharmony_ci 3425bd8deadSopenharmony_ci type Parameter GL Type Component Conversion 3435bd8deadSopenharmony_ci ------------------------------ ------- -------------------- 3445bd8deadSopenharmony_ci ... ... ... 3455bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV float c = f (depth only) 3465bd8deadSopenharmony_ci 3475bd8deadSopenharmony_ci 3485bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions) 3495bd8deadSopenharmony_ci 3505bd8deadSopenharmony_ci None. 3515bd8deadSopenharmony_ci 3525bd8deadSopenharmony_ci 3535bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and 3545bd8deadSopenharmony_ciState Requests) 3555bd8deadSopenharmony_ci 3565bd8deadSopenharmony_ci Modify DEPTH_RANGE entry in table 6.9 (Transformation State) p. 270 3575bd8deadSopenharmony_ci 3585bd8deadSopenharmony_ci Init 3595bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. Attribute 3605bd8deadSopenharmony_ci ----------- ---- ----------- ----- ---------------------- ------ --------- 3615bd8deadSopenharmony_ci DEPTH_RANGE 2xR GetFloatv 0,1 Depth range near & far 2.11.1 viewport 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci 3645bd8deadSopenharmony_ci Modify DEPTH_BOUNDS_EXT entry in table 6.19 (Pixel Operation) p. 280 3655bd8deadSopenharmony_ci 3665bd8deadSopenharmony_ci Init 3675bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec Attribute 3685bd8deadSopenharmony_ci --------------------- ----------- ----- ------------------------ ----- ------------ 3695bd8deadSopenharmony_ci DEPTH_BOUNDS_EXT 2xR GetFloatv 0,1 Depth bounds zmin & zmax 4.1.X depth-buffer 3705bd8deadSopenharmony_ci 3715bd8deadSopenharmony_ci 3725bd8deadSopenharmony_ci Modify DEPTH_CLEAR_VALUE entry in table 6.21 (Framebuffer Control) p. 280 3735bd8deadSopenharmony_ci 3745bd8deadSopenharmony_ci Init 3755bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec Attribute 3765bd8deadSopenharmony_ci ----------------- ---- ----------- ---- ------------------------ ----- ------------ 3775bd8deadSopenharmony_ci DEPTH_CLEAR_VALUE R GetFloatv 1 Depth buffer clear value 4.2.3 depth-buffer 3785bd8deadSopenharmony_ci 3795bd8deadSopenharmony_ci 3805bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 2.0 Specification (Invariance) 3815bd8deadSopenharmony_ci 3825bd8deadSopenharmony_ci None. 3835bd8deadSopenharmony_ci 3845bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 3855bd8deadSopenharmony_ci 3865bd8deadSopenharmony_ci None. 3875bd8deadSopenharmony_ci 3885bd8deadSopenharmony_ciGLX Protocol 3895bd8deadSopenharmony_ci 3905bd8deadSopenharmony_ci None. 3915bd8deadSopenharmony_ci 3925bd8deadSopenharmony_ciDependencies on EXT_depth_bounds_test: 3935bd8deadSopenharmony_ci 3945bd8deadSopenharmony_ci Modify the definition of DepthBoundsEXT in section 4.1.x Depth 3955bd8deadSopenharmony_ci Bounds Test. 3965bd8deadSopenharmony_ci 3975bd8deadSopenharmony_ci Modify section 4.1.x (Depth Bounds Test) 3985bd8deadSopenharmony_ci 3995bd8deadSopenharmony_ci (modify first paragraph) ...These values are set with 4005bd8deadSopenharmony_ci 4015bd8deadSopenharmony_ci void DepthBoundsEXT(clampd zmin, clampd zmax); 4025bd8deadSopenharmony_ci 4035bd8deadSopenharmony_ci The paramerters to DepthBoundsEXT are clamped to the range [0, 1]. 4045bd8deadSopenharmony_ci Each of zmin and zmax are subject to clamping to the range of the depth 4055bd8deadSopenharmony_ci buffer at the time the depth bounds test is applied. For 4065bd8deadSopenharmony_ci fixed-point depth buffers, the applied zmin and zmax are clamped to 4075bd8deadSopenharmony_ci [0, 1]. For floating-point depth buffers, the applied zmin and 4085bd8deadSopenharmony_ci zmax are clamped to [0, 1]. If zmin <= Zpixel <= zmax, then the depth 4095bd8deadSopenharmony_ci bounds test passes. Otherwise, the test fails and the fragment is 4105bd8deadSopenharmony_ci discarded. The test is enabled or disabled using Enable or Disable 4115bd8deadSopenharmony_ci using the constant DEPTH_BOUNDS_TEST_EXT. When disabled, it is as 4125bd8deadSopenharmony_ci if the depth bounds test always passes. If zmin is greater than 4135bd8deadSopenharmony_ci zmax, then the error INVALID_VALUE is generated. The state 4145bd8deadSopenharmony_ci required consists of two floating-point values and a bit indicating 4155bd8deadSopenharmony_ci whether the test is enabled or disabled. In the initial state, 4165bd8deadSopenharmony_ci zmin and zmax are set to 0.0 and 1.0 respectively; and the depth 4175bd8deadSopenharmony_ci bounds test is disabled. 4185bd8deadSopenharmony_ci 4195bd8deadSopenharmony_ciErrors 4205bd8deadSopenharmony_ci 4215bd8deadSopenharmony_ci Modify the following error in the EXT_packed_depth_stencil 4225bd8deadSopenharmony_ci specification by adding mention of 4235bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV: 4245bd8deadSopenharmony_ci 4255bd8deadSopenharmony_ci The error INVALID_ENUM is generated if DrawPixels or ReadPixels is 4265bd8deadSopenharmony_ci called where format is DEPTH_STENCIL_EXT and type is not 4275bd8deadSopenharmony_ci UNSIGNED_INT_24_8_EXT, or FLOAT_32_UNSIGNED_INT_24_8_REV. 4285bd8deadSopenharmony_ci 4295bd8deadSopenharmony_ci 4305bd8deadSopenharmony_ci Modify the following error in the EXT_packed_depth_stencil 4315bd8deadSopenharmony_ci specification by adding mention of 4325bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_INT_24_8_REV: 4335bd8deadSopenharmony_ci 4345bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if DrawPixels or 4355bd8deadSopenharmony_ci ReadPixels is called where type is UNSIGNED_INT_24_8_EXT, 4365bd8deadSopenharmony_ci or FLOAT_32_UNSIGNED_INT_24_8_REV and format is not 4375bd8deadSopenharmony_ci DEPTH_STENCIL_EXT. 4385bd8deadSopenharmony_ci 4395bd8deadSopenharmony_ci 4405bd8deadSopenharmony_ci Add the following error to the NV_copy_depth_to_color 4415bd8deadSopenharmony_ci specification: 4425bd8deadSopenharmony_ci 4435bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if CopyPixels is called 4445bd8deadSopenharmony_ci where type is DEPTH_STENCIL_TO_RGBA_EXT or DEPTH_STENCL_TO_BGRA_EXT 4455bd8deadSopenharmony_ci and the depth buffer uses a floating point representation. 4465bd8deadSopenharmony_ci 4475bd8deadSopenharmony_ciNew State 4485bd8deadSopenharmony_ci 4495bd8deadSopenharmony_ci None. 4505bd8deadSopenharmony_ci 4515bd8deadSopenharmony_ciIssues 4525bd8deadSopenharmony_ci 4535bd8deadSopenharmony_ci 1. Should this extension expose floating-point depth buffers through 4545bd8deadSopenharmony_ci WGL/GLX "pixel formats?" 4555bd8deadSopenharmony_ci 4565bd8deadSopenharmony_ci RESOLVED: No. The WGL_EXT_depth_float extension already provides a 4575bd8deadSopenharmony_ci mechanism for requesting a floating-point depth buffer. 4585bd8deadSopenharmony_ci 4595bd8deadSopenharmony_ci 2. How does an application access the full range of a floating-point 4605bd8deadSopenharmony_ci depth buffer? 4615bd8deadSopenharmony_ci 4625bd8deadSopenharmony_ci RESOLVED: This will be a different extension 4635bd8deadSopenharmony_ci 4645bd8deadSopenharmony_ci 3. Should we add a new state query to determine if the depth buffer is 4655bd8deadSopenharmony_ci using a floating-point representation? 4665bd8deadSopenharmony_ci 4675bd8deadSopenharmony_ci RESOLVED: No. The old EXT version of this extension had 4685bd8deadSopenharmony_ci DEPTH_BUFFER_FLOAT_MODE_EXT boolean state to see if the depth 4695bd8deadSopenharmony_ci buffer is using a floating-point representation, but in this ARB 4705bd8deadSopenharmony_ci extension we rely on the GetFramebufferAttachmentiv query 4715bd8deadSopenharmony_ci FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE query introduced with 4725bd8deadSopenharmony_ci ARB_framebuffer_object and OpenGL 3.0. 4735bd8deadSopenharmony_ci 4745bd8deadSopenharmony_ci 4755bd8deadSopenharmony_ci 4. How does polygon offset work with floating-point depth buffers? 4765bd8deadSopenharmony_ci 4775bd8deadSopenharmony_ci RESOLVED: The third paragraph of section 3.5.5 (Depth Offset) 4785bd8deadSopenharmony_ci describes the minimum resolvable difference r as "the smallest 4795bd8deadSopenharmony_ci difference in window coordinate z values that is guaranteed to remain 4805bd8deadSopenharmony_ci distinct throughout polygon rasterization and in the depth buffer." 4815bd8deadSopenharmony_ci The polygon offset value o is computed as a function of r. The 4825bd8deadSopenharmony_ci minimum resolvable difference r makes sense for fixed-point depth 4835bd8deadSopenharmony_ci values, and even floating-point depth values in the range [-1, 1]. 4845bd8deadSopenharmony_ci For unclamped floating-point depth values, there is no constant 4855bd8deadSopenharmony_ci minimum resolvable difference -- the minimum difference necessary to 4865bd8deadSopenharmony_ci change the mantissa of a floating-point value by one bit depends on 4875bd8deadSopenharmony_ci the exponent of the value being offset. To remedy this problem, the 4885bd8deadSopenharmony_ci minimum resolvable difference is defined to be relative to the range 4895bd8deadSopenharmony_ci of depth values for the given primitive when the depth buffer is 4905bd8deadSopenharmony_ci floating-point. 4915bd8deadSopenharmony_ci 4925bd8deadSopenharmony_ci 5. How does NV_copy_depth_to_color work with floating-point depth values? 4935bd8deadSopenharmony_ci 4945bd8deadSopenharmony_ci RESOLVED: It isn't clear that there is any usefulness to copying the 4955bd8deadSopenharmony_ci data for 32-bit floating-point depth values to a fixed-point color 4965bd8deadSopenharmony_ci buffer. It is even less clear how copying packed data from a 4975bd8deadSopenharmony_ci FLOAT_32_UNSIGNED_24_8_REV depth/stencil buffer to a fixed-point color 4985bd8deadSopenharmony_ci buffer would be useful or even how it should be implemented. An error 4995bd8deadSopenharmony_ci should be generated if CopyPixels is called where <type> is 5005bd8deadSopenharmony_ci DEPTH_STENCIL_TO_RGBA_EXT or DEPTH_STENCIL_TO_BGRA and the depth buffer 5015bd8deadSopenharmony_ci uses a floating-point representation. 5025bd8deadSopenharmony_ci 5035bd8deadSopenharmony_ci 6. Other OpenGL hardware implementations may be capable of supporting 5045bd8deadSopenharmony_ci floating-point depth buffers. Why is this an NV extension? 5055bd8deadSopenharmony_ci 5065bd8deadSopenharmony_ci RESOLVED: When rendering to floating-point depth buffers, we expect 5075bd8deadSopenharmony_ci that other implementations may only be capable of supporting Z values 5085bd8deadSopenharmony_ci in the range [0,1]. For such implementations, floating-point Z 5095bd8deadSopenharmony_ci buffers do not improve the range of Z values supported, but do offer 5105bd8deadSopenharmony_ci increased precision than conventional 24-bit fixed-point Z buffers, 5115bd8deadSopenharmony_ci particularly around zero. 5125bd8deadSopenharmony_ci 5135bd8deadSopenharmony_ci This extension was initially proposed as an EXT, but we have changed 5145bd8deadSopenharmony_ci it to an NV extension in the expectation that an EXT may be offered at 5155bd8deadSopenharmony_ci some point in the not-too-distant future. We expect that the EXT 5165bd8deadSopenharmony_ci could be supported by a larger range of vendors. NVIDIA would 5175bd8deadSopenharmony_ci continue to support both extensions, where the NV extension could be 5185bd8deadSopenharmony_ci thought of as taking the capability of the EXT version and extending 5195bd8deadSopenharmony_ci it to support Z values outside the range [0,1]. 5205bd8deadSopenharmony_ci 5215bd8deadSopenharmony_ci 7. Why don't the new tokens and entry points in this extension have 5225bd8deadSopenharmony_ci "ARB" suffixes like other ARB extensions? 5235bd8deadSopenharmony_ci 5245bd8deadSopenharmony_ci RESOLVED: Unlike most ARB extensions, this is a strict subset of 5255bd8deadSopenharmony_ci functionality already approved in OpenGL 3.0. This extension 5265bd8deadSopenharmony_ci exists only to support that functionality on older hardware that 5275bd8deadSopenharmony_ci cannot implement a full OpenGL 3.0 driver. Since there are no 5285bd8deadSopenharmony_ci possible behavior changes between the ARB extension and core 5295bd8deadSopenharmony_ci features, source code compatibility is improved by not using 5305bd8deadSopenharmony_ci suffixes on the extension. 5315bd8deadSopenharmony_ci 5325bd8deadSopenharmony_ciRevision History 5335bd8deadSopenharmony_ci 5345bd8deadSopenharmony_ci Rev. Date Author Changes 5355bd8deadSopenharmony_ci ---- -------- -------- ----------------------------------------- 5365bd8deadSopenharmony_ci 7 10/18/12 Jon Leech Restrict [0,1] clamp of D_t and R to 5375bd8deadSopenharmony_ci only occur for fixed-point depth textures, 5385bd8deadSopenharmony_ci matching actual driver behavior and the 5395bd8deadSopenharmony_ci original intent of NV_depth_buffer_float 5405bd8deadSopenharmony_ci (Bug 7975). 5415bd8deadSopenharmony_ci 5425bd8deadSopenharmony_ci 6 08/08/08 Jon Leech Remove DEPTH_BUFFER_FLOAT_MODE query, 5435bd8deadSopenharmony_ci update issue 3 accordingly, and 5445bd8deadSopenharmony_ci change dependency from EXT to 5455bd8deadSopenharmony_ci ARB_framebuffer_object / GL 3.0. 5465bd8deadSopenharmony_ci 5475bd8deadSopenharmony_ci 5 08/07/08 Jon Leech Remove ARB suffixes. 5485bd8deadSopenharmony_ci 5495bd8deadSopenharmony_ci 4 08/06/08 Jon Leech Fix missing _REV in some token names. 5505bd8deadSopenharmony_ci 5515bd8deadSopenharmony_ci 3 07/11/08 Jon Leech Change NV enum values due to incompatible 5525bd8deadSopenharmony_ci clamping behavior. 5535bd8deadSopenharmony_ci 5545bd8deadSopenharmony_ci 2 06/30/08 jsandmel Trivial conversion to ARB_depth_buffer_float 5555bd8deadSopenharmony_ci 5565bd8deadSopenharmony_ci 1 06/05/08 pboudier Forked from NV_depth_buffer_float. Restore 5575bd8deadSopenharmony_ci clamping to [0,1] and remove 'd' entry 5585bd8deadSopenharmony_ci points. Change suffix from NV to EXT. 559