1GLCOPYTEXSUBIMAGE2D(3G) [FIXME: manual] GLCOPYTEXSUBIMAGE2D(3G)
2
3
4
6 glCopyTexSubImage2D, glCopyTextureSubImage2D - copy a two-dimensional
7 texture subimage
8
10 void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset,
11 GLint yoffset, GLint x, GLint y,
12 GLsizei width, GLsizei height);
13
14 void glCopyTextureSubImage2D(GLuint texture, GLint level,
15 GLint xoffset, GLint yoffset, GLint x,
16 GLint y, GLsizei width, GLsizei height);
17
19 target
20 Specifies the target to which the texture object is bound for
21 glCopyTexSubImage2D function. Must be GL_TEXTURE_1D_ARRAY,
22 GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X,
23 GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
24 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
25 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or GL_TEXTURE_RECTANGLE.
26
27 texture
28 Specifies the texture object name for glCopyTextureSubImage2D
29 function.
30
31 level
32 Specifies the level-of-detail number. Level 0 is the base image
33 level. Level n is the nth mipmap reduction image.
34
35 xoffset
36 Specifies a texel offset in the x direction within the texture
37 array.
38
39 yoffset
40 Specifies a texel offset in the y direction within the texture
41 array.
42
43 x, y
44 Specify the window coordinates of the lower left corner of the
45 rectangular region of pixels to be copied.
46
47 width
48 Specifies the width of the texture subimage.
49
50 height
51 Specifies the height of the texture subimage.
52
54 glCopyTexSubImage2D and glCopyTextureSubImage2D replace a rectangular
55 portion of a two-dimensional texture image, cube-map texture image,
56 rectangular image, or a linear portion of a number of slices of a
57 one-dimensional array texture with pixels from the current
58 GL_READ_BUFFER (rather than from main memory, as is the case for
59 glTexSubImage2D()).
60
61 The screen-aligned pixel rectangle with lower left corner at x y and
62 with width width and height height replaces the portion of the texture
63 array with x indices xoffset through xoffset + width - 1, inclusive,
64 and y indices yoffset through yoffset + height - 1, inclusive, at the
65 mipmap level specified by level.
66
67 The pixels in the rectangle are processed exactly as if glReadPixels()
68 had been called, but the process stops just before final conversion. At
69 this point, all pixel component values are clamped to the range $[0,1]$
70 and then converted to the texture's internal format for storage in the
71 texel array.
72
73 The destination rectangle in the texture array may not include any
74 texels outside the texture array as it was originally specified. It is
75 not an error to specify a subtexture with zero width or height, but
76 such a specification has no effect.
77
78 When target is GL_TEXTURE_1D_ARRAY then the y coordinate and height are
79 treated as the start slice and number of slices to modify.
80
81 If any of the pixels within the specified rectangle of the current
82 GL_READ_BUFFER are outside the read window associated with the current
83 rendering context, then the values obtained for those pixels are
84 undefined.
85
86 No change is made to the internalformat, width, or height, parameters
87 of the specified texture array or to texel values outside the specified
88 subregion.
89
91 glPixelStore() modes affect texture images.
92
94 GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D,
95 GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
96 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
97 GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
98 GL_TEXTURE_1D_ARRAY, or GL_RECTANGLE.
99
100 GL_INVALID_FRAMEBUFFER_OPERATION is generated if the object bound to
101 GL_READ_FRAMEBUFFER_BINDING is not framebuffer complete.
102
103 GL_INVALID_OPERATION is generated if the texture array has not been
104 defined by a previous glTexImage2D(), glTexStorage2D() or
105 glCopyTexImage2D() operation.
106
107 GL_INVALID_OPERATION is generated by glCopyTextureSubImage2D if texture
108 is not the name of an existing texture object.
109
110 GL_INVALID_OPERATION is generated by glCopyTextureSubImage2D if the
111 effective target of texture does not correspond to one of the texture
112 targets supported by the function.
113
114 GL_INVALID_VALUE is generated if level is less than 0.
115
116 GL_INVALID_VALUE is generated if the effective target is
117 GL_TEXTURE_RECTANGLE and level is not zero.
118
119 GL_INVALID_VALUE may be generated if level > log 2 max, where max is
120 the returned value of GL_MAX_TEXTURE_SIZE.
121
122 GL_INVALID_VALUE is generated if xoffset < 0, xoffset + width > w,
123 yoffset < 0, or yoffset + height > 0,, where w is the GL_TEXTURE_WIDTH,
124 h is the GL_TEXTURE_HEIGHT and of the texture image being modified.
125
126 GL_INVALID_OPERATION is generated if:
127
128 · the read buffer is GL_NONE, or
129
130 · the value of GL_READ_FRAMEBUFFER_BINDING is non-zero, and:
131
132 · the read buffer selects an attachment that has no image
133 attached, or
134
135 · the effective value of GL_SAMPLE_BUFFERS for the read
136 framebuffer is one.
137
139 glGetTexImage()
140
142 ┌────────────────────────┬───────────────────────────────────────────────────────────────────────┐
143 │ │ OpenGL Version │
144 ├────────────────────────┼─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
145 │Function │ 2.0 │ 2.1 │ 3.0 │ 3.1 │ 3.2 │ 3.3 │ 4.0 │ 4.1 │ 4.2 │ 4.3 │ 4.4 │ 4.5 │
146 │/ │ │ │ │ │ │ │ │ │ │ │ │ │
147 │Feature │ │ │ │ │ │ │ │ │ │ │ │ │
148 │Name │ │ │ │ │ │ │ │ │ │ │ │ │
149 ├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
150 │glCopyTexSubImage2D │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │
151 ├────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
152 │glCopyTextureSubImage2D │ - │ - │ - │ - │ - │ - │ - │ - │ - │ - │ - │ ✔ │
153 └────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
154
156 glCopyTexImage1D(), glCopyTexImage2D(), glCopyTexSubImage1D(),
157 glCopyTexSubImage3D(), glPixelStore(), glReadBuffer(), glTexImage1D(),
158 glTexImage2D(), glTexImage3D(), glTexParameter(), glTexSubImage1D(),
159 glTexSubImage2D(), glTexSubImage3D()
160
162 Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2012-2014
163 Khronos Group. This document is licensed under the SGI Free Software B
164 License. For details, see http://oss.sgi.com/projects/FreeB/.
165
167 Copyright © 2014 Khronos Group
168
169
170
171[FIXME: source] 03/06/2019 GLCOPYTEXSUBIMAGE2D(3G)