mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +00:00
Fix biome noise visualizer
This commit is contained in:
@@ -74,7 +74,7 @@ const treeViewNodeInjector = (path: ModelPath, view: TreeView) => {
|
||||
})
|
||||
.join('')
|
||||
if (views.visualizer.active && views.visualizer.visualizer?.getName() === 'biome-noise') {
|
||||
if (path.startsWith(new Path(['generator', 'biome_source', 'biomes'])) && path.getArray().length === 4) {
|
||||
if (path.pop().endsWith(new Path(['generator', 'biome_source', 'biomes']))) {
|
||||
const biomeVisualizer = views.visualizer.visualizer as BiomeNoiseVisualizer
|
||||
const biome = path.push('biome').get()
|
||||
const id = view.registerChange(el => {
|
||||
|
||||
@@ -72,10 +72,10 @@ export class BiomeNoiseVisualizer extends Visualizer {
|
||||
let scale = 2**config.firstOctave
|
||||
for (let i = 0; i < config.amplitudes.length; i++) {
|
||||
n += this.noise[index].noise2D((x - this.offsetX)*scale, (y- this.offsetY)*scale + i)
|
||||
* config.amplitudes[i] * 128 / scale
|
||||
* config.amplitudes[i] / (2**scale)
|
||||
scale *= 2
|
||||
}
|
||||
return n
|
||||
return n / config.amplitudes.length
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user