GLAPI/glCompressedTexSubImage3D: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
4.0 API.
 
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{infobox feature  
{{infobox feature  
| name = glCompressedTexSubImage3D  
| name = glCompressedTexSubImage3D }}
| core = 1.3
}}


'''glCompressedTexSubImage3D:''' specify a three-dimensional texture subimage in a compressed format
'''glCompressedTexSubImage3D:''' specify a three-dimensional texture subimage in a compressed format
Line 8: Line 6:
== Function Definition ==
== Function Definition ==


   void '''glCompressedTexSubImage3D'''(GLenum ''target'', GLint ''level'', GLint ''xoffset'', GLint ''yoffset'', GLint ''zoffset'', GLsizei ''width'', GLsizei ''height'', GLsizei ''depth'', GLenum ''format'', GLsizei ''imageSize'', const GLvoid * ''data'');
   void '''glCompressedTexSubImage3D'''(GLenum {{param|target}}, GLint {{param|level}}, GLint {{param|xoffset}}, GLint {{param|yoffset}}, GLint {{param|zoffset}}, GLsizei {{param|width}}, GLsizei {{param|height}}, GLsizei {{param|depth}}, GLenum {{param|format}}, GLsizei {{param|imageSize}}, const GLvoid * {{param|data}});


; target
; target
: Specifies the target texture. Must be {{code|GL_TEXTURE_3D}}.
: Specifies the target texture. Must be {{enum|GL_TEXTURE_3D}}, {{enum|GL_TEXTURE_2D_ARRAY}}, or {{enum|GL_TEXTURE_CUBE_MAP_ARRAY}}.
; level
; level
: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image.
: Specifies the level-of-detail number. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image.
Line 25: Line 23:
: Specifies the depth of the texture subimage.
: Specifies the depth of the texture subimage.
; format
; format
: Specifies the format of the compressed image data stored at address ''data''.
: Specifies the format of the compressed image data stored at address {{param|data}}.
; imageSize
; imageSize
: Specifies the number of unsigned bytes of image data starting at the address specified by ''data''.
: Specifies the number of unsigned bytes of image data starting at the address specified by {{param|data}}.
; data
; data
: Specifies a pointer to the compressed image data in memory.
: Specifies a pointer to the compressed image data in memory.
Line 33: Line 31:
== Description ==
== Description ==


Texturing allows elements of an image array to be read by shaders.
'''glCompressedTexSubImage3D''' uploads a contiguous subregion of an existing texture which contains three-dimensional image data. The texels referenced by {{param|data}} replace the portion of the existing texture array with x indices {{param|xoffset}} and ''xoffset + width - 1'', and the y indices {{param|yoffset}} and ''yoffset + height - 1'', and the z indices {{param|zoffset}} and ''zoffset + depth - 1'', inclusive. This region may not include any texels outside the range of the texture array as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.


'''glCompressedTexSubImage3D''' redefines a contiguous subregion of an existing three-dimensional texture image. The texels referenced by ''data'' replace the portion of the existing texture array with x indices ''xoffset'' and <!--Missing Equation-->, and the y indices ''yoffset'' and <!--Missing Equation-->, and the z indices ''zoffset'' and <!--Missing Equation-->, inclusive. This region may not include any texels outside the range of the texture array as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.
{{param|internalformat}} must be a known compressed image format (such as {{enum|GL_RGTC}}) or an extension-specified compressed-texture format. The {{param|format}} of the compressed texture image is selected by the GL implementation that compressed it (see {{apifunc|glTexImage3D}}) and should be queried at the time the texture was compressed with {{apifunc|glGetTexLevelParameter}}.


''internalformat'' must be a known compressed image format (such as {{code|GL_RGTC}}) or an extension-specified compressed-texture format. The ''format'' of the compressed texture image is selected by the GL implementation that compressed it (see [[GLAPI/glTexImage3D|glTexImage3D]]) and should be queried at the time the texture was compressed with [[GLAPI/glGetTexLevelParameter|glGetTexLevelParameter]].
If a non-zero named buffer object is bound to the {{enum|GL_PIXEL_UNPACK_BUFFER}} target (see {{apifunc|glBindBuffer}}) while a texture image is specified, {{param|data}} is treated as a byte offset into the buffer object's data store.
 
If a non-zero named buffer object is bound to the {{code|GL_PIXEL_UNPACK_BUFFER}} target (see [[GLAPI/glBindBuffer|glBindBuffer]]) while a texture image is specified, ''data'' is treated as a byte offset into the buffer object's data store.


