Skip to content

Commit ca4224c

Browse files
Upgrade to bevy 0.17 (#76)
* most upgrading * updated docs * reset changelog
1 parent 6d0c66f commit ca4224c

14 files changed

Lines changed: 170 additions & 108 deletions

File tree

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ authors = ["Elliott Pierce"]
1919
description = "A simple, configurable, blazingly fast noise library built for and with Bevy."
2020

2121
[dependencies]
22-
bevy_math = { version = "0.16", default-features = false, features = ["curve"] }
23-
bevy_reflect = { version = "0.16", default-features = false, features = [
22+
bevy_math = { version = "0.17", default-features = false, features = ["curve"] }
23+
bevy_reflect = { version = "0.17", default-features = false, features = [
2424
"glam",
2525
], optional = true }
2626
serde = { version = "1", default-features = false, features = [
@@ -29,7 +29,7 @@ serde = { version = "1", default-features = false, features = [
2929

3030
[dev-dependencies]
3131
# for examples
32-
bevy = "0.16"
32+
bevy = "0.17"
3333

3434
# For benches
3535
criterion = "0.5"

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Noiz is not:
3333

3434
| Bevy version | noiz version |
3535
|--------------|--------------|
36-
| 0.16 | 0.1, 0.2 |
36+
| 0.16 | 0.1, 0.2 |
37+
| 0.17 | 0.3 |
3738

3839
## What Makes Noiz Unique?
3940

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@
2020
- [Learning Resources](./more-info/learning-resources.md)
2121
- [Changelogs](./changelogs/README.md)
2222
- [V 0.2](./changelogs/release-0-2.md)
23+
- [V 0.3](./changelogs/release-0-3.md)
2324
- [Improving Noiz](./improving-noiz.md)

book/src/changelogs/release-0-3.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Release 0.3
2+
3+
## Enhancements
4+
5+
Added `PowI` and `Sqrt` math noise functions.
6+
7+
Upgraded to Bevy 0.17.
8+
9+
## Bug Fixes
10+
11+
Fixed some places where float operations did not use the proper backend.
12+
This is unlikely to have affected anyone but is fixed now.
13+
14+
Fixed voronoi graphs not reporting correct values for worley noise.
15+
This was causing noise values to not be properly normalized for some values of voronoi randomness.
16+
Fixing this decreased the average brightness/value of some worley modes.
17+
If you would prefer to increase the value to match the behavior in 0.2, the noise can still be scaled afterwards.
18+
19+
## Migration Guide
20+
21+
In theory, if it compiled for 0.2, 0.3 should also compile (aside from any Bevy-related changes).
22+
If you run into any trouble migrating, please let me know.
23+
24+
## What's next
25+
26+
It's hard to predict the future here, as I have limited time, and lots of my ideas here depend on other projects.
27+
However, there are some things I'd like to explore for the future:
28+
29+
- 64 bit support: Noiz is powered by bevy_math, which is growing to support 64 bit precision.
30+
When that work is complete, Noiz will upgrade to support `f64` based inputs and outputs.
31+
Currently, this is blocked by Bevy's `Curve` trait.
32+
- even faster: Rust 1.88 brought support for fast-math, offering some insane performance opportunities at the cost of precision.
33+
However, this feature is not completely stable and definitely has downsides. Plus, `glam` would need to add support for it first.
34+
- Other rng backends: Noiz is powered by a *very* specialized and optimized random number generator.
35+
Some power users may want to make their own generators to either sacrifice quality for speed or speed for quality.
36+
- GPU support: This is especially tricky to think about.
37+
Some forms of noise don't even make sense on the GPU (but lots do!).
38+
As projects like WESL and rust GPU make more progress, I'd like to explore getting Noiz on the GPU.
39+
I have spent some time looking at options for implementations, and I do not see this happening any time soon, unfortunately.
40+
- Reflection noise types: As bevy editor prototypes and progress continues, making the noise types more customizable and changeable at runtime is important.
41+
Adding more reflection support will help with this.
42+
I have looked at this a lot, even with the help of some users, and I also don't see this coming any time soon. But we'll see.
43+
44+
If you have any other requests, please open an issue or PR!
45+
Feedback is always welcome as I work to make this the "go to" noise library for bevy and rust.
46+
47+
# Limited development
48+
49+
Please note that while all of these features are on my list, most of them are blocked externally.
50+
I am also working on a number of other very exciting projects, so Noiz is (for now) being more maintained than developed.
51+
52+
Noiz is fast because everything is monomorphized and inlined at compile time.
53+
However, on some platforms, rust does not fully use SIMD.
54+
There is room for another noise library to support fully dynamic noise with manually implemented SIMD optimizations.
55+
Such a library would likely out perform Noiz for large blocks of samples but under perform for specific samples or samples that can not be placed on a grid.
56+
This is one of the projects I'd like to work on, and there are many more.

changelog/release_0-3.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

changelog/release_0-4.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Release 0.4
2+
3+
WIP. Updated during development. After release, this is moved to the book.
4+
5+
## Enhancements
6+
7+
8+
## Bug Fixes
9+
10+
11+
## Migration Guide
12+
13+
14+
15+
## What's next

examples/heightmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use bevy::{
44
asset::RenderAssetUsages,
55
input::mouse::AccumulatedMouseMotion,
6+
mesh::{Indices, PrimitiveTopology},
67
prelude::*,
7-
render::mesh::{Indices, Mesh},
88
};
99
use bevy_math::Vec2;
1010
use noiz::{math_noise::Pow2, prelude::*};
@@ -76,7 +76,7 @@ fn heightmap_noise() -> impl SampleableFor<Vec2, f32> + ScalableNoise + Seedable
7676
// It's just an example.
7777
fn build_mesh(noise: impl SampleableFor<Vec2, f32>, extent: f32, resolution: f32) -> Mesh {
7878
let mut mesh = Mesh::new(
79-
bevy::render::mesh::PrimitiveTopology::TriangleList,
79+
PrimitiveTopology::TriangleList,
8080
RenderAssetUsages::RENDER_WORLD,
8181
);
8282

examples/show_gradients.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ use bevy::{
77
asset::RenderAssetUsages,
88
color::palettes,
99
prelude::*,
10-
render::{
11-
camera::ScalingMode,
12-
render_resource::{Extent3d, TextureDimension, TextureFormat},
13-
},
10+
render::render_resource::{Extent3d, TextureDimension, TextureFormat},
1411
};
1512
use noiz::{
1613
DynamicConfigurableSampleable, Noise,
@@ -181,7 +178,7 @@ fn setup(
181178
})),
182179
))
183180
.observe(
184-
|ev: Trigger<Pointer<Move>>, noise: Res<NoiseOptions>, mut hit: ResMut<Hit>| {
181+
|ev: On<Pointer<Move>>, noise: Res<NoiseOptions>, mut hit: ResMut<Hit>| {
185182
let sample =
186183
ev.hit.position.unwrap().xy() * vec2(1.0, -1.0) + vec2(WIDTH, HEIGHT) / 2.0;
187184
let loc = Vec2::new(
@@ -196,7 +193,7 @@ fn setup(
196193
commands.spawn((
197194
Camera3d::default(),
198195
Projection::Orthographic(OrthographicProjection {
199-
scaling_mode: ScalingMode::Fixed {
196+
scaling_mode: bevy::camera::ScalingMode::Fixed {
200197
width: WIDTH,
201198
height: HEIGHT,
202199
},

0 commit comments

Comments
 (0)