Editing MBM Textures

From Kerbal Space Program Wiki
Revision as of 21:24, 5 February 2013 by WarStalkeR (talk | contribs)
Jump to: navigation, search

Requirements

Before we start, we need these tools:

• Photoshop

• Hex Editor HxD

Example

Let's take an example of model with two textures.

• model.mu

• model000.mbm

• model001.mbm

Opening as Portable Bit Map .PBM

01) First we rename model000.mbm in to model000.pbm and model001.mbm to model000.pbm.


02) Now we open model000.pbm with HxD and see picture like this:

Hex 01.png






First 20 bytes is what makes MBM format different from PBM - Portable Bitmap Format.


03) Also, pay attention to Magical Number. Each model000.mbm has it's own Magical Number, so always make backup, or write somewhere these first 20 bytes for later, to restore image to original formatting.

Hex 05.png







04) Now we select them and replace them with one of these 20 bytes and replace them with one of these lines:

• For 1024 x 1024 pixel images use this row:

Hex 02.png






• For 512 x 512 pixel images use this row:

Hex 03.png






• For 256 x 256 pixel images use this row:

Hex 04.png







05) Open .PBM images with Photoshop, and do anything you want with it. Then save. Avoid changing texture size, because I didn't tried to change texture size, so I can't tell if it will work correctly or not.


06) Now open changed .PBM image with HxD again:

Hex 08.png







07) And replace with original 20 bytes that were there:

Hex 06.png







08) And don't forget about corresponding Magic Number:

Hex 07.png







09) Save and now rename back model000.pbm in to model000.mbm and model001.pbm to model000.mbm.


10) Enjoy!


Opening as Photoshop Raw Image .RAW

01) Rename images file extensions from .MBM to .RAW

02) Removing first 20 bytes via HEX editor

03) Editing via Photoshop, saving again as RAW image.

04) Adding first 20 bytes back.

05) It should work too.