include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / manglsl / texture.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="texture">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>texture</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>texture</refname>
17 <refpurpose>retrieves texels from a texture</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>gvec4 <function>texture</function></funcdef>
23 <paramdef>gsampler1D <parameter>sampler</parameter></paramdef>
24 <paramdef>float <parameter>P</parameter></paramdef>
25 <paramdef>[float <parameter>bias</parameter>]</paramdef>
26 </funcprototype>
27 <funcprototype>
28 <funcdef>gvec4 <function>texture</function></funcdef>
29 <paramdef>gsampler2D <parameter>sampler</parameter></paramdef>
30 <paramdef>vec2 <parameter>P</parameter></paramdef>
31 <paramdef>[float <parameter>bias</parameter>]</paramdef>
32 </funcprototype>
33 <funcprototype>
34 <funcdef>gvec4 <function>texture</function></funcdef>
35 <paramdef>gsampler3D <parameter>sampler</parameter></paramdef>
36 <paramdef>vec3 <parameter>P</parameter></paramdef>
37 <paramdef>[float <parameter>bias</parameter>]</paramdef>
38 </funcprototype>
39 <funcprototype>
40 <funcdef>gvec4 <function>texture</function></funcdef>
41 <paramdef>gsamplerCube <parameter>sampler</parameter></paramdef>
42 <paramdef>vec3 <parameter>P</parameter></paramdef>
43 <paramdef>[float <parameter>bias</parameter>]</paramdef>
44 </funcprototype>
45 <funcprototype>
46 <funcdef>float <function>texture</function></funcdef>
47 <paramdef>sampler1DShadow <parameter>sampler</parameter></paramdef>
48 <paramdef>vec3 <parameter>P</parameter></paramdef>
49 <paramdef>[float <parameter>bias</parameter>]</paramdef>
50 </funcprototype>
51 <funcprototype>
52 <funcdef>float <function>texture</function></funcdef>
53 <paramdef>sampler2DShadow <parameter>sampler</parameter></paramdef>
54 <paramdef>vec3 <parameter>P</parameter></paramdef>
55 <paramdef>[float <parameter>bias</parameter>]</paramdef>
56 </funcprototype>
57 <funcprototype>
58 <funcdef>float <function>texture</function></funcdef>
59 <paramdef>samplerCubeShadow <parameter>sampler</parameter></paramdef>
60 <paramdef>vec3 <parameter>P</parameter></paramdef>
61 <paramdef>[float <parameter>bias</parameter>]</paramdef>
62 </funcprototype>
63 <funcprototype>
64 <funcdef>gvec4 <function>texture</function></funcdef>
65 <paramdef>gsampler1DArray <parameter>sampler</parameter></paramdef>
66 <paramdef>vec2 <parameter>P</parameter></paramdef>
67 <paramdef>[float <parameter>bias</parameter>]</paramdef>
68 </funcprototype>
69 <funcprototype>
70 <funcdef>gvec4 <function>texture</function></funcdef>
71 <paramdef>gsampler2DArray <parameter>sampler</parameter></paramdef>
72 <paramdef>vec3 <parameter>P</parameter></paramdef>
73 <paramdef>[float <parameter>bias</parameter>]</paramdef>
74 </funcprototype>
75 <funcprototype>
76 <funcdef>gvec4 <function>texture</function></funcdef>
77 <paramdef>gsamplerCubeArray <parameter>sampler</parameter></paramdef>
78 <paramdef>vec4 <parameter>P</parameter></paramdef>
79 <paramdef>[float <parameter>bias</parameter>]</paramdef>
80 </funcprototype>
81 <funcprototype>
82 <funcdef>float <function>texture</function></funcdef>
83 <paramdef>sampler1DArrayShadow <parameter>sampler</parameter></paramdef>
84 <paramdef>vec3 <parameter>P</parameter></paramdef>
85 <paramdef>[float <parameter>bias</parameter>]</paramdef>
86 </funcprototype>
87 <funcprototype>
88 <funcdef>float <function>texture</function></funcdef>
89 <paramdef>gsampler2DArrayShadow <parameter>sampler</parameter></paramdef>
90 <paramdef>vec4 <parameter>P</parameter></paramdef>
91 <paramdef>[float <parameter>bias</parameter>]</paramdef>
92 </funcprototype>
93 <funcprototype>
94 <funcdef>gvec4 <function>texture</function></funcdef>
95 <paramdef>gsampler2DRect <parameter>sampler</parameter></paramdef>
96 <paramdef>vec2 <parameter>P</parameter></paramdef>
97 </funcprototype>
98 <funcprototype>
99 <funcdef>float <function>texture</function></funcdef>
100 <paramdef>sampler2DRectShadow <parameter>sampler</parameter></paramdef>
101 <paramdef>vec3 <parameter>P</parameter></paramdef>
102 </funcprototype>
103 <funcprototype>
104 <funcdef>float <function>texture</function></funcdef>
105 <paramdef>gsamplerCubeArrayShadow <parameter>sampler</parameter></paramdef>
106 <paramdef>vec4 <parameter>P</parameter></paramdef>
107 <paramdef>float <parameter>compare</parameter></paramdef>
108 </funcprototype>
109 </funcsynopsis>
110 </refsynopsisdiv>
111 <refsect1 id="parameters"><title>Parameters</title>
112 <variablelist>
113 <varlistentry>
114 <term><parameter>sampler</parameter></term>
115 <listitem>
116 <para>
117 Specifies the sampler to which the texture from which texels will be retrieved is bound.
118 </para>
119 </listitem>
120 </varlistentry>
121 <varlistentry>
122 <term><parameter>P</parameter></term>
123 <listitem>
124 <para>
125 Specifies the texture coordinates at which texture will be sampled.
126 </para>
127 </listitem>
128 </varlistentry>
129 <varlistentry>
130 <term><parameter>bias</parameter></term>
131 <listitem>
132 <para>
133 Specifies an optional bias to be applied during level-of-detail computation.
134 </para>
135 </listitem>
136 </varlistentry>
137 <varlistentry>
138 <term><parameter>compare</parameter></term>
139 <listitem>
140 <para>
141 Specifies the value to which the fetched texel will be compared when sampling from <code>gsamplerCubeArrayShadow</code>.
142 </para>
143 </listitem>
144 </varlistentry>
145 </variablelist>
146 </refsect1>
147 <refsect1 id="description"><title>Description</title>
148 <para>
149 <function>texture</function> samples texels from the texture bound to <parameter>sampler</parameter> at texture
150 coordinate <parameter>P</parameter>. An optional bias, specified in <parameter>bias</parameter> is included in
151 the level-of-detail computation that is used to choose mipmap(s) from which to sample.
152 </para>
153 <para>
154 For <emphasis>shadow</emphasis> forms, when <parameter>compare</parameter> is present, it is used as
155 <inlineequation><mml:math><mml:msub><mml:mi>D</mml:mi><mml:mi>sub</mml:mi></mml:msub></mml:math></inlineequation>
156 and the array layer is specified in <code><parameter>P</parameter>.w</code>. When <parameter>compare</parameter> is
157 not present, the last component of <parameter>P</parameter> is used as
158 <inlineequation><mml:math><mml:msub><mml:mi>D</mml:mi><mml:mi>sub</mml:mi></mml:msub></mml:math></inlineequation> and the
159 array layer is specified in the second to last component of <parameter>P</parameter>. (The second component of <parameter>P</parameter>
160 is unused for <emphasis>1D</emphasis> shadow lookups.)
161 </para>
162 <para>
163 For non-shadow variants, the array layer comes from the last component of <parameter>P</parameter>.
164 </para>
165 </refsect1>
166 <refsect1 id="versions"><title>Version Support</title>
167 <informaltable frame="topbot">
168 #VARTABLECOLS#
169 <thead>
170 #FUNCTABLEHEADER#
171 <row>
172 <entry>texture</entry>#newin13#
173 </row>
174 <row>
175 <entry>texture (gsampler2DRect{Shadow})</entry>#newin14#
176 </row>
177 <row>
178 <entry>texture (gsampler2DMS, gsampler2DMSArray)</entry>#newin15#
179 </row>
180 <row>
181 <entry>texture (gsamplerCubeArray{Shadow})</entry>#newin40#
182 </row>
183 </thead>
184 </tgroup>
185 </informaltable>
186 </refsect1>
187 <refsect1 id="seealso"><title>See Also</title>
188 <para>
189 <citerefentry><refentrytitle>texelFetch</refentrytitle></citerefentry>,
190 <citerefentry><refentrytitle>texelFetchOffset</refentrytitle></citerefentry>,
191 <citerefentry><refentrytitle>textureGather</refentrytitle></citerefentry>,
192 <citerefentry><refentrytitle>textureGatherOffset</refentrytitle></citerefentry>,
193 <citerefentry><refentrytitle>textureGatherOffsets</refentrytitle></citerefentry>,
194 <citerefentry><refentrytitle>textureGrad</refentrytitle></citerefentry>,
195 <citerefentry><refentrytitle>textureGradOffset</refentrytitle></citerefentry>,
196 <citerefentry><refentrytitle>textureLod</refentrytitle></citerefentry>,
197 <citerefentry><refentrytitle>textureLodOffset</refentrytitle></citerefentry>,
198 <citerefentry><refentrytitle>textureOffset</refentrytitle></citerefentry>,
199 <citerefentry><refentrytitle>textureProj</refentrytitle></citerefentry>,
200 <citerefentry><refentrytitle>textureProjGrad</refentrytitle></citerefentry>,
201 <citerefentry><refentrytitle>textureProjGradOffset</refentrytitle></citerefentry>,
202 <citerefentry><refentrytitle>textureProjLod</refentrytitle></citerefentry>,
203 <citerefentry><refentrytitle>textureProjLodOffset</refentrytitle></citerefentry>,
204 <citerefentry><refentrytitle>textureProjOffset</refentrytitle></citerefentry>,
205 <citerefentry><refentrytitle>textureQueryLod</refentrytitle></citerefentry>,
206 <citerefentry><refentrytitle>textureSize</refentrytitle></citerefentry>
207 </para>
208 </refsect1>
209 <refsect1 id="Copyright"><title>Copyright</title>
210 <para>
211 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
212 This material may be distributed subject to the terms and conditions set forth in
213 the Open Publication License, v 1.0, 8 June 1999.
214 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
215 </para>
216 </refsect1>
217 </refentry>