[Terrain Rendering] Attach/detach sons of a BranchGroup
Hi, i'm writing a terrain system to handle very large terrain.
Mi terrain is divided into square (called "tile"), in order to load in memory only the tile near the range of the filed of view of the viewer and visualize only the piece of terrain inside the view frustum.
This tile are simple Shape3D but its geometry could change when the camera is moved away or near the tile (it's a LOD based on geomipmapping algorithm).
I've a quadtree to perform fast culling.
The root of the terrain is a BranchGroup.
This Bg holds as son all the tiles that currently visible so I need to continuosly attach/detach son of this BranchGroup.
What is the overhead in doing this?
I ask this because I don't want to load all the tiles in memory (for memory limits reasons) and since I perform frustum culling I don't know why I should leave the tile that are not currently visible attached to the branchgroup that representes the root of the terrain. I think that in this way I save some cpu cycles since the java3d rendering engine don't perform any operation on the object that aren't attached to the scenegraph.
But, if attaching/detaching child of the branchgroup has some overhead maybe I must find another solution.
Hope you can help me.