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 September 2021.

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

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

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
beginTransformFeedback

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

相关链接