Contents

remapValues(toTerracesWithPeaks:terracesInverted:)

Replaces values in the noise field by mapping them to a terrace-like curve that passes through the specified control points.

Declaration

func remapValues(toTerracesWithPeaks peakInputValues: [NSNumber], terracesInverted inverted: Bool)

Parameters

  • peakInputValues:

    An array of noise values to use as the sharp points of the mapping curve.

  • inverted:

    True for curves that start rising slowly and become more steep; False for curves that start rising quickly and become more shallow.

Discussion

When you call this method, the GKNoise class first creates a curve between the points in the peakInputValues array. Each point in the array is a value that remains unchanged, and the inverted parameter determines the shape of the curve in between those points. Then, this method uses the curve to replace values in the noise field. The resulting effect can be useful for generating textures that resemble realistic terrain, replacing sloping hills with dramatic plateaus and ridges.

[Image]

See Also

Applying Operations to Noise Values