Hello,
I recently started using DiscreteLODNode and noticed that I can only use 300 of this in my scene before the application crashes because it's out of memory. I am allocation 1gb of memory to the application and only allows me to render 300 DiscreteLODNodes before crashing. With same memory allocation, I was able to render more than 40,000 of the regular Nodes.
Am I missing something or is this behavior expected?
Here is the code I am using for testing purposes.
Where variable files are all the pictures I have inside a folder ( 34).
int j =0;
for(int i=0; i < (files.length * 9); i++){
System.out.println("loading slide number: " + i);
if(j == files.length ){
j = 0;
}
TextureState.overrideNonPowerOfTwoTextureSupport(false);
BufferedImage image = ImageIO.read(files[j]);
Node sceneRoot = new Node("Slide Root");
DistanceSwitchModel ds = new DistanceSwitchModel(2);
ds.setModelDistance(0, 0, 30);
ds.setModelDistance(1, 30, Integer.MAX_VALUE);
DiscreteLodNode node = new DiscreteLodNode("test", ds);
Quad quad = new Quad("temporary");
node.attachChild(highLevelSlide(quad, image));
node.attachChild(lowDetailSlide());
node.setModelBound(new BoundingBox());
node.updateModelBound();
node.updateGeometricState(.5f, false);
node.updateRenderState();
sceneRoot.setLocalTranslation(0,0,0);
node.setActiveChild(0);
//attach this LOD node to the parent
sceneRoot.attachChild(node);
sceneRoot.setModelBound(new BoundingBox());
sceneRoot.updateModelBound();
sceneRoot.updateGeometricState(.5f, false);
sceneRoot.updateRenderState();
j++;
rootNode.attachChild(sceneRoot);
}
thanks