WebGL2RenderingContext: samplerParameter[if]() method
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.
Note: This feature is available inWeb Workers.
TheWebGL2RenderingContext.samplerParameter[if]() methodsof theWebGL 2 API setWebGLSampler parameters.
In this article
Syntax
samplerParameteri(sampler, pname, param)samplerParameterf(sampler, pname, param)Parameters
samplerA
WebGLSamplerobject.pnameA
GLenumspecifying which parameter to set. Possible values:gl.TEXTURE_COMPARE_FUNCA
GLenumspecifying thetexture comparison function.gl.TEXTURE_COMPARE_MODEA
GLenumspecifying thetexture comparison mode.gl.TEXTURE_MAG_FILTERA
GLenumspecifying thetexture magnification filter.gl.TEXTURE_MAX_LODA
GLfloatspecifying the maximumlevel-of-detail value.gl.TEXTURE_MIN_FILTERA
GLenumspecifying thetexture minification filtergl.TEXTURE_MIN_LODA
GLfloatspecifying the minimumlevel-of-detail value.gl.TEXTURE_WRAP_RA
GLenumspecifying the texturewrapping function for the texture coordinate r.gl.TEXTURE_WRAP_SA
GLenumspecifying the texturewrapping function for the texture coordinate s.gl.TEXTURE_WRAP_TA
GLenumspecifying the texturewrapping function for the texture coordinate t.
paramA
GLint(samplerParameteri) or aGLfloat(samplerParameterf) specifying a value forpname.
Return value
None (undefined).
Examples
const sampler = gl.createSampler();gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, gl.NEAREST);Specifications
| Specification |
|---|
| WebGL 2.0 Specification> # 3.7.13> |