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=
"glPolygonOffset">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glPolygonOffset
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glPolygonOffset
</refname>
17 <refpurpose>set the scale and units used to calculate depth values
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glPolygonOffset
</function></funcdef>
23 <paramdef>GLfloat
<parameter>factor
</parameter></paramdef>
24 <paramdef>GLfloat
<parameter>units
</parameter></paramdef>
28 <!-- eqn: ignoring delim $$ -->
29 <refsect1 id=
"parameters"><title>Parameters
</title>
32 <term><parameter>factor
</parameter></term>
35 Specifies a scale factor that is used to create a variable
36 depth offset for each polygon. The initial value is
0.
41 <term><parameter>units
</parameter></term>
44 Is multiplied by an implementation-specific value to
45 create a constant depth offset. The initial value is
0.
51 <refsect1 id=
"description"><title>Description
</title>
53 When
<constant>GL_POLYGON_OFFSET_FILL
</constant>,
<constant>GL_POLYGON_OFFSET_LINE
</constant>, or
54 <constant>GL_POLYGON_OFFSET_POINT
</constant> is enabled, each
55 fragment's
<emphasis>depth
</emphasis> value will be offset after it is interpolated
56 from the
<emphasis>depth
</emphasis> values of the appropriate vertices.
57 The value of the offset is
58 <inlineequation><mml:math>
59 <!-- eqn: factor * DZ + r * units: -->
62 <mml:mi mathvariant=
"italic">factor
</mml:mi>
63 <mml:mo>×</mml:mo>
64 <mml:mi mathvariant=
"italic">DZ
</mml:mi>
68 <mml:mi mathvariant=
"italic">r
</mml:mi>
69 <mml:mo>×</mml:mo>
70 <mml:mi mathvariant=
"italic">units
</mml:mi>
73 </mml:math></inlineequation>,
75 <inlineequation><mml:math>
77 <mml:mi mathvariant=
"italic">DZ
</mml:mi>
78 </mml:math></inlineequation>
79 is a measurement of the change in depth relative to the screen
80 area of the polygon, and
81 <inlineequation><mml:math><mml:mi mathvariant=
"italic">r
</mml:mi></mml:math></inlineequation>
82 is the smallest value that is guaranteed to
83 produce a resolvable offset for a given implementation.
84 The offset is added before the depth test is performed and before
85 the value is written into the depth buffer.
88 <function>glPolygonOffset
</function> is useful for rendering hidden-line images, for applying decals
89 to surfaces, and for rendering solids with highlighted edges.
92 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
94 <citerefentry><refentrytitle>glIsEnabled
</refentrytitle></citerefentry> with argument
95 <constant>GL_POLYGON_OFFSET_FILL
</constant>,
96 <constant>GL_POLYGON_OFFSET_LINE
</constant>,
97 or
<constant>GL_POLYGON_OFFSET_POINT
</constant>.
100 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_POLYGON_OFFSET_FACTOR
</constant> or
101 <constant>GL_POLYGON_OFFSET_UNITS
</constant>.
104 <refsect1 id=
"seealso"><title>See Also
</title>
106 <citerefentry><refentrytitle>glDepthFunc
</refentrytitle></citerefentry>,
107 <citerefentry><refentrytitle>glEnable
</refentrytitle></citerefentry>,
108 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry>,
109 <citerefentry><refentrytitle>glIsEnabled
</refentrytitle></citerefentry>
112 <refsect1 id=
"Copyright"><title>Copyright
</title>
114 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
115 Silicon Graphics, Inc. This document is licensed under the SGI
116 Free Software B License. For details, see
117 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.