WebGL Wiki
Advertisement

Definition[]

The clear() method clears buffers to preset values specified by clearColor(), clearDepth() and clearStencil().

Syntax[]

gl.clear(mask)

Parameters[]

Examples[]

// Clears the color and depth buffers
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
// Clears the depth buffer
gl.clear(gl.DEPTH_BUFFER_BIT);

See also[]

Advertisement