Hi
I want to increase performance by using AreaClodMesh for my models. My code to
doing this is inspired form the HelloLOD-testclass. But if I let the game display
renderer.getStatistics(), nothing seems to happen when I move (very far) away
from the cloded model. Here is my code I am using for creating the AreaClodMesh:
private static Node getClodNode(Node parentNode, String modelPath) {
Node clodNode = new Node("Clod-Node");
for(Spatial child : parentNode.getChildren()) {
if(child instanceof Node) {
clodNode.attachChild(getClodNode((Node)child, modelPath));
} else if(child instanceof TriMesh) {
AreaClodMesh clodMesh = new AreaClodMesh(child.getName(), (TriMesh)child, null);
clodMesh.setTrisPerPixel(.5f);
clodMesh.setDistanceTolerance(0f);
clodMesh.setCullMode(SceneElement.CULL_DYNAMIC);
clodMesh.setModelBound(new BoundingSphere());
clodMesh.updateModelBound();
TextureLoader.updateTextureQuality(modelPath, clodMesh, child.getName());
clodMesh.setRenderState(child.getRenderState(RenderState.RS_MATERIAL));
clodMesh.updateRenderState();
clodNode.attachChild(clodMesh);
}
}
clodNode.setLocalScale(0.08f);
return clodNode;
}
In TextureLoader.updateTextureQuality() the texture is just applied, I don't think that this code
is relevant. Hope you can help me with this :)