WebGLRenderingContext.createShader()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

La méthode WebGLRenderingContext.createShader() de l'API WebGL crée un WebGLShader, qui peut alors être configuré davantage en utilisant WebGLRenderingContext.shaderSource() et WebGLRenderingContext.compileShader().

Syntaxe

js
WebGLShader gl.createShader(type);

Paramètres

type

Soit gl.VERTEX_SHADER, soit gl.FRAGMENT_SHADER

Exemples

Voir WebGLShader pour l'utilisation et des exemples.

Spécifications

Specification
WebGL Specification
# 5.14.9

Compatibilité des navigateurs

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
createShader

Legend

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

Full support
Full support

Voir aussi