Constructor
new L3D.GLSampler(gl, options)
gl |
GLContext | |||||||||||||||||||||||||||||
options |
Object | Optional configuration for the sampler. Properties
|
Properties
The WebGL handle for the sampler object, null if it hasn't been created.
True if the sampler object has been created.
= GL.LINEAR
The magnification filter type. Can be: GL.NEAREST, or GL.LINEAR.
= GL.LINEAR
The minification filter type. Can be: GL.NEAREST, GL.LINEAR, GL.LINEAR_MIPMAP_LINEAR, GL.LINEAR_MIPMAP_NEAREST, GL.NEAREST_MIPMAP_LINEAR, or GL.NEAREST_MIPMAP_NEAREST.
= false
True if the filtering requires the texture to have a mipmap. Setting this property will change the minFilter.
= GL.REPEAT
The wrapR type. Can be: GL.REPEAT, GL.CLAMP_TO_EDGE, or GL.MIRRORED_REPEAT
= GL.REPEAT
The wrapS type. Can be: GL.REPEAT, GL.CLAMP_TO_EDGE, or GL.MIRRORED_REPEAT
= GL.REPEAT
The wrapT type. Can be: GL.REPEAT, GL.CLAMP_TO_EDGE, or GL.MIRRORED_REPEAT
Methods
bind(textureUnit)
Bind the sampler to the given texture unit.
textureUnit |
number | The texture unit index, starting from 0. |
configure(options)
Set the properties of the sampler object.
options |
Object |
Properties
|
create()
Create the sampler object.
destroy()
Destroy the sampler object.
unbind(textureUnit)
Set the sampler object assigned to the texture unit to null.
textureUnit |
number | The texture unit index, starting from 0. |
update()
Apply the properties to the sampler object.