Skip to content

Types

TextureOptions ​

Defined in: createTexture.js:4

Options for createTexture.

Properties ​

PropertyTypeDescription
data?ArrayBufferView<ArrayBufferLike> | nullInstead of img: pixels, width × height of them. Leave it out for an empty texture.
flipY?booleanFlip on upload, so the top of an image is at texture coordinate y = 1. Defaults to false.
format?numberThe texture format. Defaults to gl.RGBA.
generateMips?booleanGenerate mipmaps. Defaults to true for gl.UNSIGNED_BYTE, false otherwise.
height?numberWith data: height in pixels.
img?TexImageSourceAn image, canvas, video or ImageBitmap that has already loaded.
internalFormat?numberThe internal format. Defaults to format, or a sized format such as gl.RG32F for gl.FLOAT and gl.HALF_FLOAT.
level?numberThe mip level to upload to. Defaults to 0.
magFilter?numberThe magnification filter. Defaults to gl.LINEAR (gl.NEAREST for 32-bit float where linear filtering isn't supported).
minFilter?numberThe minification filter. Defaults to gl.LINEAR_MIPMAP_LINEAR with mipmaps, otherwise gl.LINEAR (gl.NEAREST for 32-bit float where linear filtering isn't supported).
target?numberOnly gl.TEXTURE_2D is supported. Defaults to gl.TEXTURE_2D.
type?numberThe type of each component. Defaults to gl.UNSIGNED_BYTE.
width?numberWith data: width in pixels.
wrapS?numberThe horizontal wrap mode. Defaults to gl.CLAMP_TO_EDGE.
wrapT?numberThe vertical wrap mode. Defaults to gl.CLAMP_TO_EDGE.