<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKTexture/init(vectorNoiseWithSmoothness:size:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKTexture(cm)textureVectorNoiseWithSmoothness:size:"
  },
  "title" : "init(vectorNoiseWithSmoothness:size:)"
}
-->

# init(vectorNoiseWithSmoothness:size:)

Creates a new texture whose contents are procedurally generated directional noise data.

```
convenience init(vectorNoiseWithSmoothness smoothness: CGFloat, size: CGSize)
```

## 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.

`size`

The size of the new texture in points.

## Return Value

A new noise texture.

## Discussion

The noise texture is tileable with itself. The RGB values stored in the texture can be used as directional (XYZ) data. The alpha values are also randomized and can be used as magnitude data, if desired.

The following Swift code creates three sprite nodes with textures generated by

[`init(vectorNoiseWithSmoothness:size:)`](/documentation/SpriteKit/SKTexture/init(vectorNoiseWithSmoothness:size:))

with smoothness values of `0.0`, `0.5` and `1.0`.

```swift
let columWidth = scene.size.width / 3

for i in 0...2 {
    
    let size = CGSize(width: ceil(columWidth),
                      height: 0.5 * scene.size.height)
    
    let smoothness = CGFloat(i) / 2
    
    let vectorTexture = SKTexture(vectorNoiseWithSmoothness: smoothness,
                                  size: size)
    
    let sprite = SKSpriteNode(texture: vectorTexture, size: size)
    
    sprite.position = CGPoint(x: CGFloat(i) * columWidth + (columWidth / 2),
                              y: 
scene.size.height / 2)

    
    scene.addChild(sprite)
}
```

![Vector noise with smoothness values of 0.0, 0.5 and 1.0](images/com.apple.spritekit/media-2663442@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)