t2.setCombineScaleRGB(0);
t2.setCombineScaleRGB(1.0f);
  protected void simpleInitGame() {      rootNode.setRenderQueueMode(Renderer.QUEUE_OPAQUE);      fpsNode.setRenderQueueMode(Renderer.QUEUE_OPAQUE);    DirectionalLight dl = new DirectionalLight();    dl.setDiffuse(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));    dl.setDirection(new Vector3f(1, -0.5f, 1));    dl.setEnabled(true);    lightState.attach(dl);    cam.setFrustum(1.0f, 1000.0f, -0.55f, 0.55f, 0.4125f, -0.4125f);    cam.update();    camNode = new CameraNode("Camera Node", cam);    camNode.setLocalTranslation(new Vector3f(0, 250, -20));    camNode.updateWorldData(0);    input = new NodeHandler(this, camNode, properties.getRenderer());    rootNode.attachChild(camNode);    input.setKeySpeed(150f);    input.setMouseSpeed(1f);    display.setTitle("Terrain Test");    display.getRenderer().setBackgroundColor(new ColorRGBA(0.5f,0.5f,0.5f,1));    DirectionalLight dr = new DirectionalLight();    dr.setEnabled(true);    dr.setDiffuse(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));    dr.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));    dr.setDirection(new Vector3f(0.5f, -0.5f, 0));    CullState cs = display.getRenderer().getCullState();    cs.setCullMode(CullState.CS_BACK);    cs.setEnabled(true);    rootNode.setRenderState(cs);    lightState.setTwoSidedLighting(true);    lightState.attach(dr);    //MidPointHeightMap heightMap = new MidPointHeightMap(128, 1.9f);    FaultFractalHeightMap heightMap = new FaultFractalHeightMap(257, 32, 0, 255,        0.75f);    Vector3f terrainScale = new Vector3f(10,1,10);    TerrainPage tb = new TerrainPage("Terrain", 33, heightMap.getSize(), terrainScale,                                     heightMap.getHeightMap(), false);    tb.setDetailTexture(1, 16);    rootNode.attachChild(tb);    ProceduralTextureGenerator pt = new ProceduralTextureGenerator(heightMap);    pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader().getResource(        "jmetest/data/texture/grassb.png")), -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().getTextureState();    ts.setEnabled(true);    Texture t1 = TextureManager.loadTexture(        pt.getImageIcon().getImage(),        Texture.MM_LINEAR_LINEAR,        Texture.FM_LINEAR,        true,        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,                                            true);    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(0);    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(0);    rootNode.setRenderState(ts);    FogState fs = display.getRenderer().getFogState();    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);    rootNode.setRenderState(fs);  }