Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glPolygonOffset</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glPolygonOffset"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glPolygonOffset — set the scale and units used to calculate depth values</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glPolygonOffset</b>(</code></td><td>GLfloat </td><td><var class="pdparam">factor</var>, </td></tr><tr><td> </td><td>GLfloat </td><td><var class="pdparam">units</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>factor</code></em></span></dt><dd><p> | |
4 | Specifies a scale factor that is used to create a variable | |
5 | depth offset for each polygon. The initial value is 0. | |
6 | </p></dd><dt><span class="term"><em class="parameter"><code>units</code></em></span></dt><dd><p> | |
7 | Is multiplied by an implementation-specific value to | |
8 | create a constant depth offset. The initial value is 0. | |
9 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
10 | When <code class="constant">GL_POLYGON_OFFSET_FILL</code>, <code class="constant">GL_POLYGON_OFFSET_LINE</code>, or | |
11 | <code class="constant">GL_POLYGON_OFFSET_POINT</code> is enabled, each | |
12 | fragment's <span class="emphasis"><em>depth</em></span> value will be offset after it is interpolated | |
13 | from the <span class="emphasis"><em>depth</em></span> values of the appropriate vertices. | |
14 | The value of the offset is | |
15 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
16 | ||
17 | <mml:mrow> | |
18 | <mml:mrow> | |
19 | <mml:mi mathvariant="italic">factor</mml:mi> | |
20 | <mml:mo>×</mml:mo> | |
21 | <mml:mi mathvariant="italic">DZ</mml:mi> | |
22 | </mml:mrow> | |
23 | <mml:mo>+</mml:mo> | |
24 | <mml:mrow> | |
25 | <mml:mi mathvariant="italic">r</mml:mi> | |
26 | <mml:mo>×</mml:mo> | |
27 | <mml:mi mathvariant="italic">units</mml:mi> | |
28 | </mml:mrow> | |
29 | </mml:mrow> | |
30 | </mml:math>, | |
31 | where | |
32 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
33 | ||
34 | <mml:mi mathvariant="italic">DZ</mml:mi> | |
35 | </mml:math> | |
36 | is a measurement of the change in depth relative to the screen | |
37 | area of the polygon, and | |
38 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">r</mml:mi></mml:math> | |
39 | is the smallest value that is guaranteed to | |
40 | produce a resolvable offset for a given implementation. | |
41 | The offset is added before the depth test is performed and before | |
42 | the value is written into the depth buffer. | |
43 | </p><p> | |
44 | <code class="function">glPolygonOffset</code> is useful for rendering hidden-line images, for applying decals | |
45 | to surfaces, and for rendering solids with highlighted edges. | |
46 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
47 | <code class="function">glPolygonOffset</code> is available only if the GL version is 1.1 or greater. | |
48 | </p><p> | |
49 | <code class="function">glPolygonOffset</code> has no effect on depth coordinates placed in the | |
50 | feedback buffer. | |
51 | </p><p> | |
52 | <code class="function">glPolygonOffset</code> has no effect on selection. | |
53 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
54 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glPolygonOffset</code> is executed | |
55 | between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> and the corresponding | |
56 | execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
57 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
58 | <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument | |
59 | <code class="constant">GL_POLYGON_OFFSET_FILL</code>, | |
60 | <code class="constant">GL_POLYGON_OFFSET_LINE</code>, | |
61 | or <code class="constant">GL_POLYGON_OFFSET_POINT</code>. | |
62 | </p><p> | |
63 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POLYGON_OFFSET_FACTOR</code> or | |
64 | <code class="constant">GL_POLYGON_OFFSET_UNITS</code>. | |
65 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
66 | <a class="citerefentry" href="glDepthFunc.xml"><span class="citerefentry"><span class="refentrytitle">glDepthFunc</span></span></a>, | |
67 | <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>, | |
68 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>, | |
69 | <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> | |
70 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
71 | Copyright <span class="trademark"></span>© 1991-2006 | |
72 | Silicon Graphics, Inc. This document is licensed under the SGI | |
73 | Free Software B License. For details, see | |
74 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
75 | </p></div></div></body></html> |