WebGL
The WebGL2RenderingContext.getSamplerParameter() method
of the WebGL 2 API returns parameter
information of a WebGLSampler object.
Syntax
getSamplerParameter(sampler, pname)
Parameters
sampler- : A WebGLSampler object.
pname- : A WebGL_API/Types specifying which information to return. Possible values:
gl.TEXTURE_COMPARE_FUNC: Returns a WebGL_API/Types indicating the texture comparison function.gl.TEXTURE_COMPARE_MODE: Returns a WebGL_API/Types indicating the texture comparison mode.gl.TEXTURE_MAG_FILTER: Returns a WebGL_API/Types indicating the texture magnification filter.gl.TEXTURE_MAX_LOD: Returns a WebGL_API/Types indicating the maximum level-of-detail value.gl.TEXTURE_MIN_FILTER: Returns a WebGL_API/Types indicating the texture minification filtergl.TEXTURE_MIN_LOD: Returns a WebGL_API/Types indicating the minimum level-of-detail value.gl.TEXTURE_WRAP_R: Returns a WebGL_API/Types indicating the texture wrapping function for the texture coordinate r.gl.TEXTURE_WRAP_S: Returns a WebGL_API/Types indicating the texture wrapping function for the texture coordinate s.gl.TEXTURE_WRAP_T: Returns a WebGL_API/Types indicating the texture wrapping function for the texture coordinate t.
- : A WebGL_API/Types specifying which information to return. Possible values:
Return value
Depends on the pname parameter, either a WebGL_API/Types or a
WebGL_API/Types.
Examples
const sampler = gl.createSampler();
gl.getSamplerParameter(sampler, gl.TEXTURE_COMPARE_FUNC);
Specifications
Browser compatibility
See also
- WebGLSampler
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
