1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>
<!-- Converted by db4-upgrade version 1.1 -->
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glDepthFunc">
<info>
<copyright>
<year>1991-2006</year>
<holder>Silicon Graphics, Inc.</holder>
</copyright>
<copyright>
<year>2010-2014</year>
<holder>Khronos Group</holder>
</copyright>
</info>
<refmeta>
<refentrytitle>glDepthFunc</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDepthFunc</refname>
<refpurpose>specify the value used for depth buffer comparisons</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDepthFunc</function></funcdef>
<paramdef>GLenum <parameter>func</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 xml:id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>func</parameter></term>
<listitem>
<para>
Specifies the depth comparison function.
Symbolic constants
<constant>GL_NEVER</constant>,
<constant>GL_LESS</constant>,
<constant>GL_EQUAL</constant>,
<constant>GL_LEQUAL</constant>,
<constant>GL_GREATER</constant>,
<constant>GL_NOTEQUAL</constant>,
<constant>GL_GEQUAL</constant>, and
<constant>GL_ALWAYS</constant> are accepted.
The initial value is <constant>GL_LESS</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 xml:id="description"><title>Description</title>
<para>
<function>glDepthFunc</function> specifies the function used to compare each incoming pixel depth value
with the depth value present in the depth buffer.
The comparison is performed only if depth testing is enabled.
(See <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> of <constant>GL_DEPTH_TEST</constant>.)
</para>
<para>
<parameter>func</parameter> specifies the conditions under which the pixel will be drawn.
The comparison functions are as follows:
</para>
<variablelist>
<varlistentry>
<term><constant>GL_NEVER</constant></term>
<listitem>
<para>
Never passes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_LESS</constant></term>
<listitem>
<para>
Passes if the incoming depth value is less than the stored depth value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_EQUAL</constant></term>
<listitem>
<para>
Passes if the incoming depth value is equal to the stored depth value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_LEQUAL</constant></term>
<listitem>
<para>
Passes if the incoming depth value is less than or equal to
the stored depth value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_GREATER</constant></term>
<listitem>
<para>
Passes if the incoming depth value is greater than the stored depth value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_NOTEQUAL</constant></term>
<listitem>
<para>
Passes if the incoming depth value is not equal to the stored depth value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_GEQUAL</constant></term>
<listitem>
<para>
Passes if the incoming depth value is greater than or equal to
the stored depth value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_ALWAYS</constant></term>
<listitem>
<para>
Always passes.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
The initial value of <parameter>func</parameter> is <constant>GL_LESS</constant>.
Initially, depth testing is disabled. If depth testing is disabled or if no
depth buffer exists, it is as if the depth test always passes.
</para>
</refsect1>
<refsect1 xml:id="notes"><title>Notes</title>
<para>
Even if the depth buffer exists and the depth mask is non-zero, the
depth buffer is not updated if the depth test is disabled. In order to
unconditionally write to the depth buffer, the depth test should be enabled
and set to <constant>GL_ALWAYS</constant>.
</para>
</refsect1>
<refsect1 xml:id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>func</parameter> is not an accepted value.
</para>
</refsect1>
<refsect1 xml:id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_FUNC</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_TEST</constant>
</para>
</refsect1>
<refsect1 xml:id="versions"><title>Version Support</title>
<informaltable>
<tgroup cols="13" align="left">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apifunchead.xml" xpointer="xpointer(/*/*)"/>
<tbody>
<row>
<entry><function>glDepthFunc</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='20']/*)"/>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 xml:id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDepthRange</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPolygonOffset</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 xml:id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"/> 1991-2006 Silicon Graphics, Inc.
Copyright <trademark class="copyright"/> 2010-2014 Khronos Group.
This document is licensed under the SGI Free Software B License.
For details, see
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</link>.
</para>
</refsect1>
</refentry>
|