Returns a value of perlin noise given a point.
Details
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 10250 Build 17421: arc lint + arc unit
Event Timeline
binaries/data/mods/public/maps/random/rmgen/PerlinNoise.js | ||
---|---|---|
3 ↗ | (On Diff #6891) | It's not a point, it's vector2d. (Widely used inaccuracy, I know, but please change the description to tell that) |
See IRC for improvements: http://irclogs.wildfiregames.com/2019-11/2019-11-30-QuakeNet-%230ad-dev.log starting with "12:30 < FeXoR> ...so on to D1630 I guess ^^"
@"let weight = multiplier;":
Shouldn't waight start at 1 and then be reduced each iteration?
I have no idea about math behind this but code looks good so nice job :)
I have just small safety reminder (you are free to ignore it)
would be nice to make check for scale == 0 or iterations == 0 and early return 0 and maybe log error ?
just safe guard against division by 0 :)
binaries/data/mods/public/maps/random/rmgen/perlinNoise.js | ||
---|---|---|
12 | iterations <= 0 :) |
binaries/data/mods/public/maps/random/rmgen/perlinNoise.js | ||
---|---|---|
22 | This is really not perlin noise now. Perlin noise implies gradient noise. I suggest renaming this function. Or use the perlin noise implementation in Noise2D. |
binaries/data/mods/public/maps/random/rmgen/perlinNoise.js | ||
---|---|---|
22 | Suggestion ? Factal noise, fbm ? |
binaries/data/mods/public/maps/random/rmgen/perlinNoise.js | ||
---|---|---|
22 | Fractal noise sounds better. |