GLDEPTHRANGEARRAY(3G)
π NAME π
okay so bestie, this is glDepthRangeArray(3G) β the manual page for glDepthRangeArray, and its whole slay is: specify the mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports. π
β¨ C SPECIFICATION β¨
void glDepthRangeArrayv(GLuint first, GLsizei count, const GLdouble *v);
Like, yes: the function name in the C spec is glDepthRangeArrayv with a v. Copy it exactly, no autocorrect energy. π«Ά
πΈ PARAMETERS πΈ
firstβ specifies the index of the first viewport whose depth range to update. (And remember: it must be less than the value ofGL_MAX_VIEWPORTS.)countβ specifies the number of viewports whose depth range to update.vβ specifies the address of an array containing the near and far values for the depth range of each modified viewport.
π DESCRIPTION π
After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes. Each viewport has an independent depth range specified as a linear mapping of the normalized depth coordinates in this range to window depth coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0 through 1 (like color components). glDepthRangeArray specifies a linear mapping of the normalized depth coordinates in this range to window depth coordinates for each viewport in the range [first, first + count). Thus, the values accepted by glDepthRangeArray are both clamped to this range before they are accepted. π₯
The first parameter specifies the index of the first viewport whose depth range to modify and must be less than the value of GL_MAX_VIEWPORTS. count specifies the number of viewports whose depth range to modify. first + count must be less than or equal to the value of GL_MAX_VIEWPORTS. v specifies the address of an array of pairs of double precision floating point values representing the near and far values of the depth range for each viewport, in that order. π
The setting of (0,1) maps the near plane to 0 and the far plane to 1. With this mapping, the depth buffer range is fully utilized. β¨
π¦ NOTES π¦
It is not necessary that the near plane distance be less than the far plane distance. Reverse mappings such as near = 1, and far = 0 are acceptable. no cap, the depth range said βflexible.β π
The type of the v parameter was changed from GLclampd to GLdouble. This change is transparent to user code and is described in detail on the removedTypes() page. π
π ERRORS π
GL_INVALID_VALUEis generated iffirstis greater than or equal to the value ofGL_MAX_VIEWPORTS.GL_INVALID_VALUEis generated iffirst + countis greater than or equal to the value ofGL_MAX_VIEWPORTS.
bestie, read those boundary conditions carefully β the second error really says βgreater than or equal to.β read it twice, no creative editing. π
π ASSOCIATED GETS π
glGet() with argument GL_DEPTH_RANGE. Thatβs the associated get, periodt. β
π VERSION SUPPORT π
OpenGL version vibe check for glDepthRangeArrayv β the tableβs row label is Function / Feature Name:
2.0β-2.1β-3.0β-3.1β-3.2β-3.3β-4.0β-4.1ββ4.2ββ4.3ββ4.4ββ4.5ββ
π₯ SEE ALSO π₯
glDepthFunc()glDepthRange()glDepthRangeIndexed()glPolygonOffset()glViewportArray()glViewport()removedTypes()
π§ COPYRIGHT π§
Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
π COPYRIGHT π
Copyright Β© 2010-2014 Khronos Group
π final sign-off, bestie: source/version [FIXME: source], date 08/09/2021, page GLDEPTHRANGEARRAY(3G) β mwah! π
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms