Mesh Disappears, Leaves Only Skybox

Hello Monkey Friends,



I’m having an issue where moving away from objects causes them to disappear after a certain distance, but the Skybox continues to render behind it.  What’s also odd is that where buildings that have disappeared once were, there is a hole left in the mesh under it.  Hopefully this picture should speak some words (The opening just above the buildings is where other meshes have disappeared from, leaving that hole):







It doesn’t seem like a frustum problem since the skybox is still visible in the distance, so I was thinking a CullState issue.  The problem is still there after removing cullstates as well.  Any ideas?

Hmm,…ZBuffer is set?

As far as I know, skybox should be drawn very first in the render queue, so everything else is rendered on top of it.

it means it should be attached to rootNode just before any other node.

Something like in TestIsland.java


    protected void simpleInitGame() {
        display.setTitle("Test Island");

        setupEnvironment();

        createTerrain();
        createReflectionTerrain();

        buildSkyBox();

        rootNode.attachChild(skybox); // attached first
        rootNode.attachChild(splatTerrain);
        //...
  }


ttrocha said:

Hmm,...ZBuffer is set?


Have tried it with and without the ZBufferState set.  I'll try playing around with the test functions though.  Could this be a clip state issue?  It's just strange that it's only happening to rootNode children that aren't the skybox.

@KevinK: Yes, it's attached before any of the geometry.  It renders fine until you get a certain distance away from it.

Do you update Skybox location as camera location changes?

Something like:


    protected void simpleUpdate() {
        skybox.getLocalTranslation().set(cam.getLocation());
        skybox.updateGeometricState(0.0f, true);
    }

KevinK said:

Do you update Skybox location as camera location changes?
Something like:


    protected void simpleUpdate() {
        skybox.getLocalTranslation().set(cam.getLocation());
        skybox.updateGeometricState(0.0f, true);
    }




yep, it moves along with the camera, though the height never changes..  I'm going to have to go back through the repo revisions and find what changed in the code (not jME, our project :p).  /sigh