Jump to content

[1.10.x, others] Drop-in Replacement Textures v1.10.0.0

Cydonian Monk

Recommended Posts

DiRT - Drop-in Replacement Textures

Latest Release: v1.10.0.0 for KSP v1.10.x
  1.8.x Releasev1.8.0.0 for KSP v1.8.x
  1.7.x Release: v1.7.2.0 for KSP v1.7.x
  1.3.1 Release: v1.3.1.0 for KSP v1.3.1


Source code available on Github: https://github.com/cydonian-monk/KSP-DiRT

The Whats
What Is This?

DiRT is a fork of Shaw's TextureReplacer, updated for newer versions of Kerbal Space Program. The intent of this fork is to remove features and simplify the plugin. It allows zero-configuration texture replacement by dropping your correctly-named replacement textures into the "GameData/DiRT/Textures/" folder.

What Does It Do?

  • Replaces in-game textures and normal maps with like-named textures in GameData folders as configured.
  • Optionally exports a list of the game's replaceable textures and normal maps to a text file in the plugin's GameData folder.

What Does It Not Do?

  • Absolutely anything else.

Specifically, this plugin does not perform Active Texture Management, does not compress textures, does not convert PNG files to RGB, does not generate MipMaps, and does not allow suits and heads to be mapped to specific kerbals. It also will not pop popcorn for you. If you need any of those features (except popcorn), please consider using "Texture Replacer", "Texture Replacer Replaced",  or one of TR's other forks.

This plugin does not replace NavBall textures (or if it does so they may or may not be replaced correctly). For NavBall textures, please consider using "Navball Texture Changer".

I strongly suggest the use of DDS/DXT1 or DDS/DXT5 texture files with pre-generated MipMaps (where appropriate). 


The Whys
Why Did I Do This?

  • Because I needed it.
  • Because others might find a use for it.

Why Should You Use This?

  • You only want to replace a couple textures, such as the skybox or the normal map used by the --redacted--
  • You're running KSP in a memory or resource constrained environment and want to replace textures without extra overhead.
  • You want a list of textures and normal maps in use by KSP.

This plugin is provided in the hope that it will be useful. I've been using it on my increasingly-antique MacBookPro to replace the SkyBox and Jool's cloud textures. With per-part texture switching now present in the base game and the suit switching mechanic coming in the expansion, I suspect others might also find a use for such a feature-limited plugin.

Why Should You Not Use This?

  • You want to replace NavBall textures.
  • You want to map faces or suits to specific kerbals.
  • You like menus and nice UIs.
  • You don't need it.
  • You don't like it.

The Wheres
Where Can You Download This From?

The most recent release, as well as all previous releases not deleted for causing corruption to the basic fabric of reality will always be available on GitHub. If for some reason GitHub disappears into the void, it was (likely) not my fault and I will provide an alternate download location. 

Where Do You Put It?

There is a "DiRT\GameData\DiRT\" folder in the zip file. Once you have downloaded the zip file, copy that second-level DiRT folder ("DiRT\GameData\DiRT") and all of its contents into the GameData folder of your KSP installation. Once you've done that you should have a "KSP\GameData\DiRT" folder containing the DiRT plugin and config. (If you have a "KSP\GameData\DiRT\GameData\DiRT" folder, you've copied the wrong DiRT.) Do not copy the GameData folder into the GameData folder, as that will achieve nothing. Same with the root-level DiRT folder. Do not copy your KSP installation's GameData folder into the zip file's DiRT folder, because why would you even want to do that?

See the readme file for more detailed instructions.

Where Can You Get The Source Code?

Same place as the plugin: GitHub. The source is also available in a raw form (minus the Visual Studio bits) in the plugin's download zip.

Where Do You Find the Names of Replaceable Textures?

Change the value of the "exportTextureNames" field in the "GameData/DiRT/config.cfg" file to "True". The next time you start the game DiRT will write a file named "ExportedTextureList.txt" into the very same "GameData/DiRT/" folder. Determining which texture and normal map does what will require a bit of creative reasoning, but many of them are obviously named. (Warning: There are things which some might consider to be spoilers in the texture and normal map names. Read at your own risk.)

