Hey everyone,
I played around with jmetest.effects.water.TestProjectedWater and put in a galeone model (using similar code as in the jmetest.renderer.loader.TestColladaLoading). I then tried to have it culled when it's not in the camera frustrum, creating a subnode to reflectedNode and setting its cull mode to CULL_DYNAMIC. This does not seem to work though: mesh, triangle and vertex count stay the same, alternating between two numbers (it is 29 and 79 for meshes). I tried to add the ship directly to the reflectedNode and setting the reflectedNode cull mode to CULL_DYNAMIC. Now it culls the whole sea, rendering 29 meshes when not looking at the ship.
Here is my simpleInitGame, if you need the whole source code and the model, I will upload it aswell, but maybe you can already tell by this snippet what I am doing wrong:
protected void simpleInitGame() {
display.setTitle("Water Test");
setupCamera();
reflectedNode.attachChild(createSkyBox());
reflectedNode.attachChild(modelNode);
rootNode.attachChild(reflectedNode);
modelNode.setCullMode(SceneElement.CULL_DYNAMIC);
setupWater();
RenderPass rootPass = new RenderPass();
rootPass.add(rootNode);
pManager.add(rootPass);
RenderPass fpsPass = new RenderPass();
fpsPass.add(fpsNode);
pManager.add(fpsPass);
rootNode.setCullMode(SceneElement.CULL_NEVER);
rootNode.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
fpsNode.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
try {
modelNode.attachChild(loadModel("Galeone4"));
} catch (URISyntaxException e) {
e.printStackTrace();
}
}
Why does the mesh count alternate when looking at the model? Does anybody see what I am doing wrong here?