图形绘制的能力

2024-01-23 13:22 更新

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

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

说明

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

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

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

调用方式

hml内创建canvas,示例如下:

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

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

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

Type

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

表1 Type

名称类型
GLenumnumber
GLbooleanboolean
GLbitfieldnumber
GLbytenumber
GLshortnumber
GLintnumber
GLsizeinumber
GLintptrnumber
GLsizeiptrnumber
GLubytenumber
GLushortnumber
GLuintnumber
GLfloatnumber
GLclampfnumber
TexImageSourceImageData
Float32Listarray
Int32Listarray
WebGLPowerPreferencestring

Interface

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

表2 Interface

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

WebGLContextAttributes

WebGLContextAttributes

名称参数类型必填
alphaboolean
depthboolean
stencilboolean
antialiasboolean
premultipliedAlphaboolean
preserveDrawingBufferboolean
powerPreferenceWebGLPowerPreference
failIfMajorPerformanceCaveatboolean
desynchronizedboolean

WebGLActiveInfo

WebGLActiveInfo

名称参数类型必填
sizeGLint
typeGLenum
namestring

WebGLShaderPrecisionFormat

WebGLShaderPrecisionFormat

名称参数类型必填
rangeMinGLint
rangeMaxGLint
precisionGLint

WebGLRenderingContextBase

WebGLRenderingContextBase

属性

