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.

WebGLRenderingContextcreateShader()WebGL API のメソッドで、 WebGLShader を作成します。それからさらに、 WebGLRenderingContext.shaderSource()WebGLRenderingContext.compileShader() を用いて設定できます。

構文

js
createShader(type)

引数

type

gl.VERTEX_SHADERgl.FRAGMENT_SHADER のどちらかです。

返値

新しい (WebGLShader) です。

例については WebGLShader を参照してください。

仕様書

Specification
WebGL Specification
# 5.14.9

ブラウザーの互換性

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

関連情報