Parts of heightmap appear/disappear

I'm guessing this is due to the complexity/oddity of this particular heightmap, but I would like someone to confirm that before I go any further:



here are three screen caps - notice how as I move to the right the 'mountain' in the center magically appears

www.tsourceweb.com/files/jme_ss1.png

www.tsourceweb.com/files/jme_ss2.png

www.tsourceweb.com/files/jme_ss3.png



here is the heightmap it is based off of:

www.tsourceweb.com/files/test_hm.gif



I am using a regular StandardGame for this test, nothing special.

I am still experiencing this issue - does anyone have any insight on it?



heightmap:

http://www.tsourceweb.com/files/test_hm2.gif



Here are more screenshots. 

http://www.tsourceweb.com/files/jme_ss4.png

http://www.tsourceweb.com/files/jme_ss5.png

http://www.tsourceweb.com/files/jme_ss6.png

http://www.tsourceweb.com/files/jme_ss7.png

http://www.tsourceweb.com/files/jme_ss8.png

http://www.tsourceweb.com/files/jme_ss9.png

http://www.tsourceweb.com/files/jme_ss10.png

http://www.tsourceweb.com/files/jme_ss11.png

http://www.tsourceweb.com/files/jme_ss12.png



Notice how when I move parallel to the trench the walls clip away along with my movement.  It isn't dependent on how close I am to the object. 



I am applying the texture with the command:

tmpTS.setTexture(TextureManager.loadTexture(tmpII.getImage(),Texture.MM_LINEAR_LINEAR,Texture.FM_LINEAR,true));



I do not have any lights set up - just using whatever is default to StandardGame at the moment.

Looks a bit like your zbuffer is somehow messed up. Do you have the latest graphics drivers installed?

You can also try toying around with the camera's far and near planes to get a better zbuffer resolution.

Did You use a 16Bit Raw File? In Past der was a problem, because in your grafik the vlaues are from "0 to 65K", but java swaps them to "0 to 32K and -32K to 0".

We made a map from black to grey instead of wheite, so we only used 15Bit of the 16Bit image File, and than it works.



I thoungt the Problem is solved, but I never tested it again, would you try a 8Bit File?

It isn't a driver issue for sure - I've tried it on an ubuntu laptop with the nix driver, and an XP box with the proper nvidia drivers.  I'd hope it isn't a zbuffer setting - because I am using StandardGame, I would think all those would be set up properly by default.



Also, it happens almost like a line down the middle of the screen when I move in the X axis, almost like jME can't agree with itself what the actual terrain should look like on the screen - it's very odd.



I can reproduce the problem with both raw files and gif files (using raw heightmap and image based heightmap).  I am only using values 0-255 for height at this point.




There definitely seems to be a Z-buffer / State issue… try putting some updateGeometricState adn UpdateRenderState here and there to see if it fixes it.

looks like a z-fight.

Finally had a chance to look at this again - here's the problem


            tmpTB.setModelBound(new BoundingBox());
            tmpTB.updateModelBound();
            tmpTB.updateRenderState();
            state.getRootNode().attachChild(tmpTB);



apparently I have to update the render state on the root node as well - because when I added state.getRootNode().updateRenderState(); after the attachChild the terrain distortion disappeared.  For some reason it also makes the lighting much darker - from daylight to dusk basically.  I am just using whatever the default lighting setup is for StandardGame, so that's probably why - I'll play around with adding my own lights later.