The WebGLRenderer instance that owns this wrapper.
The WebGLRenderer instance that owns this wrapper.
List of the indexes of available texture units. Used in setting uniforms.
The list of texture units available to the WebGLRenderingContext.
Binds a texture to a texture unit.
This will change the active texture unit to the given unit,
unless forceActive is false.
This should be the only way to bind a texture to a unit.
The texture to bind, or null to unbind the unit.
The texture unit to bind the texture to.
Optionalforce: boolean
If true, it will bind the texture even if it is already bound. Default false.
OptionalforceActive: boolean
If true, it will change the active texture unit to the given unit even if it is already active. Otherwise, it will only change the active texture unit if it is not already active. Default true.
Set specific texture units to specific textures.
The active texture unit may change to accommodate the bindings.
The textures to bind. Null values will be unbound. Undefined values will be skipped.
Optionalforce: boolean
If true, it will bind all textures, even if they are already bound. Default false.
Initializes the texture units to null. The active texture unit
will be 0 after this runs.
This populates every texture unit with a 1x1 texture. This stops WebGL errors on MacOS. These textures are not wrapped, and are not intended to be used, so the texture units are recorded as null.
Unbinds all textures from all texture units. This will change the active texture unit to 0.
Unbinds a specific texture from all texture units it is currently bound to.
Iterates over all texture units and replaces any binding that matches
the given texture with null. This is typically called when a texture
is about to be destroyed, to ensure no unit holds a stale reference.
The texture to unbind from all units.
A wrapper for the WebGLRenderingContext's texture units. It tracks which textures are bound to which units, and provides binding utilities.