Creates a texture from the specified noise map.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
The noise map object from which to generate a texture.
A new texture based on the contents of the noise map.
GKNoise class encapsulates the output of procedural noise generation and processing. You use noise sources (the
GKNoise class cluster), noise objects (the
GKNoise class), and noise maps to generate, process, and combine styles of noise, then use this method to create a graphical representation of the noise for use as a texture image in your game. Noise textures can be useful for imitating natural phenomena such as clouds, stone surfaces, and wood grain. You can also use noise textures as normal maps to make surfaces appear more natural under lighting.
This method colorizes the generated texture using the
gradient property of the
GKNoise object from which the noise map was created. By default, that property specifies a simple grayscale ramp, but you can change it to create more colorful textures. When you use the
init(component method to combine noise objects, each component noise object keeps its original colors, and the selection noise determines which component noise’s colors appear in which areas of a generated texture.
The following code shows how to create a texture based on Perlin noise:
The following image illustrates a sprite node using this texture as both arguments for