- Vertex Specification
- Vertex Processing
- Vertex Post-Processing
- Primitive Assembly
- Fragment Shader
- Per-Sample Processing
To define the scissor box, use this function:
The x and y is the window-space lower-left position of the scissor box, and width and height define the size of the rectangle.
Simply setting the rectangle is not enough. To actually discard fragments outside of this region, you must activate scissoring. This is done by enabling GL_SCISSOR_TEST.
|Core in version||4.4|
|Core since version||4.1|
|Core ARB extension||ARB_viewport_array|
To set the scissor box for a specific viewport, use one of these functions:
void glScissorIndexed(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);void glScissorIndexedv(GLuint index, const GLint *v);
index must be less than GL_MAX_VIEWPORTS. The array version takes 4 integers, in the same order as the parameters for glScissorIndexed.
The scissor box for several viewports can be set with this function:
This sets each viewport's scissor box starting from first up to (but not including) first + count. v is an array, where every 4 elements of the array are the scissor box for a single viewport. Therefore, v is expected to contain 4 * count elements.