WebGL2RenderingContext: phương thức readBuffer()

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.readBuffer() của WebGL 2 API chọn một bộ đệm màu làm nguồn cho pixel cho các lệnh gọi tiếp theo đến copyTexImage2D, copyTexSubImage2D, copyTexSubImage3D hoặc readPixels.

Cú pháp

js
readBuffer(source)

Tham số

source

Một GLenum chỉ định một bộ đệm màu. Các giá trị có thể:

gl.BACK

Đọc từ bộ đệm màu phía sau.

gl.NONE

Không đọc từ bộ đệm màu nào.

gl.COLOR_ATTACHMENT{0-15}

Đọc từ một trong 16 bộ đệm gắn màu.

Giá trị trả về

None (undefined).

Ví dụ

js
gl.readBuffer(gl.COLOR_ATTACHMENT0);

Đặc tả kỹ thuật

Specification
WebGL 2.0 Specification
# 3.7.4

Tương thích trình duyệt

Xem thêm