I’ve spent some time Googling and searching the forums. I apologize if this has been asked many times before…
Is there any built-in support for selecting between a group of models/meshes with different levels of detail?
I can write a script to select between model/mesh versions based on their distance from the camera and the camera’s zoom level. Before doing so, I’m curious if there’s built-in support or a preferred method.
Thanks.
I think the easiest(best?) way is to put all your LOD meshes for an object in different layers. You can than use camera culling to display the appropriate LOD. The setup is to have several cameras with the exact same position, field of view etc, but with different clipping ranges and layer cullings.
ie camera 1 renders from 0-100 meters with the high LOD layers enabled. camera 2 renders from 101+ meters with the low LOD layers enabled.
You will need to set the appropriate depth/clearing settings. Check out the Camera docs for instructions on this.
careyagimon:
That’s an interesting idea. It would take very little coding. One problem I see is that it would not be possible to implement hysteresis to prevent popping back and forth between LODs. That’s not a big deal for my game though.
I’m going to look into creating an LODModel object that has multiple meshes as member variables. It should be possible to dynamically select the correct mesh based on the current camera. This might be fun…