• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    EXT_depth_clamp
4
5Name Strings
6
7    GL_EXT_depth_clamp
8
9Contact
10
11    Gert Wollny (gert.wollny 'at' collabora.com)
12
13Notice
14
15    Copyright (c) 2019 Collabora LTD
16    Copyright (c) 2009-2013 The Khronos Group Inc. Copyright terms at
17        http://www.khronos.org/registry/speccopyright.html
18
19Status
20
21    Complete.
22
23Version
24
25    Version 1, 2019/01/24.
26    Based on ARB_depth_clamp version 4, modified 2009/08/02.
27
28Number
29
30    #309
31
32Dependencies
33
34    OpenGL ES 2.0 is required.
35    Written based on the wording of the OpenGL ES 3.2 specification.
36
37Overview
38
39    Conventional OpenGL clips geometric primitives to a clip volume
40    with six faces, two of which are the near and far clip planes.
41    Clipping to the near and far planes of the clip volume ensures that
42    interpolated depth values (after the depth range transform) must be
43    in the [0,1] range.
44
45    In some rendering applications such as shadow volumes, it is useful
46    to allow line and polygon primitives to be rasterized without
47    clipping the primitive to the near or far clip volume planes (side
48    clip volume planes clip normally).  Without the near and far clip
49    planes, rasterization (pixel coverage determination) in X and Y
50    can proceed normally if we ignore the near and far clip planes.
51    The one major issue is that fragments of a  primitive may extend
52    beyond the conventional window space depth range for depth values
53    (typically the range [0,1]).  Rather than discarding fragments that
54    defy the window space depth range (effectively what near and far
55    plane clipping accomplish), the depth values can be clamped to the
56    current depth range.
57
58    This extension provides exactly such functionality.  This
59    functionality is useful to obviate the need for near plane capping
60    of stenciled shadow volumes.  The functionality may also be useful
61    for rendering geometry "beyond" the far plane if an alternative
62    algorithm (rather than depth testing) for hidden surface removal is
63    applied to such geometry (specifically, the painter's algorithm).
64    Similar situations at the near clip plane can be avoided at the
65    near clip plane where apparently solid objects can be "seen through"
66    if they intersect the near clip plane.
67
68New Procedures and Functions
69
70    None
71
72New Tokens
73
74    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
75    and by the <pname> parameter of GetBooleanv, GetIntegerv,
76    GetFloatv:
77
78        DEPTH_CLAMP_EXT                               0x864F
79
80Additions to Chapter 12 of the OpenGL ES 3.2 Specification (Fixed-Function Vertex Post-Processing)
81
82 --  Section 12.5 "Primitive Clipping"
83
84    Add to the end of the 1st paragraph:
85
86    "Depth clamping is enabled with the generic Enable command and
87    disabled with the Disable command. The value of the argument to
88    either command is DEPTH_CLAMP_EXT. If depth clamping is enabled, the
89    "-w_c <= z_c <= w_c" plane equation are ignored by view volume
90    clipping (effectively, there is no near or far plane clipping)."
91
92Additions to Chapter 15 of the OpenGL ES 3.2 Specification (Writing Fragments and Samples to the Framebuffer)
93
94 --  Section 15.1.3 "Depth buffer test"
95
96    Add to the end of the 2nd paragraph:
97
98    "If depth clamping (see section 12.15) is enabled, before the
99    incoming fragment's z_w is compared z_w is clamped to the range
100    [min(n,f),max(n,f)], where n and f are the current near and far
101    depth range values (see section 12.6.1)."
102
103Additions to the AGL/GLX/WGL Specifications
104
105    None
106
107GLX Protocol
108
109    None
110
111Errors
112
113    None
114
115New State
116
117Add to table 6.4, transformation state
118
119Get Value       Type  Get Command  Initial Value  Description     Sec
120--------------  ----  -----------  -------------  --------------  ------
121DEPTH_CLAMP_EXT  B     IsEnabled    False          Depth clamping  12.5
122                                                  on/off
123
124New Implementation Dependent State
125
126    None
127
128Issues
129
130    See the issue list in GL_ARB_depth_clamp.
131
132    Can fragments with w_c <=0 be generated when this extension is supported?
133
134      RESOLUTION: No. The inequalities in OpenGL ES Specification 12.5 clarify
135      that only primitives that lie in the region w_c >= 0 can be produced by
136      clipping and the vertex normalization in 12.6 clarifies that values
137      w_c = 0 are prohibited. Hence fragments with w_c <= 0 should also never
138      be generated when this extension is supported.
139
140    How does this extension differ from ARB_depth_clamp?
141
142      Instead of DEPTH_CLAMP the parameter is called DEPTH_CLAMP_EXT.
143      Push/pop attrib bits are not relevant for OpenGL ES.
144
145Revision History
146
147    Version 1, 2019/01/25 (Gert Wollny) - rewrite ARB_depth_clamp against
148    OpenGL ES 3.2 instead of OpenGL 3.1.
149