Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 980 Bytes

File metadata and controls

49 lines (33 loc) · 980 Bytes
title short-title slug page-type browser-compat
WebGL2RenderingContext: bindSampler() method
bindSampler()
Web/API/WebGL2RenderingContext/bindSampler
web-api-instance-method
api.WebGL2RenderingContext.bindSampler

{{APIRef("WebGL")}}

The WebGL2RenderingContext.bindSampler() method of the WebGL 2 API binds a passed {{domxref("WebGLSampler")}} object to the texture unit at the passed index.

Syntax

bindSampler(unit, sampler)

Parameters

  • unit
    • : A {{domxref("WebGL_API/Types", "GLuint")}} specifying the index of the texture unit to which to bind the sampler to.
  • sampler
    • : A {{domxref("WebGLSampler")}} object to bind.

Return value

None ({{jsxref("undefined")}}).

Examples

const sampler = gl.createSampler();
gl.bindSampler(0, sampler);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("WebGLSampler")}}