]> gitweb.factorcode.org Git - factor.git/blob - extra/gpu/textures/textures-docs.factor
2efcb45b042c3595e99e73f7f2dec05b704abd1a
[factor.git] / extra / gpu / textures / textures-docs.factor
1 ! (c)2009 Joe Groff bsd license
2 USING: alien byte-arrays classes gpu.buffers help.markup help.syntax
3 images kernel math ;
4 IN: gpu.textures
5
6 HELP: +X
7 { $class-description "This " { $link cube-map-axis } " references the positive X face of a " { $link texture-cube-map } "." } ;
8
9 HELP: +Y
10 { $class-description "This " { $link cube-map-axis } " references the positive Y face of a " { $link texture-cube-map } "." } ;
11
12 HELP: +Z
13 { $class-description "This " { $link cube-map-axis } " references the positive Z face of a " { $link texture-cube-map } "." } ;
14
15 HELP: -X
16 { $class-description "This " { $link cube-map-axis } " references the negative X face of a " { $link texture-cube-map } "." } ;
17
18 HELP: -Y
19 { $class-description "This " { $link cube-map-axis } " references the negative Y face of a " { $link texture-cube-map } "." } ;
20
21 HELP: -Z
22 { $class-description "This " { $link cube-map-axis } " references the negative Z face of a " { $link texture-cube-map } "." } ;
23
24 HELP: <cube-map-face>
25 { $values
26     { "texture" texture-cube-map } { "axis" cube-map-axis }
27     { "cube-map-face" cube-map-face }
28 }
29 { $description "Constructs a new " { $link cube-map-face } " reference." } ;
30
31 HELP: <texture-1d-array>
32 { $values
33     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
34     { "texture" texture-1d-array }
35 }
36 { $description "Creates a new one-dimensional array texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." }
37 { $notes "Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
38
39 HELP: <texture-1d>
40 { $values
41     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
42     { "texture" texture-1d }
43 }
44 { $description "Creates a new one-dimensional texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." } ;
45
46 HELP: <texture-2d-array>
47 { $values
48     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
49     { "texture" texture-2d-array }
50 }
51 { $description "Creates a new two-dimensional array texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." }
52 { $notes "Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
53
54 HELP: <texture-2d>
55 { $values
56     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
57     { "texture" texture-2d }
58 }
59 { $description "Creates a new two-dimensional texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." } ;
60
61 HELP: <texture-3d>
62 { $values
63     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
64     { "texture" texture-3d }
65 }
66 { $description "Creates a new three-dimensional texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of the texture." } ;
67
68 HELP: <texture-cube-map>
69 { $values
70     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
71     { "texture" texture-cube-map }
72 }
73 { $description "Creates a new cube map texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the required levels of detail of each " { $link cube-map-face } " of the new texture." } ;
74
75 HELP: <texture-data>
76 { $values
77     { "ptr" gpu-data-ptr } { "component-order" component-order } { "component-type" component-type }
78     { "texture-data" texture-data }
79 }
80 { $description "Constructs a new " { $link texture-data } " tuple." }
81 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
82
83 HELP: <texture-rectangle>
84 { $values
85     { "component-order" component-order } { "component-type" component-type } { "parameters" texture-parameters }
86     { "texture" texture-rectangle }
87 }
88 { $description "Creates a new rectangle texture. The new texture starts out with no image data; " { $link allocate-texture } " or " { $link allocate-texture-image } " must be used to allocate memory for the texture." }
89 { $notes "Rectangle textures require OpenGL 3.1 or the " { $snippet "GL_ARB_texture_rectangle" } " extension." } ;
90
91 HELP: allocate-compressed-texture
92 { $values
93     { "tdt" texture-data-target } { "level" integer } { "dim" "an " { $link integer } " or sequence of " { $link integer } "s" } { "compressed-data" compressed-texture-data }
94 }
95 { $description "Allocates a new block of GPU memory for the " { $snippet "level" } "th level of detail of a " { $link texture-data-target } ". The new data is initialized with compressed texture data from the given " { $link compressed-texture-data } " object." }
96 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "compressed-texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
97
98 HELP: allocate-texture
99 { $values
100     { "tdt" texture-data-target } { "level" integer } { "dim" "an " { $link integer } " or sequence of " { $link integer } "s" } { "data" { $maybe texture-data } }
101 }
102 { $description "Allocates a new block of GPU memory for the " { $snippet "level" } "th level of detail of a " { $link texture-data-target } ". If " { $snippet "data" } " is not " { $link f } ", the new data is initialized from the given " { $link texture-data } " object; otherwise, the new image is left uninitialized." }
103 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
104
105 HELP: allocate-texture-image
106 { $values
107     { "tdt" texture-data-target } { "level" integer } { "image" image }
108 }
109 { $description "Allocates a new block of GPU memory for the " { $snippet "level" } "th level of detail of a " { $link texture-data-target } " and initializes it with the contents of an " { $link image } "." } ;
110
111 { allocate-compressed-texture allocate-texture allocate-texture-image } related-words
112
113 HELP: clamp-texcoord-to-border
114 { $class-description "This " { $link texture-wrap } " value clamps texture coordinates to a texture's border." } ;
115
116 HELP: clamp-texcoord-to-edge
117 { $class-description "This " { $link texture-wrap } " value clamps texture coordinates to a texture image's edge." } ;
118
119 HELP: cube-map-axis
120 { $class-description "Objects of this class are stored in the " { $snippet "axis" } " slot of a " { $link cube-map-face } " to choose the referenced face: " { $link +X } ", " { $link +Y } ", " { $link +Z } ", " { $link -X } ", " { $link -Y } ", or " { $link -Z } "."
121 } ;
122
123 HELP: cube-map-face
124 { $class-description "A " { $snippet "cube-map-face" } " tuple references a single face of a " { $link texture-cube-map } " object for use with " { $link allocate-texture } ", " { $link update-texture } ", or " { $link read-texture } "."
125 { $list
126 { "The " { $snippet "texture" } " slot indicates the cube map texture being referenced." }
127 { "The " { $snippet "axis" } " slot indicates which face to reference: " { $link +X } ", " { $link +Y } ", " { $link +Z } ", " { $link -X } ", " { $link -Y } ", or " { $link -Z } "." }
128 } } ;
129
130 HELP: filter-linear
131 { $class-description "This " { $link texture-filter } " value selects linear filtering between pixel samples." } ;
132
133 HELP: filter-nearest
134 { $class-description "This " { $link texture-filter } " value selects nearest-neighbor sampling." } ;
135
136 HELP: generate-mipmaps
137 { $values
138     { "texture" texture }
139 }
140 { $description "Replaces the image data for all levels of detail of " { $snippet "texture" } " below the highest level with images automatically generated from the highest level of detail image." }
141 { $notes "This word requires OpenGL 3.0 or one of the " { $snippet "GL_EXT_framebuffer_object" } " or " { $snippet "GL_ARB_framebuffer_object" } " extensions." } ;
142
143 HELP: image>texture-data
144 { $values
145     { "image" image }
146     { "dim" "a sequence of " { $link integer } "s" } { "texture-data" texture-data }
147 }
148 { $description "Constructs a " { $link texture-data } " tuple referencing the pixel data from an " { $link image } "." } ;
149
150 HELP: read-compressed-texture
151 { $values
152     { "tdt" texture-data-target } { "level" integer }
153     { "byte-array" byte-array }
154 }
155 { $description "Reads the entire compressed image for the " { $snippet "level" } "th level of detail of a texture into a new " { $link byte-array } ". The format of the data in the byte array is determined by the " { $link compressed-texture-format } " of the data originally allocated by " { $link allocate-compressed-texture } " for the texture." } ;
156
157 HELP: read-compressed-texture-to
158 { $values
159     { "tdt" texture-data-target } { "level" integer }
160     { "gpu-data-ptr" byte-array }
161 }
162 { $description "Reads the entire compressed image for the " { $snippet "level" } "th level of detail of a texture into the CPU or GPU memory referenced by " { $link gpu-data-ptr } ". The format of the written data is determined by the " { $link compressed-texture-format } " of the data originally allocated by " { $link allocate-compressed-texture } " for the texture." }
163 { $notes "Reading texture data into a GPU " { $snippet "buffer-ptr" } " requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
164
165 HELP: read-texture
166 { $values
167     { "tdt" texture-data-target } { "level" integer }
168     { "byte-array" byte-array }
169 }
170 { $description "Reads the entire image for the " { $snippet "level" } "th level of detail of a texture into a new " { $link byte-array } ". The format of the data in the byte array is determined by the " { $link component-order } " and " { $link component-type } " of the texture." } ;
171
172 HELP: read-texture-image
173 { $values
174     { "tdt" texture-data-target } { "level" integer }
175     { "image" image }
176 }
177 { $description "Reads the entire image for the " { $snippet "level" } "th level of detail of a texture into a new " { $link image } ". The format of the image is determined by the " { $link component-order } " and " { $link component-type } " of the texture." } ;
178
179 HELP: read-texture-to
180 { $values
181     { "tdt" texture-data-target } { "level" integer } { "gpu-data-ptr" gpu-data-ptr }
182 }
183 { $description "Reads the entire image for the " { $snippet "level" } "th level of detail of a texture into the CPU or GPU memory referenced by " { $link gpu-data-ptr } ". The format of the written data is determined by the " { $link component-order } " and " { $link component-type } " of the texture." }
184 { $notes "Reading texture data into a GPU " { $snippet "buffer-ptr" } " requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
185
186 { read-compressed-texture read-compressed-texture-to read-texture read-texture-image read-texture-to } related-words
187
188 HELP: repeat-texcoord
189 { $class-description "This " { $link texture-wrap } " value causes the texture image to be repeated through texture coordinate space." } ;
190
191 HELP: repeat-texcoord-mirrored
192 { $class-description "This " { $link texture-wrap } " value causes the texture image to be repeated through texture coordinate space, mirroring the image on every repetition." } ;
193
194 HELP: set-texture-parameters
195 { $values
196     { "texture" texture } { "parameters" texture-parameters }
197 }
198 { $description "Changes the " { $link texture-parameters } " of a " { $link texture } "." } ;
199
200 HELP: texture
201 { $class-description "Textures are typed, multidimensional arrays of GPU memory used for storing image data, lookup tables, and other kinds of multidimensional data for use with shader programs. They come in different types depending on dimensionality and intended usage:"
202 { $subsections
203     texture-1d
204     texture-2d
205     texture-3d
206     texture-cube-map
207     texture-rectangle
208     texture-1d-array
209     texture-2d-array
210 }
211 "Textures are constructed using the corresponding " { $snippet "<constructor word>" } " for their type. The constructor sets the texture's " { $link component-order } ", " { $link component-type } ", and " { $link texture-parameters } ". Once created, memory for a texture can be allocated with " { $link allocate-texture } ", updated with " { $link update-texture } ", or retrieved with " { $link read-texture } "." } ;
212
213 HELP: texture-1d
214 { $class-description "A one-dimensional " { $link texture } " object. Textures of this type are dimensioned by single integers in calls to " { $link allocate-texture } " and " { $link update-texture } "." } ;
215
216 { texture-1d <texture-1d> } related-words
217
218 HELP: texture-1d-array
219 { $class-description "A one-dimensional array " { $link texture } " object. Textures of this type are dimensioned by pairs of integers in calls to " { $link allocate-texture } " and " { $link update-texture } ". A 1D array texture is distinct from a 2D texture (" { $link texture-2d } ") in that each row of the texture is independent; texture values are not filtered between rows, and lower levels of detail retain the same height, only losing detail in the width direction." }
220 { $notes "Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
221
222 { texture-1d-array <texture-1d-array> } related-words
223
224 HELP: texture-2d
225 { $class-description "A two-dimensional " { $link texture } " object. Textures of this type are dimensioned by pairs of integers in calls to " { $link allocate-texture } " and " { $link update-texture } "." } ;
226
227 { texture-2d <texture-2d> } related-words
228
229 HELP: texture-2d-array
230 { $class-description "A two-dimensional array " { $link texture } " object. Textures of this type are dimensioned by sequences of three integers in calls to " { $link allocate-texture } " and " { $link update-texture } ". A 2D array texture is distinct from a 3D texture (" { $link texture-3d } ") in that each plane of the texture is independent; texture values are not filtered between planes, and lower levels of detail retain the same depth, only losing detail in the width and height directions." }
231 { $notes "Array textures require OpenGL 3.0 or the " { $snippet "GL_EXT_texture_array" } " extension." } ;
232
233 { texture-2d-array <texture-2d-array> } related-words
234
235 HELP: texture-3d
236 { $class-description "A three-dimensional " { $link texture } " object. Textures of this type are dimensioned by sequences of three integers in calls to " { $link allocate-texture } " and " { $link update-texture } "." } ;
237
238 { texture-3d <texture-3d> } related-words
239
240 HELP: texture-wrap
241 { $class-description "Values of this class are used in the " { $snippet "wrap" } " slot of a set of " { $link texture-parameters } " to specify how texture coordinates outside the 0.0 to 1.0 range should be mapped onto the texture image."
242 { $list
243 { { $link clamp-texcoord-to-edge } " clamps coordinates to the edge of the texture image." }
244 { { $link clamp-texcoord-to-border } " clamps coordinates to the border of the texture image." }
245 { { $link repeat-texcoord } " repeats the texture image." }
246 { { $link repeat-texcoord-mirrored } " repeats the texture image, mirroring it with each repetition." }
247 } } ;
248
249 HELP: texture-cube-map
250 { $class-description "A cube map " { $link texture } " object. Textures of this type comprise six two-dimensional image sets, which are independently referenced by " { $link cube-map-face } " objects and dimensioned by pairs of integers in calls to " { $link allocate-texture } " and " { $link update-texture } ". When a cube map is sampled in shader code, the three-dimensional texture coordinates are projected onto the unit cube, and the cube face that is hit by the vector is used to select a face of the cube map texture." } ;
251
252 { texture-cube-map <texture-cube-map> } related-words
253
254 HELP: texture-data
255 { $class-description { $snippet "texture-data" } " tuples are used to feed image data to " { $link allocate-texture } " and " { $link update-texture } "."
256 { $list
257 { "The " { $snippet "ptr" } " slot references either CPU memory (as a " { $link byte-array } " or " { $link alien } ") or a GPU " { $link buffer-ptr } " that contains the image data." }
258 { "The " { $snippet "component-order" } " and " { $snippet "component-type" } " slots determine the " { $link component-order } " and " { $link component-type } " of the referenced data." }
259 } }
260 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
261
262 { texture-data <texture-data> } related-words
263
264 HELP: texture-data-size
265 { $values
266     { "tdt" texture-data-target } { "level" integer }
267     { "size" integer }
268 }
269 { $description "Returns the size in bytes of the image data allocated for the " { $snippet "level" } "th level of detail of a " { $link texture-data-target } "." } ;
270
271 HELP: texture-data-target
272 { $class-description "Most " { $link texture } " types can have image data assigned to themselves directly by " { $link allocate-texture } " and " { $link update-texture } "; however, " { $link texture-cube-map } " objects comprise six independent image sets, each of which must be referenced separately with a " { $link cube-map-face } " tuple when allocating or updating images. The " { $snippet "texture-data-target" } " class is a union of all " { $link texture } " classes (except " { $snippet "texture-cube-map" } ") and the " { $snippet "cube-map-face" } " class." } ;
273
274 HELP: texture-dim
275 { $values
276     { "tdt" texture-data-target } { "level" integer }
277     { "dim" "an " { $link integer } " or sequence of integers" }
278 }
279 { $description "Returns the dimensions of the memory allocated for the " { $snippet "level" } "th level of detail of the given " { $link texture-data-target } "." } ;
280
281 HELP: compressed-texture-data-size
282 { $values
283     { "tdt" texture-data-target } { "level" integer }
284     { "size" integer }
285 }
286 { $description "Returns the size in bytes of the memory allocated for the compressed texture data making up the " { $snippet "level" } "th level of detail of the given " { $link texture-data-target } "." } ;
287
288 HELP: texture-filter
289 { $class-description { $snippet "texture-filter" } " values are used in a " { $link texture-parameters } " tuple to determine how a texture should be sampled between pixels or between levels of detail. " { $link filter-linear } " selects linear filtering, while " { $link filter-nearest } " selects nearest-neighbor sampling." } ;
290
291 HELP: texture-parameters
292 { $class-description "A " { $snippet "texture-parameters" } " tuple is supplied when constructing a " { $link texture } " to control the wrapping, filtering, and level-of-detail handling of the texture. These tuples have the following slots:"
293 { $list
294 { "The " { $snippet "wrap" } " slot determines how texture coordinates outside the 0.0 to 1.0 range are mapped to the texture image. The slot either contains a single " { $link texture-wrap } " value, which will apply to all three axes, or a sequence of up to three values, which will apply to the S, T, and R axes, respectively." }
295 { "The " { $snippet "min-filter" } " and " { $snippet "min-mipmap-filter" } " determine how the texture image is filtered when sampled below its highest level of detail, the former filtering between pixels within a level of detail and the latter filtering between levels of detail. A setting of " { $link filter-linear } " uses linear, bilinear, or trilinear filtering among the sampled pixels, while a setting of " { $link filter-nearest } " uses nearest-neighbor sampling. The " { $snippet "min-mipmap-filter" } " slot may additionally be set to " { $link f } " to disable mipmapping and only sample the highest level of detail." }
296 { "The " { $snippet "mag-filter" } " analogously determines how the texture image is filtered when sampled above its highest level of detail." }
297 { "The " { $snippet "min-lod" } " and " { $snippet "max-lod" } " slots contain integer values that will clamp the range of levels of detail that will be sampled from the texture." }
298 { "The " { $snippet "lod-bias" } " slot contains an integer value that will offset the levels of detail that would normally be sampled from the texture." }
299 { "The " { $snippet "base-level" } " slot contains an integer value that identifies the highest level of detail for the image, typically zero." }
300 { "The " { $snippet "max-level" } " slot contains an integer value that identifies the lowest level of detail for the image. This value will automatically be clamped to the maximum of the base-2 logarithms of the dimensions of the highest level of detail image." }
301 } } ;
302
303 { texture-parameters set-texture-parameters } related-words
304
305 HELP: texture-rectangle
306 { $class-description "A two-dimensional rectangle " { $link texture } " object. Textures of this type are dimensioned by pairs of integers in calls to " { $link allocate-texture } " and " { $link update-texture } ". Rectangle textures differ from normal 2D textures (" { $link texture-2d } ") in that texture coordinates map directly to pixel coordinates when they are sampled from shader code, rather than being normalized into the 0.0 to 1.0 range as with other texture types. Also, rectangle textures do not support mipmapping or texture wrapping." }
307 { $notes "Rectangle textures require OpenGL 3.1 or the " { $snippet "GL_ARB_texture_rectangle" } " extension." } ;
308
309 HELP: update-compressed-texture
310 { $values
311     { "tdt" texture-data-target } { "level" integer } { "loc" "an " { $link integer } " or sequence of integers" } { "dim" "an " { $link integer } " or sequence of integers" } { "compressed-data" texture-data }
312 }
313 { $description "Updates the linear, rectangular, or cubic subregion of a compressed " { $link texture-data-target } " bounded by " { $snippet "loc" } " and " { $snippet "dim" } " with the data referenced by the given " { $link compressed-texture-data } " tuple. The given level of detail of the texture must have been previously allocated for compressed data with " { $link allocate-compressed-texture } "." }
314 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "compressed-texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
315
316 HELP: update-texture
317 { $values
318     { "tdt" texture-data-target } { "level" integer } { "loc" "an " { $link integer } " or sequence of integers" } { "dim" "an " { $link integer } " or sequence of integers" } { "data" texture-data }
319 }
320 { $description "Updates the linear, rectangular, or cubic subregion of a " { $link texture-data-target } " bounded by " { $snippet "loc" } " and " { $snippet "dim" } " with new image data from a " { $link texture-data } " tuple." }
321 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
322
323 HELP: update-texture-image
324 { $values
325     { "tdt" texture-data-target } { "level" integer } { "loc" "an " { $link integer } " or sequence of integers" } { "image" image }
326 }
327 { $description "Updates the linear, rectangular, or cubic subregion of a " { $link texture-data-target } " bounded by " { $snippet "loc" } " and " { $snippet "dim" } " with new image data from an " { $link image } " object." } ;
328
329 { update-compressed-texture update-texture update-texture-image } related-words
330
331 HELP: compressed-texture-format
332 { $class-description { $snippet "compressed-texture-format" } " values are used as part of a " { $link compressed-texture-data } " tuple to specify the binary format of texture data being given to " { $link allocate-compressed-texture } " or " { $link update-compressed-texture } ". The following compressed formats are available:"
333 { $list
334 { { $link DXT1-RGB } }
335 { { $link DXT1-RGBA } }
336 { { $link DXT3 } }
337 { { $link DXT5 } }
338 { { $link LATC1 } }
339 { { $link LATC1-SIGNED } }
340 { { $link LATC2 } }
341 { { $link LATC2-SIGNED } }
342 { { $link RGTC1 } }
343 { { $link RGTC1-SIGNED } }
344 { { $link RGTC2 } }
345 { { $link RGTC2-SIGNED } }
346 } }
347 { $notes "The " { $snippet "DXT1" } " formats require either the " { $snippet "GL_EXT_texture_compression_s3tc" } " or " { $snippet "GL_EXT_texture_compression_dxt1" } " extension. The other " { $snippet "DXT" } " formats require the " { $snippet "GL_EXT_texture_compression_s3tc" } " extension. The " { $snippet "LATC" } " formats require the " { $snippet "GL_EXT_texture_compression_latc" } " extension. The " { $snippet "RGTC" } " formats require OpenGL 3.0 or later or the " { $snippet "GL_EXT_texture_compression_rgtc" } " extension." } ;
348
349 HELP: compressed-texture-data
350 { $class-description { $snippet "compressed-texture-data" } " tuples are used to feed compressed texture data to " { $link allocate-compressed-texture } " and " { $link update-compressed-texture } "."
351 { $list
352 { "The " { $snippet "ptr" } " slot references either CPU memory (as a " { $link byte-array } " or " { $link alien } ") or a GPU " { $link buffer-ptr } " that contains the image data." }
353 { "The " { $snippet "format" } " slot determines the " { $link compressed-texture-format } " of the referenced data." }
354 { "The " { $snippet "length" } " slot determines the size in bytes of the referenced data." }
355 } }
356 { $notes "Using a " { $link buffer-ptr } " as the " { $snippet "ptr" } " of a " { $snippet "texture-data" } " object requires OpenGL 2.1 or later or the " { $snippet "GL_ARB_pixel_buffer_object" } " extension." } ;
357
358 { compressed-texture-data <compressed-texture-data> } related-words
359
360 ARTICLE: "gpu.textures" "Texture objects"
361 "The " { $vocab-link "gpu.textures" } " vocabulary provides words for creating, allocating, updating, and reading GPU texture objects."
362 { $subsections
363     texture
364     texture-data
365     allocate-texture
366     update-texture
367     texture-dim
368     read-texture
369     read-texture-to
370 }
371 "Words are also provided to use " { $link image } " objects from the " { $vocab-link "images" } " library as data sources and destinations for texture data:"
372 { $subsections
373     allocate-texture-image
374     update-texture-image
375     read-texture-image
376 }
377 "Compressed texture data can also be supplied and read:"
378 { $subsections
379     compressed-texture-format
380     compressed-texture-data
381     allocate-compressed-texture
382     update-compressed-texture
383     compressed-texture-data-size
384     read-compressed-texture
385     read-compressed-texture-to
386 } ;
387
388 ABOUT: "gpu.textures"