Class Texture
Represent a texture.
Defined in: benchgl.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Texture(options)
Creates a new Texture.
|
Method Attributes | Method Name and Description |
---|---|
bind(unit)
Binds this Texture to a sampler unit in the current shader program.
|
|
destroy()
Destroys this Texture.
|
|
Generates mipmaps for this Texture.
|
|
unbind(unit)
Unbinds this Texture from a sampler unit in the current shader program.
|
Class Detail
Texture(options)
Creates a new Texture.
- Parameters:
- {Object} options
- Contains some info to generate the texture.
- {Image} options.image
- The image to generate the texture from.
- {Number} options.level Optional
- The level of the texture.
- {Number} options.verticalFlip Optional
- Indicates to flip the y coordinate over the texture.
- {Number} options.internalFmt Optional
- The WebGL internal format of the texture.
- {Number} options.format Optional
- The format of the texture.
- {Number} options.type Optional
- The data type of the colors for each pixel in the image.
- {Number} options.magFilter Optional
- Specifies magnification filters to use in mipmapping.
- {Number} options.minFilter Optional
- Specifies minification filters to use in mipmapping.
- {Number} options.target Optional
- The WebGL target for the texture.
- {Boolean} options.mipmap Optional
- Indicates if mipmap of the texture have to be created.
Method Detail
{Texture}
bind(unit)
Binds this Texture to a sampler unit in the current shader program.
- Parameters:
- {Number} unit
- The unit to bind this Texture to.
- Returns:
- {Texture} Returns this Texture.
destroy()
Destroys this Texture.
{Texture}
generateMipmap()
Generates mipmaps for this Texture.
- Returns:
- {Texture} Returns this Texture.
{Texture}
unbind(unit)
Unbinds this Texture from a sampler unit in the current shader program.
- Parameters:
- {Number} unit
- The unit to unbind this Texture from.
- Returns:
- {Texture} Returns this Texture.