Jump to content

[WIN] KSP to DDS texture converter


Lilleman

Recommended Posts

Sorry if this has already been addressed - but a useful feature for the converter would be to define a maximum size a texture can end up as, kind of like ATM does. What I'd like to be able to do is this:

1) Define which textures get resized - only things 512x512 and above (current version does this well).

2) But then define that ALL textures above that size shouldn't just be reduced to 1/2 or 1/4 size: instead, all textures above that size should be reduced by 1/2 OR 1/4 if that's what it takes to make them equal to or smaller than a given size. So if you defined a maximum of 256x256, both 512x512 and 2048x2048 textures would all become 256x256 rather than 256x256 and 1024x1024 respectively.

That's probably a convoluted explanation, hopfeully just "define maximum result size" is vaguely intelligible. Would be really handy!

Link to comment
Share on other sites

To Encos's list, let me add:

ResourceOverview\icons\ro_app_button.png //but not ro_toolbar_button -- that one's not hard-coded to look for a png
RCSBuildAid\Textures //Currently has options set, but the source code indicates that the stock applauncher bar is hardcoded to look for a png

Otherwise, this is a great tool! I'm also glad I picked the "keep a backup" option for everything.

Link to comment
Share on other sites

Converting now-this is a great tool! I have a crappy laptop and would give a lot for faster load times, so I'll see how this works.

Two questions:

Is it OK to use this DDSLoader with LoadOnDemand? The source code for these projects scares me. And yes I shouldn't ask this here.

How are y'all forcing OpenGL and DX9/DX11? I keep crashing when trying to do -force opengl.

Link to comment
Share on other sites

Is anyone still doing anything with the C# port of DDS4KSP? (https://github.com/Telanor/DDS4KSP.git) I ask because I'd switched to using that, as I can poke around in it as a c# program, whereas not so much with the VB version. Only trouble is, using the C# code to convert, I'm now getting "something" going wrong with the normal maps (I think), which I don't get when I convert using the VB converter.

I'll try and grab a backup and reconvert so I can see the difference in the output, but if the C# port is now a deader, I'll not bother trying to fix that, and just go back to using the VB code.

Link to comment
Share on other sites

Thx for that awesome tool, though now I'm not able to do any "important" other things while loading...:wink:

Nevertheless I've noticed, that some pngs from B9 Pack weren't converted because of wrong format (P8/L8/A8L8), but TextureReplacer does it on start up. Which tools (non-KSP-related) are capable of this formats?

Link to comment
Share on other sites

Foound another mod to add to exempt list

//Versatile Tool system throws an error on "empty.png"

MP_Nazari

//ASET PRC errors on "ClearTexture.png"

ASET

looks like there is some issue with an "empty" .png file

I have this in my file and it works:

//ASET

ASET\ERS\Parts\ClearPlate.png

ASET\ERS\Parts\ClearTexture.png

ASET\ERS\Flags\Empty.png

Link to comment
Share on other sites

I put those lines in my exceptions file (also ASET\PRC\ClearTexture.png to take care of the issue that Bit Fiddler mentioned), but the converter kept choking on Flags\Empty.png until I replaced the line and found that I had (somehow) put a space after the line -- that caused the converter to not skip that file, try to load it, and choke. Be careful, I guess is what I'm getting at.

Link to comment
Share on other sites

I'm getting the following exception when running this tool:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.TypeInitializationException: The type initializer for 'DDS4KSPcs.ImageManager' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

File name: 'Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

at DDS4KSPcs.ImageManager..cctor()

WRN: Assembly binding logging is turned OFF.

To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging.

To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

--- End of inner exception stack trace ---

at DDS4KSPcs.ImageManager.Init()

at DDS4KSPcs.MainForm.MainForm_Load(Object sender, EventArgs e)

at System.Windows.Forms.Form.OnLoad(EventArgs e)

at System.Windows.Forms.Form.OnCreateControl()

at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

at System.Windows.Forms.Control.CreateControl()

