mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Parallax optimization for jigsaw radii
This commit is contained in:
parent
031601bfa6
commit
46d810eddf
@ -65,6 +65,8 @@ public class IrisJigsawPiece extends IrisRegistrant
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public IrisJigsawPieceConnector getConnector(IrisPosition relativePosition) {
|
public IrisJigsawPieceConnector getConnector(IrisPosition relativePosition) {
|
||||||
for(IrisJigsawPieceConnector i : connectors)
|
for(IrisJigsawPieceConnector i : connectors)
|
||||||
{
|
{
|
||||||
|
@ -31,6 +31,10 @@ public class IrisJigsawStructure extends IrisRegistrant
|
|||||||
@Desc("The maximum pieces that can step out from the center piece")
|
@Desc("The maximum pieces that can step out from the center piece")
|
||||||
private int maxDepth = 9;
|
private int maxDepth = 9;
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("Jigsaw grows the parallax layer which slows iris down a bit. Since there are so many pieces, Iris takes the avg piece size and calculates the parallax radius from that. Unless your structures are using only the biggest pieces, your structure should fit in the chosen size fine. If you are seeing cut-off parts of your structures or broken terrain, turn this option on. This option will pick the biggest piece dimensions and multiply it by your (maxDepth+1) * 2 as the size to grow the parallax layer by. But typically kepp this off.")
|
||||||
|
private boolean useMaxPieceSizeForParallaxRadius = false;
|
||||||
|
|
||||||
@Desc("Add a noise feature to this village")
|
@Desc("Add a noise feature to this village")
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
private IrisFeature feature = null;
|
private IrisFeature feature = null;
|
||||||
@ -85,6 +89,8 @@ public class IrisJigsawStructure extends IrisRegistrant
|
|||||||
public int getMaxDimension()
|
public int getMaxDimension()
|
||||||
{
|
{
|
||||||
return maxDimension.aquire(() -> {
|
return maxDimension.aquire(() -> {
|
||||||
|
if(useMaxPieceSizeForParallaxRadius)
|
||||||
|
{
|
||||||
int max = 0;
|
int max = 0;
|
||||||
KList<String> pools = new KList<>();
|
KList<String> pools = new KList<>();
|
||||||
KList<String> pieces = new KList<>();
|
KList<String> pieces = new KList<>();
|
||||||
@ -100,6 +106,28 @@ public class IrisJigsawStructure extends IrisRegistrant
|
|||||||
}
|
}
|
||||||
|
|
||||||
return max * (((getMaxDepth() + 1) * 2) + 1);
|
return max * (((getMaxDepth() + 1) * 2) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int max = 0;
|
||||||
|
KList<String> pools = new KList<>();
|
||||||
|
KList<String> pieces = new KList<>();
|
||||||
|
|
||||||
|
for(String i : getPieces())
|
||||||
|
{
|
||||||
|
loadPiece(i, pools, pieces);
|
||||||
|
}
|
||||||
|
|
||||||
|
int avg = 0;
|
||||||
|
|
||||||
|
for(String i : pieces)
|
||||||
|
{
|
||||||
|
avg += getLoader().getJigsawPieceLoader().load(i).getMax2dDimension();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (avg/pieces.size()) * (((getMaxDepth() + 1) * 2) + 1);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user