Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zak-grumbles/gd_fastnoise2
Godot module for the FastNoise2 library
https://github.com/zak-grumbles/gd_fastnoise2
cpp godot godot4 noise noise-generator procedural-generation
Last synced: 13 days ago
JSON representation
Godot module for the FastNoise2 library
- Host: GitHub
- URL: https://github.com/zak-grumbles/gd_fastnoise2
- Owner: zak-grumbles
- License: mit
- Created: 2023-12-18T22:34:12.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-01T19:04:32.000Z (10 months ago)
- Last Synced: 2024-05-02T16:30:52.819Z (10 months ago)
- Topics: cpp, godot, godot4, noise, noise-generator, procedural-generation
- Language: C++
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gd_fastnoise2
WIP extension for the [Godot engine](https://github.com/godotengine/godot) that wraps the [FastNoise2](https://github.com/Auburn/FastNoise2) library and exposes functionality to GDScript.## Table of Contents
- [Building](#building)
- [Pre-requisites](#pre-requisites)
- [Building FastNoise.lib](#building-fastnoiselib)
- [Options](#options)
- [Including in Godot](#including-in-godot)
- [Usage](#usage)## Building
For the most part, the module gets built along with godot. However, you will need to build the FastNoise2 library first.
It is on the road map to have it built as part of godot's build process, but at this point it still needs to be manually built.### Pre-requisites
- [Scons](https://scons.org/)### Building FastNoise.lib
```bash
git checkout [email protected]:zak-grumbles/gd_fastnoise2.git
cd gd_fastnoise2
git submodule update --init
cd FastNoise2
scons
```#### Options
Along with the built-in scons options, these additional options are defined
- `use_llvm=yes` - Compile using llvm/clang## Including in Godot
As long as this repo is cloned into either the `godot/modules` directory or in a custom_modules directory it will be picked up along with the built-in modules when `godot` is built.## Usage
This is a minimal GDScript example using a simplex source and an FBm fractal to generate a
256x256 grid of 2D noise.```gdscript
var gen : FNGenerator = FNGenerator.new_generator(FNGenerator.GeneratorType.Simplex);
var frac : FNFractal = FNFractal.new_fractal(FNFractal.FractalType.FBm);frac.set_source(gen);
var data : PackedFloat32Array = frac.gen_uniform_grid_2D(
0, 0, 256, 256, 0.2, 1337
);
```