Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> | |
3 | <!-- saved from url=(0013)about:internet --> | |
4 | <?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" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glPolygonOffset - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></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> | |
5 | Specifies a scale factor that is used to create a variable | |
6 | depth offset for each polygon. The initial value is 0. | |
7 | </p></dd><dt><span class="term"><em class="parameter"><code>units</code></em></span></dt><dd><p> | |
8 | Is multiplied by an implementation-specific value to | |
9 | create a constant depth offset. The initial value is 0. | |
10 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
11 | When <code class="constant">GL_POLYGON_OFFSET_FILL</code>, <code class="constant">GL_POLYGON_OFFSET_LINE</code>, or | |
12 | <code class="constant">GL_POLYGON_OFFSET_POINT</code> is enabled, each | |
13 | fragment's <span class="emphasis"><em>depth</em></span> value will be offset after it is interpolated | |
14 | from the <span class="emphasis"><em>depth</em></span> values of the appropriate vertices. | |
15 | The value of the offset is | |
16 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
17 | ||
18 | <mml:mrow> | |
19 | <mml:mrow> | |
20 | <mml:mi mathvariant="italic">factor</mml:mi> | |
21 | <mml:mo>×</mml:mo> | |
22 | <mml:mi mathvariant="italic">DZ</mml:mi> | |
23 | </mml:mrow> | |
24 | <mml:mo>+</mml:mo> | |
25 | <mml:mrow> | |
26 | <mml:mi mathvariant="italic">r</mml:mi> | |
27 | <mml:mo>×</mml:mo> | |
28 | <mml:mi mathvariant="italic">units</mml:mi> | |
29 | </mml:mrow> | |
30 | </mml:mrow> | |
31 | </mml:math>, | |
32 | where | |
33 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
34 | ||
35 | <mml:mi mathvariant="italic">DZ</mml:mi> | |
36 | </mml:math> | |
37 | is a measurement of the change in depth relative to the screen | |
38 | area of the polygon, and | |
39 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">r</mml:mi></mml:math> | |
40 | is the smallest value that is guaranteed to | |
41 | produce a resolvable offset for a given implementation. | |
42 | The offset is added before the depth test is performed and before | |
43 | the value is written into the depth buffer. | |
44 | </p><p> | |
45 | <code class="function">glPolygonOffset</code> is useful for rendering hidden-line images, for applying decals | |
46 | to surfaces, and for rendering solids with highlighted edges. | |
47 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
48 | <a href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument | |
49 | <code class="constant">GL_POLYGON_OFFSET_FILL</code>, | |
50 | <code class="constant">GL_POLYGON_OFFSET_LINE</code>, | |
51 | or <code class="constant">GL_POLYGON_OFFSET_POINT</code>. | |
52 | </p><p> | |
53 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_POLYGON_OFFSET_FACTOR</code> or | |
54 | <code class="constant">GL_POLYGON_OFFSET_UNITS</code>. | |
55 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
56 | <a href="glDepthFunc.xml"><span class="citerefentry"><span class="refentrytitle">glDepthFunc</span></span></a>, | |
57 | <a href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>, | |
58 | <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>, | |
59 | <a href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> | |
60 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
61 | Copyright <span class="trademark"></span>© 1991-2006 | |
62 | Silicon Graphics, Inc. This document is licensed under the SGI | |
63 | Free Software B License. For details, see | |
64 | <a href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
65 | </p></div></div></body></html> |