TerrainBlock tb = new TerrainBlock("Terrain", heightMap.getSize(), 5, heightMap.getHeightMap(), new Vector3f(0,0,0), true);
TerrainBlock tb = new TerrainBlock("Terrain", heightMap.getSize(), 5, heightMap.getHeightMap(), new Vector3f(0,0,0), false);
    protected void initGame() {        Vector3f max = new Vector3f(0.5f, 0.5f, 0.5f);        Vector3f min = new Vector3f(-0.5f, -0.5f, -0.5f);                WireframeState ws = display.getRenderer().getWireframeState();        ws.setEnabled(false);                AlphaState as1 = display.getRenderer().getAlphaState();        as1.setBlendEnabled(true);        as1.setSrcFunction(AlphaState.SB_SRC_ALPHA);        as1.setDstFunction(AlphaState.DB_ONE);        as1.setTestEnabled(true);        as1.setTestFunction(AlphaState.TF_GREATER);        as1.setEnabled(true);                PointLight dr = new PointLight();        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.setLocation(new Vector3f(0.5f, -0.5f, 0));                        CullState cs = display.getRenderer().getCullState();        cs.setCullMode(CullState.CS_BACK);        cs.setEnabled(true);                LightState lightstate = display.getRenderer().getLightState();        lightstate.setTwoSidedLighting(true);        lightstate.setEnabled(true);        //lightstate.attach(dr);                lightNode = new LightNode("light", lightstate );                lightNode.setLight(dr);        Vector3f min2 = new Vector3f(-0.5f, -0.5f, -0.5f);        Vector3f max2 = new Vector3f(0.5f,0.5f,0.5f);        Box lightBox = new Box("box", min2,max2);        //lightBox.setForceView(true);        lightBox.setModelBound(new BoundingBox());        lightBox.updateModelBound();        lightNode.attachChild(lightBox);                        Node scene = new Node("scene");        lightNode.setTarget(scene);        scene.attachChild(lightNode);        scene.setRenderState(ws);        scene.setRenderState(lightstate);        root = new Node("Root node");                MidPointHeightMap heightMap = new MidPointHeightMap(128, 1.5f);        TerrainBlock tb = new TerrainBlock("Terrain", heightMap.getSize(), 5, heightMap.getHeightMap(), new Vector3f(0,0,0), true);        tb.setDetailTexture(1, 4);        tb.setModelBound(new BoundingBox());        tb.updateModelBound();        scene.attachChild(tb);        scene.setRenderState(cs);                TextureState ts = display.getRenderer().getTextureState();        ts.setEnabled(false);        Texture t1 = TextureManager.loadTexture(        		TestTerrain.class.getClassLoader().getResource("jmetest/data/texture/grassb.png"),				Texture.MM_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,				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);        scene.setRenderState(ts);        ZBufferState buf = display.getRenderer().getZBufferState();        buf.setEnabled(true);        buf.setFunction(ZBufferState.CF_LEQUAL);        TextureState font = display.getRenderer().getTextureState();        font.setTexture(            TextureManager.loadTexture(                TestTerrain.class.getClassLoader().getResource(                    "jmetest/data/font/font.png"),                Texture.MM_LINEAR,                Texture.FM_LINEAR,                true));        font.setEnabled(true);        fps = new Text("FPS counter", "");        fps.setRenderState(font);        fps.setRenderState(as1);                scene.setRenderState(buf);        root.attachChild(scene);        root.attachChild(fps);        root.setForceView(true);        root.updateGeometricState(0.0f, true);        root.updateRenderState();    }