This commit is contained in:
Daniel Mills 2020-11-01 10:14:50 -05:00
parent 7a7fee1d8a
commit cfc8458841
5 changed files with 43 additions and 15 deletions

22
.idea/workspace.xml generated
View File

@ -74,7 +74,7 @@
<recent name="C:\Users\cyberpwn\Documents\development\workspace\Iris\src\main\java\com\volmit\iris\gen\v2\scaffold\hunk" /> <recent name="C:\Users\cyberpwn\Documents\development\workspace\Iris\src\main\java\com\volmit\iris\gen\v2\scaffold\hunk" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Maven.Iris Build"> <component name="RunManager" selected="Maven.Iris Release">
<configuration default="true" type="MavenRunConfiguration" factoryName="Maven"> <configuration default="true" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings> <MavenSettings>
<option name="myGeneralSettings" /> <option name="myGeneralSettings" />
@ -147,22 +147,22 @@
<screen x="0" y="0" width="1920" height="1050" /> <screen x="0" y="0" width="1920" height="1050" />
</state> </state>
<state x="485" y="234" key="#com.intellij.structuralsearch.plugin.ui.StructuralSearchDialog/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1603860057506" /> <state x="485" y="234" key="#com.intellij.structuralsearch.plugin.ui.StructuralSearchDialog/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1603860057506" />
<state width="1921" height="983" key="GridCell.Tab.0.bottom" timestamp="1604241709027"> <state width="1921" height="983" key="GridCell.Tab.0.bottom" timestamp="1604243429163">
<screen x="0" y="0" width="1920" height="1050" /> <screen x="0" y="0" width="1920" height="1050" />
</state> </state>
<state width="1921" height="983" key="GridCell.Tab.0.bottom/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604241709027" /> <state width="1921" height="983" key="GridCell.Tab.0.bottom/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604243429163" />
<state width="1921" height="983" key="GridCell.Tab.0.center" timestamp="1604241709026"> <state width="1921" height="983" key="GridCell.Tab.0.center" timestamp="1604243429163">
<screen x="0" y="0" width="1920" height="1050" /> <screen x="0" y="0" width="1920" height="1050" />
</state> </state>
<state width="1921" height="983" key="GridCell.Tab.0.center/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604241709026" /> <state width="1921" height="983" key="GridCell.Tab.0.center/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604243429163" />
<state width="1921" height="983" key="GridCell.Tab.0.left" timestamp="1604241709026"> <state width="1921" height="983" key="GridCell.Tab.0.left" timestamp="1604243429163">
<screen x="0" y="0" width="1920" height="1050" /> <screen x="0" y="0" width="1920" height="1050" />
</state> </state>
<state width="1921" height="983" key="GridCell.Tab.0.left/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604241709026" /> <state width="1921" height="983" key="GridCell.Tab.0.left/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604243429163" />
<state width="1921" height="983" key="GridCell.Tab.0.right" timestamp="1604241709027"> <state width="1921" height="983" key="GridCell.Tab.0.right" timestamp="1604243429163">
<screen x="0" y="0" width="1920" height="1050" /> <screen x="0" y="0" width="1920" height="1050" />
</state> </state>
<state width="1921" height="983" key="GridCell.Tab.0.right/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604241709027" /> <state width="1921" height="983" key="GridCell.Tab.0.right/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604243429163" />
<state x="312" y="0" key="SettingsEditor" timestamp="1603947206451"> <state x="312" y="0" key="SettingsEditor" timestamp="1603947206451">
<screen x="0" y="0" width="1920" height="1050" /> <screen x="0" y="0" width="1920" height="1050" />
</state> </state>
@ -175,9 +175,9 @@
<screen x="0" y="0" width="1920" height="1050" /> <screen x="0" y="0" width="1920" height="1050" />
</state> </state>
<state x="532" y="239" key="run.anything.popup/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1603859771295" /> <state x="532" y="239" key="run.anything.popup/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1603859771295" />
<state x="539" y="15" width="840" height="1034" key="search.everywhere.popup" timestamp="1604060078796"> <state x="539" y="15" width="840" height="1034" key="search.everywhere.popup" timestamp="1604241752782">
<screen x="0" y="0" width="1920" height="1050" /> <screen x="0" y="0" width="1920" height="1050" />
</state> </state>
<state x="539" y="15" width="840" height="1034" key="search.everywhere.popup/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604060078796" /> <state x="539" y="15" width="840" height="1034" key="search.everywhere.popup/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604241752782" />
</component> </component>
</project> </project>

View File

@ -59,6 +59,11 @@ public class GenLayerBiome extends GenLayer
return null; return null;
} }
if(!iris.getDimension().getFocusRegion().trim().isEmpty())
{
return iris.loadRegion(iris.getDimension().getFocusRegion());
}
return regionGenerator.fitRarity(iris.getDimension().getAllRegions(iris), bx, bz); return regionGenerator.fitRarity(iris.getDimension().getAllRegions(iris), bx, bz);
} }

View File

@ -239,6 +239,11 @@ public class IrisDimension extends IrisRegistrant
@Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.") @Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.")
private String focus = ""; private String focus = "";
@RegistryListBiome
@DontObfuscate
@Desc("Keep this either undefined or empty. Setting any region name into this will force iris to only generate the specified region. Great for testing.")
private String focusRegion = "";
@MinNumber(0.0001) @MinNumber(0.0001)
@MaxNumber(512) @MaxNumber(512)
@DontObfuscate @DontObfuscate

View File

@ -41,6 +41,10 @@ public class IrisGenerator extends IrisRegistrant
@Desc("The opacity, essentially a multiplier on the output.") @Desc("The opacity, essentially a multiplier on the output.")
private double opacity = 1; private double opacity = 1;
@DontObfuscate
@Desc("Multiply the compsites instead of adding them")
private boolean multiplicitive = false;
@MinNumber(0.001) @MinNumber(0.001)
@DontObfuscate @DontObfuscate
@Desc("The size of the cell fractures") @Desc("The size of the cell fractures")
@ -252,15 +256,24 @@ public class IrisGenerator extends IrisRegistrant
int hc = (int) ((cliffHeightMin * 10) + 10 + cliffHeightMax * seed + offsetX + offsetZ); int hc = (int) ((cliffHeightMin * 10) + 10 + cliffHeightMax * seed + offsetX + offsetZ);
double h = 0; double h = 0;
double tp = 0; double tp = multiplicitive ? 1 : 0;
for(IrisNoiseGenerator i : composite) for(IrisNoiseGenerator i : composite)
{
if(multiplicitive)
{
tp *= i.getOpacity();
h *= i.getNoise(seed + superSeed + hc, (rx + offsetX) / zoom, (rz + offsetZ) / zoom);
}
else
{ {
tp += i.getOpacity(); tp += i.getOpacity();
h += i.getNoise(seed + superSeed + hc, (rx + offsetX) / zoom, (rz + offsetZ) / zoom); h += i.getNoise(seed + superSeed + hc, (rx + offsetX) / zoom, (rz + offsetZ) / zoom);
} }
}
double v = (h / tp) * opacity; double v = multiplicitive ? h * opacity : (h / tp) * opacity;
if(Double.isNaN(v)) if(Double.isNaN(v))
{ {

View File

@ -13,5 +13,10 @@ public abstract class GenLayer
this.rng = rng; this.rng = rng;
} }
public GenLayer()
{
this(null, null);
}
public abstract double generate(double x, double z); public abstract double generate(double x, double z);
} }