Jump to content

[1.1][1.1-1] Apr-19-2016 Dynamic Texture Loader


rbray89

Recommended Posts

Created a new mod to save graphics memory!
Without sacrificing parts or texture quality, this mod unloads and loads textures on the fly! Increase texture resolution to max again!

Now with updating loading while textures/parts load, IVA texture handling, and caching the full-sized textures! No duplicate textures are loaded into memory!

Fixed certain parts, now unloads only once new textures are loaded. DTL disables ATM now, as there are conflicts.

On DirectX 9 with tons of parts, the system memory went from 3205MB down to 2520MB!

DX11 and OpenGL use graphics memory first, and system memory for spillover, so if you use these graphics platforms, this will not likely show anything on system memory unless you use LOTS of part mods with big textures, or have small available graphics memory.


Side effects include:

  • increased loading times at start
  • Slight lag when adding new parts when building craft
  • Increased loading times when launching new crafts
  • VAB/SPH low res "icons". 
  • Adding many more mods and/or maxing texture resolution

Download Here: https://github.com/rbray89/DynamicTextureLoader/releases/tag/DTL-1.1-1 Currently broken due to unity bug. Working on fix/workaround.

This is done in my spare time, and any contribution helps!

btn_donate_LG.gif

Source:

https://github.com/rbray89/DynamicTextureLoader

License (MIT):

https://github.com/rbray89/DynamicTextureLoader/blob/master/README.md

 

Edited by rbray89
Link to comment
Share on other sites

8 minutes ago, White Owl said:

Oooo I'm a gonna try this out. Opengl works okay for me, but there are still some glitches. Maybe this will be better.

DX11 should use similar memory as openGL too, with fewer glitches.
 

9 minutes ago, amarius1 said:

Well this works like Kopernics' On-Depand planet texture loading that unloads the planet textures once they are o longer needed. But this one, THIS ONE IS FOR PARTS!!!

Pretty much!

Link to comment
Share on other sites

30 minutes ago, White Owl said:

Oooo I'm a gonna try this out. Opengl works okay for me, but there are still some glitches. Maybe this will be better.

 

Edit: Crap. I still have too many mods.

ever though of using linux for 64bit?

Link to comment
Share on other sites

33 minutes ago, White Owl said:

Oooo I'm a gonna try this out. Opengl works okay for me, but there are still some glitches. Maybe this will be better.

 

Edit: Crap. I still have too many mods.

Does it get past loading? I may have a slight improvement in-mind that I may have to implement to help it get past initial loading.

Link to comment
Share on other sites

not sure if this is significant and haven't done exhaustive testing but with just KSPRC and Squad folders I came out to 3.7GB without Textue Unloader and 3.6GB with it. Now, when I removed the Texture Replacer folder and tried again I saw 3.5GB without Texture Unloader and 3.3GB with it. Could the fact that Proot is using Texture Replacer to override the stock Squad textures on many parts make a difference? Like, could the game load the part, Texture Unloader unload the texture but then Texture Replacer add the custom one?

Link to comment
Share on other sites

3 hours ago, rbray89 said:

Does it get past loading? I may have a slight improvement in-mind that I may have to implement to help it get past initial loading.

No, it crashed just before the menu screen. But really, it's a ridiculous huge pile of mods at full texture resolution. I can't expect miracles!

Link to comment
Share on other sites

I'm curious if this will fix the memory leak issue some Macs (including mine) have had since 0.9. With textures at full the game will crash within 10-20 minutes, once the leak tops 4GB. I've had to play with the textures turned way down as a workaround until the Unity 5 migration, which will supposedly fix it. Mostly I just haven't been playing. Would be very cool if I could get my pretty Kerbin back.

 

Will try it after the holidays and report back.

Link to comment
Share on other sites

59 minutes ago, *MajorTom* said:

might have found one "feature" - does not display the distance of ships during docking maneuvers (аnd the passing...) .

Try hitting F4.

OP: I'm still playing version 1.0.4. Will this work on it?

Link to comment
Share on other sites

5 hours ago, Gaiiden said:

not sure if this is significant and haven't done exhaustive testing but with just KSPRC and Squad folders I came out to 3.7GB without Textue Unloader and 3.6GB with it. Now, when I removed the Texture Replacer folder and tried again I saw 3.5GB without Texture Unloader and 3.3GB with it. Could the fact that Proot is using Texture Replacer to override the stock Squad textures on many parts make a difference? Like, could the game load the part, Texture Unloader unload the texture but then Texture Replacer add the custom one?

