Pass octave counts through the noise offset wrapper

NoiseType.create wraps every noise in OffsetNoiseGenerator, which was not
an OctaveNoise, so CNG never set the octaves on the noise inside it. Every
multi-octave style sampled one octave: no fine detail, and a value spread
about twice as wide (natureplanet's continent style marked 21% of the world
as sea instead of v3's 6%). The wrapper now forwards setOctaves to the noise
it wraps, as VolmLib's v4 wrapper does.
This commit is contained in:
piexel committed 2026-11-10 20:24:33 +01:00
1 parent 65a6cebe9c
commit cd7e9e3416
2 files changed
+54 -1

No files matched your search

@@ -5,7 +5,7 @@ import art.arcane.volmlib.util.math.RNG;
import org.jetbrains.annotations.NotNull;
public class OffsetNoiseGenerator implements NoiseGenerator {
public class OffsetNoiseGenerator implements NoiseGenerator, OctaveNoise {
private static final int GENERIC = 0;
private static final int SIMPLEX = 1;
private static final int PERLIN = 2;
@@ -36,6 +36,13 @@ public class OffsetNoiseGenerator implements NoiseGenerator {
oz = rng.nextInt(Short.MIN_VALUE, Short.MAX_VALUE);
}
@Override
public void setOctaves(int octaves) {
if (base instanceof OctaveNoise octaveBase) {
octaveBase.setOctaves(octaves);
}
}
@Override
public double noise(double x) {
return switch (dispatchKind) {