1GLTEXSUBIMAGE3D(3G) OpenGL Manual GLTEXSUBIMAGE3D(3G)
2
3
4
6 glTexSubImage3D - specify a three-dimensional texture subimage
7
9 void glTexSubImage3D(GLenum target, GLint level, GLint xoffset,
10 GLint yoffset, GLint zoffset, GLsizei width,
11 GLsizei height, GLsizei depth, GLenum format,
12 GLenum type, const GLvoid * data);
13
15 target
16 Specifies the target texture. Must be GL_TEXTURE_3D or
17 GL_TEXTURE_2D_ARRAY.
18
19 level
20 Specifies the level-of-detail number. Level 0 is the base image
21 level. Level n is the nth mipmap reduction image.
22
23 xoffset
24 Specifies a texel offset in the x direction within the texture
25 array.
26
27 yoffset
28 Specifies a texel offset in the y direction within the texture
29 array.
30
31 zoffset
32 Specifies a texel offset in the z direction within the texture
33 array.
34
35 width
36 Specifies the width of the texture subimage.
37
38 height
39 Specifies the height of the texture subimage.
40
41 depth
42 Specifies the depth of the texture subimage.
43
44 format
45 Specifies the format of the pixel data. The following symbolic
46 values are accepted: GL_RED, GL_RG, GL_RGB, GL_BGR, GL_RGBA, and
47 GL_BGRA.
48
49 type
50 Specifies the data type of the pixel data. The following symbolic
51 values are accepted: GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT,
52 GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT,
53 GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
54 GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
55 GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
56 GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
57 GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV,
58 GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV.
59
60 data
61 Specifies a pointer to the image data in memory.
62
64 Texturing maps a portion of a specified texture image onto each
65 graphical primitive for which texturing is enabled.
66
67 glTexSubImage3D redefines a contiguous subregion of an existing
68 three-dimensional or two-dimensioanl array texture image. The texels
69 referenced by data replace the portion of the existing texture array
70 with x indices xoffset and xoffset + width - 1, inclusive, y indices
71 yoffset and yoffset + height - 1, inclusive, and z indices zoffset and
72 zoffset + depth - 1, inclusive. For three-dimensional textures, the z
73 index refers to the third dimension. For two-dimensional array
74 textures, the z index refers to the slice index. This region may not
75 include any texels outside the range of the texture array as it was
76 originally specified. It is not an error to specify a subtexture with
77 zero width, height, or depth but such a specification has no effect.
78
79 If a non-zero named buffer object is bound to the
80 GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer()) while a texture
81 image is specified, data is treated as a byte offset into the buffer
82 object's data store.
83
85 The glPixelStore() modes affect texture images.
86
87 glTexSubImage3D specifies a three-dimensional or two-dimenaional array
88 subtexture for the current texture unit, specified with
89 glActiveTexture().
90
92 GL_INVALID_ENUM is generated if /target is not GL_TEXTURE_3D or
93 GL_TEXTURE_2D_ARRAY.
94
95 GL_INVALID_ENUM is generated if format is not an accepted format
96 constant.
97
98 GL_INVALID_ENUM is generated if type is not a type constant.
99
100 GL_INVALID_VALUE is generated if level is less than 0.
101
102 GL_INVALID_VALUE may be generated if level is greater than log 2max,
103 where max is the returned value of GL_MAX_TEXTURE_SIZE.
104
105 GL_INVALID_VALUE is generated if xoffset < - b, xoffset + width > w -
106 b, yoffset < - b, or yoffset + height > h - b, or zoffset < - b, or
107 zoffset + depth > d - b, where w is the GL_TEXTURE_WIDTH, h is the
108 GL_TEXTURE_HEIGHT, d is the GL_TEXTURE_DEPTH and b is the border width
109 of the texture image being modified. Note that w, h, and d include
110 twice the border width.
111
112 GL_INVALID_VALUE is generated if width, height, or depth is less than
113 0.
114
115 GL_INVALID_OPERATION is generated if the texture array has not been
116 defined by a previous glTexImage3D() or glTexStorage3D() operation.
117
118 GL_INVALID_OPERATION is generated if type is one of
119 GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
120 GL_UNSIGNED_SHORT_5_6_5, or GL_UNSIGNED_SHORT_5_6_5_REV and format is
121 not GL_RGB.
122
123 GL_INVALID_OPERATION is generated if type is one of
124 GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
125 GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
126 GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV,
127 GL_UNSIGNED_INT_10_10_10_2, or GL_UNSIGNED_INT_2_10_10_10_REV and
128 format is neither GL_RGBA nor GL_BGRA.
129
130 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
131 bound to the GL_PIXEL_UNPACK_BUFFER target and the buffer object's data
132 store is currently mapped.
133
134 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
135 bound to the GL_PIXEL_UNPACK_BUFFER target and the data would be
136 unpacked from the buffer object such that the memory reads required
137 would exceed the data store size.
138
139 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
140 bound to the GL_PIXEL_UNPACK_BUFFER target and data is not evenly
141 divisible into the number of bytes needed to store in memory a datum
142 indicated by type.
143
145 glGetTexImage()
146
147 glGet() with argument GL_PIXEL_UNPACK_BUFFER_BINDING
148
150 glActiveTexture(), glCopyTexImage1D(), glCopyTexImage2D(),
151 glCopyTexSubImage1D(), glCopyTexSubImage2D(), glCopyTexSubImage3D(),
152 glPixelStore(), glTexImage1D(), glTexImage2D(), glTexImage3D(),
153 glTexSubImage1D(), glTexSubImage2D(), glTexParameter()
154
156 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
157 under the SGI Free Software B License. For details, see
158 http://oss.sgi.com/projects/FreeB/.
159
161 opengl.org
162
163
164
165opengl.org 06/10/2014 GLTEXSUBIMAGE3D(3G)