Updated TerrainGridTest: removed the original fractal code, as it is not used for this test anymore
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7646 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
5c8a7c4dd4
commit
c9993d87b8
@ -51,11 +51,6 @@ public class TerrainGridTest extends SimpleApplication {
|
|||||||
app.start();
|
app.start();
|
||||||
}
|
}
|
||||||
private CharacterControl player3;
|
private CharacterControl player3;
|
||||||
private FractalSum base;
|
|
||||||
private PerturbFilter perturb;
|
|
||||||
private OptimizedErode therm;
|
|
||||||
private SmoothFilter smooth;
|
|
||||||
private IterativeFilter iterate;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
@ -106,41 +101,6 @@ public class TerrainGridTest extends SimpleApplication {
|
|||||||
|
|
||||||
this.mat_terrain.setFloat("terrainSize", 513);
|
this.mat_terrain.setFloat("terrainSize", 513);
|
||||||
|
|
||||||
this.base = new FractalSum();
|
|
||||||
this.base.setRoughness(0.7f);
|
|
||||||
this.base.setFrequency(1.0f);
|
|
||||||
this.base.setAmplitude(1.0f);
|
|
||||||
this.base.setLacunarity(2.12f);
|
|
||||||
this.base.setOctaves(8);
|
|
||||||
this.base.setScale(0.02125f);
|
|
||||||
this.base.addModulator(new NoiseModulator() {
|
|
||||||
@Override
|
|
||||||
public float value(float... in) {
|
|
||||||
return ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
FilteredBasis ground = new FilteredBasis(this.base);
|
|
||||||
|
|
||||||
this.perturb = new PerturbFilter();
|
|
||||||
this.perturb.setMagnitude(0.119f);
|
|
||||||
|
|
||||||
this.therm = new OptimizedErode();
|
|
||||||
this.therm.setRadius(5);
|
|
||||||
this.therm.setTalus(0.011f);
|
|
||||||
|
|
||||||
this.smooth = new SmoothFilter();
|
|
||||||
this.smooth.setRadius(1);
|
|
||||||
this.smooth.setEffect(0.7f);
|
|
||||||
|
|
||||||
this.iterate = new IterativeFilter();
|
|
||||||
this.iterate.addPreFilter(this.perturb);
|
|
||||||
this.iterate.addPostFilter(this.smooth);
|
|
||||||
this.iterate.setFilter(this.therm);
|
|
||||||
this.iterate.setIterations(1);
|
|
||||||
|
|
||||||
ground.addPreFilter(this.iterate);
|
|
||||||
|
|
||||||
this.terrain = new TerrainGrid("terrain", 65, 1025, new ImageBasedHeightMapGrid(assetManager, new Namer() {
|
this.terrain = new TerrainGrid("terrain", 65, 1025, new ImageBasedHeightMapGrid(assetManager, new Namer() {
|
||||||
public String getName(int x, int y) {
|
public String getName(int x, int y) {
|
||||||
return "Scenes/TerrainMountains/mountains_" + (x * 512) + "_" + (y * 512) + ".png";
|
return "Scenes/TerrainMountains/mountains_" + (x * 512) + "_" + (y * 512) + ".png";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user