Enumeration

MTLTessellationPartitionMode

The partitioning mode used by the tessellator to derive the number and spacing of segments used to subdivide a corresponding edge.

Declaration

enum MTLTessellationPartitionMode : UInt

Overview

Table 1 lists the tessellation factor range for each partitioning mode.

Table 1

Tessellation factor range for each partitioning mode

The floating-point tessellation level is always clamped to its corresponding range before calculating the final tessellation factor. After clamping, the calculation depends on the chosen partitioning mode:

  • For the MTLTessellationPartitionMode.pow2 partitioning mode, the result is rounded up to the nearest integer n, where n is a power of two. The corresponding edge is divided into n segments of equal length in (u, v) space.

  • For the MTLTessellationPartitionMode.integer partitioning mode, the result is rounded up to the nearest integer n. The corresponding edge is divided into n segments of equal length in (u, v) space.

  • For the MTLTessellationPartitionMode.fractionalOdd partitioning mode, the tessellation level is rounded up the the nearest odd integer n. If n is 1, the edge is not subdivided. Otherwise, the corresponding edge is divided into n-2 segments of equal length, and two additional segments of equal length that are typically shorter than the other segments. The length of the two additional segments relative to the others decreases monotonically by the value of n-f, where f is the clamped floating-point tessellation level. If n-f is 0 the additional segments equal length to the other segments. As n-f approaches 2, the relative length of the additional segments approaches 0. The two additional segments should be placed symmetrically on opposite sides of the subdivided edge. The relative location of these two segments is undefined, but must be identical for any pair of subdivided edges with identical values of f.

  • For the MTLTessellationPartitionMode.fractionalEven partitioning mode, the tessellation level is rounded up the the nearest even integer n.

Topics

Constants

case pow2

A power of two partitioning mode.

case integer

An integer partitioning mode.

case fractionalOdd

A fractional odd partitioning mode.

case fractionalEven

A fractional even partitioning mode.

See Also

Specifying Tessellation State

var maxTessellationFactor: Int

Specifies the maximum tessellation factor to be used by the tessellator when tessellating a patch (or patches).

var isTessellationFactorScaleEnabled: Bool

Determines whether the tessellation factor is scaled.

var tessellationFactorFormat: MTLTessellationFactorFormat

The format of the tessellation factors specified in the tessellation factor buffer.

var tessellationControlPointIndexType: MTLTessellationControlPointIndexType

The size of the control point indices in a control point index buffer.

var tessellationFactorStepFunction: MTLTessellationFactorStepFunction

The step function used to determine the tessellation factors for a patch from the tessellation factor buffer.

var tessellationOutputWindingOrder: MTLWinding

The winding order of triangles output by the tessellator.

var tessellationPartitionMode: MTLTessellationPartitionMode

The partitioning mode used by the tessellator to derive the number and spacing of segments used to subdivide a corresponding edge.

enum MTLTessellationFactorFormat

The format of the tessellation factors in a tessellation factor buffer.

enum MTLTessellationControlPointIndexType

The size of the control point indices in a control point index buffer.

enum MTLTessellationFactorStepFunction

The step function used to determine the tessellation factors for a patch from the tessellation factor buffer.