WebGL2RenderingContext: phương thức texStorage3D()
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 texStorage3D() của WebGL2RenderingContext trong WebGL API chỉ định tất cả các mức của lưu trữ texture ba chiều.
Cú pháp
texStorage3D(target, levels, internalformat, width, height, depth)
Tham số
target-
Một
GLenumchỉ định điểm liên kết (target) của texture đang hoạt động. Các giá trị có thể:gl.TEXTURE_3D: Texture ba chiều.gl.TEXTURE_2D_ARRAY: Texture mảng hai chiều.
levels-
Một
GLintchỉ định số mức texture. internalformat-
Một
GLenumchỉ định định dạng lưu trữ texture. Để biết danh sách các giá trị có thể, xemWebGL2RenderingContext.texStorage2D(). width-
Một
GLsizeichỉ định chiều rộng của texture tính bằng texel. height-
Một
GLsizeichỉ định chiều cao của texture tính bằng texel. depth-
Một
GLsizeichỉ định chiều sâu của texture/số lượng texture trong mộtTEXTURE_2D_ARRAY.
Giá trị trả về
None (undefined).
Ví dụ
gl.texStorage3D(gl.TEXTURE_3D, 1, gl.RGB8, 256, 256, 256);
Đặc tả kỹ thuật
| Specification |
|---|
| WebGL 2.0 Specification> # 3.7.6> |