Apply axialFracturing to a style's built-in fractures

axialFracturing on a style only changed how that style fractures its
parent, so setting it on a style like IRIS changed nothing. It now also
makes the style's own built-in fractures axial. A fracture the pack
adds keeps its own axialFracturing setting.

Model used: Claude Opus 5.5
This commit is contained in:
piexel committed 2026-10-18 14:38:20 +02:00
1 parent 855ab90be4
commit 6f930d1370
2 files changed
+16 -1

No files matched your search

@@ -64,7 +64,7 @@ public class IrisGeneratorStyle {
@MinNumber(0.00001)
@Desc("The Output multiplier. Only used if parent is fracture.")
private double multiplier = 1;
@Desc("If set to true, each axis is warped by its own sample of this fracture instead of one shared value, which avoids straight diagonal lines. This is usually 2 or 3 times slower than normal.")
@Desc("If set to true, each axis is warped by its own sample instead of one shared value, for the most natural looking fracturing. Applies to this style's built-in fractures, and to how this style fractures its parent when used as a fracture. This is usually 2 or 3 times slower than normal, more for styles with many built-in fractures such as IRIS.")
private boolean axialFracturing = false;
@Desc("Apply a generator to the coordinate field fed into this parent generator. I.e. Distort your generator with another generator.")
private IrisGeneratorStyle fracture = null;
@@ -121,6 +121,10 @@ public class IrisGeneratorStyle {
cng = cng.scale(1D / zoom).pow(exponent).bake();
cng.setTrueFracturing(axialFracturing);
if (axialFracturing) {
cng.makeNestedFracturesAxial();
}
if (fracture != null) {
cng.fractureWith(fracture.create(rng.nextParallelRNG(2934), data), fracture.getMultiplier());
}
@@ -314,6 +314,17 @@ public class CNG {
return rng;
}
public void makeNestedFracturesAxial() {
if (fracture != null) {
fracture.setTrueFracturing(true);
fracture.makeNestedFracturesAxial();
}
if (children != null) {
children.forEach(CNG::makeNestedFracturesAxial);
}
}
public CNG fractureWith(CNG c, double scale) {
fracture = c;
fscale = scale;