Faark / KspLoadOnDemand

Makes KSP assets (atm only part textures) load once required instead of all on startup
14 stars 7 forks source link

OpenGL Support #4

Open dreadicon opened 9 years ago

dreadicon commented 9 years ago

So, feel free to reject this, I know it's a big task, but I would like to submit it anyhow.

The lack of OpenGL support actually prevents me from using KLOD. The following are the statistics for RAM usage when running KSP with different configurations: DirectX: >4GB (crashes very early while loading) ATM + DirectX: >4GB (crashes while loading) KLOD + DirectX: >4GB (crashes while loading) ATM + KLOD + DirectX: 3.7GB (Crashes between 5 and 50 minutes after load due to memory)

OpenGL: >4GB (crashes while loading) ATM + OpenGL: ~3GB (Runs stably for 2-6 hours before crashing due to memory)

I have a ton of mods, yes. But I don't even use EVE or Texture Replacer. There also might be an issue with ATM not fully working properly with KLOD, but that's more of a hunch.

There is apparently some glitch in the DirectX build of KSP which causes texture duplication and extra needless overhead from what I have heard around the forums. As a programmer myself, I am well aware of the difficulties in doing something like supporting another whole API/architecture, but if possible, it would be greatly appreciated. I would like to note that ignoring the out of memory issue with KLOD + ATM, the game loads and runs noticeably faster.

EDIT: I can post LOD logs later if desired; just let me know if that would be helpful

Thanks for taking a look!

Faark commented 9 years ago

There isn't any glitch in DirectX. Good old dx9 offers most textures to be backed by system RAM, so dx can automatically handle device resets for the game. Newer DX versions use a different driver model to make this mostly unnecessary. OpenGL seems to do the same. I don't have much experience with OpenGL thus no idea whats necessary to support it. It would be nice and i'ill leave this open, but likely focus on other stuff for now.

dreadicon commented 9 years ago

I see. IIRC from my dabbling in lower level implementations, OpenGL has some minor syntax (but not functional) changes, except for one major difference; it orders axes differently. Like XZY vs XYZ or some such.

Anyhow, thanks for adding it as a potential future goal, if nothing else!