Jump to content

Photo

[Tutorial] How to import/export BM, NM (BC1, BC5U, BC7) textures

tutorial textures edit

7 replies to this topic

#1
UberGrainy

UberGrainy

    Resident poster

  • Supporter
  • PipPipPipPipPip
  • 3,882 posts

NEW VERSION:

 

Confirmed that this method works for BMM, BML, CMM, RMT, NM. I forget what else.

 

Finding textures:

Unpack the files using this. Look for the TEX files you want to edit. You can use this tool lto preview them and see what they might be.

 

Alternatively, Install this and run the game. When in-game, bring up the menu and under Direct 3D 11, click Render Mod Tools. This will open a window where you can refresh to list all current textures loaded. Try using this in as isolated an area as possible (ie. character creation screen, because it has no background). You can then dump the texture to Monster Hunter World/SK_Res/ in the dump folder.

 

Note that if you use the second method, you should use Vuze's texture quality fix, to ensure that you get max resolution textures.

 

Converting TEX to DDS:
If the TEX is BC1 (usually BM files), you can usually use this. If it's BC7 (usually GUI files), you can use this.
If it's not supported by the above tools, you'll need to use the preview tool in the above section, and experiment with compression type and size until it "looks correct".

 

Textures with transparencies tend to currently not convert properly (they come out looking like rainbow trash). Normal maps are usually BC5U (ATI2) and squished vertically. Invert them after you open them. Don't forget to invert back when exporting.
 

In the top left, where it says "0xOFFSET", you can enter values to shift the image, so that you don't have to later. Offsets are almost always 100, 108, 110 or 118. Pay attention to the top left/right of the texture. There will be a little box or distortion that helps you figure out if you've aligned the texture correctly or not.

 

If the texture is garbled, you're either using the wrong DDS header (I think it's always BC1, BC5 or BC7) or the wrong offset. Once you get both of these correct, it should also ungarble the texture. I usually use offset 100 as a base when testing headers.

 

Alternatively. if  you used Kaldaien's tool, you should already have the texture in DDS format.

 

Importing DDS into Photoshop and editing it:

You can use GIMP, but I don't know how. For Photoshop, wou will need this. Open the texture (don't import mipmaps as layers).

 

If you converted directly from TEX without playing with the offset, textures will have the right side cut off and appearing on the left. You'll have to fix this manually (just paste the left onto the right and move it up a little).

 

Edit the texture as you see fit. There are two ways to edit transparencies, either with layer transparency or by creating an alpha channel and defining opacity via black (invisible) and white (visible).

 

Exporting DDS:

Under Texture Type dropdown, select the type you need. Normal Map if it's a normal map, Color if it has no transparencies, and Color + Alpha if it does have transparencies. Try to export as BC1 or BC7. Normal map needs to be exported as BC5 (it's BC5U, although it doesn't say it).

 

As long as it's not a normal map, it doesn't seem to need to be the same DDS format as the original, but you'll need to export it in a format that one of the currently available tools can convert back to TEX without imploding. So far I've only tested this with importing a BC1 and exporting as BC7 with alpha, and it worked. If it doesn't work refer to the old version of the guide below for more details..

 

If you used BC7, drag drop the exported DDS onto the BC7 converter. Otherwise do the same with the BC1 converter. It should spit out a TEX file. Place this TEX file where the game is looking for the original texture (match the folder structure under Monster Hunter World/NativePC/) and the game should load it.

 

Normal Maps:
I think normal maps need to be the same resolution (note how the vertical res is half horizontal). After exporting them as BC5, you can drag them on top of the BC7 converter 0.2, and it should convert to TEX. However, it may appeared garbled in-game. To fix this, you need to copy paste the start of the original NM TEX file, onto the edited one that you made.

 

