Jump to content

[WIP] Loading textures only as required


Faark

Recommended Posts

The thing to keep in mind is that the size of your GameData folder, or rather all the assets when KSP compiles everything together when loading, is not what you eventually get in your RAM usage. Unless you're running Linux with an absolute ton of RAM available, you're still extremely limited. ATM isn't allowing you to use more ram, all it's doing is resizing and compressing textures to reduce the amount of RAM that is being used in the first place. That means, KSP 32-bit DirectX cannot use that ~6.6 Gigs of RAM, period, even with ATM.

As for the limitation of using this with DirectX, I am not even sure if it even works with anything other than DirectX 9. It's not impossible to make something like this happen in DX11, or OGL, or whatever. The only fact is that this way of implementing such a system is limited in this way. That and the rest of us don't have the expertise to modify it or rewrite it for a different set of rendering drivers and libraries.

Edited by Gaalidas
Link to comment
Share on other sites

That means, KSP 32-bit DirectX cannot use that ~6.6 Gigs of RAM, period, even with ATM.

Sure, I understand that and thanks for your reply! :) That's why I'm currently on Ubuntu x64, but as hab136 pointed out, Ubuntu uses OpenGL, so currently no LoD for me or anyone on either of the two operating systems mentioned. I tried to ask for a way to get rid of the DirectX-dependency in my post above yours...this may have not been very clear though, I apologize if there was a misunderstanding...and of course, the size of GameData is in no way indicative for the actual used RAM-space, I can remember that one from my computer science class about 15 years ago...;)

Cheers

EDIT:

Ah, okay so long story short: big fat NO on getting it on Linux...Thanks for the answer, kind sir!

Edited by E.Nygma
Link to comment
Share on other sites

Big fat NO, but... as you well know... the bigger they are, the harder they fall from orbit and slam into the ground...

I think I over did that one, but you get the picture. It's not impossible, just not happening anytime soon unless another unknown modder comes out of nowhere and blows our minds with some new implementation.

Link to comment
Share on other sites

If anyone has successfully compiled loadOnDemand for 0.90 can I please have a copy? I don't feel like compiling from source and setting up dependecies.

SpaceTiger has a link to a compiled version a few pages back:

Get the dll from here. Download and install the requirements(.NET Framework (4.0)/Visual C++ Redistributable Packages for Visual Studio 2013) and load up your game. :)

You just need to put the dll in your GameData directory and you're off to the races.

Link to comment
Share on other sites

As for the limitation of using this with DirectX, I am not even sure if it even works with anything other than DirectX 9. It's not impossible to make something like this happen in DX11, or OGL, or whatever. The only fact is that this way of implementing such a system is limited in this way. That and the rest of us don't have the expertise to modify it or rewrite it for a different set of rendering drivers and libraries.

And... it works under linux... almost.

*To explain:

Wine provides linux with a directx to opengl wrapper. While you won't get the benefits of software being designed for the platform, you can still run the software; if what I did worked, getting it to work under linux would be as simple (well... not really "simple") as wrapping the KSP executable to redirect incompatible system calls to wine. I'm, not really certain I'd want to go down that road myself though...

One caveat is that you must have dotnet40 installed, not just mono (tested under wine-mono-4.5.6). Don't know why, don't care... mono probably just isn't feature complete.

What works... is just about everything. Thumbnails are generated and loaded instead of textures, memory usage is ~200mb lower than without (tested under base install), textures load when requested on launch pad and in VAB.

What doesn't is how the textures load; some don't really look like the right texture, others just look like they weren't mapped correctly to the model.

Why post this? Because it is close. I was only testing the Windows version, a similar approach with the linux version may have different results. Someone may know how to get wine to simply sit back and handle the windows calls with a command line script that means you don't even need to write a wrapper; or know of a program that would do what I'm saying anyways. The issue may even be corrected in a future version of wine. It may even be a simple setting somewhere that can be changed to fix it; I don't know.

It is just an idea, do what you will with it.

Link to comment
Share on other sites

Has anyone tried to compile this under 1.0? I would but I'm not familiar with compiling and other coding mechanics.

I was able to compile this under 1.0 with a few changes. But since 1.0 uses dds textures and LoD never was made compatible to handle dds it doesn't do anything.

Link to comment
Share on other sites

I was able to compile this under 1.0 with a few changes. But since 1.0 uses dds textures and LoD never was made compatible to handle dds it doesn't do anything.

Gah! Could you explain the problem to a lay person? Why is it not compatible. Could be be made to be compatible?

Link to comment
Share on other sites

Gah! Could you explain the problem to a lay person? Why is it not compatible. Could be be made to be compatible?
DDS textures aren't in LoD's list of "workable" textures. If i add them to it KSP crashes as soon as it hits the main menu. From what i looked at the problem is in the C++/Nativebridge part of LoD which i don't understand at all.
Link to comment
Share on other sites

Im hoping someone picks this up and gets it working with dds ...I keep seeing people say 1.0.2(ksp) makes it so we can add more mods for me this doesnt seem to be the case with just an hand full off mods with low part counts i get CTD no ram issue even though im using opengl. With this mod and ddsloader on .90 i could run 50-60 mods including kw,b9,vens,sspe, Interstellar V2 and the whole USI catologue together....OH boy not anymore not even close.......

Brutal

Link to comment
Share on other sites

Got an incomplete (doesn't fill in dds srcs, so black/undefined for now, just need to fill stub) experimental fork done: 2.2gb (without) vs 1.7gb (with)

Will post something when done (later, but do hold your breath for my amusment). Should be doing work right now so I unreasonably expect devout prostration from y'all when I do stuff this online.

Note: Didn't notice much better load times; Logging/dbgr bottlenecking the process? Will check later.

Link to comment
Share on other sites

This mod, with the right changes, should be integrated into KSP's stock version in the future...

Even better is if Squad could implement the functionality directly using Unity.

Link to comment
Share on other sites

Sorry for dropping in out of the blue, but is this compatible with 1.0.2? And with the new DDS textures do we still need this?

I would say yes we do

REPOST FROM LAST PAGE:

Im hoping someone picks this up and gets it working with dds ...I keep seeing people say 1.0.2(ksp) makes it so we can add more mods for me this doesnt seem to be the case with just an hand full off mods with low part counts i get CTD no ram issue even though im using opengl. With this mod and ddsloader on .90 i could run 50-60 mods including kw,b9,vens,sspe, Interstellar V2 and the whole USI catologue together....OH boy not anymore not even close.......

Brutal

Link to comment
Share on other sites

  • 1 month later...

Hi, anyone can repair this Plugin for DDS format? I looked at code but i not understand what i can do for DDS. I use few mods and i have already 95% ram used by mods. :(

This plugin are the best for adding more mods and no lag in game or something else. It's wonderful this plugin.

Link to comment
Share on other sites

I learned C++ back at university, unfortunately I hardly remember anything and now I make my living with c#.

If someone has some guidelines, posts or information I can try to fix it or at least help others but I don't know how to even start with this :(

Link to comment
Share on other sites

  • 1 month later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...