Instance Method


Initializes a noise texture that creates random color noise.


- (instancetype)initScalarNoiseWithSmoothness:(float)smoothness name:(NSString *)name textureDimensions:(vector_int2)textureDimensions channelCount:(int)channelCount channelEncoding:(MDLTextureChannelEncoding)channelEncoding grayscale:(BOOL)grayscale;



A value that indicates how similar neighboring texels will be in the resulting texture. The value should be between 0.0 and 1.0. A value of 1.0 generates a smooth surface.


The name property for the new texture object.


The texel dimensions (width and height) of the texture image.


The number of channels per texel—for example, 1 for a grayscale texture, 3 for an RGB color texture, or 4 for RGBA.


The data format for each channel value per texel—for example, 8-bit integer or 32-bit floating point. For possible values, see MDLTextureChannelEncoding.


If YES, all four components of each texel will have equal values. If NO, all four values are completely randomized.

Return Value

A new color noise texture object.


A color noise texture has random values for each color channel and can be tiled or mirrored without showing visible borders.

This initializer does not generate texel data; the MDLNoiseTexture class automatically generates data and caches it for reuse when you use one of the MDLTexture methods listed in Accessing Texture Data.

See Also

Creating a Noise Texture

- initVectorNoiseWithSmoothness:name:textureDimensions:channelEncoding:

Initializes a noise texture that creates random directional noise.