-
-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from Keavon/rust-port
Rust port
- Loading branch information
Showing
15 changed files
with
3,054 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ nupkg/ | |
[Rr]elease/ | ||
[Rr]eleases/ | ||
[Pp]ublish/ | ||
[Tt]arget/ | ||
x64/ | ||
x86/ | ||
build/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// MIT License | ||
// MIT License | ||
// | ||
// Copyright(c) 2020 Jordan Peck ([email protected]) | ||
// Copyright(c) 2020 Contributors | ||
|
@@ -45,7 +45,7 @@ | |
// ....',;;clodxkkOOOkkdolc:;,,,,,,,,'..........,;:clodxkO0KKXKK0Okxdolcc::;;,,,;;:codkO0XXNNNNXKK0OOOOOkkkkxxdoollloodxkO0KKKXXXXX | ||
// | ||
// VERSION: 1.0.1 | ||
// https://github.com/Auburn/FastNoise | ||
// https://github.com/Auburn/FastNoiseLite | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,8 +49,8 @@ | |
// https://www.npmjs.com/package/fastnoise-lite | ||
// https://discord.gg/SHVaVfV | ||
// | ||
// Ported to Javascript by storm (Patrick U): | ||
// Discord: storm#8888 (prefered) | Email: [email protected] | Github: stormy482 (https://github.com/stormy482) | ||
// Ported to JavaScript by storm (Patrick U): | ||
// Discord: storm#8888 (preferred) | Email: [email protected] | GitHub: stormy482 (https://github.com/stormy482) | ||
// | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "fastnoise-lite" | ||
version = "1.0.1" | ||
edition = "2021" | ||
license = "MIT" | ||
description = "FastNoiseLite Lite is an extremely portable open source noise generation library with a large selection of noise algorithms" | ||
repository = "https://github.com/Auburn/FastNoiseLite" | ||
readme = "README.md" | ||
authors = ["Jordan Peck", "Keavon Chambers"] | ||
|
||
[features] | ||
f64 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[crates.io](https://crates.io/crates/fastnoise-lite) • [docs.rs](https://docs.rs/fastnoise-lite/latest/bezier_rs/) • [repo](https://github.com/GraphiteEditor/Graphite/tree/master/libraries/fastnoise-lite) | ||
|
||
# FastNoise Lite | ||
|
||
FastNoise Lite is an extremely portable open source noise generation library with a large selection of noise algorithms. This library focuses on high performance while avoiding platform/language specific features, allowing for easy ports to as many possible languages. | ||
|
||
## Features | ||
|
||
- 2D & 3D | ||
- OpenSimplex2 Noise | ||
- OpenSimplex2S Noise | ||
- Cellular (Voronoi) Noise | ||
- Perlin Noise | ||
- Value Noise | ||
- Value Cubic Noise | ||
- OpenSimplex2-based Domain Warp | ||
- Basic Grid Gradient Domain Warp | ||
- Multiple fractal options for all of the above | ||
- Supports floats and/or doubles | ||
- Switch from `f32` to `f64` position inputs with the `"f64"` feature flag in your `Cargo.toml` | ||
|
||
## Getting Started | ||
|
||
Below is an example for creating a 128x128 array of OpenSimplex2 noise. | ||
|
||
Additional documentation is available at [docs.rs](https://docs.rs/fastnoise-lite/latest/bezier_rs/) and the project's [Getting Started](https://github.com/Auburn/FastNoiseLite/wiki#getting-started) and [Documentation](https://github.com/Auburn/FastNoiseLite/wiki/Documentation) pages from its GitHub wiki. | ||
|
||
```rs | ||
use fastnoise_lite::*; | ||
|
||
// Create and configure FastNoise object | ||
let mut noise = FastNoiseLite::new(); | ||
noise.SetNoiseType(NoiseType::OpenSimplex2); | ||
|
||
// Gather noise data | ||
const WIDTH: usize = 128; | ||
const HEIGHT: usize = 128; | ||
|
||
let mut noise_data = [0.; WIDTH * HEIGHT]; | ||
|
||
for y in 0..HEIGHT { | ||
for x in 0..WIDTH { | ||
// Enable `features = ["f64"]` in Cargo.toml to pass f64 values here instead of f32. | ||
// Use `noise.get_noise_3d(x, y, z)` for 3D noise instead of 2D. | ||
noise_data[WIDTH * y + x] = noise.get_noise_2d(x as f32, y as f32); | ||
} | ||
} | ||
|
||
// Do something with this data... | ||
``` |
Oops, something went wrong.