Instead of img: pixels, width × height of them. Leave it out for an empty texture.
flipY?
boolean
Flip on upload, so the top of an image is at texture coordinate y = 1. Defaults to false.
format?
number
The texture format. Defaults to gl.RGBA.
generateMips?
boolean
Generate mipmaps. Defaults to true for gl.UNSIGNED_BYTE, false otherwise.
height?
number
With data: height in pixels.
img?
TexImageSource
An image, canvas, video or ImageBitmap that has already loaded.
internalFormat?
number
The internal format. Defaults to format, or a sized format such as gl.RG32F for gl.FLOAT and gl.HALF_FLOAT.
level?
number
The mip level to upload to. Defaults to 0.
magFilter?
number
The magnification filter. Defaults to gl.LINEAR (gl.NEAREST for 32-bit float where linear filtering isn't supported).
minFilter?
number
The 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?
number
Only gl.TEXTURE_2D is supported. Defaults to gl.TEXTURE_2D.
type?
number
The type of each component. Defaults to gl.UNSIGNED_BYTE.
width?
number
With data: width in pixels.
wrapS?
number
The horizontal wrap mode. Defaults to gl.CLAMP_TO_EDGE.
wrapT?
number
The vertical wrap mode. Defaults to gl.CLAMP_TO_EDGE.