public class ARBClearTexture
extends java.lang.Object
Texture objects are fundamental to the operation of OpenGL. They are used as a source for texture sampling and destination for rendering as well as
being accessed in shaders for image load/store operations. It is also possible to invalidate the contents of a texture. It is currently only possible to
set texture image data to known values by uploading some or all of a image array from application memory or by attaching it to a framebuffer object and
using Clear or the OpenGL 3.0 ClearBuffer commands.
Both uploading initial texture data and clearing by attaching to a framebuffer have potential disadvantages when one simply wants to initialize texture data to a known value. Uploading initial data requires the application to allocate a (potentially large) chunk of memory and transferring that to the GL. This can be a costly operation both in terms of memory bandwidth and power usage. Alternatively, attaching a texture level to a framebuffer to clear it may not be possible if the texture format isn't supported for rendering, or even if it is, attaching the image to a framebuffer object may cause the texture to be allocated in certain types of memory, which it may otherwise not need to be placed in.
This extension solves these problems by providing a mechanism whereby the contents of a texture image array can be set to known values by using the
ClearTexImage or ClearTexSubImage commands. These commands can also be useful for initializing an image that will be used for atomic shader
operations.
Requires OpenGL 1.3. Promoted to core in OpenGL 4.4.
| Modifier and Type | Field and Description |
|---|---|
static int |
GL_CLEAR_TEXTURE
|
| Modifier and Type | Method and Description |
|---|---|
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
java.nio.ByteBuffer data)
Is equivalent to calling
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have). |
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
double[] data)
Array version of:
ClearTexImage |
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
java.nio.DoubleBuffer data)
Is equivalent to calling
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have). |
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
float[] data)
Array version of:
ClearTexImage |
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
java.nio.FloatBuffer data)
Is equivalent to calling
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have). |
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
int[] data)
Array version of:
ClearTexImage |
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
java.nio.IntBuffer data)
Is equivalent to calling
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have). |
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
short[] data)
Array version of:
ClearTexImage |
static void |
glClearTexImage(int texture,
int level,
int format,
int type,
java.nio.ShortBuffer data)
Is equivalent to calling
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have). |
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
java.nio.ByteBuffer data)
Fills all or part of a texture image with a constant value.
|
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
double[] data)
Array version of:
ClearTexSubImage |
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
java.nio.DoubleBuffer data)
Fills all or part of a texture image with a constant value.
|
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
float[] data)
Array version of:
ClearTexSubImage |
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
java.nio.FloatBuffer data)
Fills all or part of a texture image with a constant value.
|
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
int[] data)
Array version of:
ClearTexSubImage |
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
java.nio.IntBuffer data)
Fills all or part of a texture image with a constant value.
|
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
short[] data)
Array version of:
ClearTexSubImage |
static void |
glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
java.nio.ShortBuffer data)
Fills all or part of a texture image with a constant value.
|
static void |
nglClearTexImage(int texture,
int level,
int format,
int type,
long data)
Unsafe version of:
ClearTexImage |
static void |
nglClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
long data)
Unsafe version of:
ClearTexSubImage |
public static final int GL_CLEAR_TEXTURE
public static void nglClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
long data)
ClearTexSubImagepublic static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
java.nio.ByteBuffer data)
Arguments xoffset, yoffset, and zoffset specify the lower left texel coordinates of a width-wide by height-high
by depth-deep rectangular subregion of the texel array and are interpreted as they are in TexSubImage3D.
For 1D array textures, yoffset is interpreted as the first layer to be cleared and height is the number of layers to clear. For 2D array
textures, zoffset is interpreted as the first layer to be cleared and depth is the number of layers to clear. Cube map textures are
treated as an array of six slices in the z-dimension, where the value of zoffset is interpreted as specifying the cube map face for the
corresponding layer and depth is the number of faces to clear. For cube map array textures, zoffset is the first layer-face to
clear, and depth is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.
Negative values of xoffset, yoffset, and zoffset correspond to the coordinates of border texels.
texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearxoffset - the x coordinate of the texel subregionyoffset - the y coordinate of the texel subregionzoffset - the z coordinate of the texel subregionwidth - the subregion widthheight - the subregion heightdepth - the subregion depthformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
java.nio.ShortBuffer data)
Arguments xoffset, yoffset, and zoffset specify the lower left texel coordinates of a width-wide by height-high
by depth-deep rectangular subregion of the texel array and are interpreted as they are in TexSubImage3D.
For 1D array textures, yoffset is interpreted as the first layer to be cleared and height is the number of layers to clear. For 2D array
textures, zoffset is interpreted as the first layer to be cleared and depth is the number of layers to clear. Cube map textures are
treated as an array of six slices in the z-dimension, where the value of zoffset is interpreted as specifying the cube map face for the
corresponding layer and depth is the number of faces to clear. For cube map array textures, zoffset is the first layer-face to
clear, and depth is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.
Negative values of xoffset, yoffset, and zoffset correspond to the coordinates of border texels.
texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearxoffset - the x coordinate of the texel subregionyoffset - the y coordinate of the texel subregionzoffset - the z coordinate of the texel subregionwidth - the subregion widthheight - the subregion heightdepth - the subregion depthformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
java.nio.IntBuffer data)
Arguments xoffset, yoffset, and zoffset specify the lower left texel coordinates of a width-wide by height-high
by depth-deep rectangular subregion of the texel array and are interpreted as they are in TexSubImage3D.
For 1D array textures, yoffset is interpreted as the first layer to be cleared and height is the number of layers to clear. For 2D array
textures, zoffset is interpreted as the first layer to be cleared and depth is the number of layers to clear. Cube map textures are
treated as an array of six slices in the z-dimension, where the value of zoffset is interpreted as specifying the cube map face for the
corresponding layer and depth is the number of faces to clear. For cube map array textures, zoffset is the first layer-face to
clear, and depth is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.
Negative values of xoffset, yoffset, and zoffset correspond to the coordinates of border texels.
texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearxoffset - the x coordinate of the texel subregionyoffset - the y coordinate of the texel subregionzoffset - the z coordinate of the texel subregionwidth - the subregion widthheight - the subregion heightdepth - the subregion depthformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
java.nio.FloatBuffer data)
Arguments xoffset, yoffset, and zoffset specify the lower left texel coordinates of a width-wide by height-high
by depth-deep rectangular subregion of the texel array and are interpreted as they are in TexSubImage3D.
For 1D array textures, yoffset is interpreted as the first layer to be cleared and height is the number of layers to clear. For 2D array
textures, zoffset is interpreted as the first layer to be cleared and depth is the number of layers to clear. Cube map textures are
treated as an array of six slices in the z-dimension, where the value of zoffset is interpreted as specifying the cube map face for the
corresponding layer and depth is the number of faces to clear. For cube map array textures, zoffset is the first layer-face to
clear, and depth is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.
Negative values of xoffset, yoffset, and zoffset correspond to the coordinates of border texels.
texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearxoffset - the x coordinate of the texel subregionyoffset - the y coordinate of the texel subregionzoffset - the z coordinate of the texel subregionwidth - the subregion widthheight - the subregion heightdepth - the subregion depthformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
java.nio.DoubleBuffer data)
Arguments xoffset, yoffset, and zoffset specify the lower left texel coordinates of a width-wide by height-high
by depth-deep rectangular subregion of the texel array and are interpreted as they are in TexSubImage3D.
For 1D array textures, yoffset is interpreted as the first layer to be cleared and height is the number of layers to clear. For 2D array
textures, zoffset is interpreted as the first layer to be cleared and depth is the number of layers to clear. Cube map textures are
treated as an array of six slices in the z-dimension, where the value of zoffset is interpreted as specifying the cube map face for the
corresponding layer and depth is the number of faces to clear. For cube map array textures, zoffset is the first layer-face to
clear, and depth is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.
Negative values of xoffset, yoffset, and zoffset correspond to the coordinates of border texels.
texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearxoffset - the x coordinate of the texel subregionyoffset - the y coordinate of the texel subregionzoffset - the z coordinate of the texel subregionwidth - the subregion widthheight - the subregion heightdepth - the subregion depthformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void nglClearTexImage(int texture,
int level,
int format,
int type,
long data)
ClearTexImagepublic static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
java.nio.ByteBuffer data)
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have).texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
java.nio.ShortBuffer data)
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have).texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
java.nio.IntBuffer data)
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have).texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
java.nio.FloatBuffer data)
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have).texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
java.nio.DoubleBuffer data)
ClearTexSubImage with xoffset, yoffset, and zoffset equal to -b and width,
height, and depth equal to the dimensions of the texture image plus 2xb (or zero and one for dimensions the texture doesn't
have).texture - the texture to clear. It is an error if texture is zero or not the name of a texture object, if texture is a buffer texture, or if
the texture image has a compressed internal formatlevel - the texture level to clearformat - the format of the source data. One of:type - the type of the source data. One of:data - an array of between one and four components of texel data that will be used as the source for the constant fill value. If data is NULL,
then the pointer is ignored and the sub-range of the texture image is filled with zeros.public static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
short[] data)
ClearTexSubImagepublic static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
int[] data)
ClearTexSubImagepublic static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
float[] data)
ClearTexSubImagepublic static void glClearTexSubImage(int texture,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
@Nullable
double[] data)
ClearTexSubImagepublic static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
short[] data)
ClearTexImagepublic static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
int[] data)
ClearTexImagepublic static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
float[] data)
ClearTexImagepublic static void glClearTexImage(int texture,
int level,
int format,
int type,
@Nullable
double[] data)
ClearTexImageCopyright LWJGL. All Rights Reserved. License terms.