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