== Errors ==
== Errors ==


{{code|GL_INVALID_ENUM}} is generated if ''internalformat'' is one of the generic compressed internal formats: {{code|GL_COMPRESSED_RED}}, {{code|GL_COMPRESSED_RG}}, {{code|GL_COMPRESSED_RGB}}, {{code|GL_COMPRESSED_RGBA}}. {{code|GL_COMPRESSED_SRGB}}, or {{code|GL_COMPRESSED_SRGB_ALPHA}}.
{{enum|GL_INVALID_ENUM}} is generated if {{param|internalformat}} is one of the generic compressed internal formats: {{enum|GL_COMPRESSED_RED}}, {{enum|GL_COMPRESSED_RG}}, {{enum|GL_COMPRESSED_RGB}}, {{enum|GL_COMPRESSED_RGBA}}. {{enum|GL_COMPRESSED_SRGB}}, or {{enum|GL_COMPRESSED_SRGB_ALPHA}}.


{{code|GL_INVALID_VALUE}} is generated if ''imageSize'' is not consistent with the format, dimensions, and contents of the specified compressed image data.
{{enum|GL_INVALID_VALUE}} is generated if {{param|imageSize}} is not consistent with the format, dimensions, and contents of the specified compressed image data.


{{code|GL_INVALID_OPERATION}} is generated if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension.
{{enum|GL_INVALID_OPERATION}} is generated if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension.


