After much debugging, figured out that SkyProviderOrbit is being instantiated many times. It seems like it was originally designed to be instantiated once/a small number of times, then render() called on it many times.
Instantiating this class many, many times was leading to a memory leak where many copies of the openGL display lists were instantiated but never free'd.
This patch changes those display lists to only instantiate once and be re-used by any subsequent instance of SkyProviderOrbit. This should fix the memory leak and improve overall rendering performance.
Somewhat anecdotal, but this brings my FPS from ~20 to my monitor's 120 vsync. The sky still animates on my space station... seems to work well but not sure how else to test this.
After much debugging, figured out that SkyProviderOrbit is being instantiated many times. It seems like it was originally designed to be instantiated once/a small number of times, then render() called on it many times.
Instantiating this class many, many times was leading to a memory leak where many copies of the openGL display lists were instantiated but never free'd.
This patch changes those display lists to only instantiate once and be re-used by any subsequent instance of SkyProviderOrbit. This should fix the memory leak and improve overall rendering performance.
Somewhat anecdotal, but this brings my FPS from ~20 to my monitor's 120 vsync. The sky still animates on my space station... seems to work well but not sure how else to test this.