Instance Method

setScissorRect:

Sets the scissor rectangle for a fragment scissor test.

Required.

Declaration

- (void)setScissorRect:(MTLScissorRect)rect;

Parameters

rect

The scissor rectangle used for a fragment scissor test.

Discussion

The scissor rectangle must lie entirely within the current attachment. The rendering pipeline discards fragments that lie outside the scissor rectangle.

The default value is (0, 0, width, height), where width and height are the x and y dimensions of the attachment, respectively.

Calling setScissorRect: after calling setScissorRects:count:, and vice versa, overrides previously set scissor rectangles.

See Also

Setting Viewport and Scissor Behavior

Rendering to Multiple Viewports in a Draw Command

Select viewports and their corresponding scissor rectangles in your vertex shader.

- setViewport:

Sets the viewport used for transformations and clipping.

Required.

- setViewports:count:

Sets an array of viewports.

Required.

- setScissorRects:count:

Sets an array of scissor rectangles.

Required.

MTLViewport

A 3D rectangular region for the viewport clipping.

MTLScissorRect

A rectangle for the scissor fragment test.