WebGLSampler
Experimental
这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。
WebGL 2 API 的 WebGLSampler
接口存储一系列采样参数,供 WebGLTexture
在着色器中访问。
当使用 WebGLSampler
对象时,有以下 WebGL2RenderingContext
相关方法:
示例
创建 WebGLSampler
对象
在本例中,gl
必须是一个 WebGL2RenderingContext
对象。因为 WebGLSampler
在 WebGL 1 中是不可用的。
var sampler = gl.createSampler();
规范
Specification | Status | Comment |
---|---|---|
WebGL 2.0 WebGLSample |
Editor's Draft | 初始定义。 |
浏览器兼容性
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.