---
title: "init(scalarNoiseWithSmoothness:name:textureDimensions:channelCount:channelEncoding:grayscale:)"
framework: modelio
role: symbol
role_heading: Initializer
path: "modelio/mdlnoisetexture/init(scalarnoisewithsmoothness:name:texturedimensions:channelcount:channelencoding:grayscale:)"
---

# init(scalarNoiseWithSmoothness:name:textureDimensions:channelCount:channelEncoding:grayscale:)

Initializes a noise texture that creates random color noise.

## Declaration

```swift
init(scalarNoiseWithSmoothness smoothness: Float, name: String?, textureDimensions: vector_int2, channelCount: Int32, channelEncoding: MDLTextureChannelEncoding, grayscale: Bool)
```

## Parameters

- `smoothness`: 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.
- `name`: The doc://com.apple.modelio/documentation/ModelIO/MDLNamed/name property for the new texture object.
- `textureDimensions`: The texel dimensions (width and height) of the texture image.
- `channelCount`: The number of channels per texel—for example, 1 for a grayscale texture, 3 for an RGB color texture, or 4 for RGBA.
- `channelEncoding`: The data format for each channel value per texel—for example, 8-bit integer or 32-bit floating point. For possible values, see doc://com.apple.modelio/documentation/ModelIO/MDLTextureChannelEncoding.
- `grayscale`: If doc://com.apple.documentation/documentation/Swift/true, all four components of each texel will have equal values. If doc://com.apple.documentation/documentation/Swift/false, all four values are completely randomized.

## Return Value

Return Value A new color noise texture object.

## Discussion

Discussion 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

- [init(vectorNoiseWithSmoothness:name:textureDimensions:channelEncoding:)](modelio/mdlnoisetexture/init(vectornoisewithsmoothness:name:texturedimensions:channelencoding:).md)
