WebGL

WebGL提供图形绘制的能力,包括对当前绘制图形的位置、颜色等进行处理。

WebGL标准图形API,对应OpenGL ES 2.0特性集。更多信息请参考WebGL™标准

说明:

本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。

WebGL遵循OpenGL协议,不支持多线程调用。

目前该功能仅支持使用兼容JS的类Web开发范式开发。

调用方式

hml内创建canvas,示例如下:

<!--xxx.hml-->
<div class="container">
    <canvas ref="canvas1" style="width : 400px; height : 200px; background-color : lightyellow;"></canvas>
    <button class="btn-button" onclick="BtnDraw2D">BtnDraw2D</button>
</div>

js内获取canvas实例,示例如下:

// 获取canvas组件实例
const el = this.$refs.canvas1;
// 从canvas组件实例获取WebGL上下文
const gl = el.getContext('webgl');
// 调用WebGL API
gl.clearColor(0.0, 0.0, 0.0, 1.0);

Type

系统能力: 以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL。

表1 Type

名称 类型
GLenum number
GLboolean boolean
GLbitfield number
GLbyte number
GLshort number
GLint number
GLsizei number
GLintptr number
GLsizeiptr number
GLubyte number
GLushort number
GLuint number
GLfloat number
GLclampf number
TexImageSource ImageData
Float32List array
Int32List array
WebGLPowerPreference string

Interface

系统能力: 以下各项对应的系统能力均为 SystemCapability.Graphic.Graphic2D.WebGL。

表2 Interface

名称
WebGLContextAttributes
WebGLBuffer
WebGLFrameBuffer
WebGLProgram
WebGLRenderbuffer
WebGLShader
WebGLTexture
WebGLUniformLocation
WebGLActiveInfo
WebGLShaderPrecisionFormat
WebGLRenderingContextBase
WebGLRenderingContextOverloads

WebGLContextAttributes

WebGLContextAttributes

名称 参数类型 必填
alpha boolean
depth boolean
stencil boolean
antialias boolean
premultipliedAlpha boolean
preserveDrawingBuffer boolean
powerPreference WebGLPowerPreference
failIfMajorPerformanceCaveat boolean
desynchronized boolean

WebGLActiveInfo

WebGLActiveInfo

名称 参数类型 必填
size GLint
type GLenum
name string

WebGLShaderPrecisionFormat

WebGLShaderPrecisionFormat

名称 参数类型 必填
rangeMin GLint
rangeMax GLint
precision GLint

WebGLRenderingContextBase

WebGLRenderingContextBase

属性

