Updating readme.
This commit is contained in:
parent
98432e186d
commit
45c0a7d75f
11
README.md
11
README.md
@ -4,6 +4,15 @@ This is a lua library implementation of 1D, 2D, and 3D [Hill Noise](http://blog.
|
||||
This random noise function generates continuous approximately uniformly distributed pseudorandom noise
|
||||
values in the range (0-1) with configurable resolution, level of detail, and shape characteristics.
|
||||
|
||||
## API
|
||||
|
||||
* `make1d([opts])` Return 1D noise function and 1D noise gradient function.
|
||||
* `make2d([opts])` Return 2D noise function and 2D noise gradient function.
|
||||
* `make3d([opts])` Return 3D noise function and 3D noise gradient function.
|
||||
* `make1dShader([opts])` Return 1D noise shader and 1D noise gradient shader (for use with LÖVE game engine).
|
||||
* `make2dShader([opts])` Return 2D noise shader and 2D noise gradient shader (for use with LÖVE game engine).
|
||||
* `make3dShader([opts])` Return 3D noise shader and 3D noise gradient shader (for use with LÖVE game engine).
|
||||
|
||||
## Usage
|
||||
|
||||
```lua
|
||||
@ -16,6 +25,7 @@ local dndx,dndy,dndz = noise_gradient(x,y,z)
|
||||
|
||||
## Parameters
|
||||
The noise construction functions all take the following options:
|
||||
|
||||
* random: a random number function (default: math.random)
|
||||
* seed: if "random" is not provided, and the love.math module is loaded, a new
|
||||
pseudorandom number generator will be used with the specified seed
|
||||
@ -49,6 +59,7 @@ love.graphics.setShader()
|
||||
```
|
||||
|
||||
The noise gradient shaders populate the RGB channels with:
|
||||
|
||||
* for 1D: `sigmoid(2*dn/dx)`, `sigmoid(2*dn/dx)`, `sigmoid(2*dn/dx)`
|
||||
* for 2D: `sigmoid(1.5*dn/dx)`, `sigmoid(1.5*dn/dy)`, `0`
|
||||
* for 3D: `sigmoid(4*dn/dx)`, `sigmoid(4*dn/dy)`, `sigmoid(4*dn/dz)`
|
||||
|
Loading…
Reference in New Issue
Block a user