https://github.com/thinknathan/defold-noise
https://github.com/thinknathan/defold-noise
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/thinknathan/defold-noise
- Owner: thinknathan
- License: cc0-1.0
- Created: 2023-06-03T06:45:22.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T04:07:46.000Z (over 2 years ago)
- Last Synced: 2023-12-29T05:22:16.086Z (over 2 years ago)
- Language: C++
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# defold-noise
A defold native extension attempting to implement Open Simplex 2 2d noise and Fractal noise.
Not yet tested.
## Usage
```lua
-- Generate a single noise value
local x = 0.5
local y = 0.8
local singleValue = noise.noise_2d(x, y)
print("Single noise value: ", singleValue)
-- Generate fractal noise with multiple octaves
local octaves = 4
local lacunarity = 2.0
local gain = 0.5
local fractalValue = noise.fractal_noise(x, y, octaves, lacunarity, gain)
print("Fractal noise value: ", fractalValue)
```
## Background
Created with Chat-GPT. Prompt:
```
create a defold extension that exposes a module to lua, use c++ that does not use any features newer than 2009, and does not use the standard library, and always uses const char* instead of std::string.
the name of the module is noise.
implement open simplex 2 noise.
use static classes instead of namespaces.
implement fractal noise with 2d simplex noise as its source.
```