此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

WebGL2RenderingContext.beginTransformFeedback()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2021年9月⁩.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

WebGL 2 APIWebGL2RenderingContext.beginTransformFeedback() 方法开始一个变换回传(Transform Feedback)操作。

语法

void gl.beginTransformFeedback(primitiveMode);

参数

primitiveMode

A GLenum specifying the output type of the primitives that will be recorded into the buffer objects that are bound for transform feedback. 可能的值:

  • gl.POINTS
  • gl.LINES
  • gl.TRIANGLES

返回值

无。

示例

js
var transformFeedback = gl.createTransformFeedback();
gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback);
gl.beginTransformFeedback(gl.TRIANGLES);
gl.drawArrays(gl.TRIANGLES, 0, 3);

规范

Specification
WebGL 2.0 Specification
# 3.7.15

浏览器兼容性

相关链接