Light | Dark

# docs.GL

OpenGL 4
OpenGL 3
OpenGL 2

# glClearDepth

## Name

glClearDepth — specify the clear value for the depth buffer

## C Specification

`void glClearDepth(` | GLdouble depth`)`;

`void glClearDepthf(` | GLfloat depth`)`;

## Parameters

`depth`

  Specifies the depth value used when the depth buffer is cleared. The initial value is 1.

## Description

`glClearDepth` specifies the depth value used by glClear to clear the depth buffer. Values specified by `glClearDepth` are clamped to the range 0 1 .

## Notes

The type of the `depth` parameter was changed from GLclampf to GLfloat for `glClearDepthf` and from GLclampd to GLdouble for `glClearDepth`. This change is transparent to user code and is described in detail on the removedTypes page.

## Associated Gets

glGet with argument `GL_DEPTH_CLEAR_VALUE`

## Version Support

| OpenGL Version
--- | ---
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
`glClearDepth` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔
`glClearDepthf` | - | - | - | - | - | - | - | ✔ | ✔ | ✔ | ✔ | ✔

## See Also

glClear, removedTypes

## Copyright

Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2010-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/.

Think you can improve this page? Edit this page on GitHub.