9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-19 15:09:18 +00:00

add option to control the noise threshold for cave shapes

This commit is contained in:
Julian Krings
2025-09-05 16:06:53 +02:00
parent 609a3585c1
commit 1d81daafbb
2 changed files with 7 additions and 4 deletions

View File

@@ -104,7 +104,7 @@ public class IrisCave extends IrisRegistrant {
CNG cng = shape.getNoise(base.nextParallelRNG(8131545), engine); CNG cng = shape.getNoise(base.nextParallelRNG(8131545), engine);
KSet<IrisPosition> mask = shape.getMasked(rng, engine); KSet<IrisPosition> mask = shape.getMasked(rng, engine);
writer.setNoiseMasked(points, writer.setNoiseMasked(points,
girth, cng.noise(x, y, z), cng, mask, true, girth, shape.getNoiseThreshold() < 0 ? cng.noise(x, y, z) : shape.getNoiseThreshold(), cng, mask, true,
(xf, yf, zf) -> yf <= h ? w : c); (xf, yf, zf) -> yf <= h ? w : c);
} }

View File

@@ -1,9 +1,7 @@
package com.volmit.iris.engine.object; package com.volmit.iris.engine.object;
import com.volmit.iris.engine.framework.Engine; import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.annotations.Desc; import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
import com.volmit.iris.engine.object.annotations.Snippet;
import com.volmit.iris.util.collection.KMap; import com.volmit.iris.util.collection.KMap;
import com.volmit.iris.util.collection.KSet; import com.volmit.iris.util.collection.KSet;
import com.volmit.iris.util.math.M; import com.volmit.iris.util.math.M;
@@ -25,6 +23,11 @@ public class IrisCaveShape {
@Desc("Noise used for the shape of the cave") @Desc("Noise used for the shape of the cave")
private IrisGeneratorStyle noise = new IrisGeneratorStyle(); private IrisGeneratorStyle noise = new IrisGeneratorStyle();
@MinNumber(0)
@MaxNumber(1)
@Desc("The threshold for noise mask")
private double noiseThreshold = -1;
@RegistryListResource(IrisObject.class) @RegistryListResource(IrisObject.class)
@Desc("Object used as mask for the shape of the cave") @Desc("Object used as mask for the shape of the cave")
private String object = null; private String object = null;