// turn on scissor test
gl.enable(gl.SCISSOR_TEST);
// set the scissor rectangle
gl.scissor(x, y, width, height);
// execute drawing commands in the scissor box (e.g. clear)
// turn off scissor test again
gl.disable(gl.SCISSOR_TEST);WebGLRenderingContext: scissor() method / notebook
WebGLRenderingContext: scissor() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
gl.scissor(0, 0, 200, 200);
gl.getParameter(gl.SCISSOR_BOX);
// Int32Array[0, 0, 200, 200]