Simple stupid noise primitives for WGSL and Rust (glam/bevy types)

Overview

noisy_bevy

crates.io MIT docs.rs

Simple stupid noise primitives for glam types (Vec2, Vec3) and wgsl.

Main motivations are:

  • ergonomic usage with Bevy
  • same results on rust and wgsl (not bit-level perfect, though)

screenshot of an asteroid generated on the gpu and cpu

Implemented noise primitives:

  • [simplex_noise_2d]
  • [simplex_noise_2d_seeded]
  • [simplex_noise_3d]
  • [fbm_simplex_2d]
  • [fbm_simplex_2d_seeded]
  • [fbm_simplex_3d]

Usage

From rust

Zero initialization, just call the noise functions:

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:

App::new()
    .add_plugin(NoisyShaderPlugin)

And import it and use it in your shaders, with the same API as on the CPU-side:

#import noisy_bevy::prelude

// ...

let p = vec2(12.3, 45.6);
let value = simplex_noise_2d(p);

See the asteroids example, 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.9 0.2, main
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!

You might also like...
A simple-to-use input manager for the Bevy game engine that empowers players and makes accessibility easy.

Bevy Ineffable A simple-to-use input manager for the Bevy game engine that empowers players and makes accessibility easy. Core tenets Make accessibili

Simple RUST game with the Bevy Engine

Simple RUST Game using the Bevy Engine YouTube videos for this code base: Episode 1 - Rust Game Development tutorial from Scratch with Bevy Engine Epi

Simple island generator written in rust using bevy engine
Simple island generator written in rust using bevy engine

Getting Started Easy enough to run cargo run --release Change generation speed Find the system set that looks like this .add_system_set(

Bevy is a refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

A prototype plugin providing a simple line drawing api for bevy.
A prototype plugin providing a simple line drawing api for bevy.

bevy_debug_lines A prototype plugin providing a simple line drawing api for bevy. See docs.rs for documentation. Expect breakage on master. Click on t

A simple authoritative server networking library for Bevy.

Bevy Networking Plugin This is a simple networking plugin for the Bevy game engine. This plugin provides the building blocks which game developers can

A simple camera for properly displaying tile-based low resolution pixel perfect 2D games in bevy.
A simple camera for properly displaying tile-based low resolution pixel perfect 2D games in bevy.

Bevy Tiled Camera A simple camera for properly displaying low resolution pixel perfect 2D games in bevy. The camera will adjust the viewport to scale

A simple example showcasing how to use Bevy to display a square with acceleration (controllable with your keyboard) that wraps around the screen!
A simple example showcasing how to use Bevy to display a square with acceleration (controllable with your keyboard) that wraps around the screen!

Bevy Wrapping Square example A simple example showcasing how to use Bevy to display a square with acceleration (controllable with your keyboard) that

A simple helper for spawning objects in Bevy.

Spew A simple helper for spawning objects in Bevy. Usage First, create an enum that holds objects you might want to spawn: #[derive(Debug, Eq, Partial

Comments
  • Additional noise primitives

    Additional noise primitives

    Maybe add:

    • ridged multifractal
    • hybrid multifractal
    • worley
    • turbulence
    • voronoise

    Perhaps not all of them... I want to keep the scope and complexity of the crate down...

    enhancement 
    opened by johanhelsing 0
Releases(v0.2.0)
Owner
Johan Klokkhammer Helsing
Making names and taking games
Johan Klokkhammer Helsing
Bevy plugin to simulate and preview different types of Color Blindness.

Bevy Color Blindness Simulation Bevy plugin to simulate and preview different types of Color Blindness. This lets you ensure that your game is accessi

annie 29 Nov 22, 2022
Attach Bevy's Handles/Entities statically to Types.

Easily attach bevy's Handles/Entities statically to types on startup and get them in any system, without using Resources. It's just a little less clut

Dekirisu 6 Sep 4, 2023
A simple extension for `bevy-editor-pls` to support tilemap editing right inside the bevy app.

What is this This is a simple tilemap editor plugin, that hooks right into bevy_editor_pls to work with bevy_ecs_tilemap. It works completely within i

null 3 May 8, 2023
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Adam 7 Oct 4, 2023
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy

Bevy Voxel Cone Tracing bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy. Bevy Version

研究社交 208 Dec 27, 2022
🍖A WGPU graphics pipeline, along with simple types used to marshal data to the GPU

renderling ?? This library is a collection of WGPU render pipelines. Shaders are written in GLSL. shaderc is used to compile shaders to SPIR-V. Defini

Schell Carl Scivally 5 Dec 20, 2022
Terminal UI implementation and types for the Dark Forest game

dark-forest.rs Terminal UI implementation and types for the Dark Forest game Development We use the standard Rust toolchain cargo check

Georgios Konstantopoulos 63 Nov 12, 2022
Simple 2d pinball game for testing of bevy and rapier.

Pinball2D Using the Bevy game engine and Rapier physics engine for a simple 2D pinball game. pinball2d.mov Wrote a short piece about how the game was

Gunstein Vatnar 21 Dec 27, 2022