Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> | |
4 | <refentry id="glDepthRange"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glDepthRange</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glDepthRange</refname> | |
17 | <refpurpose>specify mapping of depth values from normalized device coordinates to window coordinates</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glDepthRange</function></funcdef> | |
23 | <paramdef>GLdouble <parameter>nearVal</parameter></paramdef> | |
24 | <paramdef>GLdouble <parameter>farVal</parameter></paramdef> | |
25 | </funcprototype> | |
26 | <funcprototype> | |
27 | <funcdef>void <function>glDepthRangef</function></funcdef> | |
28 | <paramdef>GLfloat <parameter>nearVal</parameter></paramdef> | |
29 | <paramdef>GLfloat <parameter>farVal</parameter></paramdef> | |
30 | </funcprototype> | |
31 | </funcsynopsis> | |
32 | </refsynopsisdiv> | |
33 | <!-- eqn: ignoring delim $$ --> | |
34 | <refsect1 id="parameters"><title>Parameters</title> | |
35 | <variablelist> | |
36 | <varlistentry> | |
37 | <term><parameter>nearVal</parameter></term> | |
38 | <listitem> | |
39 | <para> | |
40 | Specifies the mapping of the near clipping plane to window coordinates. | |
41 | The initial value is 0. | |
42 | </para> | |
43 | </listitem> | |
44 | </varlistentry> | |
45 | <varlistentry> | |
46 | <term><parameter>farVal</parameter></term> | |
47 | <listitem> | |
48 | <para> | |
49 | Specifies the mapping of the far clipping plane to window coordinates. | |
50 | The initial value is 1. | |
51 | </para> | |
52 | </listitem> | |
53 | </varlistentry> | |
54 | </variablelist> | |
55 | </refsect1> | |
56 | <refsect1 id="description"><title>Description</title> | |
57 | <para> | |
58 | After clipping and division by <emphasis>w</emphasis>, | |
59 | depth coordinates range from | |
60 | <inlineequation><mml:math> | |
61 | <!-- eqn: -1: --> | |
62 | <mml:mn>-1</mml:mn> | |
63 | </mml:math></inlineequation> | |
64 | to 1, | |
65 | corresponding to the near and far clipping planes. | |
66 | <function>glDepthRange</function> specifies a linear mapping of the normalized depth coordinates | |
67 | in this range to window depth coordinates. | |
68 | Regardless of the actual depth buffer implementation, | |
69 | window coordinate depth values are treated as though they range | |
70 | from 0 through 1 (like color components). | |
71 | Thus, | |
72 | the values accepted by <function>glDepthRange</function> are both clamped to this range | |
73 | before they are accepted. | |
74 | </para> | |
75 | <para> | |
76 | The setting of (0,1) maps the near plane to 0 and | |
77 | the far plane to 1. | |
78 | With this mapping, | |
79 | the depth buffer range is fully utilized. | |
80 | </para> | |
81 | </refsect1> | |
82 | <refsect1 id="notes"><title>Notes</title> | |
83 | <para> | |
84 | It is not necessary that <parameter>nearVal</parameter> be less than <parameter>farVal</parameter>. | |
85 | Reverse mappings such as | |
86 | <inlineequation><mml:math> | |
87 | <!-- eqn: nearVal = 1: --> | |
88 | <mml:mrow> | |
89 | <mml:mi mathvariant="italic">nearVal</mml:mi> | |
90 | <mml:mo>=</mml:mo> | |
91 | <mml:mn>1</mml:mn> | |
92 | </mml:mrow> | |
93 | </mml:math></inlineequation>, | |
94 | and | |
95 | <inlineequation><mml:math> | |
96 | <!-- eqn: farVal = 0: --> | |
97 | <mml:mrow> | |
98 | <mml:mi mathvariant="italic">farVal</mml:mi> | |
99 | <mml:mo>=</mml:mo> | |
100 | <mml:mn>0</mml:mn> | |
101 | </mml:mrow> | |
102 | </mml:math></inlineequation> | |
103 | are acceptable. | |
104 | </para> | |
105 | <para> | |
106 | The type of the <parameter>nearVal</parameter> and | |
107 | <parameter>farVal</parameter> parameters was changed from | |
108 | GLclampf to GLfloat for <function>glDepthRangef</function> | |
109 | and from GLclampd to GLdouble for | |
110 | <function>glDepthRange</function>. This change is | |
111 | transparent to user code and is described in detail on the | |
112 | <citerefentry><refentrytitle>removedTypes</refentrytitle></citerefentry> | |
113 | page. | |
114 | </para> | |
115 | </refsect1> | |
116 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
117 | <para> | |
118 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_RANGE</constant> | |
119 | </para> | |
120 | </refsect1> | |
121 | <refsect1 id="seealso"><title>See Also</title> | |
122 | <para> | |
123 | <citerefentry><refentrytitle>glDepthFunc</refentrytitle></citerefentry>, | |
124 | <citerefentry><refentrytitle>glPolygonOffset</refentrytitle></citerefentry>, | |
125 | <citerefentry><refentrytitle>glViewport</refentrytitle></citerefentry>, | |
126 | <citerefentry><refentrytitle>removedTypes</refentrytitle></citerefentry> | |
127 | </para> | |
128 | </refsect1> | |
129 | <refsect1 id="Copyright"><title>Copyright</title> | |
130 | <para> | |
131 | Copyright <trademark class="copyright"></trademark> 1991-2006 | |
132 | Silicon Graphics, Inc. This document is licensed under the SGI | |
133 | Free Software B License. For details, see | |
134 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. | |
135 | </para> | |
136 | </refsect1> | |
137 | </refentry> |