verpeteren / rust-simd-noise

SIMD noise library for Rust
https://crates.io/crates/simdnoise
249 stars 20 forks source link

Noise derivatives #24

Open Ralith opened 4 years ago

Ralith commented 4 years ago

Simplex noise is said to have "a well-defined and continuous gradient everywhere that can be computed quite cheaply." This is immensely valuable for generating smooth normals for noise-displaced geometry, and may have applications in generating random vector fields directly. It would be awesome to have this in simdnoise.

Generating displacement + normals will generally want both the value and its spatial derivative simultaneously, so there might be performance benefits in generating them simultaneously in a single pass.

Ralith commented 4 years ago

The reference impl at http://staffwww.itn.liu.se/~stegu/simplexnoise/DSOnoises.html has simplex noise implementations with derivatives with detailed comments. The permutation table they use is identical to this crate's so I'm guessing there's some common lineage there; however, their scaling factors don't (all?) match the ones needed by this crate, so I'm leery of porting over changes blindly.