WebGLRenderingContext.disable()
方法在
WebGL API
disables specific WebGL capabilities for this context.
void gl.disable(cap);
cap
GLenum
specifying which WebGL capability to disable. Possible values:
| 常量 | 描述 |
|---|---|
gl.BLEND
|
Deactivates blending of the computed fragment color values. See
WebGLRenderingContext.blendFunc()
.
|
gl.CULL_FACE
|
Deactivates culling of polygons. See
WebGLRenderingContext.cullFace()
.
|
gl.DEPTH_TEST
|
Deactivates depth comparisons and updates to the depth buffer. See
WebGLRenderingContext.depthFunc()
.
|
gl.DITHER
|
Deactivates dithering of color components before they get written to the color buffer. |
gl.POLYGON_OFFSET_FILL
|
Deactivates adding an offset to depth values of polygon's fragments. See
WebGLRenderingContext.polygonOffset()
.
|
gl.SAMPLE_ALPHA_TO_COVERAGE
|
Deactivates the computation of a temporary coverage value determined by the alpha value. |
gl.SAMPLE_COVERAGE
|
Deactivates ANDing the fragment's coverage with the temporary coverage value. See
WebGLRenderingContext.sampleCoverage()
.
|
gl.SCISSOR_TEST
|
Deactivates the scissor test that discards fragments that are outside of the scissor rectangle. See
WebGLRenderingContext.scissor()
.
|
gl.STENCIL_TEST
|
Deactivates stencil testing and updates to the stencil buffer. See
WebGLRenderingContext.stencilFunc()
.
|
| 常量 | 描述 |
|---|---|
gl.RASTERIZER_DISCARD
|
Deactivates that primitives are discarded immediately before the rasterization stage, but after the optional transform feedback stage.
gl.clear()
commands are ignored.
|
None.
gl.disable(gl.DITHER);
To check if a capability is disabled, use the
WebGLRenderingContext.isEnabled()
方法:
gl.isEnabled(gl.DITHER); // false
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebGL 1.0
The definition of 'disable' in that specification. |
推荐 | Initial definition for WebGL. |
|
OpenGL ES 2.0
The definition of 'glDisable' in that specification. |
标准 | Man page of the (similar) OpenGL ES 2.0 API. |
|
OpenGL ES 3.0
The definition of 'glDisable' in that specification. |
标准 | Man page of the (similar) OpenGL ES 3.0 API. |
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
更新 GitHub 上的兼容性数据| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
disable
|
Chrome 9 | Edge 12 | Firefox 4 | IE 11 | Opera 12 | Safari 5.1 | WebView Android Yes | Chrome Android 25 | Firefox Android Yes | Opera Android 12 | Safari iOS 8 | Samsung Internet Android 1.5 |
完整支持
WebGLRenderingContext
activeTexture()
attachShader()
bindAttribLocation()
bindBuffer()
bindFramebuffer()
bindRenderbuffer()
bindTexture()
blendColor()
blendEquation()
blendEquationSeparate()
blendFunc()
blendFuncSeparate()
bufferData()
bufferSubData()
checkFramebufferStatus()
clear()
clearColor()
clearDepth()
clearStencil()
colorMask()
commit()
compileShader()
compressedTexImage[23]D()
compressedTexSubImage2D()
copyTexImage2D()
copyTexSubImage2D()
createBuffer()
createFramebuffer()
createProgram()
createRenderbuffer()
createShader()
createTexture()
cullFace()
deleteBuffer()
deleteFramebuffer()
deleteProgram()
deleteRenderbuffer()
deleteShader()
deleteTexture()
depthFunc()
depthMask()
depthRange()
detachShader()
disable()
disableVertexAttribArray()
drawArrays()
drawElements()
enable()
enableVertexAttribArray()
finish()
flush()
framebufferRenderbuffer()
framebufferTexture2D()
frontFace()
generateMipmap()
getActiveAttrib()
getActiveUniform()
getAttachedShaders()
getAttribLocation()
getBufferParameter()
getContextAttributes()
getError()
getExtension()
getFramebufferAttachmentParameter()
getParameter()
getProgramInfoLog()
getProgramParameter()
getRenderbufferParameter()
getShaderInfoLog()
getShaderParameter()
getShaderPrecisionFormat()
getShaderSource()
getSupportedExtensions()
getTexParameter()
getUniform()
getUniformLocation()
getVertexAttrib()
getVertexAttribOffset()
hint()
isBuffer()
isContextLost()
isEnabled()
isFramebuffer()
isProgram()
isRenderbuffer()
isShader()
isTexture()
lineWidth()
linkProgram()
pixelStorei()
polygonOffset()
readPixels()
renderbufferStorage()
sampleCoverage()
scissor()
shaderSource()
stencilFunc()
stencilFuncSeparate()
stencilMask()
stencilMaskSeparate()
stencilOp()
stencilOpSeparate()
texImage2D()
texParameter[fi]()
texSubImage2D()
uniform[1234][fi][v]()
uniformMatrix[234]fv()
useProgram()
validateProgram()
vertexAttrib[1234]f[v]()
vertexAttribPointer()
viewport()
ANGLE_instanced_arrays
EXT_blend_minmax
EXT_color_buffer_half_float
EXT_disjoint_timer_query
EXT_frag_depth
EXT_sRGB
EXT_shader_texture_lod
EXT_texture_filter_anisotropic
OES_element_index_uint
OES_standard_derivatives
OES_texture_float
OES_texture_float_linear
OES_texture_half_float
OES_texture_half_float_linear
OES_vertex_array_object
WEBGL_color_buffer_float
WEBGL_compressed_texture_atc
WEBGL_compressed_texture_etc1
WEBGL_compressed_texture_pvrtc
WEBGL_compressed_texture_s3tc
WEBGL_compressed_texture_s3tc_srgb
WEBGL_debug_renderer_info
WEBGL_debug_shaders
WEBGL_depth_texture
WEBGL_draw_buffers
WEBGL_lose_context
WebGL2RenderingContext
WebGLActiveInfo
WebGLBuffer
WebGLContextEvent
WebGLFramebuffer
WebGLObject
WebGLProgram
WebGLQuery
WebGLRenderbuffer
WebGLSampler
WebGLShader
WebGLShaderPrecisionFormat
WebGLSync
WebGLTexture
WebGLTransformFeedback
WebGLUniformLocation
WebGLVertexArrayObject