Contents

MTLTessellationPartitionMode

Options for choosing the partition mode that the tessellator applies when deriving the number and spacing of segments for subdividing a corresponding edge.

Declaration

enum MTLTessellationPartitionMode

Overview

The table lists the tessellation factor range for each partitioning mode.

Partitioning mode

Tessellation factor range

Pow2

[1, Maxtessellationfactor]

Integer

[1, Maxtessellationfactor]

Fractionalodd

[1, Maxtessellationfactor-1]

Fractionaleven

[2, Maxtessellationfactor]

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 needs to 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

Partition modes

Initializers

See Also

Specifying tessellation state