[Solved] LodControl and multiple viewports/cameras

Hi!

Since the new LODGenerator i decided to try out the LODControl. Unfortunately i had a lot of weird problems with the lod (negative last distance, distance not changing anymore). It turned out that the multiple viewports in my application caused all that. I use them for simulated cameras in my application so they are necessary. But the one Control will be updated for every viewport, so in my case multiple times. I solved it through extending the LodControl and a new setter for a camera. When the setted camera doesn’t equal the one in the controlRender method i don’t do anything.
I would probably need to a add multiple LODControls for the other viewports unless someone knows a better solution.

It took me quite some time to figure all that out so hopefully this thread can help someone in the future.

1 Like

Sorry for another post but it seems i cant edit it.

Probably you have to store the lastDistances (in the LODControl) for each viewport and load it in the controlRender method.