mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-08-27 04:37:47 +00:00
Add Perplex noise (Perlin × Simplex multiplied)
- New PerplexNoise generator blends Perlin and Simplex by multiplying outputs - Registered as PERPLEX in NoiseType enum - Added PERPLEX and PERPLEX_IRIS styles to NoiseStyle (visible in Noise Explorer) - Flows into IrisComplex via standard generator registration path
This commit is contained in:
@@ -446,6 +446,12 @@ public enum NoiseStyle {
|
|||||||
|
|
||||||
@Desc("Vascular noise gets higher as the position nears a cell border. Cells are distorted using Iris styled wispy noise.")
|
@Desc("Vascular noise gets higher as the position nears a cell border. Cells are distorted using Iris styled wispy noise.")
|
||||||
VASCULAR_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.VASCULAR)),
|
VASCULAR_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.VASCULAR)),
|
||||||
|
|
||||||
|
@Desc("Perplex noise = Perlin x Simplex, multiplied together.")
|
||||||
|
PERPLEX(rng -> new CNG(rng, NoiseType.PERPLEX, 1D, 1)),
|
||||||
|
|
||||||
|
@Desc("Perplex noise with Iris wispy swirls.")
|
||||||
|
PERPLEX_IRIS(rng -> CNG.signature(rng, NoiseType.PERPLEX)),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final CNGFactory f;
|
private final CNGFactory f;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public enum NoiseType {
|
|||||||
WHITE_HERMITE((s) -> new InterpolatedNoise(s, WHITE, InterpolationMethod.HERMITE)),
|
WHITE_HERMITE((s) -> new InterpolatedNoise(s, WHITE, InterpolationMethod.HERMITE)),
|
||||||
SIMPLEX(SimplexNoise::new),
|
SIMPLEX(SimplexNoise::new),
|
||||||
PERLIN(seed -> new PerlinNoise(seed).hermite()),
|
PERLIN(seed -> new PerlinNoise(seed).hermite()),
|
||||||
|
PERPLEX(PerplexNoise::new),
|
||||||
FRACTAL_BILLOW_SIMPLEX(FractalBillowSimplexNoise::new),
|
FRACTAL_BILLOW_SIMPLEX(FractalBillowSimplexNoise::new),
|
||||||
FRACTAL_BILLOW_PERLIN(FractalBillowPerlinNoise::new),
|
FRACTAL_BILLOW_PERLIN(FractalBillowPerlinNoise::new),
|
||||||
FRACTAL_FBM_SIMPLEX(FractalFBMSimplexNoise::new),
|
FRACTAL_FBM_SIMPLEX(FractalFBMSimplexNoise::new),
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||||
|
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.volmit.iris.util.noise;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.math.RNG;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perplex noise blends Perlin and Simplex noise by multiplying their outputs together.
|
||||||
|
* Both components are normalized to [0,1] so the product stays in [0,1].
|
||||||
|
*/
|
||||||
|
public class PerplexNoise implements NoiseGenerator {
|
||||||
|
private final NoiseGenerator perlin;
|
||||||
|
private final SimplexNoise simplex;
|
||||||
|
|
||||||
|
public PerplexNoise(long seed) {
|
||||||
|
PerlinNoise p = new PerlinNoise(new RNG(seed).lmax());
|
||||||
|
p.hermite();
|
||||||
|
this.perlin = p;
|
||||||
|
this.simplex = new SimplexNoise(new RNG(seed).lmax());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double noise(double x) {
|
||||||
|
return perlin.noise(x) * simplex.noise(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double noise(double x, double z) {
|
||||||
|
return perlin.noise(x, z) * simplex.noise(x, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double noise(double x, double y, double z) {
|
||||||
|
return perlin.noise(x, y, z) * simplex.noise(x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user