private void assignTexture(TerrainBlock tb, ImageBasedHeightMap heightMap)
{
@SuppressWarnings("unused")
float[] hm = tb.getHeightMap();
// generate a terrain texture with 2 textures
ProceduralTextureGenerator pt = new ProceduralTextureGenerator(heightMap);
pt.addTexture(new ImageIcon(getClass().getClassLoader().getResource(
"data/water.jpg")), 0, 60, 100);
pt.addTexture(new ImageIcon(getClass().getClassLoader().getResource(
"jmetest/data/texture/dirt.jpg")), 60, 100, 200);
pt.addTexture(new ImageIcon(getClass().getClassLoader().getResource(
"jmetest/data/texture/highest.jpg")), 100, 200, 380);
pt.createTexture(512);
// assign the texture to the terrain
TextureState ts1 = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
ts1.setEnabled(true);
Texture t1 = TextureManager.loadTexture(pt.getImageIcon().getImage(),MinificationFilter.NearestNeighborLinearMipMap,MagnificationFilter.NearestNeighbor,
ts1.getMaxAnisotropic(), true);
Texture t2 = TextureManager.loadTexture(new ImageIcon(
getClass().getClassLoader().getResource(