OES_texture_float extension
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Phần mở rộng OES_texture_float là một phần của WebGL API và hiển thị các kiểu pixel dấu phẩy động cho texture.
Các phần mở rộng WebGL có sẵn bằng cách sử dụng phương thức WebGLRenderingContext.getExtension(). Để biết thêm thông tin, xem Sử dụng Phần mở rộng trong hướng dẫn WebGL.
Phương thức mở rộng
Phần mở rộng này mở rộng WebGLRenderingContext.texImage2D() và WebGLRenderingContext.texSubImage2D():
- Tham số
typegiờ chấp nhậngl.FLOAT. - Tham số
pixelsgiờ chấp nhậnFloat32Array.
Giới hạn: Lọc tuyến tính
Lọc tuyến tính trên texture dấu phẩy động không được phép với phần mở rộng này. Để sử dụng lọc tuyến tính trên texture dấu phẩy động, hãy bật phần mở rộng OES_texture_float_linear ngoài phần mở rộng này.
Ví dụ
js
const ext = gl.getExtension("OES_texture_float");
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.FLOAT, image);
Thông số kỹ thuật
| Specification |
|---|
| WebGL OES_texture_float Khronos Ratified Extension Specification> |