OES_texture_half_float_linear extension
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Phần mở rộng OES_texture_half_float_linear là một phần của WebGL API và cho phép lọc tuyến tính với các kiểu pixel dấu phẩy động nửa độ chính xác 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.
Lọc tuyến tính
Phần mở rộng OES_texture_half_float một mình không cho phép lọc tuyến tính với texture dấu phẩy động nửa độ chính xác. Phần mở rộng này cho phép khả năng này.
Với sự giúp đỡ của phần mở rộng này, bạn có thể đặt bộ lọc phóng to hoặc thu nhỏ trong phương thức WebGLRenderingContext.texParameter() thành một trong gl.LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR hoặc gl.LINEAR_MIPMAP_LINEAR và sử dụng texture dấu phẩy động nửa độ chính xác.
Ví dụ
const halfFloat = gl.getExtension("OES_texture_half_float");
gl.getExtension("OES_texture_half_float_linear");
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texImage2D(
gl.TEXTURE_2D,
0,
gl.RGBA,
gl.RGBA,
halfFloat.HALF_FLOAT_OES,
image,
);
Thông số kỹ thuật
| Specification |
|---|
| WebGL OES_texture_half_float_linear Khronos Ratified Extension Specification> |