docs.rodeo

MDN Web Docs mirror

WebGLSampler

{{APIRef("WebGL")}} {{AvailableInWorkers}} 

The WebGLSampler interface is part of the WebGL 2 API and stores sampling parameters for {{domxref("WebGLTexture")}}  access inside of a shader.

{{InheritanceDiagram}} 

When working with WebGLSampler objects, the following methods of the {{domxref("WebGL2RenderingContext")}}  are useful:

Examples

Creating a WebGLSampler object

in this example, gl must be a {{domxref("WebGL2RenderingContext")}} . WebGLSampler objects are not available in WebGL 1.

const sampler = gl.createSampler();

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

In this article

View on MDN