EDIT FIXED : I thought the size argument pretained to the size to set it to. My Bad :}
First off, this is based off the example code. This works if I let the original
heightMap made by the fault fractal. Then I save it, (RAW), and load the Raw using the RawHeightMap loader. Nothing pops up saying either that its loaded successfully or not ( Like it should ), and it blanks out my whole screen (my UI). And the screen is blank. Also, before loading it, I manually add the .raw to the filename so that the heightmap loader loads it.
//FaultFractalHeightMap heightMap = new FaultFractalHeightMap(257, 32, 0, 255,
// 0.75f);
//heightMap.save("rawtest");
//heightMap.unloadHeightMap();
/*RawHeightMap Load*/
heightMap2 = new RawHeightMap("rawtest.raw", 3);
Vector3f terrainScale = new Vector3f(10,1,10);
heightMap2.setHeightScale( 0.001f);
TerrainPage tb = new TerrainPage("Terrain", 33, heightMap2.getSize(), terrainScale,
heightMap2.getHeightMap(), false);
tb.setDetailTexture(1, 16);
ProceduralTextureGenerator pt = new ProceduralTextureGenerator(heightMap2);
pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader().getResource(
"jmetest/data/texture/grass.jpg")), -128, 0, 128);
pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader().getResource(
"jmetest/data/texture/dirt.jpg")), 0, 128, 255);
pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader().getResource(
"jmetest/data/texture/highest.jpg")), 128, 255, 384);
pt.createTexture(512);
TextureState ts = display.getRenderer().createTextureState();
ts.setEnabled(true);
Texture t1 = TextureManager.loadTexture(
pt.getImageIcon().getImage(),
Texture.MM_LINEAR_LINEAR,
Texture.FM_LINEAR,
true);
ts.setTexture(t1, 0);
Texture t2 = TextureManager.loadTexture(TestTerrain.class.getClassLoader().
getResource(
"jmetest/data/texture/Detail.jpg"),
Texture.MM_LINEAR_LINEAR,
Texture.FM_LINEAR);
ts.setTexture(t2, 1);
t2.setWrap(Texture.WM_WRAP_S_WRAP_T);
t1.setApply(Texture.AM_COMBINE);
t1.setCombineFuncRGB(Texture.ACF_MODULATE);
t1.setCombineSrc0RGB(Texture.ACS_TEXTURE);
t1.setCombineOp0RGB(Texture.ACO_SRC_COLOR);
t1.setCombineSrc1RGB(Texture.ACS_PRIMARY_COLOR);
t1.setCombineOp1RGB(Texture.ACO_SRC_COLOR);
t1.setCombineScaleRGB(1.0f);
t2.setApply(Texture.AM_COMBINE);
t2.setCombineFuncRGB(Texture.ACF_ADD_SIGNED);
t2.setCombineSrc0RGB(Texture.ACS_TEXTURE);
t2.setCombineOp0RGB(Texture.ACO_SRC_COLOR);
t2.setCombineSrc1RGB(Texture.ACS_PREVIOUS);
t2.setCombineOp1RGB(Texture.ACO_SRC_COLOR);
t2.setCombineScaleRGB(1.0f);
tb.setRenderState(ts);
FogState fs = display.getRenderer().createFogState();
fs.setDensity(0.5f);
fs.setEnabled(true);
fs.setColor(new ColorRGBA(0.5f, 0.5f, 0.5f, 0.5f));
fs.setEnd(1000);
fs.setStart(500);
fs.setDensityFunction(FogState.DF_LINEAR);
fs.setApplyFunction(FogState.AF_PER_VERTEX);
tb.setRenderState(fs);
rootNode.attachChild(tb);