WebGL2RenderingContext.beginTransformFeedback()

Experimental: 这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

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

语法

void gl.beginTransformFeedback(primitiveMode);

参数

primitiveMode

A GLenum (en-US) 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

返回值

无。

示例

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

浏览器兼容性

BCD tables only load in the browser

相关链接