{{code|GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{code|GL_PIXEL_UNPACK_BUFFER}} target and the buffer object's data store is currently mapped.
{{enum|GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{enum|GL_PIXEL_UNPACK_BUFFER}} target and the buffer object's data store is currently mapped.


{{code|GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{code|GL_PIXEL_UNPACK_BUFFER}} target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size.
{{enum|GL_INVALID_OPERATION}} is generated if a non-zero buffer object name is bound to the {{enum|GL_PIXEL_UNPACK_BUFFER}} target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size.


Undefined results, including abnormal program termination, are generated if ''data'' is not encoded in a manner consistent with the extension specification defining the internal compression format.
Undefined results, including abnormal program termination, are generated if {{param|data}} is not encoded in a manner consistent with the extension specification defining the internal compression format.


== Associated Gets ==
== Associated Gets ==


[[GLAPI/glGetCompressedTexImage|glGetCompressedTexImage]]
{{apifunc|glGetCompressedTexImage}}


[[GLAPI/glGet|glGet]] with argument {{code|GL_TEXTURE_COMPRESSED}}
{{apifunc|glGet}} with argument {{enum|GL_TEXTURE_COMPRESSED}}


[[GLAPI/glGet|glGet]] with argument {{code|GL_PIXEL_UNPACK_BUFFER_BINDING}}
{{apifunc|glGet}} with argument {{enum|GL_PIXEL_UNPACK_BUFFER_BINDING}}


[[GLAPI/glGetTexLevelParameter|glGetTexLevelParameter]] with arguments {{code|GL_TEXTURE_INTERNAL_FORMAT}} and {{code|GL_TEXTURE_COMPRESSED_IMAGE_SIZE}}
{{apifunc|glGetTexLevelParameter}} with arguments {{enum|GL_TEXTURE_INTERNAL_FORMAT}} and {{enum|GL_TEXTURE_COMPRESSED_IMAGE_SIZE}}


== See Also ==
== See Also ==


[[GLAPI/glActiveTexture|glActiveTexture]], [[GLAPI/glCompressedTexImage1D|glCompressedTexImage1D]], [[GLAPI/glCompressedTexImage2D|glCompressedTexImage2D]], [[GLAPI/glCompressedTexImage3D|glCompressedTexImage3D]], [[GLAPI/glCompressedTexSubImage1D|glCompressedTexSubImage1D]], [[GLAPI/glCompressedTexSubImage2D|glCompressedTexSubImage2D]], [[GLAPI/glCopyTexImage1D|glCopyTexImage1D]], [[GLAPI/glCopyTexImage2D|glCopyTexImage2D]], [[GLAPI/glCopyTexSubImage1D|glCopyTexSubImage1D]], [[GLAPI/glCopyTexSubImage2D|glCopyTexSubImage2D]], [[GLAPI/glCopyTexSubImage3D|glCopyTexSubImage3D]], [[GLAPI/glPixelStore|glPixelStore]], [[GLAPI/glTexImage2D|glTexImage2D]], [[GLAPI/glTexImage3D|glTexImage3D]], [[GLAPI/glTexSubImage1D|glTexSubImage1D]], [[GLAPI/glTexSubImage2D|glTexSubImage2D]], [[GLAPI/glTexSubImage3D|glTexSubImage3D]], [[GLAPI/glTexParameter|glTexParameter]]
{{apifunc|glActiveTexture}}, {{apifunc|glBindTexture}}, {{apifunc|glBindFramebuffer}}, {{apifunc|glCompressedTexSubImage1D}}, {{apifunc|glCompressedTexSubImage2D}}, {{apifunc|glPixelStore}}, {{apifunc|glCompressedTexImage3D}}, {{apifunc|glTexImage3D}}, {{apifunc|glTexStorage3D}}


== Copyright ==
== Copyright ==


Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/].
Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [https://khronos.org/registry/OpenGL-Refpages/LICENSES/LicenseRef-FreeB.txt LicenseRef-FreeB].


[[Category:API Reference 4]]
[[Category:Core API Reference|CompressedTexSubImage3D]]
[[Category:Core API Ref Texturing|CompressedTexSubImage3D]]
[[Category:Texture Object API State Functions|CompressedTexSubImage3D]]

Latest revision as of 22:18, 5 February 2021

glCompressedTexSubImage3D
Core in version 4.6

glCompressedTexSubImage3D: specify a three-dimensional texture subimage in a compressed format

Function Definition

 void glCompressedTexSubImage3D(GLenum target​, GLint level​, GLint xoffset​, GLint yoffset​, GLint zoffset​, GLsizei width​, GLsizei height​, GLsizei depth​, GLenum format​, GLsizei imageSize​, const GLvoid * data​);
target
Specifies the target texture. Must be GL_TEXTURE_3D, GL_TEXTURE_2D_ARRAY, or GL_TEXTURE_CUBE_MAP_ARRAY.
level
Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
xoffset
Specifies a texel offset in the x direction within the texture array.
yoffset
Specifies a texel offset in the y direction within the texture array.
width
Specifies the width of the texture subimage.
height
Specifies the height of the texture subimage.
depth
Specifies the depth of the texture subimage.
format
Specifies the format of the compressed image data stored at address data​.
imageSize
Specifies the number of unsigned bytes of image data starting at the address specified by data​.
data
Specifies a pointer to the compressed image data in memory.

Description

glCompressedTexSubImage3D uploads a contiguous subregion of an existing texture which contains three-dimensional image data. The texels referenced by data​ replace the portion of the existing texture array with x indices xoffset​ and xoffset + width - 1, and the y indices yoffset​ and yoffset + height - 1, and the z indices zoffset​ and zoffset + depth - 1, inclusive. This region may not include any texels outside the range of the texture array as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.

internalformat​ must be a known compressed image format (such as GL_RGTC) or an extension-specified compressed-texture format. The format​ of the compressed texture image is selected by the GL implementation that compressed it (see glTexImage3D) and should be queried at the time the texture was compressed with glGetTexLevelParameter.

If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer) while a texture image is specified, data​ is treated as a byte offset into the buffer object's data store.

Errors

GL_INVALID_ENUM is generated if internalformat​ is one of the generic compressed internal formats: GL_COMPRESSED_RED, GL_COMPRESSED_RG, GL_COMPRESSED_RGB, GL_COMPRESSED_RGBA. GL_COMPRESSED_SRGB, or GL_COMPRESSED_SRGB_ALPHA.

GL_INVALID_VALUE is generated if imageSize​ is not consistent with the format, dimensions, and contents of the specified compressed image data.

GL_INVALID_OPERATION is generated if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension.

GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to the GL_PIXEL_UNPACK_BUFFER target and the buffer object's data store is currently mapped.

GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to the GL_PIXEL_UNPACK_BUFFER target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size.

Undefined results, including abnormal program termination, are generated if data​ is not encoded in a manner consistent with the extension specification defining the internal compression format.

Associated Gets

glGetCompressedTexImage

glGet with argument GL_TEXTURE_COMPRESSED

glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING

glGetTexLevelParameter with arguments GL_TEXTURE_INTERNAL_FORMAT and GL_TEXTURE_COMPRESSED_IMAGE_SIZE

See Also

glActiveTexture, glBindTexture, glBindFramebuffer, glCompressedTexSubImage1D, glCompressedTexSubImage2D, glPixelStore, glCompressedTexImage3D, glTexImage3D, glTexStorage3D

Copyright

Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see LicenseRef-FreeB.