The WebGLRenderer instance that owns this wrapper.
Mip level of the texture.
Filtering of the texture.
Filtering of the texture.
Wrapping mode of the texture.
Wrapping mode of the texture.
Which format does the texture use.
The pixel data used to populate the texture. Can be a Canvas, Video, ImageData, Uint8Array, or compressed texture object.
Width of the texture in pixels.
Height of the texture in pixels.
Optionalpma: boolean
Does the texture have premultiplied alpha? Default true.
OptionalforceSize: boolean
If true it will use the width and height passed to this method, regardless of the pixels dimension. Default false.
OptionalflipY: boolean
Sets the UNPACK_FLIP_Y_WEBGL flag the WebGL Texture uses during upload. Default true.
The texture unit this texture will be bound to in the current rendering batch.
This should be set by the batcher. It is a quick way to tell whether this texture has been included in the batch. If it is -1, it has not.
Sets the UNPACK_FLIP_Y_WEBGL flag the WebGL Texture uses during upload.
Whether to use the width and height properties, regardless of pixel dimensions.
The WebGL pixel format of the texture (e.g. gl.RGBA or gl.RGB).
Generate mipmap levels for the texture. This method is called internally.
Mipmaps are only generated if this texture is mipmap-enabled and has a size which is a power of two. Otherwise this function returns without side effects.
Height of the texture in pixels.
Return whether the texture is set to use a mipmap minification filter.
Whether this is used as a RenderTexture.
The magnification filter for the texture, as a WebGL filter constant
(e.g. gl.LINEAR or gl.NEAREST). Applied when the texture is
scaled up.
The minification filter for the texture, as a WebGL filter constant
(e.g. gl.LINEAR or gl.NEAREST). Applied when the texture is
scaled down.
Mip level of the texture.
Whether the mipmaps should be regenerated.
This is only relevant to dynamic textures and framebuffers with
rapidly changing content.
The process which changes the content should set this flag.
When the texture is next bound, the WebGLTextureUnitsWrapper
should trigger the generateMipmap method.
Pixel data. This is the source data used to create the WebGLTexture.
Does the texture have premultiplied alpha?
The WebGLRenderer this WebGLTexture belongs to.
The __SPECTOR_Metadata property of the WebGLTexture,
used to add extra data to the debug SpectorJS integration.
The WebGLTexture that this wrapper is wrapping.
This property could change at any time. Therefore, you should never store a reference to this value. It should only be passed directly to the WebGL API for drawing.
Width of the texture in pixels.
The wrapping mode for the S (horizontal) axis of the texture,
as a WebGL wrap constant (e.g. gl.REPEAT or gl.CLAMP_TO_EDGE).
The wrapping mode for the T (vertical) axis of the texture,
as a WebGL wrap constant (e.g. gl.REPEAT or gl.CLAMP_TO_EDGE).
Creates a WebGLTexture from the given parameters.
This is called automatically by the constructor. It may also be called again if the WebGLTexture needs re-creating.
Deletes the WebGLTexture from the GPU, if it has not been already.
Resizes the WebGLTexture to the new dimensions. This will destroy the contents of the texture.
Wrap mode will be updated: REPEAT if the new size is power-of-two, CLAMP_TO_EDGE if not.
Texture minification filter will be updated:
The new width of the WebGLTexture.
The new height of the WebGLTexture.
Updates the WebGLTexture from an updated source.
This should only be used when the source is a Canvas or Video element.
Because textures usually change into something complex and unique, this method forces all properties to update without checking.
The source to update the WebGLTexture with.
The new width of the WebGLTexture.
The new height of the WebGLTexture.
Should the WebGLTexture set UNPACK_FLIP_Y_WEBGL?
The new wrapping mode for the WebGLTexture.
The new wrapping mode for the WebGLTexture.
The new minification filter for the WebGLTexture.
The new magnification filter for the WebGLTexture.
The new format for the WebGLTexture.
Wrapper for a WebGL texture, containing all the information that was used to create it.
A WebGLTexture should never be exposed outside the WebGLRenderer, so the WebGLRenderer can handle context loss and other events without other systems having to be aware of it. Always use WebGLTextureWrapper instead.