See the readme for some common texture names.

Where Can You Get Textures?

Anywhere. There are many textures available on this forum and across the endless intertubes that are appropriate for KSP. If you find one you like, rename it to use the name of the texture you want to replace and drop it in the "GameData/DiRT/Textures/" folder.

(If you give me a few days to finish them, I'll have my suit textures available for download. I need to finish cleaning some things up first.)

Where Can You Put Texture Packs?

Anywhere in GameData, provided you have the correct config files. This plugin will load textures from any config file which includes a "DiRT_Config" root node and a "TextureFolder" entry inside that node. If for some bizarre reason you want to distribute a texture pack for this plugin, just drop one such config file into your pack's folder, set the "TextureFolder" to the GameData-relative path where your texture files live, and DiRT will handle the rest. See the "config.cfg" file provided with the plugin for an example.

If you've created a texture pack using a DiRT config file, leave a note and I'll add a link to it here.

Can I use a Module Manager config node to work with DiRT?

Yes. See the readme file for specifics.


The Other Stuff
Planned Features

Kerbal Texture Mapping - It won't be a zero-config "Drop-In" setting, but I do intend to add the ability to assign specific textures to specific kerbals. This is part of what is intended for "Phase 2". Details will be discussed at a future time. Otherwise, there are no planned features. The basic premise of dirt-simple drop-in texture replacement is not expected to change.

Technical Support

If it's broke I'll try to fix it. If it's not broke I'll still try to fix it. If you find something weird or wrong or kraken-inspired please mention it. Raise issues here, in a private message, or on GitHub. Use your best judgment. I may or may not need logs depending on the issue. This plugin is provided as-is and with absolutely no warranty, even in cases where I might want otherwise, but especially in jurisdictions where I may be required to provide some strange or inhumane warranty. It is not responsible for feeding your cat, correcting the ills caused by Daylight Savings Time, or cleaning up after the questionable garbage collection in Unity.

Known Issues

  • Pre-1.5 Suit Textures will not work with post-1.5 KSP. This is not a DiRT issue, but one you might encounter regardless. The suit and helmet textures and model have changed entirely, while the EVA jetpack uses the same model and texture name, yet has been remapped.
  • Jool as/of 1.10.x has a new texture and animation structure. The base texture is now named CloudPattern_low instead of gas1_clouds. While DiRT tells me it has replaced this texture, it never seems to appear in the game itself. I'm looking into this, but so far the way it is behaving doesn't make a huge amount of sense. There's a chance these textures can only be changed by doing something akin to how Kopernicus manages it (which for the regular planets makes some sense as you also need to adjust terrain, etc.). That said, the new stock texture is 8k, looks quite nice, and features interesting animated cloud swirls.

A Request For Tests

I have tested this plugin on the following Squad/KSP-store-bought English-language versions of KSP: 

  • Windows 64-bit (in Windows 10): 1.3.1-1.10.1/MH+BG
  • MacOS 64-bit (in MacOS Mojave 10.14): 1.4.0-1.5.1/MH

This plugin is untested on all other platforms and versions (specifically Linux, as none of my Linux boxes are capable of running KSP), and has not been tested against any Steam installs (which should be fundamentally identical; I'm not worried about Steam). If you happen to use this plugin on one of these other platforms, please send me a note regarding issues or lack thereof. Thanks!

License and Credit

This plugin preserves TextureReplacer's original MIT license, provided below.

The majority of the work I did for this plugin involved liberal usage of the Delete key, excluding my rework of the code used to log texture and normal map names. The bulk of the remaining code was originally written by @shaw. I do not think any of @rbray89's code remains in this plugin, but he deserves a mention anyway.


Copyright © 2018-2020 Andrew Cummings (Cydonian Monk)
Copyright © 2013-2015 Davorin Učakar, Ryan Bray

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.



Edited by Cydonian Monk
v1.10.0.0 Release
Link to comment
Share on other sites

5 hours ago, Cydonian Monk said:

Currently using a Linq-based method for determining if other conflicting plugins are loaded. If anyone knows of a non-Linq way of doing this, or if we've determined Linq is no longer a major polluter that slows down the garbage collector, please let me know.

Unless you do it each frame linq is not bad.

Link to comment
Share on other sites

1 hour ago, sarbian said:

Unless you do it each frame linq is not bad.

Ok, good. Thanks. I wasn’t entirely certain how severe the issue was; that makes sense. 


2 hours ago, RangeMachine said:

To fix bump map spam add somethine like this:

if (!material.HasProperty(Util.BUMPMAP_PROPERTY))


That seems to have done it, thanks. (And checking HasProperty for the equivalent “_MainTex” prevents the same ERR regarding the handful of objects lacking a main texture.) Fairly minor as far as log spam goes but it was annoying me regardless. I’ll hold this until the 1.4.1 update.

Edited by Cydonian Monk
Link to comment
Share on other sites

On 3/14/2018 at 11:39 AM, Puggonaut said:

Blimey there is a hellish amount of stuff now in the Export List

Yep. That’s the #1 reason why I split that out into its own file instead of dumping it into the KSP.log like TR used to. 

On 3/14/2018 at 11:39 AM, Puggonaut said:

just got to figure out which parts are the skybox

Those are the ones prefixed with “GalaxyTex_”:

  • GalaxyTex_NegativeX, 
  • GalaxyTex_PositiveX, 
  • GalaxyTex_NegativeY, 
  • GalaxyTex_PositiveY, 
  • GalaxyTex_NegativeZ, 
  • GalaxyTex_PositiveZ

As for which way is X, Y, or Z.... I don’t really remember.

I’m going to go through the new textures and normal maps this weekend and put together a list of the more-commonly used ones. (For the moment it’s probably best to just refer to the documentation for TextureReplacer/Replaced and their packs.)

Edited by Cydonian Monk
Link to comment
Share on other sites

37 minutes ago, Cydonian Monk said:

Yep. That’s the #1 reason why I split that out into its own file instead of dumping it into the KSP.log like TR used to. 

Those are the ones prefixed with “GalaxyTex_”:

  • GalaxyTex_NegativeX, 
  • GalaxyTex_PositiveX, 
  • GalaxyTex_NegativeY, 
  • GalaxyTex_PositiveY, 
  • GalaxyTex_NegativeZ, 
  • GalaxyTex_PositivfeZ

As for which way is X, Y, or Z.... I don’t really remember.

I’m going to go through the new textures and normal maps this weekend and put together a list of the more-commonly used ones. (For the moment it’s probably best to just refer to the documentation for TextureReplacer/Replaced and their packs.)

That's great thanks for this , give me a head start .


And Bam

Just like that Ver1.4.1 KSP is looking fine by me .


Edited by Puggonaut 2
Link to comment
Share on other sites

  • 2 weeks later...
On 3/24/2018 at 8:37 PM, RoboRay said:

Thank you so much for this lightweight texture replacer.  All I want to change is the skybox, and every other mod that can do that is overkill.

3 minutes ago, Squelch7 said:

This is exactly what I was looking for. Thank you.

You are both quite welcome. I'm happy to see I wasn't the only one that wanted a thinner version of TR.

Link to comment
Share on other sites

Same to me, just the skybox.

I took the Crab Nebula skybox from

Because it's .png files I converted them to DDS DXT5 with mipmaps as you said in the OP - and I remembered to mirror and rotate them before, because I used a tool that doesn't do that for me :mad:

btw are mipmaps necessary for skyboxes? Or is it a general speaking rule to have mipmaps when it's about part textures?

If not, I just open and save them with XnViewMP, that will "purge" the mipmaps ... :wink:

Link to comment
Share on other sites

49 minutes ago, Gordon Dry said:

btw are mipmaps necessary for skyboxes? Or is it a general speaking rule to have mipmaps when it's about part textures?

You know, that’s an interesting question. The simple answer is no (or is it?). You really shouldn’t have or need mipmaps for the skybox.

The skybox should almost always be at a fixed distance from the camera so mipmaps will never come into play. (Except it really isn’t, as the skybox is rendered as a cube, so the corners of the cube will always be further away than the closest edges.) Now I’m wondering what Unity does when the skybox has mipmaps. Based on what I’ve seen with KSP I’m going to guess it always uses the highest res of the set, so you wouldn’t see any loss of detail (including at the corners). That’s something I might experiment with later. 

The only textures TextureReplacer used to exclude from mipmap generation were really small ones (icons) and the navballs. If mipmaps in GalaxyTex were an issue, I think we would’ve noticed by now. 


There are still a couple oddities in replacing textures that I’m going to attempt to address. For example: if texture resolutions aren’t a power of 2 (ex: 8x16, 1024x512) they end up going “fuzzy”. This can apparently be worked around by loading the textures directly from disk in the plugin. Still always best to use resolutions that are a multiple of the resolution of the texture being replaced. (That’s one of the reasons I also print out the resolution when exporting the texture list.)

Edited by Cydonian Monk
Or is it?
Link to comment
Share on other sites

@Gordon Dry

As a test I grabbed the GalaxyTex_NegativeX and very crudely bucket filled the dark bits. The top texture was Red, each mipmap under that I shifted downwards through Blue and into Green. This was the result in the map view:


As you shift the camera, the renderer does pull in the lower mipmaps at the more distant corners, as one would expect. This will presumably still give you the usual performance benefits of using mipmaps, and to be honest I've never noticed the loss in quality of stars on the backdrop. This would likely be very apparent in mods that add telescopes (such as Tarsier).

Edited by Cydonian Monk
Link to comment
Share on other sites

Does DiRT support Envmaps, like for skyboxes in TR(R) there is a folder with darkened and smaller variants of the skybox textures?

So when I add these files to the DiRT\Textures folder, does it do anything?


And what about that one, is this TR(R) specific or stock-ish?



the last one creates an error in the KSP.log, so perhaps it's not okay (it's a .dds with mipmaps, perhaps that is the problem)

[LOG 01:55:14.791] Load(Texture): DiRT/Textures/suncoronanew
[EXC 01:55:14.795] UnityException: LoadRawTextureData: not enough data provided (will result in overread).
	UnityEngine.Texture2D.LoadRawTextureData (System.Byte[] data)
	DatabaseLoaderTexture_DDS.Read (System.String filename)
	DatabaseLoaderTexture_DDS+<Load>c__Iterator0.MoveNext ()
	UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)
	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

