From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/webglsampler/index.html | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 files/zh-cn/web/api/webglsampler/index.html (limited to 'files/zh-cn/web/api/webglsampler/index.html') diff --git a/files/zh-cn/web/api/webglsampler/index.html b/files/zh-cn/web/api/webglsampler/index.html new file mode 100644 index 0000000000..3ec32629d4 --- /dev/null +++ b/files/zh-cn/web/api/webglsampler/index.html @@ -0,0 +1,56 @@ +--- +title: WebGLSampler +slug: Web/API/WebGLSampler +tags: + - API + - WebGL + - WebGL2 + - 参考 + - 实验性 +translation_of: Web/API/WebGLSampler +--- +
{{APIRef("WebGL")}} {{SeeCompatTable}}
+ +

WebGL 2 API 的 WebGLSampler 接口存储一系列采样参数,供 {{domxref("WebGLTexture")}} 在着色器中访问。

+ +

当使用 WebGLSampler 对象时,有以下 {{domxref("WebGL2RenderingContext")}} 相关方法:

+ + + +

示例

+ +

创建 WebGLSampler 对象

+ +

在本例中,gl 必须是一个 {{domxref("WebGL2RenderingContext")}} 对象。因为 WebGLSampler 在 WebGL 1 中是不可用的。

+ +
var sampler = gl.createSampler();
+
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('WebGL2', "#3.3", "WebGLSample")}}{{Spec2('WebGL2')}}初始定义。
+ +

浏览器兼容性

+ + + +

{{Compat("api.WebGLSampler")}}

-- cgit v1.2.3-54-g00ecf