Implementing Discrete Level of detail for models based on the distance from camera.
Before submitting model to the renderer, it calculates distance from camera. Based on that computed distance, is switched to another variant of the model.
To not rebuild model everytime, there is member variable LOD, which is true, if lower level of detail have been chosen to not rebuild models when it is staying the same.
In actor, main model (not props) can introduce variant with name "low" and that will be chosen. It will switch back to or frequency = "1" or name = "high" variant in the same group.
What we can do with this is, that we can hide all small props that do not need to be visible from distance and it does not matter. Another thing we can do is to switch to meshes with lower number of vertices.
Current distance to switch models is hardcoded and kind of small for showcase (maybe it is enough, dont know actually).
I am also hiding projectiles at some distance entirely, because units have high rate of fire and they stay at ground quite long so with bigg frustrum range, there is really a lot of them so that might help perf too. (I ll split this to another diff if someone suggests it)
Another usage: Hyrule Conquest would like to have that.
---------------------
I ll remove actor changes for another diff after feature is complete.
Also I would like to do profiling but i need find out why profiler2 is failing for me.
Btw. That units edited are in combat demo huge
I do not expect too much improvement since I removed just some random props.