Modding:Texture formatting: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(18 intermediate revisions by 6 users not shown)
Line 3: Line 3:
|description=This page is a hub for everything related to Modding Baldur's Gate 3. Check out the following guides to learn how to mod BG3.
|description=This page is a hub for everything related to Modding Baldur's Gate 3. Check out the following guides to learn how to mod BG3.
|image=Modding_resources.webp
|image=Modding_resources.webp
}}Main page: [[Modding Resources]]
}}{{Modding box}}
This tutorial is from [https://www.nexusmods.com/users/14681269 atmosfur]
This tutorial is from [https://www.nexusmods.com/users/14681269 atmosfur]
<br>
<big>Work in Progress</big>
<br><br>
<br><br>
This guide has several sections related to the texture formats that BG3 uses, and how to export and prepare them in several programs. This guide is mainly about maps baked from custom 3D models and does not include skin textures currently.
This guide has several sections related to the texture formats that BG3 uses, and how to export and prepare them in several programs. This guide is mainly about maps baked from custom 3D models and does not include skin textures currently.
Line 12: Line 10:
'''The texture maps this guide covers are:'''<br>
'''The texture maps this guide covers are:'''<br>
*_BM (Basecolor Map)<br>
*_BM (Basecolor Map)<br>
*_NM (Normal Map)<br>
*_NM (Normal Map) [https://styly.cc/tips/maku-blender-normalmap-bake/ How to bake a normal map in Blender]<br>
*_MSK (Mask Map)<br>
*_MSK (Mask Map)<br>
*_PM (Physcial Map)<br>
*_PM (Physical Map)<br>
<br>
<br>
'''Additionally, to create a PM you will need:'''<br>
'''Additionally, to create a PM you will need:'''<br>
Line 54: Line 52:
<br>
<br>
== Creating the DDS files ==
== Creating the DDS files ==
=== Simple Conversion ===
=== Simple Conversion with Paint.NET ===
If your textures have all their channels set up correctly already, you just need to export them with the correct DDS compression in the editing program of your choice. I'm using Paint.NET as an example.<br><br>
If your textures have all their channels set up correctly already, you just need to export them with the correct DDS compression in the editing program of your choice. I'm using Paint.NET as an example.<br><br>
'''Basecolor Map Settings:'''<br>
'''Basecolor Map Settings:'''<br>
Choose BC1 (Linear,DTX1), make sure Generate Mip Maps is checked<br>
Choose BC1 (Linear,DTX1), make sure Generate Mip Maps is checked<br>
[[File:BM DTX1.webp]]<br><br>
[[File:BM DTX1.webp|frameless]]<br><br>
'''Mask Map Settings:'''<br>
'''Mask Map Settings:'''<br>
Choose BC5 (Linear, Unsigned), make sure Generate Mip Maps is checked<br>
Choose BC5 (Linear, Unsigned), make sure Generate Mip Maps is checked<br>
[[File:MSKBC5.webp]]<br><br>
[[File:MSKBC5.webp|frameless]]<br><br>
'''Normal Map Settings:'''<br>
'''Normal Map Settings:'''<br>
Choose BC3 (Linear, DTX5), make sure Generate Mip Maps is checked<br>
Choose BC3 (Linear, DTX5), make sure Generate Mip Maps is checked<br>
[[File:NMDTX.webp]]<br><br>
[[File:NMDTX.webp|frameless]]<br><br>
'''Physical Map Settings:'''<br>
'''Physical Map Settings:'''<br>
Choose BC1 (Linear,DTX1), make sure Generate Mip Maps is checked<br>
Choose BC1 (Linear,DTX1), make sure Generate Mip Maps is checked<br>
[[File:PMDTX.webp]]<br><br>
[[File:PMDTX.webp|frameless]]<br><br>
=== Manually Assign Channels ===
 
=== Manually Assign Channels with GIMP ===
If you've created your textures in a program other than Substance Painter, you might need to manually assign the correct channels to your maps. Your best choice for doing this is probably GIMP, and I tried to make this part of the guide as beginner friendly as possible if you've never used the program before.<br>
If you've created your textures in a program other than Substance Painter, you might need to manually assign the correct channels to your maps. Your best choice for doing this is probably GIMP, and I tried to make this part of the guide as beginner friendly as possible if you've never used the program before.<br>
I recommend working on one map type at a time if you're following along with this guide. Again, this uses a horns texture as an example, the way other textures are set up in the game might be different, and it does not touch on the way skin textures are set up.<br>
I recommend working on one map type at a time if you're following along with this guide. Again, this uses a horns texture as an example, the way other textures are set up in the game might be different, and it does not touch on the way skin textures are set up.<br>
==== Normal Map ====
==== Normal Map ====
1. Open your Normal Map in GIMP, and click on the Channels tab to view the channels of your map. Depending on the program you created your normal map with, you might or might not have an Alpha channel already.<br>
1. Open your Normal Map in GIMP, and click on the Channels tab to view the channels of your map. Depending on the program you created your normal map with, you might or might not have an Alpha channel already.<br>
[[File:Nm1.webp]]<br><br>
[[File:Nm1.webp|frameless|900px]]<br><br>
2. If you do not see an Alpha channel in your channels, switch back over to the Layers tab, right-click on your layer and select "Add Alpha Channel". This will add an empty Alpha channel.<br>
2. If you do not see an Alpha channel in your channels, switch back over to the Layers tab, right-click on your layer and select "Add Alpha Channel". This will add an empty Alpha channel.<br>
[[File:Nm2.webp]]
[[File:Nm2.webp|frameless]]
[[File:Nm3.webp]]<br><br>
[[File:Nm3.webp|frameless]]<br><br>
3. Back in your Channels tab, right-click on the "Red" channel and select "Channel to Selection".<br>
3. Back in your Channels tab, right-click on the "Red" channel and select "Channel to Selection".<br>
[[File:Nm4.webp]]<br><br>
[[File:Nm4.webp|frameless]]<br><br>
4. Swap back to your Layer tab, then in your menu bar go to "Edit -> Clear" to delete the selected areas. This basically copies the contents of the Red channel to the Alpha channel.<br>
4. Swap back to your Layer tab, then in your menu bar go to "Edit -> Clear" to delete the selected areas. This basically copies the contents of the Red channel to the Alpha channel.<br>
[[File:Nm5.webp]]<br><br>
[[File:Nm5.webp|frameless|900px]]<br><br>
5. Deselect your image by going to "Select -> None" in the menu bar.<br>
5. Deselect your image by going to "Select -> None" in the menu bar.<br>
[[File:Nm7.webp]]<br><br>
[[File:Nm7.webp|frameless|900px]]<br><br>
6. Check your Channels tab, your Alpha channel should now look like your Red channel.<br>
6. Check your Channels tab, your Alpha channel should now look like your Red channel.<br>
[[File:Nm8.webp]]<br><br>
[[File:Nm8.webp|frameless]]<br><br>
7. In the menu bar, go to "Colors -> Components -> Decompose". This is going to create and open a new version of your file, with all the channels separated into individual layers.<br>
7. In the menu bar, go to "Colors -> Components -> Decompose". This is going to create and open a new version of your file, with all the channels separated into individual layers.<br>
[[File:Nm9.webp]]<br><br>
[[File:Nm9.webp|frameless]]<br><br>
8. In the pop-up window select RGBA as the Color mode, then hit OK.<br>
8. In the pop-up window select RGBA as the Color mode, then hit OK.<br>
[[File:Nm10.webp]]<br><br>
[[File:Nm10.webp|frameless]]<br><br>
9. You should now see a file that looks like your normal map, but in greyscale. In the layers tab you will see that each channel has its own layer now.<br>
9. You should now see a file that looks like your normal map, but in greyscale. In the layers tab you will see that each channel has its own layer now.<br>
[[File:Nm11.webp]]<br><br>
[[File:Nm11.webp|frameless|900px]]<br><br>
10. Before the next step, make sure that your Foreground color is set to black. If it is not, you can click the small icon of a black and white square underneath the color selector to reset it.<br>
10. Before the next step, make sure that your Foreground color is set to black. If it is not, you can click the small icon of a black and white square underneath the color selector to reset it.<br>
[[File:Nm12.webp]]<br><br>
[[File:Nm12.webp|frameless]]<br><br>
11. Click on the "red" layer to set it to your active layer, then in the menu bar go to "Edit -> Fill with FG Color" to fill the layer with black.<br>
11. Click on the "red" layer to set it to your active layer, then in the menu bar go to "Edit -> Fill with FG Color" to fill the layer with black.<br>
[[File:Nm13.webp]]
[[File:Nm13.webp|frameless|900px]]
[[File:Nm14.webp]]<br><br>
[[File:Nm14.webp|frameless|900px]]<br><br>
12. Go to "Colors -> Components -> Recompose" in the menu bar to recompose the layers back into channels in your original file. <br>
12. Go to "Colors -> Components -> Recompose" in the menu bar to recompose the layers back into channels in your original file. <br>
[[File:Nm17.webp]]<br><br>
[[File:Nm17.webp|frameless]]<br><br>
13. Go back to the original file and check the Channels tab to make sure the red channel is just black (empty) now. <br>
13. Go back to the original file and check the Channels tab to make sure the red channel is just black (empty) now. <br>
[[File:Nm18.webp]]<br><br>
[[File:Nm18.webp|frameless|900px]]<br><br>
14. If your original file seems to still be the same as before, make sure that in the channels tab none of the channels are selected/highlighted. If any of them are, just click on them again to de-select them, then go back to the Decomposed Layers file and repeat step 12 to recompose it.<br>
14. If your original file seems to still be the same as before, make sure that in the channels tab none of the channels are selected/highlighted. If any of them are, just click on them again to de-select them, then go back to the Decomposed Layers file and repeat step 12 to recompose it.<br>
[[File:Nm15.webp]]
[[File:Nm15.webp|frameless]]
[[File:Nm16.webp]]<br><br>
[[File:Nm16.webp|frameless]]<br><br>
15. Your recomposed file is now ready to export. Go to "File -> Export As..."<br>
15. Your recomposed file is now ready to export. Go to "File -> Export As..."<br>
[[File:Nm19.webp]]<br><br>
[[File:Nm19.webp|frameless]]<br><br>
16. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.<br>
16. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.<br>
[[File:Nm20.webp]]<br>
[[File:Nm20.webp|frameless|900px]]<br>
[[File:Nm21.webp]]<br><br>
[[File:Nm21.webp|frameless|900px]]<br><br>
17. To correctly export your Normal map as a .dds file, make sure to select "BC3/DTX5" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".<br>
17. To correctly export your Normal map as a .dds file, make sure to select "BC3/DTX5" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".<br>
[[File:Nm22.webp]]<br><br>
[[File:Nm22.webp|frameless]]<br><br>
==== Physical Map ====
==== Physical Map ====
To create the Physical Map, you will need to have these three maps: <br>
To create the Physical Map, you will need to have these three maps: <br>
Line 116: Line 115:
* Metallic Map<br><br>
* Metallic Map<br><br>
1. Open all three maps in GIMP. (If your Metallic Map is just black just skip opening it)<br>
1. Open all three maps in GIMP. (If your Metallic Map is just black just skip opening it)<br>
[[File:Pm23.webp]]<br><br>
[[File:Pm23.webp|frameless]]<br><br>
2. Go to your Roughness Map and in the menu bar, go to "Image -> Mode -> RGB" to convert your image from Grayscale mode to RGB mode. This creates the RGB channels needed. <br>
2. Go to your Roughness Map and in the menu bar, go to "Image -> Mode -> RGB" to convert your image from Grayscale mode to RGB mode. This creates the RGB channels needed. <br>
[[File:Pm25.webp]]<br><br>
[[File:Pm25.webp|frameless|900px]]<br><br>
3. Right-click on your layer and select "Add Alpha Channel". This will add a blank Alpha channel.<br>
3. Right-click on your layer and select "Add Alpha Channel". This will add a blank Alpha channel.<br>
[[File:Pm26.webp]]
[[File:Pm26.webp|frameless|900px]]
[[File:Pm27.webp]]<br><br>
[[File:Pm27.webp|frameless]]<br><br>
4. In the menu bar, go to "Colors -> Components -> Decompose". This is going to create and open a new version of your file, with all the channels separated into individual layers.<br>
4. In the menu bar, go to "Colors -> Components -> Decompose". This is going to create and open a new version of your file, with all the channels separated into individual layers.<br>
[[File:Pm28.webp]]<br><br>
[[File:Pm28.webp|frameless|900px]]<br><br>
5. In the window that pops up, select "RGBA" as the Color mode, then hit OK.<br>
5. In the window that pops up, select "RGBA" as the Color mode, then hit OK.<br>
[[File:Pm29.webp]]<br><br>
[[File:Pm29.webp|frameless]]<br><br>
6. You should now see a second file that looks like your roughness map, with each channel as a separate layer.<br>
6. You should now see a second file that looks like your roughness map, with each channel as a separate layer.<br>
[[File:Pm30.webp]]<br><br>
[[File:Pm30.webp|frameless|900px]]<br><br>
7. If your Metalness map was just black, you can simply fill the "red" layer with black. If your Metalness map has information in it, follow the steps for the AO map instead to insert the Metalness map into the "red" layer. <br>
7. If your Metalness map was just black, you can simply fill the "red" layer with black. If your Metalness map has information in it, follow the steps for the AO map instead to insert the Metalness map into the "red" layer. <br>
To fill the layer with black, click on the "red" layer to set it to active, then go to "Edit -> Fill with FG Color" in the menu bar, making sure that your foreground color is set to black.<br>
To fill the layer with black, click on the "red" layer to set it to active, then go to "Edit -> Fill with FG Color" in the menu bar, making sure that your foreground color is set to black.<br>
[[File:Pm31.webp]]  
[[File:Pm31.webp|frameless|900px]]  
[[File:Pm32.webp]]<br><br>
[[File:Pm32.webp|frameless|900px]]<br><br>
8. Now it's time to insert the AO map. To make things easier, hide both the "red" and "green" layer by clicking the little eye shaped icon next to them. <br>
8. Now it's time to insert the AO map. To make things easier, hide both the "red" and "green" layer by clicking the little eye shaped icon next to them. <br>
[[File:Pm33.webp]]<br><br>
[[File:Pm33.webp|frameless|900px]]<br><br>
9. Now swap over to your AO map file and in the menu bar go to "Select -> Select All" to select the entire image.<br>
9. Now swap over to your AO map file and in the menu bar go to "Select -> Select All" to select the entire image.<br>
[[File:Pm34.webp]]
[[File:Pm34.webp|frameless|900px]]
[[File:Pm35.webp]]<br><br>
[[File:Pm35.webp|frameless]]<br><br>
10. In the menu bar, go to "Edit -> Copy" (or hit Ctrl+C) to copy your AO map image.<br>
10. In the menu bar, go to "Edit -> Copy" (or hit Ctrl+C) to copy your AO map image.<br>
[[File:Pm36.webp]]<br><br>
[[File:Pm36.webp|frameless]]<br><br>
11. Swap back over the Decomposed Layers file and click on the "blue" layer to set it to the active layer.<br>
11. Swap back over the Decomposed Layers file and click on the "blue" layer to set it to the active layer.<br>
[[File:Pm37.webp]]<br><br>
[[File:Pm37.webp|frameless|900px]]<br><br>
12. In the menu bar, go to "Edit -> Paste In Place" to paste your copied AO map.<br>
12. In the menu bar, go to "Edit -> Paste In Place" to paste your copied AO map.<br>
[[File:Pm38.webp]]<br><br>
[[File:Pm38.webp|frameless]]<br><br>
13. You should see your AO map pasted in the file now as a "Floating Selection". <br>
13. You should see your AO map pasted in the file now as a "Floating Selection". <br>
[[File:Pm39.webp]]<br><br>
[[File:Pm39.webp|frameless|900px]]<br><br>
14. In the layer tab, click the small anchor icon at the bottom to anchor the pasted layer onto the one below it.<br>
14. In the layer tab, click the small anchor icon at the bottom to anchor the pasted layer onto the one below it.<br>
[[File:Pm40.webp]]
[[File:Pm40.webp|frameless]]
[[File:Pm41.webp]]<br><br>
[[File:Pm41.webp|frameless]]<br><br>
15. Your "blue" layer should now have merged with the pasted image. Merging the layers together this way ensures that they will Recompose properly in the end. If your Metalness map has information in it, paste it into the "red" layer the same way as the AO map. <br>
15. Your "blue" layer should now have merged with the pasted image. Merging the layers together this way ensures that they will Recompose properly in the end. If your Metalness map has information in it, paste it into the "red" layer the same way as the AO map. <br>
[[File:Pm42.webp]]<br><br>
[[File:Pm42.webp|frameless]]<br><br>
16. Click on the small eye icons next to the layers you hid before to make them visible again. <br>
16. Click on the small eye icons next to the layers you hid before to make them visible again. <br>
[[File:Pm43.webp]]<br><br>
[[File:Pm43.webp|frameless|900px]]<br><br>
17. Go to "Colors -> Components -> Recompose" in the menu bar to recompose the layers back into channels in your original file. <br>
17. Go to "Colors -> Components -> Recompose" in the menu bar to recompose the layers back into channels in your original file. <br>
[[File:Nm17.webp]]<br><br>
[[File:Nm17.webp|frameless]]<br><br>
18. Go back to the original file and check the Channels tab to make sure it recomposed properly - your PM map should now also look something like this.<br>
18. Go back to the original file and check the Channels tab to make sure it recomposed properly - your PM map should now also look something like this.<br>
[[File:Pm45.webp]]<br><br>
[[File:Pm45.webp|frameless|900px]]<br><br>
19. If your original file seems to still be the same as before, make sure that in the channels tab none of the channels are selected/highlighted. If any of them are, just click on them again to de-select them, then go back to the Decomposed Layers file and repeat step 17 to recompose it.<br>
19. If your original file seems to still be the same as before, make sure that in the channels tab none of the channels are selected/highlighted. If any of them are, just click on them again to de-select them, then go back to the Decomposed Layers file and repeat step 17 to recompose it.<br>
[[File:Nm15.webp]]
[[File:Nm15.webp|frameless]]
[[File:Nm16.webp]]<br><br>
[[File:Nm16.webp|frameless]]<br><br>
20. Your channel order for the finished PM should be Metalness in Red, Roughness in Green, AO in Blue, and nothing in Alpha. <br>
20. Your channel order for the finished PM should be Metalness in Red, Roughness in Green, AO in Blue, and nothing in Alpha. <br>
[[File:Pm46.webp]]<br><br>
[[File:Pm46.webp|frameless]]<br><br>
21. Your recomposed file is now ready to export. Go to "File -> Export As..."<br>
21. Your recomposed file is now ready to export. Go to "File -> Export As..."<br>
[[File:Nm19.webp]]<br><br>
[[File:Nm19.webp|frameless]]<br><br>
22. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.<br>
22. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.<br>
[[File:Nm20.webp]]<br>
[[File:Nm20.webp|frameless|900px]]<br>
[[File:Nm21.webp]]<br><br>
[[File:Nm21.webp|frameless|900px]]<br><br>
23. To correctly export your Physical map as a .dds file, make sure to select "BC1/DTX1" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".<br>
23. To correctly export your Physical map as a .dds file, make sure to select "BC1/DTX1" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".<br>
[[File:Pm47.webp]]
[[File:Pm47.webp|frameless]]
<br><br>
<br><br>
==== Basecolor Map ====
==== Basecolor Map ====
1. Open your Basecolor Map in GIMP. Right-click on the layer and select "Add Alpha Channel". This will add an empty Alpha channel. <br>
1. Open your Basecolor Map in GIMP. Right-click on the layer and select "Add Alpha Channel". This will add an empty Alpha channel. <br>
[[File:Bm49.webp]]
[[File:Bm49.webp|frameless]]
[[File:Bm50.webp]]<br><br>
[[File:Bm50.webp|frameless]]<br><br>
2. Your file is now ready to export. Go to "File -> Export As..."<br>
2. Your file is now ready to export. Go to "File -> Export As..."<br>
[[File:Nm19.webp]]<br><br>
[[File:Nm19.webp|frameless]]<br><br>
3. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.<br>
3. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.<br>
[[File:Nm20.webp]]<br>
[[File:Nm20.webp|frameless|900px]]<br>
[[File:Nm21.webp]]<br><br>
[[File:Nm21.webp|frameless|900px]]<br><br>
4. To correctly export your Basecolor map as a .dds file, make sure to select "BC1/DTX1" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".<br>
4. To correctly export your Basecolor map as a .dds file, make sure to select "BC1/DTX1" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".<br>
[[File:Bm51.webp]]
[[File:Bm51.webp|frameless]]
<br><br>
<br><br>
==== Mask Map ====
==== Mask Map ====
The channels that mask maps use in the game vary depending on what the mask is used for. This example is just for horn textures, so check the vanilla game textures first to find out what channels you need. In any case, mask maps do not need an Alpha channel, so all you have to do for them is export as a .dds file.<br>
The channels that mask maps use in the game vary depending on what the mask is used for. This example is just for horn textures, so check the vanilla game textures first to find out what channels you need. In any case, mask maps do not need an Alpha channel, so all you have to do for them is export as a .dds file.<br>
Either way, it doesn't hurt to check the Channels tab to make sure you've only got information in the channels that are supposed to have it, i.e. just the "green" channel for horn mask maps.<br>
Either way, it doesn't hurt to check the Channels tab to make sure you've only got information in the channels that are supposed to have it, i.e. just the "green" channel for horn mask maps.<br>
[[File:Msk53.webp]]<br><br>
[[File:Msk53.webp|frameless]]<br><br>
1. Your file is now ready to export. Go to "File -> Export As..."<br>
1. Your file is now ready to export. Go to "File -> Export As..."<br>
[[File:Nm19.webp]]<br><br>
[[File:Nm19.webp|frameless]]<br><br>
2. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.<br>
2. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.<br>
[[File:Nm20.webp]]<br>
[[File:Nm20.webp|frameless|900px]]<br>
[[File:Nm21.webp]]<br><br>
[[File:Nm21.webp|frameless|900px]]<br><br>
3. To correctly export your Mask map as a .dds file, make sure to select "BC3/ATI2 (3Dc)" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".<br>
3. To correctly export your Mask map as a .dds file, make sure to select "BC5/ATI2 (3Dc)" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".<br>
[[File:Msk54.webp]]<br><br>
[[File:Msk54.webp|frameless]]<br><br>
==== GIMP TL;DR ====
 
== Export Settings TL;DR ==
If you already know how to do all the channel editing and just need a quick reference on how these maps are set up and exported.<br><br>
Normal Map Channels: <br>
* Red - Nothing
* Green - Green
* Blue - Blue
* Alpha - Red<br><br>
Physical Map Channels:<br>
* Red - Metalness
* Green - Roughness
* Blue - AO
* Alpha - Nothing<br><br>
Basecolor Map Channels: <br>
* Red - Red
* Green - Green
* Blue - Blue
* Alpha - Nothing<br><br>
Mask Map Channels:<br>
* Check vanilla textures for whatever you're masking. These usually don't need an Alpha channel.<br><br>
 
DDS Export Settings:<br>
* '''Normal Map:'''<br>
* BC3 DTX5<br><br>
* '''Physical Map:'''<br>
* BC1 DTX1<br><br>
* '''Basecolor Map:'''<br>
* BC1 DTX1<br><br>
<br>
<br>
* '''Mask Map:'''<br>
* These again depend on the type of mask you're creating. I'll be collecting as much info for different mask maps here as I find.
* <nowiki>BC5 Unsigned (Paint.NET) / BC5 ATI2 (GIMP)</nowiki> for Horn masks
* <nowiki>BC7 RGBA 8bpp | Explicit alpha (Photoshop) / BC7 sRGB or BC7 Linear (Paint.NET) for Shared Scars MSK</nowiki> (thanks to [https://www.nexusmods.com/baldursgate3/users/47038262 aurebuen] for the info)
[[Category:Modding resources]]
== Icon/Atlas Export Settings ==
If using Paint.net and your icon atlas ends up invisible in game when using DXT1/DXT5 try using the below:
*First make sure your uuids are unique and are not clashing with another mod
* if that doesn't work use this format
[[File:Atlas Paintnet Export Settings.webp|Atlas Paintnet Export Settings.webp]]
[[Category:Modding guides]]
[[Category:Armor modding]]

Latest revision as of 04:43, 9 January 2024

This tutorial is from atmosfur

This guide has several sections related to the texture formats that BG3 uses, and how to export and prepare them in several programs. This guide is mainly about maps baked from custom 3D models and does not include skin textures currently.

The texture maps this guide covers are:


Additionally, to create a PM you will need:

  • AO (Ambient Occlusion Map)
  • Roughness Map
  • Metallic Map


This guide also includes a section on setting up maps by hand in GIMP if you do not have Substance Painter, or edited your textures by hand.

Substance Painter Export Preset[edit | edit source]

In case the BG3 export presets for Substance Painter do not work for you, or you have a pre-Adobe version of Substance Painter, here's how you can set up your own export presets in Substance Painter. I personally divided these into two separate presets due to my Basecolor and Mask map both pulling from different layers of basecolor information.

1. In the File -> Export Textures window, select the Configuration tab.
2. Click the small + icon next to "Presets" on the left side to create a new preset.
3. Create two R+G+B+A Output maps and one R+G+B Output map for the NM, PM and MSK map respectively.
4. On the right, you will see which Input maps you will need to drag and drop onto the Output maps R,G,B and A slots.
SPSettings1.webp
SPExport2.webp

5. Drag and drop the Input maps onto the corresponding slots in the Output maps tab:
Normal Map (Make sure to use the Converted maps - NormalDirectX):
R: Leave this empty
G: NormalDirectX, select Green channel
B: NormalDirectX, select Blue channel
A: NormalDirectX, select Red channel
SPExportNM.webp

Physical Map:
R: Metallic, select Gray channel
G: Roughness, select Gray channel
B: Ambient occlusion, select Gray channel
A: Leave this empty
SPPMexport.webp

Mask Map:
This is specifically for horn textures, you will need to check a vanilla mask of whatever you are texturing to see which channel has the mask for customizing color. In this case, horns only use the Green channel for that.

R: Leave this empty for horns
G: Base Color, select Green channel
B: Leave this empty for horns
6. As mentioned, for the Basecolor Map I create a new export preset. For this you just need one RGB+A Output map, and drag the Base Color Input map onto the RGB slot.
SPexportBM.webp

7. Go back to the "Export" tab of the window and select your newly created export presets from the drop down at the top, then just hit export. Double check your created textures in a program that lets you view channels (such as GIMP or Photoshop) to make sure they all got assigned correctly. You will still need to convert your textures to DDS now.

Creating the DDS files[edit | edit source]

Simple Conversion with Paint.NET[edit | edit source]

If your textures have all their channels set up correctly already, you just need to export them with the correct DDS compression in the editing program of your choice. I'm using Paint.NET as an example.

Basecolor Map Settings:
Choose BC1 (Linear,DTX1), make sure Generate Mip Maps is checked
BM DTX1.webp

Mask Map Settings:
Choose BC5 (Linear, Unsigned), make sure Generate Mip Maps is checked
MSKBC5.webp

Normal Map Settings:
Choose BC3 (Linear, DTX5), make sure Generate Mip Maps is checked
NMDTX.webp

Physical Map Settings:
Choose BC1 (Linear,DTX1), make sure Generate Mip Maps is checked
PMDTX.webp

Manually Assign Channels with GIMP[edit | edit source]

If you've created your textures in a program other than Substance Painter, you might need to manually assign the correct channels to your maps. Your best choice for doing this is probably GIMP, and I tried to make this part of the guide as beginner friendly as possible if you've never used the program before.
I recommend working on one map type at a time if you're following along with this guide. Again, this uses a horns texture as an example, the way other textures are set up in the game might be different, and it does not touch on the way skin textures are set up.

Normal Map[edit | edit source]

1. Open your Normal Map in GIMP, and click on the Channels tab to view the channels of your map. Depending on the program you created your normal map with, you might or might not have an Alpha channel already.
Nm1.webp

2. If you do not see an Alpha channel in your channels, switch back over to the Layers tab, right-click on your layer and select "Add Alpha Channel". This will add an empty Alpha channel.
Nm2.webp Nm3.webp

3. Back in your Channels tab, right-click on the "Red" channel and select "Channel to Selection".
Nm4.webp

4. Swap back to your Layer tab, then in your menu bar go to "Edit -> Clear" to delete the selected areas. This basically copies the contents of the Red channel to the Alpha channel.
Nm5.webp

5. Deselect your image by going to "Select -> None" in the menu bar.
Nm7.webp

6. Check your Channels tab, your Alpha channel should now look like your Red channel.
Nm8.webp

7. In the menu bar, go to "Colors -> Components -> Decompose". This is going to create and open a new version of your file, with all the channels separated into individual layers.
Nm9.webp

8. In the pop-up window select RGBA as the Color mode, then hit OK.
Nm10.webp

9. You should now see a file that looks like your normal map, but in greyscale. In the layers tab you will see that each channel has its own layer now.
Nm11.webp

10. Before the next step, make sure that your Foreground color is set to black. If it is not, you can click the small icon of a black and white square underneath the color selector to reset it.
Nm12.webp

11. Click on the "red" layer to set it to your active layer, then in the menu bar go to "Edit -> Fill with FG Color" to fill the layer with black.
Nm13.webp Nm14.webp

12. Go to "Colors -> Components -> Recompose" in the menu bar to recompose the layers back into channels in your original file.
Nm17.webp

13. Go back to the original file and check the Channels tab to make sure the red channel is just black (empty) now.
Nm18.webp

14. If your original file seems to still be the same as before, make sure that in the channels tab none of the channels are selected/highlighted. If any of them are, just click on them again to de-select them, then go back to the Decomposed Layers file and repeat step 12 to recompose it.
Nm15.webp Nm16.webp

15. Your recomposed file is now ready to export. Go to "File -> Export As..."
Nm19.webp

16. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.
Nm20.webp
Nm21.webp

17. To correctly export your Normal map as a .dds file, make sure to select "BC3/DTX5" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".
Nm22.webp

Physical Map[edit | edit source]

To create the Physical Map, you will need to have these three maps:

  • AO Map
  • Roughness Map
  • Metallic Map

1. Open all three maps in GIMP. (If your Metallic Map is just black just skip opening it)
Pm23.webp

2. Go to your Roughness Map and in the menu bar, go to "Image -> Mode -> RGB" to convert your image from Grayscale mode to RGB mode. This creates the RGB channels needed.
Pm25.webp

3. Right-click on your layer and select "Add Alpha Channel". This will add a blank Alpha channel.
Pm26.webp Pm27.webp

4. In the menu bar, go to "Colors -> Components -> Decompose". This is going to create and open a new version of your file, with all the channels separated into individual layers.
Pm28.webp

5. In the window that pops up, select "RGBA" as the Color mode, then hit OK.
Pm29.webp

6. You should now see a second file that looks like your roughness map, with each channel as a separate layer.
Pm30.webp

7. If your Metalness map was just black, you can simply fill the "red" layer with black. If your Metalness map has information in it, follow the steps for the AO map instead to insert the Metalness map into the "red" layer.
To fill the layer with black, click on the "red" layer to set it to active, then go to "Edit -> Fill with FG Color" in the menu bar, making sure that your foreground color is set to black.
Pm31.webp Pm32.webp

8. Now it's time to insert the AO map. To make things easier, hide both the "red" and "green" layer by clicking the little eye shaped icon next to them.
Pm33.webp

9. Now swap over to your AO map file and in the menu bar go to "Select -> Select All" to select the entire image.
Pm34.webp Pm35.webp

10. In the menu bar, go to "Edit -> Copy" (or hit Ctrl+C) to copy your AO map image.
Pm36.webp

11. Swap back over the Decomposed Layers file and click on the "blue" layer to set it to the active layer.
Pm37.webp

12. In the menu bar, go to "Edit -> Paste In Place" to paste your copied AO map.
Pm38.webp

13. You should see your AO map pasted in the file now as a "Floating Selection".
Pm39.webp

14. In the layer tab, click the small anchor icon at the bottom to anchor the pasted layer onto the one below it.
Pm40.webp Pm41.webp

15. Your "blue" layer should now have merged with the pasted image. Merging the layers together this way ensures that they will Recompose properly in the end. If your Metalness map has information in it, paste it into the "red" layer the same way as the AO map.
Pm42.webp

16. Click on the small eye icons next to the layers you hid before to make them visible again.
Pm43.webp

17. Go to "Colors -> Components -> Recompose" in the menu bar to recompose the layers back into channels in your original file.
Nm17.webp

18. Go back to the original file and check the Channels tab to make sure it recomposed properly - your PM map should now also look something like this.
Pm45.webp

19. If your original file seems to still be the same as before, make sure that in the channels tab none of the channels are selected/highlighted. If any of them are, just click on them again to de-select them, then go back to the Decomposed Layers file and repeat step 17 to recompose it.
Nm15.webp Nm16.webp

20. Your channel order for the finished PM should be Metalness in Red, Roughness in Green, AO in Blue, and nothing in Alpha.
Pm46.webp

21. Your recomposed file is now ready to export. Go to "File -> Export As..."
Nm19.webp

22. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.
Nm20.webp
Nm21.webp

23. To correctly export your Physical map as a .dds file, make sure to select "BC1/DTX1" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".
Pm47.webp

Basecolor Map[edit | edit source]

1. Open your Basecolor Map in GIMP. Right-click on the layer and select "Add Alpha Channel". This will add an empty Alpha channel.
Bm49.webp Bm50.webp

2. Your file is now ready to export. Go to "File -> Export As..."
Nm19.webp

3. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.
Nm20.webp
Nm21.webp

4. To correctly export your Basecolor map as a .dds file, make sure to select "BC1/DTX1" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".
Bm51.webp

Mask Map[edit | edit source]

The channels that mask maps use in the game vary depending on what the mask is used for. This example is just for horn textures, so check the vanilla game textures first to find out what channels you need. In any case, mask maps do not need an Alpha channel, so all you have to do for them is export as a .dds file.
Either way, it doesn't hurt to check the Channels tab to make sure you've only got information in the channels that are supposed to have it, i.e. just the "green" channel for horn mask maps.
Msk53.webp

1. Your file is now ready to export. Go to "File -> Export As..."
Nm19.webp

2. Select a save location for your file, and name it to whatever you choose. Check the vanilla game textures to see what naming conventions are used for the files the textures are for. I personally also export a .png version to keep as a backup, but you will need a .dds file for the game. You can either rename your file with the .dds extension, or click "Select File Type (By Extension)" at the bottom to select the .dds file type. Once ready, just click "Export" to save your texture. A window will pop-up with export options. For .png, just leave everything at default.
Nm20.webp
Nm21.webp

3. To correctly export your Mask map as a .dds file, make sure to select "BC5/ATI2 (3Dc)" for Compression, and "Generate mipmaps" for Mipmaps. Set the Filter under Mipmap Options to "Kaiser".
Msk54.webp

Export Settings TL;DR[edit | edit source]

If you already know how to do all the channel editing and just need a quick reference on how these maps are set up and exported.

Normal Map Channels:

  • Red - Nothing
  • Green - Green
  • Blue - Blue
  • Alpha - Red

Physical Map Channels:

  • Red - Metalness
  • Green - Roughness
  • Blue - AO
  • Alpha - Nothing

Basecolor Map Channels:

  • Red - Red
  • Green - Green
  • Blue - Blue
  • Alpha - Nothing

Mask Map Channels:

  • Check vanilla textures for whatever you're masking. These usually don't need an Alpha channel.

DDS Export Settings:

  • Normal Map:
  • BC3 DTX5

  • Physical Map:
  • BC1 DTX1

  • Basecolor Map:
  • BC1 DTX1


  • Mask Map:
  • These again depend on the type of mask you're creating. I'll be collecting as much info for different mask maps here as I find.
  • BC5 Unsigned (Paint.NET) / BC5 ATI2 (GIMP) for Horn masks
  • BC7 RGBA 8bpp | Explicit alpha (Photoshop) / BC7 sRGB or BC7 Linear (Paint.NET) for Shared Scars MSK (thanks to aurebuen for the info)

Icon/Atlas Export Settings[edit | edit source]

If using Paint.net and your icon atlas ends up invisible in game when using DXT1/DXT5 try using the below:

  • First make sure your uuids are unique and are not clashing with another mod
  • if that doesn't work use this format

Atlas Paintnet Export Settings.webp