WebGLSampler
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 in Web Workers.
Giao diện WebGLSampler là một phần của API WebGL 2 và lưu trữ các tham số lấy mẫu cho việc truy cập WebGLTexture bên trong shader.
Khi làm việc với các đối tượng WebGLSampler, các phương thức sau của WebGL2RenderingContext hữu ích:
Ví dụ
>Tạo đối tượng WebGLSampler
Trong ví dụ này, gl phải là một WebGL2RenderingContext. Các đối tượng WebGLSampler không khả dụng trong WebGL 1.
js
const sampler = gl.createSampler();
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| WebGL 2.0 Specification> # 3.3> |