So this really depends on the graphics platform. If you are running in OpenGL or DX11, you'll find the system memory will fluctuate with how much the dedicated graphics memory is staturated. It took a long time to figure this out. You can run gpuZ (https://www.techpowerup.com/gpuz/) to track your dedicated memory usage. Texture replacer doesn't load textures, it re-uses them from the GameDatabase that is loaded. 

4 hours ago, White Owl said:

No, it crashed just before the menu screen. But really, it's a ridiculous huge pile of mods at full texture resolution. I can't expect miracles!

I can fix this. 

2 hours ago, ZenithRising said:

I'm curious if this will fix the memory leak issue some Macs (including mine) have had since 0.9. With textures at full the game will crash within 10-20 minutes, once the leak tops 4GB. I've had to play with the textures turned way down as a workaround until the Unity 5 migration, which will supposedly fix it. Mostly I just haven't been playing. Would be very cool if I could get my pretty Kerbin back.

 

Will try it after the holidays and report back.

It will probably help a bit if the graphics memory is being used up, otherwise not much.

2 hours ago, Gaultesian said:

Can you use this in conjunction with either OpenGL or force dx11?

Yup! You just won't notice results on system memory unless your graphics memory is saturated. As an example, I have 2GB of graphics memory, and I don't see it touch system memory even after tons of part mods.

47 minutes ago, *MajorTom* said:

might have found one "feature" - does not display the distance of ships during docking maneuvers (аnd the passing...) .

??? This is not this mod's doing.

Link to comment
Share on other sites

20 minutes ago, somnambulist said:

It's a Christmas miracle: 3.0 GB on the splash screen is down to 875 MB. 

This is about what I expect on DX9 platforms... I hope the loading times weren't too terrible

10 minutes ago, Mitchz95 said:

Try hitting F4.

OP: I'm still playing version 1.0.4. Will this work on it?

Knew it wasn't my mod! :)

Link to comment
Share on other sites

Loaded it up, started game.  Everything got loaded, but it appeared to crash after loading everything and just before the initial menu.  This was with OpenGL enabled.

So, here is the interesting data:

Windows 10, 32 gig memory
GTX 760 with 2 gig onboard
There are between 166 and 170 different mods installed

With OpenGL:                         2095Mb, GPU memory was maxed, got to menu
With OpenGL and this mod:   2189MB, and crash before main menu, GPU memory was maxed
With just this mod:                 3658MB, and crash before main menu, GPU memory was about 500 Mb

Let me know if you want any logs.  I did see your comment earlier that you could fix the crash problem

 

Edited by linuxgurugamer
Correction
Link to comment
Share on other sites

Absolutely the best Christmas gift! Thank you!

Initial results are exactly as advertised! So much less crashing! I haven't dared to push it further but it has clearly freed up quite a bit of space for me with far less work/configuration/etc!

Thanks!

Edit: I did get ambitious and increase my texture resolution from half to full (with the same set of parts/mods I have been using mostly successfully but with a crash after a hour of play or so). This worked at first but crashed after 30 minutes or so. This was on DX9. Still such a nice improvement!

Edited by Black-Talon
Link to comment
Share on other sites

4 minutes ago, linuxgurugamer said:

Loaded it up, started game.  Everything got loaded, but it appeared to crash after loading everything and just before the initial menu.  This was with OpenGL enabled.

So, here is the interesting data:

Windows 10, 32 gig memory
GTX 760 with 2 gig onboard
There are between 166 and 170 different mods installed

With OpenGL:                         2095Mb, GPU memory was maxed, got to menu
With OpenGL and this mod:   2189MB, and crash before main menu, GPU memory was maxed
With just this mod:                 3658MB, and crash before main menu, GPU memory was about 500 Mb

Let me know if you want any logs.  I did see your comment earlier that you could fix the crash problem

 

Yeah, this is close to what I'd expect. During load, the textures are all unloaded at once near the end and have to load the originals and do PNG encoding, so if you don't get past the point were you start do decrease in memory, it actually bumps up a bit. I think I can change it so that as parts are loaded the originals are unloaded. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...