The part you need to copy paste is usually obvious. There'll be a bunch of bytes like 7F 7F 00 00 00 00 00 00 7F 7F 00 00 00 00 00 00, and then suddenly other data. Copy paste everything before the other data, and then try to mimic the structure of the bytes in your edited version by copy pasting the data over. You'll have to overwrite the start of your edited NM (the header won't be the same size as the original).

 

The file size of your edited TEX should be slightly smaller. If you copy paste it correctly, the file sizes should match, and it should display correctly in-game.

 

RMT maps:

I haven't quite figured these out yet, but I think each color channel corresponds to a type of shading. Shininess, reflection, etc. Metallic stuff is usually colored yellow-green.

 

Skin map alpha channel:
The alpha channel on the skin map seems to be some kind of specular map. The darker it is, the higher phong shading the skin seems to have.

 

 

OLD VERSION:

 

Copy paste from my description for  the mod "Prettier Handler Face and Eye Colors".

1. Unpack the files using this. Look for the TEX files you want to edit. You can use this tool to preview them and see what they might be.

2. Convert TEX to DDS. If it's BC1 (usually BM files), you can usually use this. If it's BC7 (usually GUI files), you can use this.
If it's not supported by the above tools, you'll need to experiment with compression type and size using the above preview tool, until it "looks correct".
Textures with transparencies tend to currently not convert properly (they come out looking like rainbow trash).

Normal maps are usually BC5U (ATI2) and squished vertically. Invert them after you open them. Don't forget to invert back when exporting.

3. Edit the texture in Photoshop. Notice that the textures usually have the right side cut off and appearing on the left. You will need both this misaligned version, and the aligned version. The misaligned version is for the main image, and the aligned version is for the mipmaps. Don't ask me why it has to be that way, because I have no idea. That's just how I got it working properly.

4. When exporting, you will need this. You need to export them in the same DDS format as the original. For BM, compression should be BC1 Linear. For NM (normal maps), choose Normal Map from the Texture Type dropdown menu. I haven't tried other types yet.

5. If you are exporting to a format not supported by the tools above, You will need to export both non-mipmap (misaligned) and mipmap (aligned) versions of the texture. Otherwise you can simply drag drop the edited DDS into the above tools (currently only supporting BC1 or BC7) and it should convert them back to TEX, no problem.

6. If you are converting to another format (ie. BC5U normal maps) you'll need a Hex Editor for this next part. Have the original TEX file handy. Open the TEX file, and both of your exported DDS, side-by-side so you can compare addresses.

7. Copy the original TEX file header (starts at the beginning with "TEX", and usually ends on the last line with 7E 7D, next line starts with 80 7D). You can tell because the header should have lots of 00 byte spaces. When it starts looking like compacted garbled letters, that's when other data starts. You only need the header.

8. Paste the TEX file header over the start of the mis-aligned (no mipmap) DDS file header, also looking for the same place where the header ends (ie. final line with 7E 7D, next line starts with 80 7D).

9. Scroll down to the bottom of the misaligned no mipmap DDS file. Note the address where the file ends (eg. 00080070).

10. Now go to the same address in the original TEX, and in the mipmap DDS. You should see some junk data close to that address. It should look like several lines of "7E 7D 00 00 00 49 92 24 7E 7D 00 00 00 49 92 24". Before these lines is where the main image texture data ends. After these lines is where the mipmap texture data starts.

11. What you need to do is append the misaligned non-mipmap DDS (with the original TEX header overwriting the start) with the bottom aligned mipmap DDS data, and make sure the starting (and ending) addresses match the original TEX addresses. If you do it right, the file size should match the original.

12. Test the texture in-game. If it's rainbow garbled, then you didn't convert to the correct format. If it's completely black or white, then you didn't copy the header properly. If it's misaligned, then you probably mixed up the aligned/misaligned versions.

There's one more way to obtain and edit textures, although I haven't really tried it.
Note that it is affected by the texture display bug, meaning whatever you dump will probably be at a lesser mipmap resolution.

1. Install this and run the game.

2. When in-game, bring up the menu and under Direct 3D 11, click Render Mod Tools. This will open a window where you can refresh to list all current textures loaded. Try using this in as isolated an area as possible (ie. character creation screen, because it has no background).

3. You can then dump the texture (it'll dump to Monster Hunter World/SK_Res/ in the dump folder)

4. You can inject back in by putting the same texture in the inject folder when you're done).


Edited by UberGrainy, 16 October 2018 - 01:30 pm.


#2
Thray

Thray

    Journeyman

  • Supporter
  • Pip
  • 41 posts

Fantastic, very helpful!



#3
UberGrainy

UberGrainy

    Resident poster

  • Supporter
  • PipPipPipPipPip
  • 3,882 posts
Did a little more experimentation. Others have probably already figured it out.
You can export back under other types (ie. import BC1, export as BC7 and the game will still read it).

I'll append to the post above.

Edited by UberGrainy, 04 September 2018 - 10:25 pm.


#4
winter1206

winter1206

    Stranger

  • Members
  • Pip
  • 6 posts

Thankyou, It is very helpful.


Edited by winter1206, 12 September 2018 - 04:30 pm.


#5
T4ke

T4ke

    Journeyman

  • Members
  • Pip
  • 39 posts

HI there, thanks for the explanation. But I'm still a little bit confused with the raindbow .dds output. For example the f_body032_0010_BM.tex (Vaal Hazak body armor) comes out as trash after conversion. Is there a way to fix that yet? I saw some re texture mods for that armor on nexus so there have to some way to convert this tex into a editable format.



#6
UberGrainy

UberGrainy

    Resident poster

  • Supporter
  • PipPipPipPipPip
  • 3,882 posts

Updated the post. Added more information about exporting NM files. Added more information about RMT files and the skin texture alpha channel. Clarified a few things here and there.

 

When something comes out trash, you either have the wrong DDS header (it's always either BC1, BC5, BC7) or the wrong offset. Try 100, 108, 110 or 118. Pretty sure it's always, or almost always one of those.



#7
TBBle

TBBle

    Stranger

  • Members
  • Pip
  • 1 posts

Thanks for this guide. I had a quick play with a hex editor, and the offset is actually in the file. That said, it matches the dimensions anyway: 256x256 is 0x100, 512x512 is 0x108, 1024x1024 is 0x110. Or at least for the ones I looked at, which were all square. I assume 2048x2048 would be 0x118.

 

It's basically adding 8 bytes to the offset for each MIP level. You can see the 2nd MIP level in RawTex by adding 0x8000 for BC1 or 0x10000 for BC5U, and then halving the dimensions, and hitting 'Try and Convert'.

 

i.e. given a 1024x1024 BC1 file, with offset 0x110, you can also see a 512x512 version of the texture at offset 0x80110. You can see a 256x256 version of the texture at offset 0xa0110.

 

Or as a handy list:

 

offset <== size (dimensions)

 
0x00110 <== 0x80000 (1024x1024)
0x80110 <== 0x20000 (512x512)
0xa0110 <== 0x08000 (256x256)
0xa8110 <== 0x02000 (128x128)
0xaa110 <== 0x00800 (64x64)
0xaa910 <== 0x00200 (32x32)
0xaab10 <== 0x00080 (16x16)
0xaab90 <== 0x00020 (8x8)
0xaabb0 <== 0x00008 (4x4)
0xaabb8 <== 0x00008 (4x4)
0xaabc0 <== 0x00008 (4x4)
 
For normal maps, they use BC5U, which is twice as many bits per pixel. RawTex misdetects this as being twice as wide as it is tall, but if you switch to BC5U and halve the width, you get the right image.
 
The same offset table for a 1024x1024 NM file:
 
0x000110 <== 0x100000 (1024x1024)
0x100110 <== 0x040000 (512x512)
0x140110 <== 0x010000 (256x256)
0x150110 <== 0x004000 (128x128)
0x154110 <== 0x001000 (64x64)
0x155110 <== 0x000400 (32x32)
0x155510 <== 0x000100 (16x16)
0x155610 <== 0x000040 (8x8)
0x155650 <== 0x000010 (4x4)
0x155660 <== 0x000010 (4x4)
0x155670 <== 0x000010 (4x4)

 



#8
UberGrainy

UberGrainy

    Resident poster

  • Supporter
  • PipPipPipPipPip
  • 3,882 posts
Nice, I never realized that. Thanks for the info.



Reply to this topic



  



Also tagged with one or more of these keywords: tutorial, textures, edit

IPB skins by Skinbox
Page loaded in: 5.097 seconds