rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / manglsl / gl_ClipDistance.xml
diff --git a/upstream-doc/manglsl/gl_ClipDistance.xml b/upstream-doc/manglsl/gl_ClipDistance.xml
new file mode 100644 (file)
index 0000000..d47f356
--- /dev/null
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"\r
+              "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">\r
+<refentry id="gl_ClipDistance">\r
+    <refmeta>\r
+        <refmetainfo>\r
+            <copyright>\r
+                <year>2011</year>\r
+                <holder>Khronos Group</holder>\r
+            </copyright>\r
+        </refmetainfo>\r
+        <refentrytitle>gl_ClipDistance</refentrytitle>\r
+        <manvolnum>3G</manvolnum>\r
+    </refmeta>\r
+    <refnamediv>\r
+        <refname>gl_ClipDistance</refname>\r
+        <refpurpose>provides a forward-compatible mechanism for vertex clipping</refpurpose>\r
+    </refnamediv>\r
+    <refsynopsisdiv><title>Declaration</title>\r
+        <para>\r
+            <function>gl_ClipDistance</function> is a member of the <function>gl_PerVertex</function>\r
+            named block:\r
+        </para>\r
+        <funcsynopsis>\r
+<programlisting><![CDATA[    out gl_PerVertex {\r
+        vec4 gl_Position;\r
+        float gl_PointSize;\r
+        float gl_ClipDistance[];\r
+    };]]></programlisting>\r
+        </funcsynopsis>\r
+        <para>\r
+            In the fragment language, it is intrinsically declared as:\r
+        </para>\r
+        <funcsynopsis>\r
+            <function>in float gl_ClipDistance[];</function>\r
+        </funcsynopsis>\r
+    </refsynopsisdiv>\r
+    <refsect1 id="description"><title>Description</title>\r
+        <para>\r
+            The <function>gl_ClipDistance</function> variable provides a forward compatible\r
+            mechanism for controlling user clipping. The element <function>gl_ClipDistance[<emphasis>i</emphasis>]</function>\r
+            specifies a clip distance for each user clip plane <emphasis>i</emphasis>. A distance of 0.0 means that\r
+            the vertex is on the plane, a positive distance means that the vertex is insider the clip plane, and a negative\r
+            distance means that the point is outside the clip plane. The clip distances will be linearly interpolated across\r
+            the primitive and the portion of the primitive with interpolated distances less than 0.0 will be clipped.\r
+        </para>\r
+        <para>\r
+            The <function>gl_ClipDistance</function> array is initially predeclared as unsized and must be\r
+            sized by the shader either by redeclaring it with an explicit size, or by indexing it\r
+            with only integral constant expressions. The array must be sized to include all\r
+            clip planes that are enabled via the OpenGL API; if the size does not include all enabled planes,\r
+            results are undefined. The size may be at most <function>gl_MaxClipDistances</function>. The number\r
+            of variing components consumed by <function>gl_ClipDistance</function> will match the size of the\r
+            array, no matter how many planes are enabled. The shader must also set all values in <function>gl_ClipDistance</function>\r
+            that have been enabled via the OpenGL API, or results are undefined. Values written into\r
+            <function>gl_ClipDistance</function> planes that are not enabled have no effect.\r
+        </para>\r
+        <para>\r
+            In the vertex, tessellation evaluation and geoemtry languages, a single\r
+            global instance of the <function>gl_PerVertex</function> named block is available and\r
+            its <function>gl_ClipDistance</function> member is an output that receives the\r
+            clip distances for the current vertex. It may be written at any time during shader execution.\r
+            The value written to <function>gl_ClipDistance</function> will be used by primitive assembly,\r
+            clipping, culling and other fixed functionality operations, if present, that operate on\r
+            primitives after vertex processing has occurred.\r
+        </para>\r
+        <para>\r
+            In the tessellation control language, the <function>gl_PerVertex</function> named block\r
+            is used to construct an array, <function>gl_out[]</function>, whose <function>gl_ClipDistance</function>\r
+            members hold clip distances for each of the control points, which become available as inputs to the subsequent\r
+            tessellation evaluation shader.\r
+        </para>\r
+        <para>\r
+            The value of <function>gl_ClipDistance</function> (or the <function>gl_ClipDistance</function> member of the <function>gl_out[]</function>\r
+            array, in the case of the tessellation control shader)\r
+            is undefined after the vertex, tessellation control, and tessellation evaluation\r
+            shading stages if the corresponding shader executable does\r
+            not write to gl_ClipDistance. It is also undefined after the geometry processing stage if the geometry shader executable calls\r
+            <citerefentry><refentrytitle>EmitVertex</refentrytitle></citerefentry> without having\r
+            written <function>gl_ClipDistance</function> since the last call to <citerefentry><refentrytitle>EmitVertex</refentrytitle></citerefentry>\r
+            (or hasn't written it at all).\r
+        </para>\r
+        <para>\r
+            In the tessellation control, tessellation evaluation and geoemetry languages,\r
+            the <function>gl_PerVertex</function> named block is used to construct an array, <function>gl_in[]</function>\r
+            of per-vertex or per-control point inputs whose content represents the corresponding\r
+            outputs written by the previous stage. Only elements of the <function>gl_ClipDistance</function>\r
+            array that correspond to enabled clip planes have defined values.\r
+         </para>\r
+    </refsect1>\r
+    <refsect1 id="versions"><title>Version Support</title>\r
+        <informaltable frame="topbot">\r
+            #VARTABLECOLS#\r
+                <thead>\r
+                    #VARTABLEHEADER#\r
+                    <row>\r
+                        <entry>gl_ClipDistance</entry>#newin13#\r
+                    </row>\r
+                </thead>\r
+            </tgroup>\r
+        </informaltable>\r
+        <para>Versions 1.30 to 1.40 - vertex shader only.</para>\r
+        <para>Versions 1.50 to 3.30 - vertex and geometry shaders only.</para>\r
+    </refsect1>\r
+    <refsect1 id="seealso"><title>See Also</title>\r
+        <para>\r
+            <citerefentry><refentrytitle>gl_PointSize</refentrytitle></citerefentry>\r
+        </para>\r
+    </refsect1>\r
+    <refsect1 id="Copyright"><title>Copyright</title>\r
+        <para>\r
+            Copyright <trademark class="copyright"></trademark> 2011 Khronos Group. \r
+            This material may be distributed subject to the terms and conditions set forth in \r
+            the Open Publication License, v 1.0, 8 June 1999.\r
+            <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
+        </para>\r
+    </refsect1>\r
+</refentry>\r