Skip to content

Commit

Permalink
Updated tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
nightcycle committed Feb 5, 2024
1 parent c7093e4 commit eea573d
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@
# Usage

```lua
local noise = Noise.new(12345)
local value = noise:Perlin(1, 2) -- a value from 0 to 1 (ish)
```

## Random

<img src="./media/random.png" alt="random">

```lua
local seed = 12356
local x = 0.5
local y = 0.25
local noise = Noise.new(seed)
local value = noise:Random(x,y) -- a value from 0 to 1 (ish)
```

## Perlin

<img src="./media/perlin.png" alt="perlin">

```lua
local seed = 12356
local x = 0.5
local y = 0.25
local noise = Noise.new(seed)
local value = noise:Perlin(x,y) -- a value from 0 to 1 (ish)
```

## Worley / Cellular

<img src="./media/worley.png" alt="worley">

```lua
local seed = 12356
local x = 0.5
local y = 0.25
local noise = Noise.new(seed)
local value = noise:Cellular(x,y) -- a value from 0 to 1 (ish)
```

## Voronoi

<img src="./media/voronoi.png" alt="voronoi">

```lua
local seed = 12356
local x = 0.5
local y = 0.25
local noise = Noise.new(seed)
local value = noise:Voronoi(x,y) -- a value from 0 to 1 (ish)
```

# Benchmark

Each map was sampled 32 times, including math.noise, to determine how long each of them took. Some maps have built in optimizations for when only x and y are provided.
Expand Down

0 comments on commit eea573d

Please sign in to comment.