mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-28 06:50:02 +00:00
Compiled scalar group heights
- Layer and generator programs sample single points through NoiseProgram.sample2D - Scalar interpolator group means use the compiled programs when the seed matches - Single-point program heights are property-tested against the generator path
This commit is contained in:
1 parent
fa996a2e24
commit
a25233edbc
5 files changed
+180
-2
No files matched your search
@@ -39,6 +39,26 @@ public class GeneratorProgramParityTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void singlePointProgramHeightsMatchScalarHeightsBitForBit() {
|
||||
SplittableRandom random = new SplittableRandom(0xFEEDL);
|
||||
TerrainBatchScratch scratch = new TerrainBatchScratch();
|
||||
for (int generatorIndex = 0; generatorIndex < 160; generatorIndex++) {
|
||||
long shapeSeed = random.nextLong();
|
||||
IrisGenerator scalar = generator(new SplittableRandom(shapeSeed));
|
||||
IrisGenerator compiled = generator(new SplittableRandom(shapeSeed));
|
||||
long superSeed = random.nextLong();
|
||||
GeneratorProgram program = compiled.compileProgram(superSeed);
|
||||
for (int sample = 0; sample < 400; sample++) {
|
||||
double x = coordinate(random);
|
||||
double z = random.nextInt(5) == 0 ? x : coordinate(random);
|
||||
assertEquals("generator " + generatorIndex + " point " + x + "," + z,
|
||||
Double.doubleToRawLongBits(scalar.getHeight(x, z, superSeed)),
|
||||
Double.doubleToRawLongBits(program.height(scratch, x, z)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void chunkGridsMatchScalarHeightsBitForBit() {
|
||||
SplittableRandom random = new SplittableRandom(0xC0FFEEL);
|
||||
|
||||
Reference in new issue
Block a user