at System.Windows.Forms.Control.WmShowWindow(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.Form.WmShowWindow(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

DDS4KSPcs

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///C:/Games/Kerbal%20Space%20Program/DDS4KSP/DDS4KSPcs.exe

----------------------------------------

System.Windows.Forms

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Drawing

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

From what I see in this thread, this should be fixed in the latest version, which is the one I have. I triple-checked this.

Link to comment
Share on other sites

Thanks for the great app. Just curious, if I try to apply it to either my PlanetFactory or StarSystems folders from this pack (http://forum.kerbalspaceprogram.com/threads/103298-0-90-Working-Multiple-Star-Systems%28WITH-PLANETS%21%29), it skips all the files within it. But if I select the individual files within the directories it will convert them, but not rename the old ones or back them up. They're not on the exception list, so I'm not sure why they'd be treated differently? Not a big deal since everything else is converted they're not that bad, just curious if I should bother to go through and do each one manually or if it'll break something. Thanks.

Link to comment
Share on other sites

Hi everyone. I keep getting the message below about a quarter of the way through using the texture converter. I am not really sure what is causing it except that it happens on this part every time:

LOG : Converting C:\Games\Kerbal Space Program\GameData\Squad\Parts\Structural\engineBodyRadial\C1EB_NRM.mbm to C:\Games\Kerbal Space Program\GameData\Squad\Parts\Structural\engineBodyRadial\C1EB_NRM.dds Format : Dxt5, normalmap : True, res: 512x512

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

Error in the application.

-2005529767 (D3DXERR_INVALIDDATA)

at Microsoft.DirectX.Direct3D.TextureLoader.ImageInformationFromFile(String srcFile)

at DDS4KSP.IMGManager.convertFileToDDS(cConversionParameters& convParams, cFolderProcessingParams& CFG)

at DDS4KSP.FolderLoader.processFileLists(String sFolderPath, ProgressBar& PB, Label& lInfos, cFolderProcessingParams& CFG)

at DDS4KSP.FRM_main.ExportAllToDDSToolStripMenuItem_Click(Object sender, EventArgs e)

at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)

at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)

at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)

at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)

at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)

at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)

at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)

at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)

at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ToolStrip.WndProc(Message& m)

at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.8009 (FX35W81RTMGDR.050727-8000)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

DDS4KSP

Assembly Version: 0.0.0.1

Win32 Version: 0.0.0.1

CodeBase: file:///C:/Users/Ian/Desktop/DDS4KSP/DDS4KSP.exe

----------------------------------------

Microsoft.VisualBasic

Assembly Version: 8.0.0.0

Win32 Version: 8.0.50727.8007 (FX35W81RTMGDR.050727-8000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll

----------------------------------------

System

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.8009 (FX35W81RTMGDR.050727-8000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Windows.Forms

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.8008 (FX35W81RTMGDR.050727-8000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.8007 (FX35W81RTMGDR.050727-8000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

System.Runtime.Remoting

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.8012 (FX35W81RTMGDR.050727-8000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll

----------------------------------------

System.Configuration

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.8007 (FX35W81RTMGDR.050727-8000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

----------------------------------------

System.Xml

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.8009 (FX35W81RTMGDR.050727-8000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

----------------------------------------

Microsoft.DirectX.Direct3D

Assembly Version: 1.0.2902.0

Win32 Version: 9.05.132.0000

CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3D/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3D.dll

----------------------------------------

Microsoft.DirectX

Assembly Version: 1.0.2902.0

Win32 Version: 5.04.00.2904

CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll

----------------------------------------

OpenFolderDialog

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///C:/Users/Ian/Desktop/DDS4KSP/OpenFolderDialog.DLL

----------------------------------------

System.Core

Assembly Version: 3.5.0.0

Win32 Version: 3.5.30729.7903 built by: Win9Rel

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll

----------------------------------------

Microsoft.DirectX.Direct3DX

Assembly Version: 1.0.2902.0

Win32 Version: 5.04.00.3900

CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3DX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3DX.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

Link to comment
Share on other sites

Hi, I'm attempting to convert B9 textures to it, but I'm getting a weird issue where files are reported as found but are then completely ignored on export, with every single one skipped for unknown reason. Tried every mask setting, disabling config reading and every other option, zero effect.

Folder infos :

MBM files count : 0

TGA files count : 172

PNG files count : 32

Backup files count : 0

-----

-----

Starting conversion of 204 files.

MBM count : 0.

TGA count : 0.

PNG count : 0.

204 files excluded, 0 files without mipmaps. 0 files will skip normal detection.0 files will not be resized.

Link to comment
Share on other sites

Hi, I'm attempting to convert B9 textures to it, but I'm getting a weird issue where files are reported as found but are then completely ignored on export, with every single one skipped for unknown reason. Tried every mask setting, disabling config reading and every other option, zero effect.

I had luck by converting the B9 textures either to:

- NOT grayscale -> convert them to 8-bit color (in Photoshop)

- NOT palettized (same)

- Simply opening in photoshop and re-saving/overwriting: they were in a specific PNG format that DDS4KSP apparently can't read

Link to comment
Share on other sites

As already mentioned here, the concept of the algorithm to convert image files is not really suitable for all mods. The good side of this tool is the two ideas of the controlled conversion and user friendly interface process. However, maintaining the basic idea, you must implement it in the right direction with better flexibility. And I think that, in the right direction would be as follows:

  1. Show dialog box to select the folder in which you want to convert images. (realized)
  2. Given that the DDS textures can only be square and have a side of a power of two - provide conversion options, taking into account parameters such as:


    1. Exclude images width less than or equal to
      Min_Width
      (control with 2 arrows Up/Down that will rise/low power of two or set manually (any size for some future reasons))

    2. Exclude images height less than or equal to
      Min_Height
      (same control)

    3. Reduce images width to the size of
      Max_Width
      (same control, but check if above the Min_Width, else set equal to Min_Width).

    4. Reduce images height to the size of
      Max_Heigth
      (same control, but check if above the Min_Height, else set equal to Min_Height).

    5. Three Radio buttons (dots) for option above: "
      Ignore local exception files, use settings from this file
      "; "
      Use local exception files but use settings from this file
      "; "
      Use local exception files and use settings from those files
      ".

    6. And CheckBox labeled "
      When exception file found then ask me to apply or ignore it using dialog box.
      "




  3. All those options described above must be writen in the file "DDS4KSP_Global.txt", in global section (see what is mean below).
  4. Parser must check each folder for files with exceptions (created by author of the corresponding MOD's). The file name with exceptions must be strictly regulated in the description of this utility. For example, "DDS4KSP_Exceptions.txt".
  5. "DDS4KSP_Exceptions.txt", as the "DDS4KSP_Global.txt", may contain the following structure:

    1. Section for global settings (
      see #2
      ) for converting images from the current folder and its subfolders.

    2. Section for exceptions, which will specify files excluded from the list of conversion or for which will be valid only the specified conversion options if they are indicated as string parameters.

[*]If local "DDS4KSP_Exceptions.txt" not found then settings will be used from "DDS4KSP_Exceptions.txt" of upper folder or from "DDS4KSP_Global.txt". Same for options from #2.e.

Link to comment
Share on other sites

Great work. This and DDSLoader reduced my memory footprint from 3 GiB to 2.4 Gib or so, which is great.

One note, I would suggest adding the Squad/Contracts/Icons folder to the exceptions. As you might guess, it contains the small icons used to contract waypoints. DDS4KSP makes them solid blocks.

Link to comment
Share on other sites

Something must have gone terribly wrong with the DDS conversion, because I can't change scenes after loading a save game. I can open the menus like contracts and reasearch (not VAB, SPH or Tracking), but cant return to the KSC scene either. After restoring from backup, everything works again. What files do you think shouldn't have been converted? (I did the whole Gamedata folder with the exceptions provided in the download)

Link to comment
Share on other sites

I have a question as to weather this would be the right choice for me. I'm running Linux with the 64 bit ksp. I have 16 GB of ram so I'm not worried about running out of memory in that way, I have all of the visual upgrade mods and around 80+ additional mods and the game runs just as well with or with out them installed. My problem is with FPS. When I have a ship or station with more than 400 or so parts my frames drop to the point of not being playable. So my question is will this help me in the way of compressing the files so they can be displayed quicker in game or will it only help me loading the game quicker? Sorry to sound like such a noob but I guess I really am here. Thanks.

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