mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-18 14:50:56 +00:00
fix cellular sampler
This commit is contained in:
+6
@@ -279,8 +279,11 @@ public class CellularSampler extends NoiseFunction {
|
|||||||
|
|
||||||
if(distanceFunction == DistanceFunction.Euclidean && returnType != ReturnType.CellValue) {
|
if(distanceFunction == DistanceFunction.Euclidean && returnType != ReturnType.CellValue) {
|
||||||
distance0 = Math.sqrt(distance0);
|
distance0 = Math.sqrt(distance0);
|
||||||
|
|
||||||
|
if (returnType != ReturnType.Distance) {
|
||||||
distance1 = Math.sqrt(distance1);
|
distance1 = Math.sqrt(distance1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return switch(returnType) {
|
return switch(returnType) {
|
||||||
case CellValue -> closestHash * (1 / 2147483648.0);
|
case CellValue -> closestHash * (1 / 2147483648.0);
|
||||||
@@ -368,8 +371,11 @@ public class CellularSampler extends NoiseFunction {
|
|||||||
|
|
||||||
if(distanceFunction == DistanceFunction.Euclidean && returnType != ReturnType.CellValue) {
|
if(distanceFunction == DistanceFunction.Euclidean && returnType != ReturnType.CellValue) {
|
||||||
distance0 = Math.sqrt(distance0);
|
distance0 = Math.sqrt(distance0);
|
||||||
|
|
||||||
|
if (returnType != ReturnType.Distance) {
|
||||||
distance1 = Math.sqrt(distance1);
|
distance1 = Math.sqrt(distance1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return switch(returnType) {
|
return switch(returnType) {
|
||||||
case CellValue -> closestHash * (1 / 2147483648.0);
|
case CellValue -> closestHash * (1 / 2147483648.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user