Skip to content

Commit 25d02eb

Browse files
Finish 0.2 (#60)
* update readme * release notes * updated benches * release note edits
1 parent 704ebb5 commit 25d02eb

2 files changed

Lines changed: 102 additions & 39 deletions

File tree

README.md

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Noiz is not:
3333

3434
| Bevy version | noiz version |
3535
|--------------|--------------|
36-
| 0.16 | 0.1 |
36+
| 0.16 | 0.1, 0.2 |
3737

3838
## What Makes Noiz Unique?
3939

@@ -233,15 +233,15 @@ Time (milliseconds) per 1024 ^ 2 = 1048576 samples. Lower is better.
233233
| Noise Type | noiz | noise | libnoise | fastnoise_lite |
234234
|-----------------------|-------------|--------------|----------------|-----------------|
235235
| value | 1.7365 ✅ | 3.1 | 1.8831 ✅ | 14.8 |
236-
| value fbm 2 octave | 7.0 | 8.6 | 5.8 ✅ | 31.4 |
237-
| value fbm 8 octave | 28.6 | 33.4 | 22.0 ✅ | 112.0 |
238-
| perlin | 3.1| 8.8 | 3.0 ✅ | 8.1 |
239-
| perlin fbm 2 octave | 8.0| 18.4 | 8.1 ✅ | 17.2 |
240-
| perlin fbm 8 octave | 33.5 | 71.8 | 31.1 ✅ | 58.0 |
241-
| simplex | 6.8| 8.6 | 8.1 | 10.6 |
242-
| simplex fbm 2 octave | 14.5| 22.3 | 17.7 | 21.6 |
243-
| simplex fbm 8 octave | 56.3| 108.5 | 89.2 | 116.0 |
244-
| worley | 5.6| 24.5 | 11.8 | 17.8 |
236+
| value fbm 2 octave | 7.1 | 8.6 | 5.8 ✅ | 31.4 |
237+
| value fbm 8 octave | 29.5 | 33.4 | 22.0 ✅ | 112.0 |
238+
| perlin | 3.4| 8.8 | 3.0 ✅ | 8.1 |
239+
| perlin fbm 2 octave | 8.6| 18.4 | 8.1 ✅ | 17.2 |
240+
| perlin fbm 8 octave | 36.7 | 71.8 | 31.1 ✅ | 58.0 |
241+
| simplex | 7.0| 8.6 | 8.1 | 10.6 |
242+
| simplex fbm 2 octave | 14.7| 22.3 | 17.7 | 21.6 |
243+
| simplex fbm 8 octave | 57.8| 108.5 | 89.2 | 116.0 |
244+
| worley | 5.7| 24.5 | 11.8 | 17.8 |
245245
| worley approximate | 2.8 ✅ | --- | --- | --- |
246246

247247
### 3D
@@ -250,17 +250,17 @@ Time (milliseconds) per 101 ^ 3 = 1030301 samples. Lower is better.
250250

251251
| Noise Type | noiz | noiz `Vec3A` | noise | libnoise | fastnoise_lite |
252252
|-----------------------|-------------|--------------|----------------|-----------------|-----------------|
253-
| value | 3.0 | 7.4 | 11.4 | 2.7 ✅ | 39.6 |
254-
| value fbm 2 octave | 11.8 | 15.8 | 22.5 | 8.2 ✅ | 85.7 |
255-
| value fbm 8 octave | 55.3 | 61.4 | 89.3 | 33.5 ✅ | 336.6 |
256-
| perlin | 7.1 | 9.9 | 76.9 | 6.4 ✅ | 13.8 |
257-
| perlin fbm 2 octave | 19.6 | 20.1 | 28.5 | 15.8 ✅ | 29.7 |
258-
| perlin fbm 8 octave | 80.3 | 75.4 | 368.9 | 69.7 ✅ | 132.0 |
259-
| simplex | 12.6| 17.0 | 14.2 | 16.3 | 20.1 |
260-
| simplex fbm 2 octave | 26.7| 32.9 | 51.8 | 25.9 ✅ | 43.0 |
261-
| simplex fbm 8 octave | 106.9| 126.2 | 207.8 | 181.7 | 175.1 |
262-
| worley | 53.3 | 53.6 | 78.9 | 52.9 | 42.3 ✅ |
263-
| worley approximate | 6.2 ✅ | 13.6 | --- | --- | --- |
253+
| value | 3.0 | 7.8 | 11.4 | 2.7 ✅ | 39.6 |
254+
| value fbm 2 octave | 13.2 | 16.0 | 22.5 | 8.2 ✅ | 85.7 |
255+
| value fbm 8 octave | 56.8 | 60.7 | 89.3 | 33.5 ✅ | 336.6 |
256+
| perlin | 7.1 | 11.4 | 76.9 | 6.4 ✅ | 13.8 |
257+
| perlin fbm 2 octave | 17.4 | 23.0 | 28.5 | 15.8 ✅ | 29.7 |
258+
| perlin fbm 8 octave | 76.4 | 86.4 | 368.9 | 69.7 ✅ | 132.0 |
259+
| simplex | 12.9| 17.6 | 14.2 | 16.3 | 20.1 |
260+
| simplex fbm 2 octave | 27.3| 33.5 | 51.8 | 25.9 ✅ | 43.0 |
261+
| simplex fbm 8 octave | 108.7| 129.8 | 207.8 | 181.7 | 175.1 |
262+
| worley | 54.8 | 57.4 | 78.9 | 52.9 | 42.3 ✅ |
263+
| worley approximate | 6.2 ✅ | 14.9 | --- | --- | --- |
264264

265265
`Vec3A` is an aligned 3d type from `bevy_math` (glam). It enables SIMD instructions, but uses more memory to do so.
266266
As you can see, it's not worth it here.
@@ -271,17 +271,17 @@ Time (milliseconds) per 32 ^ 4 = 1048576 samples. Lower is better.
271271

272272
| Noise Type | noiz | noise | libnoise | fastnoise_lite |
273273
|-----------------------|-------------|--------------|----------------|-----------------|
274-
| value | 13.5 | 21.2 | 3.9 ✅ | --- |
275-
| value fbm 2 octave | 27.5 | 46.0 | 14.3 ✅ | --- |
276-
| value fbm 8 octave | 106.7 | 167.3 | 57.3 ✅ | --- |
277-
| perlin | 16.9| 177.6 | 17.6 | --- |
278-
| perlin fbm 2 octave | 37.3 ✅ | 53.5 | 38.4 | --- |
279-
| perlin fbm 8 octave | 141.5| 824.2 | 203.1 | --- |
280-
| simplex | 18.2| 35.5 | 29.5 | --- |
281-
| simplex fbm 2 octave | 35.7| 108.8 | 41.0 | --- |
282-
| simplex fbm 8 octave | 137.1| 421.0 | 234.4 | --- |
283-
| worley | 185.3 | 156.3 ✅ | 205.8 | --- |
284-
| worley approximate | 26.6| --- | --- | --- |
274+
| value | 13.8 | 21.2 | 3.9 ✅ | --- |
275+
| value fbm 2 octave | 27.7 | 46.0 | 14.3 ✅ | --- |
276+
| value fbm 8 octave | 109.0 | 167.3 | 57.3 ✅ | --- |
277+
| perlin | 17.5| 177.6 | 17.6 | --- |
278+
| perlin fbm 2 octave | 38.3 ✅ | 53.5 | 38.4 | --- |
279+
| perlin fbm 8 octave | 146.1| 824.2 | 203.1 | --- |
280+
| simplex | 18.8| 35.5 | 29.5 | --- |
281+
| simplex fbm 2 octave | 36.6| 108.8 | 41.0 | --- |
282+
| simplex fbm 8 octave | 139.3| 421.0 | 234.4 | --- |
283+
| worley | 186.8 | 156.3 ✅ | 205.8 | --- |
284+
| worley approximate | 26.3| --- | --- | --- |
285285

286286
### Summary
287287

@@ -319,10 +319,3 @@ Use `libnoise` if you don't need a ton of configuration, are using relatively sm
319319
If you absolutely need `f64` support, use `libnoise`, but again, the permutation table rng makes the large domain kinda a moot point. Same goes for `noise`.
320320
If you are integrating with `bevy`, need lots of customization, need general, high performance, or need serialization and reflection, use `noiz`.
321321
I am not aware of a reason to use `noise` (though there may well be one I'm missing).
322-
323-
## Rough Roadmap
324-
325-
- [ ] Optimize with fastmath coming in rust 1.88
326-
- [ ] Add dynamic types to switch between noise functions via reflection.
327-
- [ ] (Maybe) Let noise types generate WESL code. (Specify noise in rust, build to WESL.) Possible, but maybe not worth it.
328-
- [ ] Any reasonable suggestions that come in.

changelog/release_0-2.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Release 0.2
2+
3+
This is a small release, mostly focusing on rounding some rough edges from 0.1.
4+
If there are any issues you run across, please don't hesitate to open an issue!
5+
6+
## Enhancements
7+
8+
When collecting results of layered noise, `Normed` and `NormedByDerivative` can now collect gradients. Ex: `Normed<WithGradient<f32, Vec2>>`.
9+
This is the proper way to collect gradient information of fractal layered noise and is very useful for things like analytical normals for mesh generation.
10+
11+
A new noise function, `WithGradientOf`, can now be used to "fudge" a gradient value.
12+
Although this will not be correct, it can be artistically useful when paired with `NormedByDerivative`, or other systems that use gradient information to affect the output.
13+
14+
A new `Lerped` curve now allows interpolating between vector space values.
15+
This is particularly helpful when combined with the new `RemapCurve` noise function.
16+
17+
A noise function, `Translated`, has been added to replace the `Offset<Constant>` pattern.
18+
19+
The `prelude::common_noise` module has been expanded to include derivatives of common noise.
20+
In general, I prefer to use the noise types directly, rather than these aliases; that opens up more customization and demystifies the actual algorithm.
21+
However, in some places, shorter names are preferred, and now derivatives are possible there too.
22+
23+
## Bug Fixes
24+
25+
It's hard to define a "bug" when it comes to noise, since there's no real correct vs incorrect for most systems; just whether or not it "feels" random enough in the right ways.
26+
That said, there were a few bug-like fixes over 0.1.
27+
28+
Some gradients were not mathematically rigorous; they were often "good enough", but they weren't correct.
29+
Many of these are now fixed, including simplex noise, fractal noise, masked noise, and linearly mapped noise (like `UNormToSNorm`).
30+
Notably, `Abs`, `Billow`, and `NormedByDerivative` are still not mathematically rigorous.
31+
These do not appear to be classically differentiable, but "good enough" implementations are still provided.
32+
33+
Perlin noise is now normalized to ±1; it was ±(1/√N) where N was the number of dimensions.
34+
This was previously not normalized for performance (it's a linear scale, which the user will configure anyway), but it has been fixed to help with usability.
35+
With fast-math coming in rust 1.88, this will be made zero cost in the future.
36+
37+
## Migration Guide
38+
39+
`Blender` and `DiferentiableGradientBlender` have been replaced by `ValueBlender`, `DifferentiableValueBlender`, `GradientBlender`, and `DifferentiableGradientBlender`.
40+
The functionality of these traits remains the same, but this separation allows more specific implementations.
41+
42+
The `LayerOperationFor` trait has been expanded over the new `LayerResultContextFor`.
43+
This will not affect most users, but if you were making custom layers, this will need to be migrated.
44+
45+
`Scaled` now scales directly rather than going through a nested noise function.
46+
If you want the previous behavior, use `Masked`.
47+
48+
I have deliberately kept this brief, as these changes are unlikely to affect anyone, but if you have any trouble migrating, please open an issue!
49+
50+
## What's next
51+
52+
It's hard to predict the future here, as I have limited time, and lots of my ideas here depend on other projects.
53+
However, there are some things I'd like to explore for the future:
54+
55+
- 64 bit support: Noiz is powered by bevy_math, which is growing to support 64 bit precision.
56+
When that work is complete, Noiz will upgrade to support `f64` based inputs and outputs.
57+
- even faster: Rust 1.88 brings support for fast-math, offering some insane performance opportunities at the cost of precision.
58+
This will probably be an opt-out feature, as it is not without downsides, but this is still up for debate.
59+
- Other rng backends: Noiz is powered by a *very* specialized and optimized random number generator.
60+
Some power users may want to make their own generators to either sacrifice quality for speed or speed for quality.
61+
- GPU support: This is especially tricky to think about.
62+
Some forms of noise don't even make sense on the GPU (but lots do!).
63+
As projects like WESL and rust GPU make more progress, I'd like to explore getting noiz on the GPU.
64+
This is still a long way off but is something I'm looking into.
65+
- Reflection noise types: As bevy editor prototypes and progress continues, making the noise types more customizable and changeable at runtime is important.
66+
Adding more reflection support will help with this.
67+
Designing this features is difficult without compromising speed, so don't expect this too soon, but know that it is in the works!
68+
69+
If you have any other requests, please open an issue or PR!
70+
Feedback is always welcome as I work to make this the "go to" noise library for bevy and rust.

0 commit comments

Comments
 (0)