Editing Modding:How To Find A Virtual Texture

From Baldur's Gate 3 Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 15: Line 15:


* First thing you need to find the item is its '''name''' - the exact item name it has. For example, 'The Deathstalker Mantle'. Put the '''name''' (or the NPC's name, to lead you to their CharacterVisuals entry) in the modder's multitool index search. This should lead you to its entry in the english.loca file, where you can find the '''handle.'''
* First thing you need to find the item is its '''name''' - the exact item name it has. For example, 'The Deathstalker Mantle'. Put the '''name''' (or the NPC's name, to lead you to their CharacterVisuals entry) in the modder's multitool index search. This should lead you to its entry in the english.loca file, where you can find the '''handle.'''
* Take the '''handle''' (a handle is h[string of numbers], similar to an UUID) and search that. For example, The Deathstalker Mantle's handle is ''hb7ee75e7g15f1g42a7gacf3gafe7628d8b10''. This should lead you to the ''RootTemplate'' of the item. (If it doesn't have an entry in the RootTemplate, it's in the ParentTemplate's file instead.)
* Take the '''handle''' (a handle is h[string of numbers], similar to an UUID) and search that. For example, The Deathstalker Mantle's handle is ''hb7ee75e7g15f1g42a7gacf3gafe7628d8b10''. This should lead you to the ''RootTemplate'' of the item. (If it doesnt have one in the RootTemplate, it's in the ParentTemplate's file instead)
* You can then find its mesh '''mapkey'''. Search that and you should find the meshes lsx entry, which will lead you to the mesh name. For example, The Deathstalker Mantle's mesh name is ''UNI_DarkUrge_Bhaal_Cloak''.  
* You can then find its mesh '''mapkey'''. Search that and you should find the meshes lsx entry, which will lead you to the mesh name. For example, The Deathstalker Mantle's mesh name is ''UNI_DarkUrge_Bhaal_Cloak''.  


Line 25: Line 25:
Some meshes also share textures with other versions of the mesh, so you may need to remove the ''_a'' or ''_broken'' (for example) appendage if you aren't getting any matches.
Some meshes also share textures with other versions of the mesh, so you may need to remove the ''_a'' or ''_broken'' (for example) appendage if you aren't getting any matches.


For example, we like ''''HUM_M_ARM_Bandit_C_Body'''<nowiki/>' so we search this in the multitool.
We like ''''HUM_M_ARM_Bandit_C_Body'''<nowiki/>' so we search this in the multitool.


It has an entry in '''<nowiki/>'Shared\Public\Shared\Content\Assets\Characters\Humans\[PAK]_Male_Armor\_merged.lsf''<nowiki/>' ''''' so we click ''convert & open'' for that.
It has an entry in '''Shared\Public\Shared\Content\Assets\Characters\Humans\[PAK]_Male_Armor\_merged.lsf''<nowiki/>' ''''' so we click ''convert & open'' for that.


We CTRL+F '''HUM_M_ARM_Bandit_C_Body''' and find a mesh entry for it.
We CTRL+F '''HUM_M_ARM_Bandit_C_Body''' and find a mesh entry for it.
Line 48: Line 48:


         <attribute id="LOD" type="uint8" value="0" />
         <attribute id="LOD" type="uint8" value="0" />
      '''<attribute id="MaterialID" type="FixedString" value="57a6fd6e-c00d-60eb-5e52-31560b95332b" />''' <!-- This is the material ID -->
      '''<attribute id="MaterialID" type="FixedString" value="57a6fd6e-c00d-60eb-5e52-31560b95332b" />'''
          <attribute id="ObjectID" type="FixedString" value="HUM_M_ARM_Bandit_C_Body.HUM_M_ARM_Bandit_C_Body_Mesh.0" />
          <attribute id="ObjectID" type="FixedString" value="HUM_M_ARM_Bandit_C_Body.HUM_M_ARM_Bandit_C_Body_Mesh.0" />
             </node>
             </node>


This material ID (57a6fd6e-c00d-60eb-5e52-31560b95332b) is what we need. We scroll back up to the very start of the '''_merged.lsf '''(materials are usually near the top) and CTRL+F for that.
This material ID is what we need. We scroll back up to the very start of the '''_merged.lsf '''(materials are usually near the top) and ctrl+f for that.


We find:
We find


                  <node id="Resource">
                  <node id="Resource">
Line 62: Line 62:
                   <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_A_Body" />
                   <attribute id="Name" type="LSString" value="HUM_M_ARM_Bandit_A_Body" />
                   [material continues, cut for length]
                   [material continues, cut for length]
We scroll down to the end of the material, past the vector parameters and we find the VirtualTextureParameters ID:
We scroll down to the end of the material, past the vector parameters and we find:


              <node id="VirtualTextureParameters">                     
              <node id="VirtualTextureParameters">                     
Line 72: Line 72:
             <attribute id="ParameterName" type="FixedString" value="virtualtexture" />
             <attribute id="ParameterName" type="FixedString" value="virtualtexture" />
                </node>
                </node>
So we search d53fa1a1-aa8e-2564-1077-42f6c36086c5. Luckily for us, it is in the same file. (If it isn't, you may need to search the multitool for it.)
So we search d53fa1a1-aa8e-2564-1077-42f6c36086c5. Luckily for us, it is in the same file. (If it isn't you may need to search the multitool with it.)


  <node id="Resource">
  <node id="Resource">
Line 88: Line 88:
                 </node>
                 </node>


The GTexFileName, b049a62336641c449903f6ec8b4dae67, is the correct string. Now you can extract it from the virtual textures.
b049a62336641c449903f6ec8b4dae67 is the correct string. Now you can extract it from the virtual textures.


And we do see that it shares a texture with the other bandit models- it is the part under the armour. We will need to go back and extract the armour and accessories separately by looking at the materials under the different mesh chunks listed in the mesh entry.
And we do see that it shares a texture with the other bandit models- it is the part under the armour. We will need to go back and extract the armour and accessories separately by looking at the materials under the different mesh chunks listed in the mesh entry.


=== Unpacking using Multitool ===
=== Unpacking using Multitool ===
Now that you have your GTexFileName, you can extract the textures from VT. Search your GTexFileName (in this case: b049a62336641c449903f6ec8b4dae67) in the multitool. Select the file that's inside VirtualTextures and click on the Extract file icon.
Search b049a62336641c449903f6ec8b4dae67 in the multitool. Select the file inside VirtualTextures and click on the Extract file icon.
[[File:SearchGTEXinmultitool.png|frameless|840x840px]]
[[File:SearchGTEXinmultitool.png|frameless|840x840px]]


Line 101: Line 101:
[[File:SearchGTEXinvirtualtex.png|frameless|840x840px]]
[[File:SearchGTEXinvirtualtex.png|frameless|840x840px]]


Here are the three texture files you will need, in .dds format. The red underlined one is the PM (Physical Map), the green underlined one is the NM (Normal Map), and the purple underlined one is the (BM) Base Map. The PM is usually brighter colors, the NM is usually almost all blue, and the BM is usually very light with a sort of beige tone. We recommend copying all of these to your project folder and renaming them with the mesh name + _BM, _NM, or _PM, so it's easier to keep track of them later.
Here are the three texture files you will need, in .dds format. The red underlined one is the PM (Physical Map), the green underlined one is the NM (Normal Map), and the purple underlined one is the (BM) Base Map. The PM is usually brighter colors, the NM is usually almost all blue, and the BM is usually very light with a sort of beige tone.
 
Congrats, you've successfully exported textures from VT and can now use them for your modding project!


===Lslib===
===Lslib===
Please note that all contributions to Baldur's Gate 3 Wiki are considered to be released under the CC BY-NC-SA license, except when noted otherwise (see BG3Wiki:Copyrights for details). If you do not want your writing to be edited and redistributed at will, do not submit it here. Per our Content Rules, you are promising that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)