Replies: 5 comments
-
This would be excellent to have! However, as far as I understand it (and in my testing) the current type signature of A number of the modules use If we had const generics, the signature could be simplified to I know |
Beta Was this translation helpful? Give feedback.
-
I wasn't talking about using &[T] but rather typenum and generic-array so we can use Point<T, U2> to refer to a 2D point at compile time. Internally it would make sense for things like PermTable to take a &[T] since they don't need to care about the dimensionality. |
Beta Was this translation helpful? Give feedback.
-
Super-simplex is impossible to generalize into higher dimensions, there is no known 4D or higher variant. Open-simplex has a 4D variant, but no 5D or higher variant is known. Cell/Worley noise is fairly easy to extend; in fact I have a script that can be repurposed to calculate the minimum kernel to be sampled. Occluded cells can also be identified by taking the corners of the central 2n cells. |
Beta Was this translation helpful? Give feedback.
-
It's likely that low D variants will have SIMD accelerations, but ppl shouldn't exclude ND just because low D is faster. It would be nice if noise were to be an all inclusive API wrapper around more specialized implementations, not a collection of popular specialized implementations. |
Beta Was this translation helpful? Give feedback.
-
maybe I'm out of the loop, but what is the point of higher dimensional noise than 4D? I've seen people mention tile-ability, but you can reliably do that with the same dimensionality you need by repeating coherent hashes. If the purpose is to simply create repeatable versions of 3D and 2D, then just use those. Perlin noise is trivially tileable, and if you can't figure out how to do it with simplex noise, using 6D to tile 3D isn't going to get you any advantages over perlin, as you've just lost your speed, and now you're just left with simplex's worse noise artifacts. |
Beta Was this translation helpful? Give feedback.
-
As mentioned in #134 one way to get the 5D and 6D noise functions would be to, as much as possible, make the library generic over dimensions. I've implemented this as a proof of concept using generic-array for Perlin noise (TODO: publish this and link to it) and it's at worst 200% the run time of the specialized implementations but I believe I can improve on that. If not we can always keep the existing implementations too, we'll just have four implementations of NoiseModule for each generator then (Point, Point2, Point3, Point4). On nightly Rust we could even use impl specialization to get the specialized implementations when using Point.
We can easily do N-dimensional versions of Perlin, Simplex, and Value noise as well as all of the modifiers, fractals, and checkboard and such. The complicated/impossible ones are OpenSimplex, SuperSimplex, and Worley. Those might be possible with more research or with much slower generic implementations. Worst case we can have Point<U2>, Point<U3>, and Point<U4> versions that call to the specialized implementations and the compiler will give a type error if someone tries to get 5D SuperSimplex noise.
As an aside, while working on the N-dimensional Perlin version I discovered using an N-dimensional PermTable via a
get(&[T]) -> usize
method results in pretty dramatic speedups for the 64x64 benchmarks. Even if we don't do full N-dimensional I'm going to try to make as much of the helper machinery (PermTable, math, per-noise helpers) N-dimensional and see if that has a similar effect on performance.Beta Was this translation helpful? Give feedback.
All reactions