名称 参数类型 必填
DEPTH_BUFFER_BIT GLenum
STENCIL_BUFFER_BIT GLenum
COLOR_BUFFER_BIT GLenum
POINTS GLenum
LINES GLenum
LINE_LOOP GLenum
LINE_STRIP GLenum
TRIANGLES GLenum
TRIANGLE_STRIP GLenum
TRIANGLE_FAN GLenum
ZERO GLenum
ONE GLenum
SRC_COLOR GLenum
ONE_MINUS_SRC_COLOR GLenum
SRC_ALPHA GLenum
ONE_MINUS_SRC_ALPHA GLenum
DST_ALPHA GLenum
ONE_MINUS_DST_ALPHA GLenum
DST_COLOR GLenum
ONE_MINUS_DST_COLOR GLenum
SRC_ALPHA_SATURATE GLenum
FUNC_ADD GLenum
BLEND_EQUATION GLenum
BLEND_EQUATION_RGB GLenum
BLEND_EQUATION_ALPHA GLenum
FUNC_SUBTRACT GLenum
FUNC_REVERSE_SUBTRACT GLenum
BLEND_DST_RGB GLenum
BLEND_SRC_RGB GLenum
BLEND_DST_ALPHA GLenum
BLEND_SRC_ALPHA GLenum
CONSTANT_COLOR GLenum
ONE_MINUS_CONSTANT_COLOR GLenum
CONSTANT_ALPHA GLenum
ONE_MINUS_CONSTANT_ALPHA GLenum
BLEND_COLOR GLenum
ARRAY_BUFFER GLenum
ELEMENT_ARRAY_BUFFER GLenum
ARRAY_BUFFER_BINDING GLenum
ELEMENT_ARRAY_BUFFER_BINDING GLenum
STREAM_DRAW GLenum
STATIC_DRAW GLenum
DYNAMIC_DRAW GLenum
BUFFER_SIZE GLenum
BUFFER_USAGE GLenum
CURRENT_VERTEX_ATTRIB GLenum
FRONT GLenum
BACK GLenum
FRONT_AND_BACK GLenum
CULL_FACE GLenum
BLEND GLenum
DITHER GLenum
STENCIL_TEST GLenum
DEPTH_TEST GLenum
SCISSOR_TEST GLenum
POLYGON_OFFSET_FILL GLenum
SAMPLE_ALPHA_TO_COVERAGE GLenum
SAMPLE_COVERAGE GLenum
NO_ERROR GLenum
INVALID_ENUM GLenum
INVALID_VALUE GLenum
INVALID_OPERATION GLenum
OUT_OF_MEMORY GLenum
CW GLenum
CCW GLenum
LINE_WIDTH GLenum
ALIASED_POINT_SIZE_RANGE GLenum
ALIASED_LINE_WIDTH_RANGE GLenum
CULL_FACE_MODE GLenum
FRONT_FACE GLenum
DEPTH_RANGE GLenum
DEPTH_WRITEMASK GLenum
DEPTH_CLEAR_VALUE GLenum
DEPTH_FUNC GLenum
STENCIL_CLEAR_VALUE GLenum
STENCIL_FUNC GLenum
STENCIL_FAIL GLenum
STENCIL_PASS_DEPTH_FAIL GLenum
STENCIL_PASS_DEPTH_PASS GLenum
STENCIL_REF GLenum
STENCIL_VALUE_MASK GLenum
STENCIL_WRITEMASK GLenum
STENCIL_BACK_FUNC GLenum
STENCIL_BACK_FAIL GLenum
STENCIL_BACK_PASS_DEPTH_FAIL GLenum
STENCIL_BACK_PASS_DEPTH_PASS GLenum
STENCIL_BACK_REF GLenum
STENCIL_BACK_VALUE_MASK GLenum
STENCIL_BACK_WRITEMASK GLenum
VIEWPORT GLenum
SCISSOR_BOX GLenum
COLOR_CLEAR_VALUE GLenum
COLOR_WRITEMASK GLenum
UNPACK_ALIGNMENT GLenum
PACK_ALIGNMENT GLenum
MAX_TEXTURE_SIZE GLenum
MAX_VIEWPORT_DIMS GLenum
SUBPIXEL_BITS GLenum
RED_BITS GLenum
GREEN_BITS GLenum
BLUE_BITS GLenum
ALPHA_BITS GLenum
DEPTH_BITS GLenum
STENCIL_BITS GLenum
POLYGON_OFFSET_UNITS GLenum
POLYGON_OFFSET_FACTOR GLenum
TEXTURE_BINDING_2D GLenum
SAMPLE_BUFFERS GLenum
SAMPLES GLenum
SAMPLE_COVERAGE_VALUE GLenum
SAMPLE_COVERAGE_INVERT GLenum
COMPRESSED_TEXTURE_FORMATS GLenum
DONT_CARE GLenum
FASTEST GLenum
NICEST GLenum
GENERATE_MIPMAP_HINT GLenum
BYTE GLenum
UNSIGNED_BYTE GLenum
SHORT GLenum
UNSIGNED_SHORT GLenum
INT GLenum
UNSIGNED_INT GLenum
FLOAT GLenum
DEPTH_COMPONENT GLenum
ALPHA GLenum
RGB GLenum
RGBA GLenum
LUMINANCE GLenum
LUMINANCE_ALPHA GLenum
UNSIGNED_SHORT_4_4_4_4 GLenum
UNSIGNED_SHORT_5_5_5_1 GLenum
UNSIGNED_SHORT_5_6_5 GLenum
FRAGMENT_SHADER GLenum
VERTEX_SHADER GLenum
MAX_VERTEX_ATTRIBS GLenum
MAX_VERTEX_UNIFORM_VECTORS GLenum
MAX_VARYING_VECTORS GLenum
MAX_COMBINED_TEXTURE_IMAGE_UNITS GLenum
MAX_VERTEX_TEXTURE_IMAGE_UNITS GLenum
MAX_TEXTURE_IMAGE_UNITS GLenum
MAX_FRAGMENT_UNIFORM_VECTORS GLenum
SHADER_TYPE GLenum
DELETE_STATUS GLenum
LINK_STATUS GLenum
VALIDATE_STATUS GLenum
ATTACHED_SHADERS GLenum
ACTIVE_UNIFORMS GLenum
ACTIVE_ATTRIBUTES GLenum
SHADING_LANGUAGE_VERSION GLenum
CURRENT_PROGRAM GLenum
NEVER GLenum
LESS GLenum
EQUAL GLenum
LEQUAL GLenum
GREATER GLenum
NOTEQUAL GLenum
GEQUAL GLenum
ALWAYS GLenum
KEEP GLenum
REPLACE GLenum
INCR GLenum
DECR GLenum
INVERT GLenum
INCR_WRAP GLenum
DECR_WRAP GLenum
VENDOR GLenum
RENDERER GLenum
VERSION GLenum
NEAREST GLenum
LINEAR GLenum
NEAREST_MIPMAP_NEAREST GLenum
LINEAR_MIPMAP_NEAREST GLenum
NEAREST_MIPMAP_LINEAR GLenum
LINEAR_MIPMAP_LINEAR GLenum
TEXTURE_MIN_FILTER GLenum
TEXTURE_WRAP_S GLenum
TEXTURE_WRAP_T GLenum
TEXTURE_2D GLenum
TEXTURE GLenum
TEXTURE_CUBE_MAP GLenum
TEXTURE_BINDING_CUBE_MAP GLenum
TEXTURE_CUBE_MAP_POSITIVE_X GLenum
TEXTURE_CUBE_MAP_NEGATIVE_X GLenum
TEXTURE_CUBE_MAP_POSITIVE_Y GLenum
TEXTURE_CUBE_MAP_NEGATIVE_Y GLenum
TEXTURE_CUBE_MAP_POSITIVE_Z GLenum
TEXTURE_CUBE_MAP_NEGATIVE_Z GLenum
MAX_CUBE_MAP_TEXTURE_SIZE GLenum
TEXTURE0 GLenum
TEXTURE1 GLenum
TEXTURE2 GLenum
TEXTURE3 GLenum
TEXTURE4 GLenum
TEXTURE5 GLenum
TEXTURE6 GLenum
TEXTURE7 GLenum
TEXTURE8 GLenum
TEXTURE9 GLenum
TEXTURE10 GLenum
TEXTURE11 GLenum
TEXTURE12 GLenum
TEXTURE13 GLenum
TEXTURE14 GLenum
TEXTURE15 GLenum
TEXTURE16 GLenum
TEXTURE17 GLenum
TEXTURE18 GLenum
TEXTURE19 GLenum
TEXTURE20 GLenum
TEXTURE21 GLenum
TEXTURE22 GLenum
TEXTURE23 GLenum
TEXTURE24 GLenum
TEXTURE25 GLenum
TEXTURE26 GLenum
TEXTURE27 GLenum
TEXTURE28 GLenum
TEXTURE29 GLenum
TEXTURE30 GLenum
TEXTURE31 GLenum
ACTIVE_TEXTURE GLenum
REPEAT GLenum
CLAMP_TO_EDGE GLenum
MIRRORED_REPEAT GLenum
FLOAT_VEC2 GLenum
FLOAT_VEC3 GLenum
FLOAT_VEC4 GLenum
INT_VEC2 GLenum
INT_VEC3 GLenum
INT_VEC4 GLenum
BOOL GLenum
BOOL_VEC2 GLenum
BOOL_VEC3 GLenum
BOOL_VEC4 GLenum
FLOAT_MAT2 GLenum
FLOAT_MAT3 GLenum
FLOAT_MAT4 GLenum
SAMPLER_2D GLenum
SAMPLER_CUBE GLenum
VERTEX_ATTRIB_ARRAY_ENABLED GLenum
VERTEX_ATTRIB_ARRAY_SIZE GLenum
VERTEX_ATTRIB_ARRAY_STRIDE GLenum
VERTEX_ATTRIB_ARRAY_TYPE GLenum
VERTEX_ATTRIB_ARRAY_NORMALIZED GLenum
VERTEX_ATTRIB_ARRAY_POINTER GLenum
VERTEX_ATTRIB_ARRAY_BUFFER_BINDING GLenum
IMPLEMENTATION_COLOR_READ_TYPE GLenum
IMPLEMENTATION_COLOR_READ_FORMAT GLenum
COMPILE_STATUS GLenum
LOW_FLOAT GLenum
MEDIUM_FLOAT GLenum
HIGH_FLOAT GLenum
LOW_INT GLenum
MEDIUM_INT GLenum
HIGH_INT GLenum
FRAMEBUFFER GLenum
RENDERBUFFER GLenum
RGBA4 GLenum
RGB5_A1 GLenum
RGB565 GLenum
DEPTH_COMPONENT16 GLenum
STENCIL_INDEX8 GLenum
DEPTH_STENCIL GLenum
RENDERBUFFER_WIDTH GLenum
RENDERBUFFER_HEIGHT GLenum
RENDERBUFFER_INTERNAL_FORMAT GLenum
RENDERBUFFER_RED_SIZE GLenum
RENDERBUFFER_GREEN_SIZE GLenum
RENDERBUFFER_BLUE_SIZE GLenum
RENDERBUFFER_ALPHA_SIZE GLenum
RENDERBUFFER_DEPTH_SIZE GLenum
RENDERBUFFER_STENCIL_SIZE GLenum
FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE GLenum
FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL GLenum
FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE GLenum
COLOR_ATTACHMENT0 GLenum
DEPTH_ATTACHMENT GLenum
STENCIL_ATTACHMENT GLenum
DEPTH_STENCIL_ATTACHMENT GLenum
NONE GLenum
FRAMEBUFFER_COMPLETE GLenum
FRAMEBUFFER_INCOMPLETE_ATTACHMENT GLenum
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GLenum
FRAMEBUFFER_INCOMPLETE_DIMENSIONS GLenum
FRAMEBUFFER_UNSUPPORTED GLenum
FRAMEBUFFER_BINDING GLenum
RENDERBUFFER_BINDING GLenum
MAX_RENDERBUFFER_SIZE GLenum
INVALID_FRAMEBUFFER_OPERATION GLenum
UNPACK_FLIP_Y_WEBGL GLenum
UNPACK_PREMULTIPLY_ALPHA_WEBGL GLenum
CONTEXT_LOST_WEBGL GLenum
UNPACK_COLORSPACE_CONVERSION_WEBGL GLenum
BROWSER_DEFAULT_WEBGL GLenum
canvas HTMLCanvasElement | OffscreenCanvas
drawingBufferWidth GLsizei
drawingBufferHeight GLsizei

