WebGL2RenderingContext: phương thức bindSampler()
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.
Phương thức WebGL2RenderingContext.bindSampler() của WebGL 2 API liên kết một đối tượng WebGLSampler đã cho với đơn vị texture tại chỉ mục đã cho.
Cú pháp
js
bindSampler(unit, sampler)
Tham số
unit-
Một
GLuintchỉ định chỉ mục của đơn vị texture sẽ liên kết sampler. sampler-
Một đối tượng
WebGLSamplerđể liên kết.
Giá trị trả về
None (undefined).
Ví dụ
js
const sampler = gl.createSampler();
gl.bindSampler(0, sampler);
Đặc tả kỹ thuật
| Specification |
|---|
| WebGL 2.0 Specification> # 3.7.13> |