How to do LOD with multiple cameras?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Zylann
:warning: Old Version Published before Godot 3 was released.

I have projects in mind involving heavy reliance on Level of Detail, however something confuses me with Godot:

Usually, the idea is to render a different mesh depending on the distance you are from it. So it looks easy to script that on a Spatial having several MeshInstances as child, each of them being a different LOD.
But…
This will not work if there are multiple cameras in the world, because only one LOD can be active at a time with this method :confused:

So I’m wondering… how is this possible to do with Godot, assuming that the project could be an open-world with a huge streamed map?

You could measure the distance to the nearest camera and determine the LoD from that distance.
One thing to think about is:
When you have one camera near at your object and one far away, the object will be rendered in high LoD. I don’t know if it’s better to render the same high-LoD mesh twice or two different meshes with one high and one low LoD…

timoschwarzer | 2016-08-14 18:56

This is exactly what I’m concerned about. The only way I know would be to determine the LOD at the render stage, not the process stage. But I have no idea how Godot handles it, or if it handles LOD at all.

Zylann | 2016-08-14 18:59

:bust_in_silhouette: Reply From: Leonard Meagher

You should be able to use different mesh instances, and set their “Range Begin” and “Range End” parameters, you shouldn’t have to worry about cameras then.