Hello,
Atm i try to get some knowledge about a simple lod system and setting it up with trees.
Ok, i have made a tree:
As you can see it is made out of 28 objects (1 object is lamp)
I have given every object a lod property with a set distance in it (50 for leaves, 60, 70 and 80 for branches and 100 for the feet).
I also made a verry simple lod system:
from bge import logic
def lod():
cont = logic.getCurrentController()
scene_objects = logic.getCurrentScene().objects
own = cont.owner
for obj in scene_objects:
if 'lod' in obj:
distance = own.getDistanceTo(obj)
if distance > obj['lod']:
#maak ontzichtbaar en stop physics
obj.visible = False
obj.suspendDynamics()
else:
#maak zichtbaar en re-activeer physics
obj.visible = True
obj.restoreDynamics()
lod()
It works great, now i am wondering… is this a good setup?
Or can i better combine all the leaves and the 3 branches so we get like 3 objects to work with?
I thought that it gives better graphics this way, and the back of the tree (when out of range) will be removed so it will be easier to calculate?
Can someone tell me a good method for this?
Thank you.