This is the file: https://www.dropbox.com/s/semiu3if8hojhax/suncoronanew.7z?dl=1

The Envmaps work, see


Edited by Gordon Dry
Link to comment
Share on other sites

20 minutes ago, Gordon Dry said:

Does DiRT support Envmaps

Not directly. Those envmap textures in TR were for the reflection plugin. Now if there are existing envmaps that are loaded as regular textures when DiRT runs (such as for stock reflections, standalone reflection plugins, etc), it would be able to replace those. 


23 minutes ago, Gordon Dry said:

the last one creates an error in the KSP.log

I’ll take a look at the Corona a bit later. I do know there are some peculiarities with The Sun, but I thought most of those were related to SunFlares (which DiRT almost certainly can’t replace as they’re not regular textures). That might’ve been one of the “bug fixes” in TR that I cut. 

Link to comment
Share on other sites

1 hour ago, Gordon Dry said:

LoadRawTextureData: not enough data provided

Regarding your suncoronanew.dds file - this is an interesting thing. It happens when the base game calls LoadRawTextureData(), and will occur with or without DiRT. I don’t want to call it a bug. It’s a Unity thing. It’s not something DiRT can fix.

It is, however, something you can fix. 

Your file is encountering this issue because it isn’t large enough (nor is it properly terminated, but Unity doesn’t seem to care about that). LoadRawTextureData() is expecting a specific file length and this suncoronanew is exactly 32 bytes short. It attempts to keep reading data, which it can’t do, so it throws the “not enough data” exception and discards the new texture. 

