https://github.com/johanhelsing/noisy_bevy
Simple stupid noise primitives for WGSL and Rust (glam/bevy types)
https://github.com/johanhelsing/noisy_bevy
bevy fbm noise procedural-generation simplex-noise
Last synced: about 1 year ago
JSON representation
Simple stupid noise primitives for WGSL and Rust (glam/bevy types)
- Host: GitHub
- URL: https://github.com/johanhelsing/noisy_bevy
- Owner: johanhelsing
- License: other
- Created: 2022-10-24T19:54:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-10T19:16:22.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T17:55:44.834Z (over 1 year ago)
- Topics: bevy, fbm, noise, procedural-generation, simplex-noise
- Language: Rust
- Homepage:
- Size: 103 KB
- Stars: 75
- Watchers: 4
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# noisy_bevy
[](https://crates.io/crates/noisy_bevy)

[](https://docs.rs/noisy_bevy)
Simple stupid noise primitives for glam (`Vec2`, `Vec3`) and WGSL.
- Integrates with Bevy seamlessly
- Same results on the CPU and GPU (not bit-level perfect, though)
## Features
- [`simplex_noise_2d`]
- [`simplex_noise_2d_seeded`]
- [`simplex_noise_3d`]
- [`fbm_simplex_2d`]
- [`fbm_simplex_2d_seeded`]
- [`fbm_simplex_3d`]
- [`worley_2d`]

## Usage
### From Rust
Zero initialization, just call the noise functions:
```rust
use bevy::prelude::*;
use noisy_bevy::simplex_noise_2d;
let p = Vec2::new(12.3, 45.6);
let value = simplex_noise_2d(p);
```
### From WGSL shaders
First add the plugin to the Bevy app:
```rust ignore
App::new()
.add_plugins(NoisyShaderPlugin)
```
Then use it in your shaders:
```wgsl
#import noisy_bevy::simplex_noise_2d
// ...
let p = vec2(12.3, 45.6);
let value = simplex_noise_2d(p);
```
See the [`asteroids example`](https://github.com/johanhelsing/noisy_bevy/blob/main/examples/asteroids.rs), for an example that uses noise to procedurally generate a tilemap on the CPU and a matching background in a wgsl shader.
## Bevy Version Support
The `main` branch targets the latest bevy release.
|bevy|noisy_bevy|
|----|----------|
|0.15| 0.8, main|
|0.14| 0.7 |
|0.13| 0.6 |
|0.12| 0.5 |
|0.11| 0.4 |
|0.10| 0.3 |
|0.9 | 0.2 |
|0.8 | 0.1 |
## License
MIT
The original simplex noise source is MIT-only, however all changes made by me or PRs to this repo are also available under Apache-2.0.
## Acknowledgments
The noise primitives are ports/copies of these
-
-
-
## Contributions
PRs welcome!