Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tayloraswift/swift-noise

Generate and compose commonly-used procedural noises and distributions, in pure Swift
https://github.com/tayloraswift/swift-noise

graphics perlin-noise poisson-disc-sampling procedural-noise pseudo-random-generator simplex-noise supersimplex-noise worley-noise

Last synced: 16 days ago
JSON representation

Generate and compose commonly-used procedural noises and distributions, in pure Swift

Awesome Lists containing this project

README

        

***`noise`***
`2.0`

[![ci build status](https://github.com/tayloraswift/swift-noise/actions/workflows/build.yml/badge.svg)](https://github.com/tayloraswift/swift-noise/actions/workflows/build.yml)
[![ci build status](https://github.com/tayloraswift/swift-noise/actions/workflows/docs.yml/badge.svg)](https://github.com/tayloraswift/swift-noise/actions/workflows/docs.yml)

[![swift package index versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftayloraswift%2Fswift-noise%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/tayloraswift/swift-noise)
[![swift package index platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftayloraswift%2Fswift-noise%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/tayloraswift/swift-noise)

![](Sources/Noise/docs.docc/png/banner_FBM.png)

**`swift-noise`** is a free, pure Swift procedural noise generation library. The library product has no dependencies and does not import Foundation or any system frameworks.

All popular types of procedural noise are supported, including three [gradient noises](https://en.wikipedia.org/wiki/Perlin_noise) (often called Perlin or simplex noises), and two [cellular noises](https://en.wikipedia.org/wiki/Worley_noise) (sometimes called Worley or Voronoi noises).

`swift-noise` includes a [fractal brownian motion](https://thebookofshaders.com/13/) (FBM) noise composition framework, and a [disk point sampler](https://en.wikipedia.org/wiki/Supersampling#Poisson_disc) (often called a Poisson sampler), for generating visually even point distributions in the plane. `swift-noise` also includes pseudo-random number generation and hashing tools.

`swift-noise`’s entire public API is [documented](https://swiftinit.org/docs/swift-noise/noise).

## Building

Build *Noise* with the Swift Package Manager. *Noise* itself has no dependencies, but the tests use

The package includes an executable, `generate-noise`, that depends on [`swift-png`](https://github.com/tayloraswift/swift-png).
It generates noise locally for visual inspection.
To regenerate example images, run the following command in the terminal:

```
swift run -c release generate-noise
```