Mind if I ask what program you saved it with? (Photoshop?) Were there any peculiar settings?

Try reexporting that file and see what happens. I exported it from GIMP with the (most recent and yet already 8-years-old) DDS plugin both as a DXT1 and a DXT5 and KSP loaded either of those textures without issue. Adding 32 random bytes to the end of your file in a hex editor also worked.

Link to comment
Share on other sites

Just now, Gordon Dry said:

Why is a specific file length expected? Because of the file header or hard coded?

I’m not sure. I’ve not read the spec for BC3/DXT5. Maybe it has something to do with the decompression routine expecting data in specifically sized chunks? Or is it enforcing a filesize specified in the header? Either way Unity wanted a set length and didn’t get it. 

Apparently you can get around this by changing some of the parameters when calling LoadRawTextureData(), but that’s obviously beyond our control. (And I’m not sure why you’d want to allow your game to load incomplete textures.... None of the edge cases I saw in the Unity forums seemed particularly valid.)

Link to comment
Share on other sites

DiRT version is now available on GitHub: https://github.com/cydonian-monk/KSP-DiRT/releases/tag/

- Recompiled against KSP v1.4.2.0.
- Small update to ReadMe to list SkyBox textures.



I'm currently going through the new kerbal textures and trying to make sense of what's where. It _looks_ like the Making History helmet and EVA/IVA suits both draw from the same base texture, which is a departure from previous kerbals but not really a bad thing (fewer textures means reduced memory usage). I'm only just learning what is where, and I'll update the readme once I've got all that mapped out. 

Link to comment
Share on other sites

  • 2 weeks later...

Screenshot shows texture loading log messages, which seem to indicate something was loaded, but I'm still seeing default textures. Jool and skybox should look different in this case. Have I left out a step (do I need to edit cfg file)? No error messages. My filenames and file sizes / dimensions seem to match. Not using any other replacer mod.   v1.4.2.  Only other mods are KAC + KER.

Link to comment
Share on other sites

11 minutes ago, basic.syntax said:

Screenshot shows texture loading log messages

Weird. Search the KSP log file in the root KSP folder for DiRT and see if there are any other DiRT errors. If nothing obvious jumps out at you, upload the log somewhere for me (pastebin, etc) and I’ll take a closer look. 

Also, what OS (Win? Mac? Linux?)? Steam?


Link to comment
Share on other sites

[LOG 16:27:48.860] ******* Log Initiated for Kerbal Space Program - (WindowsPlayer x64) en-us *******
Kerbal Space Program - (WindowsPlayer x64) en-us

OS: Windows 10  (10.0.0) 64bit
CPU: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4)
RAM: 16338
GPU: NVIDIA GeForce GTX 660 (2015MB)
SM: 30 (Direct3D 9.0c [nvldumdx.dll])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, Default, ARGB2101010, DefaultHDR, ARGB64, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8, RG32

Log started: Wed, Apr 11, 2018 16:27:48

