WebGLRenderingContext.createShader()

这篇翻译不完整。请帮忙从英语翻译这篇文章

WebGLRenderingContext.createShader() 用于创建一个 WebGLShader 着色器对象,该对象可以使用 WebGLRenderingContext.shaderSource()WebGLRenderingContext.compileShader() 方法配置着色器代码.

语法

WebGLShader gl.createShader(type);

参数

type
gl.VERTEX_SHADER 或 gl.FRAGMENT_SHADER,两者其一

示例

详见 WebGLShader 的使用和示例

规范

Specification Status Comment
WebGL 1.0
createShader
Recommendation Initial definition.
OpenGL ES 2.0
glCreateShader
Standard OpenGL man page.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 9Edge Full support 12Firefox Full support 4IE Full support 11Opera Full support 12Safari Full support 5.1WebView Android Full support YesChrome Android Full support 25Edge Mobile Full support YesFirefox Android Full support YesOpera Android Full support 12Safari iOS Full support 8.1Samsung Internet Android Full support Yes

Legend

Full support  
Full support

其他相关

文档标签和贡献者

此页面的贡献者: hi-zhaolei
最后编辑者: hi-zhaolei,