名称参数类型必填
DEPTH_BUFFER_BITGLenum
STENCIL_BUFFER_BITGLenum
COLOR_BUFFER_BITGLenum
POINTSGLenum
LINESGLenum
LINE_LOOPGLenum
LINE_STRIPGLenum
TRIANGLESGLenum
TRIANGLE_STRIPGLenum
TRIANGLE_FANGLenum
ZEROGLenum
ONEGLenum
SRC_COLORGLenum
ONE_MINUS_SRC_COLORGLenum
SRC_ALPHAGLenum
ONE_MINUS_SRC_ALPHAGLenum
DST_ALPHAGLenum
ONE_MINUS_DST_ALPHAGLenum
DST_COLORGLenum
ONE_MINUS_DST_COLORGLenum
SRC_ALPHA_SATURATEGLenum
FUNC_ADDGLenum
BLEND_EQUATIONGLenum
BLEND_EQUATION_RGBGLenum
BLEND_EQUATION_ALPHAGLenum
FUNC_SUBTRACTGLenum
FUNC_REVERSE_SUBTRACTGLenum
BLEND_DST_RGBGLenum
BLEND_SRC_RGBGLenum
BLEND_DST_ALPHAGLenum
BLEND_SRC_ALPHAGLenum
CONSTANT_COLORGLenum
ONE_MINUS_CONSTANT_COLORGLenum
CONSTANT_ALPHAGLenum
ONE_MINUS_CONSTANT_ALPHAGLenum
BLEND_COLORGLenum
ARRAY_BUFFERGLenum
ELEMENT_ARRAY_BUFFERGLenum
ARRAY_BUFFER_BINDINGGLenum
ELEMENT_ARRAY_BUFFER_BINDINGGLenum
STREAM_DRAWGLenum
STATIC_DRAWGLenum
DYNAMIC_DRAWGLenum
BUFFER_SIZEGLenum
BUFFER_USAGEGLenum
CURRENT_VERTEX_ATTRIBGLenum
FRONTGLenum
BACKGLenum
FRONT_AND_BACKGLenum
CULL_FACEGLenum
BLENDGLenum
DITHERGLenum
STENCIL_TESTGLenum
DEPTH_TESTGLenum
SCISSOR_TESTGLenum
POLYGON_OFFSET_FILLGLenum
SAMPLE_ALPHA_TO_COVERAGEGLenum
SAMPLE_COVERAGEGLenum
NO_ERRORGLenum
INVALID_ENUMGLenum
INVALID_VALUEGLenum
INVALID_OPERATIONGLenum
OUT_OF_MEMORYGLenum
CWGLenum
CCWGLenum
LINE_WIDTHGLenum
ALIASED_POINT_SIZE_RANGEGLenum
ALIASED_LINE_WIDTH_RANGEGLenum
CULL_FACE_MODEGLenum
FRONT_FACEGLenum
DEPTH_RANGEGLenum
DEPTH_WRITEMASKGLenum
DEPTH_CLEAR_VALUEGLenum
DEPTH_FUNCGLenum
STENCIL_CLEAR_VALUEGLenum
STENCIL_FUNCGLenum
STENCIL_FAILGLenum
STENCIL_PASS_DEPTH_FAILGLenum
STENCIL_PASS_DEPTH_PASSGLenum
STENCIL_REFGLenum
STENCIL_VALUE_MASKGLenum
STENCIL_WRITEMASKGLenum
STENCIL_BACK_FUNCGLenum
STENCIL_BACK_FAILGLenum
STENCIL_BACK_PASS_DEPTH_FAILGLenum
STENCIL_BACK_PASS_DEPTH_PASSGLenum
STENCIL_BACK_REFGLenum
STENCIL_BACK_VALUE_MASKGLenum
STENCIL_BACK_WRITEMASKGLenum
VIEWPORTGLenum
SCISSOR_BOXGLenum
COLOR_CLEAR_VALUEGLenum
COLOR_WRITEMASKGLenum
UNPACK_ALIGNMENTGLenum
PACK_ALIGNMENTGLenum
MAX_TEXTURE_SIZEGLenum
MAX_VIEWPORT_DIMSGLenum
SUBPIXEL_BITSGLenum
RED_BITSGLenum
GREEN_BITSGLenum
BLUE_BITSGLenum
ALPHA_BITSGLenum
DEPTH_BITSGLenum
STENCIL_BITSGLenum
POLYGON_OFFSET_UNITSGLenum
POLYGON_OFFSET_FACTORGLenum
TEXTURE_BINDING_2DGLenum
SAMPLE_BUFFERSGLenum
SAMPLESGLenum
SAMPLE_COVERAGE_VALUEGLenum
SAMPLE_COVERAGE_INVERTGLenum
COMPRESSED_TEXTURE_FORMATSGLenum
DONT_CAREGLenum
FASTESTGLenum
NICESTGLenum
GENERATE_MIPMAP_HINTGLenum
BYTEGLenum
UNSIGNED_BYTEGLenum
SHORTGLenum
UNSIGNED_SHORTGLenum
INTGLenum
UNSIGNED_INTGLenum
FLOATGLenum
DEPTH_COMPONENTGLenum
ALPHAGLenum
RGBGLenum
RGBAGLenum
LUMINANCEGLenum
LUMINANCE_ALPHAGLenum
UNSIGNED_SHORT_4_4_4_4GLenum
UNSIGNED_SHORT_5_5_5_1GLenum
UNSIGNED_SHORT_5_6_5GLenum
FRAGMENT_SHADERGLenum
VERTEX_SHADERGLenum
MAX_VERTEX_ATTRIBSGLenum
MAX_VERTEX_UNIFORM_VECTORSGLenum
MAX_VARYING_VECTORSGLenum
MAX_COMBINED_TEXTURE_IMAGE_UNITSGLenum
MAX_VERTEX_TEXTURE_IMAGE_UNITSGLenum
MAX_TEXTURE_IMAGE_UNITSGLenum
MAX_FRAGMENT_UNIFORM_VECTORSGLenum
SHADER_TYPEGLenum
DELETE_STATUSGLenum
LINK_STATUSGLenum
VALIDATE_STATUSGLenum
ATTACHED_SHADERSGLenum
ACTIVE_UNIFORMSGLenum
ACTIVE_ATTRIBUTESGLenum
SHADING_LANGUAGE_VERSIONGLenum
CURRENT_PROGRAMGLenum
NEVERGLenum
LESSGLenum
EQUALGLenum
LEQUALGLenum
GREATERGLenum
NOTEQUALGLenum
GEQUALGLenum
ALWAYSGLenum
KEEPGLenum
REPLACEGLenum
INCRGLenum
DECRGLenum
INVERTGLenum
INCR_WRAPGLenum
DECR_WRAPGLenum
VENDORGLenum
RENDERERGLenum
VERSIONGLenum
NEARESTGLenum
LINEARGLenum
NEAREST_MIPMAP_NEARESTGLenum
LINEAR_MIPMAP_NEARESTGLenum
NEAREST_MIPMAP_LINEARGLenum
LINEAR_MIPMAP_LINEARGLenum
TEXTURE_MIN_FILTERGLenum
TEXTURE_WRAP_SGLenum
TEXTURE_WRAP_TGLenum
TEXTURE_2DGLenum
TEXTUREGLenum
TEXTURE_CUBE_MAPGLenum
TEXTURE_BINDING_CUBE_MAPGLenum
TEXTURE_CUBE_MAP_POSITIVE_XGLenum
TEXTURE_CUBE_MAP_NEGATIVE_XGLenum
TEXTURE_CUBE_MAP_POSITIVE_YGLenum
TEXTURE_CUBE_MAP_NEGATIVE_YGLenum
TEXTURE_CUBE_MAP_POSITIVE_ZGLenum
TEXTURE_CUBE_MAP_NEGATIVE_ZGLenum
MAX_CUBE_MAP_TEXTURE_SIZEGLenum
TEXTURE0GLenum
TEXTURE1GLenum
TEXTURE2GLenum
TEXTURE3GLenum
TEXTURE4GLenum
TEXTURE5GLenum
TEXTURE6GLenum
TEXTURE7GLenum
TEXTURE8GLenum
TEXTURE9GLenum
TEXTURE10GLenum
TEXTURE11GLenum
TEXTURE12GLenum
TEXTURE13GLenum
TEXTURE14GLenum
TEXTURE15GLenum
TEXTURE16GLenum
TEXTURE17GLenum
TEXTURE18GLenum
TEXTURE19GLenum
TEXTURE20GLenum
TEXTURE21GLenum
TEXTURE22GLenum
TEXTURE23GLenum
TEXTURE24GLenum
TEXTURE25GLenum
TEXTURE26GLenum
TEXTURE27GLenum
TEXTURE28GLenum
TEXTURE29GLenum
TEXTURE30GLenum
TEXTURE31GLenum
ACTIVE_TEXTUREGLenum
REPEATGLenum
CLAMP_TO_EDGEGLenum
MIRRORED_REPEATGLenum
FLOAT_VEC2GLenum
FLOAT_VEC3GLenum
FLOAT_VEC4GLenum
INT_VEC2GLenum
INT_VEC3GLenum
INT_VEC4GLenum
BOOLGLenum
BOOL_VEC2GLenum
BOOL_VEC3GLenum
BOOL_VEC4GLenum
FLOAT_MAT2GLenum
FLOAT_MAT3GLenum
FLOAT_MAT4GLenum
SAMPLER_2DGLenum
SAMPLER_CUBEGLenum
VERTEX_ATTRIB_ARRAY_ENABLEDGLenum
VERTEX_ATTRIB_ARRAY_SIZEGLenum
VERTEX_ATTRIB_ARRAY_STRIDEGLenum
VERTEX_ATTRIB_ARRAY_TYPEGLenum
VERTEX_ATTRIB_ARRAY_NORMALIZEDGLenum
VERTEX_ATTRIB_ARRAY_POINTERGLenum
VERTEX_ATTRIB_ARRAY_BUFFER_BINDINGGLenum
IMPLEMENTATION_COLOR_READ_TYPEGLenum
IMPLEMENTATION_COLOR_READ_FORMATGLenum
COMPILE_STATUSGLenum
LOW_FLOATGLenum
MEDIUM_FLOATGLenum
HIGH_FLOATGLenum
LOW_INTGLenum
MEDIUM_INTGLenum
HIGH_INTGLenum
FRAMEBUFFERGLenum
RENDERBUFFERGLenum
RGBA4GLenum
RGB5_A1GLenum
RGB565GLenum
DEPTH_COMPONENT16GLenum
STENCIL_INDEX8GLenum
DEPTH_STENCILGLenum
RENDERBUFFER_WIDTHGLenum
RENDERBUFFER_HEIGHTGLenum
RENDERBUFFER_INTERNAL_FORMATGLenum
RENDERBUFFER_RED_SIZEGLenum
RENDERBUFFER_GREEN_SIZEGLenum
RENDERBUFFER_BLUE_SIZEGLenum
RENDERBUFFER_ALPHA_SIZEGLenum
RENDERBUFFER_DEPTH_SIZEGLenum
RENDERBUFFER_STENCIL_SIZEGLenum
FRAMEBUFFER_ATTACHMENT_OBJECT_TYPEGLenum
FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVELGLenum
FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACEGLenum
COLOR_ATTACHMENT0GLenum
DEPTH_ATTACHMENTGLenum
STENCIL_ATTACHMENTGLenum
DEPTH_STENCIL_ATTACHMENTGLenum
NONEGLenum
FRAMEBUFFER_COMPLETEGLenum
FRAMEBUFFER_INCOMPLETE_ATTACHMENTGLenum
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENTGLenum
FRAMEBUFFER_INCOMPLETE_DIMENSIONSGLenum
FRAMEBUFFER_UNSUPPORTEDGLenum
FRAMEBUFFER_BINDINGGLenum
RENDERBUFFER_BINDINGGLenum
MAX_RENDERBUFFER_SIZEGLenum
INVALID_FRAMEBUFFER_OPERATIONGLenum
UNPACK_FLIP_Y_WEBGLGLenum
UNPACK_PREMULTIPLY_ALPHA_WEBGLGLenum
CONTEXT_LOST_WEBGLGLenum
UNPACK_COLORSPACE_CONVERSION_WEBGLGLenum
BROWSER_DEFAULT_WEBGLGLenum
canvasHTMLCanvasElement | OffscreenCanvas
drawingBufferWidthGLsizei
drawingBufferHeightGLsizei

方法

方法返回值类型
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
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号