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