Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. WebGL2RenderingContext
  4. samplerParameter[if]()

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.

Syntax

js
samplerParameteri(sampler, pname, param)samplerParameterf(sampler, pname, param)

Parameters

sampler

AWebGLSampler object.

pname

AGLenum specifying which parameter to set. Possible values:

gl.TEXTURE_COMPARE_FUNC

AGLenum specifying thetexture comparison function.

gl.TEXTURE_COMPARE_MODE

AGLenum specifying thetexture comparison mode.

gl.TEXTURE_MAG_FILTER

AGLenum specifying thetexture magnification filter.

gl.TEXTURE_MAX_LOD

AGLfloat specifying the maximumlevel-of-detail value.

gl.TEXTURE_MIN_FILTER

AGLenum specifying thetexture minification filter

gl.TEXTURE_MIN_LOD

AGLfloat specifying the minimumlevel-of-detail value.

gl.TEXTURE_WRAP_R

AGLenum specifying the texturewrapping function for the texture coordinate r.

gl.TEXTURE_WRAP_S

AGLenum specifying the texturewrapping function for the texture coordinate s.

gl.TEXTURE_WRAP_T

AGLenum specifying the texturewrapping function for the texture coordinate t.

param

AGLint (samplerParameteri) or aGLfloat(samplerParameterf) specifying a value forpname.

Return value

None (undefined).

Examples

js
const sampler = gl.createSampler();gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, gl.NEAREST);

Specifications

Specification
WebGL 2.0 Specification
# 3.7.13

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp