Jump to content

[WIP] Loading textures only as required


Faark

Recommended Posts

I've noticed that LOD doesn't interact with the DDS loader plugin: http://forum.kerbalspaceprogram.com/threads/96729-0-25-DDSLoader-1-5-%28Oct-31%29-Loads-DDS-Texture-Yes-it-is-boring-edition

Textures converted to DDS (or ones that ship in this format) are not "going through" LOD (they're loaded, but normally, at start). Could that be fixed? It'd be good for LOD's "response time", because DDS textures are quicker to load.

Link to comment
Share on other sites

From what I can tell, OpenGL doesn't cause nearly the problems that DirectX does when dealing with memory and processor use. LOD might not even be necessary under it. I can't even launch in OpenGL on this system though.

OpenGL definitely manages to contain memory crashes--at least at first. Some people experience bad memory leaks that eventually push it over 3.1 GB leading to crashes.

For me, OpenGL is less attractive because of shader issues and really, really bad performance--a FPS decline, but also simulation time is halved (so it takes 2 seconds for every second of in game time to pass, under normal acceleration). Accelerated time doesn't really fix the issue.

Some people don't have this issue, so it seems to depend on how well your system handles OpenGL. I much prefer LOD even if it crashes after a few launches, since I'll get proper performance before it does.

Link to comment
Share on other sites

Also, LOD will allow you to get even more mods in than OpenGL mode. I prefer LOD, it's biggest problem right now is that it doesn't handle DDS textures. Some modders are starting to use them for various reasons, and it'd be great if LOD supported them.

Link to comment
Share on other sites

Also, LOD will allow you to get even more mods in than OpenGL mode. I prefer LOD, it's biggest problem right now is that it doesn't handle DDS textures. Some modders are starting to use them for various reasons, and it'd be great if LOD supported them.

I tried to pull the source and recompile with what I thought would allow DDS textures, but I don't have the DirectX9 SDK, or the db SDK that's being used, so I abandoned my attempts at a proof of concept... I hope that DDS support does get baked into LOD. I can't go back to 5-10 minutes loads, and I'd like to use LOD.

Link to comment
Share on other sites

*dreams of this and ddsloader working together*

correction: dream of this and ddsloader working together on directX 11 and/or OpenGL ;) with stock dx9, ddsloader just speeds up load times and reduces the space on your disk; there is no sizable benefit to RAM use over ATM (for this or for ddsloader) without directX 11/OpenGL, unfortunately. None the less, it's a great step forward for KSP for those who are not running more than a few modpacks ;) and a step in the right direction for KSP optimization in general.

Link to comment
Share on other sites

LOD works on DX11, I checked. So if its made to work it with DDSLoader, then DX11 should work, too.

Interesting, I will have to check this out later. iirc, there was some issue with LOD on DX11, but my memory could be faulty. If that is the case, then yeah, this just has to be made compatible with dds files/ddsloader directly. A side note, DX11 is known to have some minor glitches, and isn't quite as lightweight on RAM as OpenGL, but it's still an order of magnitude better than DX9 for memory usage concerning graphics.

Link to comment
Share on other sites

Interesting, I will have to check this out later. iirc, there was some issue with LOD on DX11, but my memory could be faulty. If that is the case, then yeah, this just has to be made compatible with dds files/ddsloader directly. A side note, DX11 is known to have some minor glitches, and isn't quite as lightweight on RAM as OpenGL, but it's still an order of magnitude better than DX9 for memory usage concerning graphics.

I think DirectX 11 has some graphical glitches--most obviously, shaders on the launch pad don't appear properly, instead showing up as giant black streaks.

Still, it's better than crashing.

Link to comment
Share on other sites

When you say it required DX9 does this mean I need to do anything special? or if I just run KSP as is, does this use DX9, as opposed to forcing DX11 or OpenGL.

I am also getting the error about the nativebridge. I do not see any mention in this forum about what it is and how to fix it. am I just missing the post or has it not been answered yet?

Edited by Bit Fiddler
Link to comment
Share on other sites

I think DirectX 11 has some graphical glitches--most obviously, shaders on the launch pad don't appear properly, instead showing up as giant black streaks.

Still, it's better than crashing.

Actually, I hardly noticed any difference. That was on 32bit, though. DX11 is mostly notable because it stabilizes 64bit.

Link to comment
Share on other sites

Actually, I hardly noticed any difference. That was on 32bit, though. DX11 is mostly notable because it stabilizes 64bit.

So, couple things; first, the black streaks are consistent with my experience. There is supposedly another command line option which helps with this, but I cannot recall what it is, nor can I verify that it works.

Second, I tried loading up KSP with the DX11 option last night a couple times, and LOD fails to initialize. Gives the same message I get when I run in OpenGL. However, with DX9 or no command line option, LOD initializes normally. Will double check my setup this evening. Tried with and without EVE, ATM, and Texture Replacer. Windows 7 64-bit. KSP x86.

@Bit Fiddler, shouldn't have to do anything special concerning DX9. KSP on windows launches in DX9 mode by default. If you don't have the full libraries you may have to install them (as per the OP), but usually that's not an issue.

Link to comment
Share on other sites

I really hope that DDSLoader support will be added. I believe that all that needs to be done is to make .dds files valid in LOD. There may be other optimizations that would be handy, but I think that's be bare necessity. Now, I don't know if LOD loads the textures, then writes them back out as DDS files in its cache (in which case, there's a duplication of data that's unneeded), or if it is storing something else. Regardless, if LOD is loading textures on the fly, DDSLoader will help immensely, as those load times will shrink. The dangers of doing too much, too fast in the VAB or SPH are much reduced, since there will be a smaller window during the texture loads.

Also, unless LOD implements its own TGA loader, it's still relying on the leaky bucket Squad gives us (that ATM overrides)...

Link to comment
Share on other sites

I convert all textures in my mod installs to png to avoid the tga issues. Also, for the issues with DX11, it should be noted that (as the OP states) this thing only really works in DX9. I hadn't heard anything about DX11 stabilizing 64bit. In fact, that really doesn't make a lot of sense to me. I have doubts that I could run anything in a stable DX11 on this barely-chugging laptop though.

Link to comment
Share on other sites

and the native bridge error thing? what causes it and how can I fix it? I get it as a small popup on my loading screen. and yes I am running dx9. as in no -force-blablabla switch on my shortcut. I have tried with and without .dds converters and both give the same results.

just adding my vote to have LOD support .DDS as well. that would give us the fast loading times as well as the memory reduction... any hope of this?

EDIT:

So, anybody else having the nativebridge problem...

I finally just deleted my MSVCR120.DLL and reacquired the install package from the OP. this fixed the issue. not sure if it was an x86 vs. x64 version mismatch, or if the file was corrupted or what, but it did clear up the error message.

However... LOD does not seem to be working. I no longer get the native bridge error, but I am not seeing any memory savings. it runs up to the 3 Gig limit and the game crashes. yes if I just run it in OpenGL mode with ATM running it sits down around 2.6 Gigs and just occasionally crashes.

EDIT:

Ok well now it seems to be doing something I have a message on the screen telling me it is preparing textures: 18/1839 and loading textures: 0/178

I assume this means if I wait long enough the purple check pattern will be replaced by the real full size textures?

and it seems the cause of this not working may have been the fact I was running it with the -popwindow and -force-d3d9 tags. I have not tested this to be sure but this time around I accidentally just hit the KSP.exe file itself and not my shortcut. I will have to do more testing to verify if this was indeed the cause of LOD not working before.

EDIT:

after waiting for some time It looks like indeed some of the textures I am looking at are switching out the pink checks for a real texture, however KSP is still crashing before it "prepares" all the files. is there anything I can send you to assist with understanding what is going on? or is this all known already and I am just late to the game?

Edited by Bit Fiddler
Link to comment
Share on other sites

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...