---
title: "applyTurbulence(frequency:power:roughness:seed:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gknoise/applyturbulence(frequency:power:roughness:seed:)"
---

# applyTurbulence(frequency:power:roughness:seed:)

Replaces values in the noise field by applying a randomized distortion effect.

## Declaration

```swift
func applyTurbulence(frequency: Double, power: Double, roughness: Int32, seed: Int32)
```

## Parameters

- `frequency`: A value that determines how often (per unit area) the amount of distortion changes.
- `power`: A value that determines the magnitude of distortion applied.
- `roughness`: A value that determines the rate of change in distortion amounts over the noise field. Lower values result in smooth transitions between more-distorted and less-distorted regions; higher values result in rapid, rough transitions.
- `seed`: A value that governs the randomization of the turbulence effect. Passing the same seed value for multiple calls to this method results in the same general structure of turbulence (modulated by the other parameters).

## Discussion

Discussion Applying turbulence randomly distorts areas of the noise field, resulting in more natural-looking textures. This method is equivalent to using the displaceWithNoises(x:y:z:) method with three noise fields generated by the GKPerlinNoiseSource class.

The frequency and power parameters are closely related: Low frequency and low power results in very minor changes to the original noise field. Low frequency and high power adds elongated, twisting features to the original noise field. High frequency and low power results in a rougher version of the original noise field. High frequency and high power tend toward completely random noise. tip: For natural-looking results when applying turbulence to GKCoherentNoiseSource output, start with a frequency parameter 2-4 times the frequency value of the noise source and a power parameter that is the reciprocal of that frequency. Then experiment with slight variations to each parameter to find a desired effect.

## See Also

### Applying Operations that Distort Noise

- [displaceWithNoises(x:y:z:)](gameplaykit/gknoise/displacewithnoises(x:y:z:).md)