方法

方法 返回值类型
getContextAttributes() WebGLContextAttributes | null
isContextLost() boolean
getSupportedExtensions() string[] | null
getExtension(name: string) any
activeTexture(texture: GLenum) void
attachShader(program: WebGLProgram, shader: WebGLShader) void
bindAttribLocation(program: WebGLProgram, index: GLuint, name: string) void
bindBuffer(target: GLenum, buffer: WebGLBuffer | null) void
bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null) void
bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null) void
bindTexture(target: GLenum, texture: WebGLTexture | null) void
blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) void
blendEquation(mode: GLenum) void
blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) void
blendFunc(sfactor: GLenum, dfactor: GLenum) void
blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) void
checkFramebufferStatus(target: GLenum) GLenum
clear(mask: GLbitfield) void
clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) void
clearDepth(depth: GLclampf) void
clearStencil(s: GLint) void
colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) void
compileShader(shader: WebGLShader) void
copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) void
copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) void
createBuffer() WebGLBuffer | null
createFramebuffer() WebGLFramebuffer | null
createProgram() WebGLProgram | null
createRenderbuffer() WebGLRenderbuffer | null
createShader(type: GLenum) WebGLShader | null
createTexture() WebGLTexture | null
cullFace(mode: GLenum) void
deleteBuffer(buffer: WebGLBuffer | null) void
deleteFramebuffer(framebuffer: WebGLFramebuffer | null) void
deleteProgram(program: WebGLProgram | null) void
deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null) void
deleteShader(shader: WebGLShader | null) void
deleteTexture(texture: WebGLTexture | null) void
depthFunc(func: GLenum) void
depthMask(flag: GLboolean) void
depthRange(zNear: GLclampf, zFar: GLclampf) void
detachShader(program: WebGLProgram, shader: WebGLShader) void
disable(cap: GLenum) void
disableVertexAttribArray(index: GLuint) void
drawArrays(mode: GLenum, first: GLint, count: GLsizei) void
drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) void
enable(cap: GLenum) void
enableVertexAttribArray(index: GLuint) void
finish() void
flush() void
framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer | null) void
framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level: GLint) void
frontFace(mode: GLenum) void
generateMipmap(target: GLenum) void
getActiveAttrib(program: WebGLProgram, index: GLuint) WebGLActiveInfo | null
getActiveUniform(program: WebGLProgram, index: GLuint) WebGLActiveInfo | null
getAttachedShaders(program: WebGLProgram) WebGLShader[] | null
getAttribLocation(program: WebGLProgram, name: string) GLint
getBufferParameter(target: GLenum, pname: GLenum) any
getParameter(pname: GLenum) any
getError() GLenum
getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) any
getProgramParameter(program: WebGLProgram, pname: GLenum) any
getProgramInfoLog(program: WebGLProgram) string | null
getRenderbufferParameter(target: GLenum, pname: GLenum) any
getShaderParameter(shader: WebGLShader, pname: GLenum) any
getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) WebGLShaderPrecisionFormat | null
getShaderInfoLog(shader: WebGLShader) string | null
getShaderSource(shader: WebGLShader) string | null
getTexParameter(target: GLenum, pname: GLenum) any
getUniform(program: WebGLProgram, location: WebGLUniformLocation) any
getUniformLocation(program: WebGLProgram, name: string) WebGLUniformLocation | null
getVertexAttrib(index: GLuint, pname: GLenum) any
getVertexAttribOffset(index: GLuint, pname: GLenum) GLintptr
hint(target: GLenum, mode: GLenum) void
isBuffer(buffer: WebGLBuffer | null) GLboolean
isEnabled(cap: GLenum) GLboolean
isFramebuffer(framebuffer: WebGLFramebuffer | null) GLboolean
isProgram(program: WebGLProgram | null) GLboolean
isRenderbuffer(renderbuffer: WebGLRenderbuffer | null) GLboolean
isShader(shader: WebGLShader | null) GLboolean
isTexture(texture: WebGLTexture | null) GLboolean
lineWidth(width: GLfloat) void
linkProgram(program: WebGLProgram) void
pixelStorei(pname: GLenum, param: GLint | GLboolean) void
polygonOffset(factor: GLfloat, units: GLfloat) void
renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) void
sampleCoverage(value: GLclampf, invert: GLboolean) void
scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) void
shaderSource(shader: WebGLShader, source: string) void
stencilFunc(func: GLenum, ref: GLint, mask: GLuint) void
stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) void
stencilMask(mask: GLuint) void
stencilMaskSeparate(face: GLenum, mask: GLuint) void
stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) void
stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) void
texParameterf(target: GLenum, pname: GLenum, param: GLfloat) void
texParameteri(target: GLenum, pname: GLenum, param: GLint) void
uniform1f(location: WebGLUniformLocation | null, x: GLfloat) void
uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat) void
uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat) void
uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) void
uniform1i(location: WebGLUniformLocation | null, x: GLint) void
uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint) void
uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint) void
uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint) void
useProgram(program: WebGLProgram | null) void
validateProgram(program: WebGLProgram) void
vertexAttrib1f(index: GLuint, x: GLfloat) void
vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) void
vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) void
vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) void
vertexAttrib1fv(index: GLuint, values: Float32List) void
vertexAttrib2fv(index: GLuint, values: Float32List) void
vertexAttrib3fv(index: GLuint, values: Float32List) void
vertexAttrib4fv(index: GLuint, values: Float32List) void
vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) void
viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) void

WebGLRenderingContextOverloads

WebGLRenderingContextOverloads

方法 返回值类型
bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) void
bufferData(target: GLenum, data: BufferSource | null, usage: GLenum) void
bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) void
compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) void
compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) void
readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null) void
texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null) void
texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) void
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null) void
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) void
uniform1fv(location: WebGLUniformLocation | null, v: Float32List) void
uniform2fv(location: WebGLUniformLocation | null, v: Float32List) void
uniform3fv(location: WebGLUniformLocation | null, v: Float32List) void
uniform4fv(location: WebGLUniformLocation | null, v: Float32List) void
uniform1iv(location: WebGLUniformLocation | null, v: Int32List) void
uniform2iv(location: WebGLUniformLocation | null, v: Int32List) void
uniform3iv(location: WebGLUniformLocation | null, v: Int32List) void
uniform4iv(location: WebGLUniformLocation | null, v: Int32List) void
uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List) void
uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List) void
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List) void