Further optimize biome noise visualizer

This commit is contained in:
Misode
2020-09-14 18:51:51 +02:00
parent de3a978388
commit 508b258ad3
2 changed files with 24 additions and 19 deletions

View File

@@ -31,9 +31,11 @@ export class NormalNoise {
let inputF = this.lowestFreqInputFactor
let valueF = this.lowestFreqValueFactor
for (let i = 0; i < this.amplitudes.length; i += 1) {
value += this.amplitudes[i] * this.noiseLevels[i].noise2D(this.wrap(x * inputF), this.wrap(y * inputF) + i) * valueF
inputF *= 2
valueF /= 2
if (this.amplitudes[i] !== 0) {
value += this.amplitudes[i] * this.noiseLevels[i].noise2D(this.wrap(x * inputF), this.wrap(y * inputF) + i) * valueF
inputF *= 2
valueF /= 2
}
}
return 2 * value * this.valueFactor
}