202e5d54552d475e808df7e3aadd30bb037640c9
[clinton/guile-figl.git] / upstream-man-pages / manglsl / textureGather.xml
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="textureGather">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>textureGather</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>textureGather</refname>
17 <refpurpose>gathers four texels from a texture</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>gvec4 <function>textureGather</function></funcdef>
23 <paramdef>gsampler2D <parameter>sampler</parameter></paramdef>
24 <paramdef>vec2 <parameter>P</parameter></paramdef>
25 <paramdef>[int <parameter>comp]</parameter></paramdef>
26 </funcprototype>
27 <funcprototype>
28 <funcdef>gvec4 <function>textureGather</function></funcdef>
29 <paramdef>gsampler2DArray <parameter>sampler</parameter></paramdef>
30 <paramdef>vec3 <parameter>P</parameter></paramdef>
31 <paramdef>[int <parameter>comp]</parameter></paramdef>
32 </funcprototype>
33 <funcprototype>
34 <funcdef>gvec4 <function>textureGather</function></funcdef>
35 <paramdef>gsamplerCube <parameter>sampler</parameter></paramdef>
36 <paramdef>vec3 <parameter>P</parameter></paramdef>
37 <paramdef>[int <parameter>comp]</parameter></paramdef>
38 </funcprototype>
39 <funcprototype>
40 <funcdef>gvec4 <function>textureGather</function></funcdef>
41 <paramdef>gsamplerCubeArray <parameter>sampler</parameter></paramdef>
42 <paramdef>vec4 <parameter>P</parameter></paramdef>
43 <paramdef>[int <parameter>comp]</parameter></paramdef>
44 </funcprototype>
45 <funcprototype>
46 <funcdef>gvec4 <function>textureGather</function></funcdef>
47 <paramdef>gsampler2DRect <parameter>sampler</parameter></paramdef>
48 <paramdef>vec3 <parameter>P</parameter></paramdef>
49 <paramdef>[int <parameter>comp]</parameter></paramdef>
50 </funcprototype>
51 <funcprototype>
52 <funcdef>vec4 <function>textureGather</function></funcdef>
53 <paramdef>gsampler2DShadow <parameter>sampler</parameter></paramdef>
54 <paramdef>vec2 <parameter>P</parameter></paramdef>
55 <paramdef>float <parameter>refZ</parameter></paramdef>
56 </funcprototype>
57 <funcprototype>
58 <funcdef>vec4 <function>textureGather</function></funcdef>
59 <paramdef>gsampler2DArrayShadow <parameter>sampler</parameter></paramdef>
60 <paramdef>vec3 <parameter>P</parameter></paramdef>
61 <paramdef>float <parameter>refZ</parameter></paramdef>
62 </funcprototype>
63 <funcprototype>
64 <funcdef>vec4 <function>textureGather</function></funcdef>
65 <paramdef>gsamplerCubeShadow <parameter>sampler</parameter></paramdef>
66 <paramdef>vec3 <parameter>P</parameter></paramdef>
67 <paramdef>float <parameter>refZ</parameter></paramdef>
68 </funcprototype>
69 <funcprototype>
70 <funcdef>vec4 <function>textureGather</function></funcdef>
71 <paramdef>gsamplerCubeArrayShadow <parameter>sampler</parameter></paramdef>
72 <paramdef>vec4 <parameter>P</parameter></paramdef>
73 <paramdef>float <parameter>refZ</parameter></paramdef>
74 </funcprototype>
75 <funcprototype>
76 <funcdef>vec4 <function>textureGather</function></funcdef>
77 <paramdef>gsampler2DRectShadow <parameter>sampler</parameter></paramdef>
78 <paramdef>vec3 <parameter>P</parameter></paramdef>
79 <paramdef>float <parameter>refZ</parameter></paramdef>
80 </funcprototype>
81 </funcsynopsis>
82 </refsynopsisdiv>
83 <refsect1 id="parameters"><title>Parameters</title>
84 <variablelist>
85 <varlistentry>
86 <term><parameter>sampler</parameter></term>
87 <listitem>
88 <para>
89 Specifies the sampler to which the texture from which texels will be retrieved is bound.
90 </para>
91 </listitem>
92 </varlistentry>
93 <varlistentry>
94 <term><parameter>P</parameter></term>
95 <listitem>
96 <para>
97 Specifies the texture coordinates at which texture will be sampled.
98 </para>
99 </listitem>
100 </varlistentry>
101 <varlistentry>
102 <term><parameter>comp</parameter></term>
103 <listitem>
104 <para>
105 Specifies the component of the source texture that will be used to generate the resulting vector.
106 </para>
107 </listitem>
108 </varlistentry>
109 <varlistentry>
110 <term><parameter>refZ</parameter></term>
111 <listitem>
112 <para>
113 Specifies the reference Z value used in the comparison for shadow forms.
114 </para>
115 </listitem>
116 </varlistentry>
117 </variablelist>
118 </refsect1>
119 <refsect1 id="description"><title>Description</title>
120 <para>
121 <function>textureGather</function> returns the value:
122 </para>
123 <para>
124 <programlisting><![CDATA[ vec4(Sample_i0_j1(P, base).comp,
125 Sample_i1_j1(P, base).comp,
126 Sample_i1_j0(P, base).comp,
127 Sample_i0_j9(P, base).comp);]]></programlisting>
128 </para>
129 <para>
130 If specified, the value of <parameter>comp</parameter> must ba constant integer expression with a value
131 of 0, 1, 2, or 3, identifying the x, y, z or w component of the four-component vector lookup result for each
132 texel, respectively. If <parameter>comp</parameter> is not specified, it is treated as 0, selecting the x
133 component of each texel to generate the result.
134 </para>
135 </refsect1>
136 <refsect1 id="versions"><title>Version Support</title>
137 <informaltable frame="topbot">
138 #VARTABLECOLS#
139 <thead>
140 #FUNCTABLEHEADER#
141 <row>
142 <entry>textureGather</entry>#newin40#
143 </row>
144 </thead>
145 </tgroup>
146 </informaltable>
147 </refsect1>
148 <refsect1 id="seealso"><title>See Also</title>
149 <para>
150 <citerefentry><refentrytitle>texelFetch</refentrytitle></citerefentry>,
151 <citerefentry><refentrytitle>texelFetchOffset</refentrytitle></citerefentry>,
152 <citerefentry><refentrytitle>texture</refentrytitle></citerefentry>,
153 <citerefentry><refentrytitle>textureGatherOffset</refentrytitle></citerefentry>,
154 <citerefentry><refentrytitle>textureGatherOffsets</refentrytitle></citerefentry>,
155 <citerefentry><refentrytitle>textureGrad</refentrytitle></citerefentry>,
156 <citerefentry><refentrytitle>textureGradOffset</refentrytitle></citerefentry>,
157 <citerefentry><refentrytitle>textureLod</refentrytitle></citerefentry>,
158 <citerefentry><refentrytitle>textureLodOffset</refentrytitle></citerefentry>,
159 <citerefentry><refentrytitle>textureOffset</refentrytitle></citerefentry>,
160 <citerefentry><refentrytitle>textureProj</refentrytitle></citerefentry>,
161 <citerefentry><refentrytitle>textureProjGrad</refentrytitle></citerefentry>,
162 <citerefentry><refentrytitle>textureProjGradOffset</refentrytitle></citerefentry>,
163 <citerefentry><refentrytitle>textureProjLod</refentrytitle></citerefentry>,
164 <citerefentry><refentrytitle>textureProjLodOffset</refentrytitle></citerefentry>,
165 <citerefentry><refentrytitle>textureProjOffset</refentrytitle></citerefentry>,
166 <citerefentry><refentrytitle>textureQueryLod</refentrytitle></citerefentry>,
167 <citerefentry><refentrytitle>textureSize</refentrytitle></citerefentry>
168 </para>
169 </refsect1>
170 <refsect1 id="Copyright"><title>Copyright</title>
171 <para>
172 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
173 This material may be distributed subject to the terms and conditions set forth in
174 the Open Publication License, v 1.0, 8 June 1999.
175 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
176 </para>
177 </refsect1>
178 </refentry>