[LOG 16:27:48.949] AppCanvas MASK: 3458764513820540928
[LOG 16:27:48.962] MainCanvas MASK: 3458764513820540928
[LOG 16:27:48.970] PhysicsGlobals: Loading database
[WRN 16:27:48.990] [SpaceNavigatorWindows]: Could not initialize device.
[LOG 16:27:48.993] ActionCanvas MASK: 3458764513820540928
[LOG 16:27:52.284] Load(Assembly): DiRT/GameData/DiRT/DiRT
[LOG 16:27:52.285] AssemblyLoader: Loading assembly at C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\DiRT\GameData\DiRT\DiRT.dll
[LOG 16:27:52.314] Load(Assembly): Squad/Plugins/KSPSteamCtrlr
[LOG 16:27:52.314] AssemblyLoader: Loading assembly at C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\Squad\Plugins\KSPSteamCtrlr.dll
[LOG 16:27:52.315] Load(Assembly): Squad/Plugins/Steamworks.NET
[LOG 16:27:52.315] AssemblyLoader: Loading assembly at C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\Squad\Plugins\Steamworks.NET.dll
[LOG 16:27:52.319] AssemblyLoader: Loading assemblies
[LOG 16:27:52.387] VesselModules: Found VesselModule of type CommNetVessel with order 999
[LOG 16:27:52.389] VesselModules: Found VesselModule of type FlightIntegrator with order 0
[LOG 16:27:52.391] VesselModules: Found 2 VesselModule types
[LOG 16:27:52.605]
Environment Info
Mod DLLs found:
Stock assembly: Assembly-CSharp v0.0.0.0
DiRT v1.4.0.3
Stock assembly: KSPSteamCtrlr v0.0.1.35
Stock assembly: Steamworks.NET v9.0.0.0 / v9.0.0
Folders and files in GameData:
Stock folder: Squad
Stock folder: SquadExpansion

[LOG 16:27:52.623] [AddonLoader]: Instantiating addon 'DiRTActivator' from assembly 'DiRT'
[LOG 16:27:52.624] [AddonLoader]: Instantiating addon 'KSPSteamController' from assembly 'KSPSteamCtrlr'
[ERR 16:27:52.627] <color=orange><b>[KSPSteamController]:</b> Failed to initialize Steam API!</color>
[LOG 16:27:54.348] Load(Texture): DiRT/GameData/DiRT/Textures/GalaxyTex_NegativeX
[LOG 16:27:54.373] Load(Texture): DiRT/GameData/DiRT/Textures/GalaxyTex_NegativeY
[LOG 16:27:54.412] Load(Texture): DiRT/GameData/DiRT/Textures/GalaxyTex_NegativeZ
[LOG 16:27:54.450] Load(Texture): DiRT/GameData/DiRT/Textures/GalaxyTex_PositiveX
[LOG 16:27:54.485] Load(Texture): DiRT/GameData/DiRT/Textures/GalaxyTex_PositiveY
[LOG 16:27:54.497] Load(Texture): DiRT/GameData/DiRT/Textures/GalaxyTex_PositiveZ
[LOG 16:27:54.534] Load(Texture): DiRT/GameData/DiRT/Textures/gas1_clouds
(no other instances of these files in ksp.log)
(search result for all remaining references to DiRT:)
[LOG 16:28:17.139] Config(DiRT_Config) DiRT/GameData/DiRT/config/DiRT_Config
[LOG 16:28:41.821] [AddonLoader]: Instantiating addon 'DiRTActivator' from assembly 'DiRT'
[LOG 16:28:43.084] [AddonLoader]: Instantiating addon 'DiRT' from assembly 'DiRT'
[LOG 16:28:43.085] [DiRT.DiRT] Awake
[LOG 16:28:43.086] [AddonLoader]: Instantiating addon 'DiRTActivator' from assembly 'DiRT'
[LOG 16:28:43.554] [DiRT.DiRT] Start
[LOG 16:28:54.076] [AddonLoader]: Instantiating addon 'DiRTActivator' from assembly 'DiRT'
[LOG 16:28:54.837] [AddonLoader]: Instantiating addon 'DiRTActivator' from assembly 'DiRT'
[LOG 16:29:06.578] [AddonLoader]: Instantiating addon 'DiRTActivator' from assembly 'DiRT'

Removed KAC/KER and tried again; this is an excerpt of ksp.log 

Link to comment
Share on other sites

Now that the forum works again I can tell you how to fix this:

3 hours ago, basic.syntax said:

[LOG 16:27:52.284] Load(Assembly): DiRT/GameData/DiRT/DiRT

You’ve got the DiRT folder in the wrong place (too deep). (It almost looks as though you’ve got one of the Source zips instead of the Release zip.)

In the Release zip file on GitHub there’s a GameData folder. Copy the DiRT folder that’s inside that GameData folder into KSP’s GameData folder.

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.

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