Hi everyone :).<br><br>For my project, I wanted to use LoD to quickly reduce the polycount in the distance. However the Level of Detail provided by Godot had several issues:<br><br>1) The transition is very aggressive (models seems to pop from nowhere) which is distracting<br>2) If the player moves a bit, it can trigger the LoD and produce also unwanted distraction<br><br>After several hours of testing and attempt to create smoother transitions, I finally have a working prototype.<br><br>Transitions have a small offset. For instance if an object is due to appear when the player is at a distance of 10 units, going from 9.9 to 10.1 won't toggle the LoD. You have to be at least at 13 units to reset the LoD. It might seems like a small thing but it does a huge improvement (small player's movements won't risk to cascade in several objects appearing/disappearing simultaneously.<br><br>During transitions objects will have a temporary Alpha Tested material that is using a special noise texture to create a smoother transition.<br><br>Here is a screenshot showing it in action<br><br>
<img title="Image: http://i.imgur.com/XRLyzXw.jpg" src="http://i.imgur.com/XRLyzXw.jpg" alt=""><br><br>I also tested with 1500 monkeys in a scene and 3 levels of LoD. Everything runs fine at more or less 60 FPS (despite using Godot script). The transitions are barely noticeable, I had to color each models differently to help distinguish them.<br><br>
<img title="Image: http://i.imgur.com/RW96uId.jpg" src="http://i.imgur.com/RW96uId.jpg" alt="">
One of the major drawback of the method, is the rendering during a very short time (the transition) of two objects. The one that will be hidden and the one replacing it. During the test sometime the number of drawn objects can go from 200 to 300 (during transitions) however this scene is heavy and doesn't represent necessarily a typical game.<br><br>Pros:<br>
Very smooth transition between models (almost not noticeable during gameplay)
Easy to integrate on a regular workflow (using the Range begin and Range end value)
Can be easily modified (like transition time, etc)
Objects can have more aggressive transition near the player since it's less noticeable
Can fallback to the faster vanilla Level of Detail if FPS start to drop too much (also configurable)<br>
Cons:<br>
Done in Godot Script (potentially very slow). It Would be better if directly integrated to the engine or in a CPP module (and probably not difficult)
During the transition objects are temporary doubled (the model disappearing and the model appearing).
Also during the transition can increase the number of different materials to be rendered
Currently works only on fixed_material and the transition shader will only use the diffuse map (in order to be faster)
Some clean up must be done before I can release the full source code :). I don't have a lot of time so if someone could do a C++ module or even better if godot devs would agree to integrate in the core engine that would be awesome.<br><br>Sam<br>