From 45cd5d5d205d521c214129c94c61cb1002d5bd5f Mon Sep 17 00:00:00 2001 From: DarkShadow Date: Wed, 29 May 2024 23:37:31 +0300 Subject: [PATCH] Update wiki (WIP) --- wiki/home.md | 8 +-- wiki/tutorials/surfaces.md | 62 ++++++++++++++++ wiki/tutorials/tutorial_part_1.md | 2 +- wiki/tutorials/tutorial_part_2.md | 110 +++++++++++++++++++++++++++++ wiki/tutorials/tutorial_prelude.md | 45 ++++++------ 5 files changed, 198 insertions(+), 29 deletions(-) create mode 100644 wiki/tutorials/surfaces.md create mode 100644 wiki/tutorials/tutorial_part_2.md diff --git a/wiki/home.md b/wiki/home.md index 159dc7b..e2b88c5 100644 --- a/wiki/home.md +++ b/wiki/home.md @@ -1,10 +1,10 @@ -Welcome to the DDS-D3DTX-Converter wiki! +Welcome to the Telltale Texture Mod Tool wiki! -This is the home page containing all the pages and information about the Texture Mod Tool. If you have trouble understanding, please use an in-built Google Translate. +This is the home page containing all the pages and information about the Texture Mod Tool. If you have trouble understanding in English, please use an in-built Google Translate. ### Table of Contents -1. **[Application Guide](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BHelp%5D-Application-Guide)** -2. **[Reporting issues/bugs](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BHelp%5D---Reporting-an-Issue-or-Bug)** +1. **[Application Guide](/wiki/application_guide.md)** +2. **[Reporting issues/bugs](/wiki/issue.md)** ### Tutorials 1. **[How to make a Texture Mod (Prelude)](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BTutorial%5D--How-to-make-a-Texture-Mod-(Part-1))** diff --git a/wiki/tutorials/surfaces.md b/wiki/tutorials/surfaces.md new file mode 100644 index 0000000..400b9df --- /dev/null +++ b/wiki/tutorials/surfaces.md @@ -0,0 +1,62 @@ + +[Home](/wiki/home.md) + +Telltale surface formats have their equivalent DXGI format. If you are not sure in which format to save, this is a table containing useful information. + +| Telltale Surface Format | DXGI Format | Notes | +| ----------------------- | ----------- | ----------- | +| ARGB8 | B8R8G8A8_UNORM or B8R8G8A8_UNORM_SRGB[^1] | | +| ARGB16 | R16B16G16A16_UNORM | +| RGB565 | R5G6B5_UNORM | +| ARGB1555 | B5G5R5A1_UNORM | +| ARGB4 | B4G4R4A4_UNORM | +| ARGB2101010 | R10G10B10A2_UNORM | Requires swizzling the red and blue channels. +| R16 | R16_UNORM | +| RG16 | R16G16_UNORM | +| RGBA16 | R16G16B16A16_UNORM | +| RG8 | R8G8_UNORM | +| RGBA8 | R8G8B8A8_UNORM or R8G8B8A8_UNORM_SRGB[^1] | +| R32 | R32_FLOAT| +| RG32 | R32G32_FLOAT | +| RGBA32 | R32G32B32A32 | +| R8 | R8_UNORM |- Use R8 in Paint.Net or L8 in GIMP +| RGBA8S | R8G8B8A8_SNORM | +| A8 | A8_UNORM | Used in detail textures. +| L8 | R8_UNORM | +| AL8 | R8G8_UNORM | +| L16 | R16_UNORM | Use DirectX SDK (2010 version). +| RG16S | R16G16_SNORM | +| RGBA16S | R16G16B16A16_SNORM | +| R16UI | R16_UINT| +| RG16UI | R16G16 _UINT | +| R16F | R16_FLOAT | +| RG16F | R16G16_FLOAT | +| RGBA16F | R16G16B16A16_FLOAT | +| R32F | R32_FLOAT | +| RG32F | R32G32_FLOAT | | +| RGBA32F | R32G32B32A32_FLOAT | Used in light maps. +| BC1 | BC1_UNORM or BC1_UNORM_SRGB[^1] | +| BC2 | BC2_UNORM or BC2_UNORM_SRGB[^1] | +| BC3 | BC3_UNORM or BC3_UNORM_SRGB[^1] | +| BC4 | BC4_UNORM | +| BC5 | BC5_UNORM | +| BC6 | BC6H_UF16 | +| BC7 | BC7_UNORM or BC7_UNORM_SRGB[^1] | +| [Any Format]_UNORM | [Any Format]_UNORM | You will find these formats in legacy Telltale titles. + +> There are other existing Telltale formats, but they cannot be found on PC platforms. + +> DDS editors do not have all of the save options presented above. Use DirectX SDK or NVIDIA Texture Tool for conversion. + +| Telltale Surface Gamma | DXGI Format | +| --- | --- | +| Non-existent | Non-SRGB (Linear) | +| Unknown | Non-SRGB (Linear) | +| Linear | Non-SRGB (Linear)| +| sRGB | SRGB | +> Non-existent means that there is no such field in the relative D3DTX version. + +[^1]: The output depends on the D3DTX's surface gamma value. + + + diff --git a/wiki/tutorials/tutorial_part_1.md b/wiki/tutorials/tutorial_part_1.md index 1be6dba..44d0ee9 100644 --- a/wiki/tutorials/tutorial_part_1.md +++ b/wiki/tutorials/tutorial_part_1.md @@ -2,7 +2,7 @@ **Welcome to the first part of the tutorial on how to make a texture mod for Telltale's games. In this section we focus on how to find and extract the textures needed for your mods!** -## [Make sure you read the prelude before beginning. It contains important information.](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BTutorial%5D-How-to-make-a-Texture-Mod-(Prelude)) +## [Make sure you read the prelude before beginning. It contains important information.](/wiki/tutorials/tutorial_prelude.md) **Now with that out of the way let's begin.** We use Telltale Explorer for this part of the tutorial. Make sure to download it. diff --git a/wiki/tutorials/tutorial_part_2.md b/wiki/tutorials/tutorial_part_2.md new file mode 100644 index 0000000..339775f --- /dev/null +++ b/wiki/tutorials/tutorial_part_2.md @@ -0,0 +1,110 @@ +## Step 1/9 - Selecting your Texture Folder + +Open the application, simple and straightforward. + +![tut1](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut1.png) + +Go to the folder icon and click it to browse for your folder containing your **.d3dtx** textures. + +![tut2](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut2.png) + +It will open a folder browser, in here navigate and find the folder that contains your **.d3dtx** textures. Worth mentioning you can just have a single **.d3dtx** file in there or multiple. Once your folder is selected in the browser, just click **Select Folder**. + +![tut3](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut3.png) + +## Step 2/9 - Converting textures to .dds + +Once you select your folder, the **Textures Directory section** will be populated with your **.d3dtx** files. The next thing to do here is to now convert these **.d3dtx** files into a **.dds** by clicking **Convert To DDS**. + +It's worth mentioning that as of v1.0.0 the application will freeze for a few moments, but it will not crash. Just let it run and the conversion will be complete. + +![tut4](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut4.png) + +## Step 3/9 - Browsing through the .dds textures + +Once the application finishes converting the **.d3dtx** textures, it will remove the original **.d3dtx** textures from the directory and replace them with the extracted **.dds** texture file along with a **.header** file that contains the original d3dtx header **(DO NOT REMOVE THIS FILE)**. + +**With this process complete you can now browse through the textures and find which one you want to modify.** + +![tut5](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut5.png) + +**Once you have picked your .dds file to edit**, be sure to select it in the application like so, and before we move forward the next step is to look in the **Image Properties** section to know what to keep in mind when saving the texture after modification. + +![tut6](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut6.png) + +## Step 4/9 - Noting the Image Properties (IMPORTANT) + +Look under the **Image Properties** section of the selected image you want to modify and note the information displayed. The **image resolution** needs to remain the same *(this will change in a later update)*. Not only that you need to pay attention most importantly to the **DDS Format**, and **Mip Map** info. + +If the texture has mipmap information. **Has Mip Maps** will be displaying True along with **Mip Map Count** which will display the number of mipmaps. Occasionally when saving a dds texture the mipmap count will change, **this is fine** and won't ruin the texture. We just want to make sure that when we modify and save the image, that our image editing software generates mipmaps and is also saving in the same compression type as the original. + +![tut7](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut7.png) + +## Step 5/9 - Opening the Image in your editing software + +Once we have the information noted. To get the texture you can **right-click** on the File Browser in the **Textures Directory** section and click **Open Folder** to open the folder in File Explorer. + +![tut8](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut8.png) + +Once you have it open in file explorer you can right click and edit this image in the following programs. + +### **[Photoshop](https://www.adobe.com/products/photoshop.html)** with **[this DDS plugin](https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html)** or **[Paint.NET](https://www.getpaint.net/)**. + +In the case of this tutorial we are using **[Photoshop](https://www.adobe.com/products/photoshop.html)** with **[this DDS plugin](https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html)** but the same steps will apply to **[Paint.NET](https://www.getpaint.net/)**. **[Photoshop](https://www.adobe.com/products/photoshop.html)** will ask for a prompt like this. It's self-explanatory but I'll describe it in a little more detail. + +![tut9](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut9.png) + +Checking the field here will load the different mipmap levels into **separate layers** in the image editor. You can do this however you need to keep in mind that when you are making changes to one layer you will need to do the same to each different mipmap layer which can get tedious. **For convenience and ease, I recommend leaving this off as we can generate mipmaps from the single texture later when saving, which is the next step.** + +**Note:** if you are editing an alpha texture it will ask if you want to load it in the alpha channel. **Leave this off** as the alpha channel will just be read as transparency by default in **[Photoshop](https://www.adobe.com/products/photoshop.html)**. + +## Step 6/9 - Saving the modified Image in your editing software (IMPORTANT) + +**In this case, we are still using [Photoshop](https://www.adobe.com/products/photoshop.html) with [this DDS plugin](https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html) but the information I will describe here can be applied to a different image editing software with DDS support.** + +Worth noting here that the modified image here is the same resolution as the original. + +@@ -94,40 +84,43 @@ Minor note: If your application is giving an error indicating that it can't save + +![tut10](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut10.png) + +## Step 7/9 - Opening the Texture Mod Tool application and viewing/verifying the texture + +Once we have our final modified texture, we will return to the application to view and verify the texture. We can see that the image dimensions are the same, the format is also the same and along with that the texture has mipmaps as well. The mipmap count did grow compared to the original however this is okay, the important thing here is that the image has mipmaps. + +![tut11](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut11.png) + +## Step 8/9 - Converting the textures back into a D3DTX format + +After we finished verifying our texture data and information we can now start the conversion process of putting these back into their native **.d3dtx** format. Simply click the **Convert To D3DTX** button in the **Textures Directory** section. + +![tut12](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut12.png) + + **Once we click the Convert To D3DTX button in the Textures Directory section it will ask you what folder to save the modified textures into.** Simply select an empty folder and click **Select Folder**. Once again as of v1.0.0 the application will freeze for a moment as it begins to convert the textures into a **.d3dtx** format. + +![tut13](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut13.png) + +## Step 9/9 - Conversion Complete + +Once the conversion is complete, the application will automatically open file explorer to the folder in which your modified textures were saved to. In this case, we can see all of our converted textures and I have selected the main texture that I modified. + +![tut14](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/tut14.png) + +# [Part 2](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BTutorial%5D--How-to-make-a-Texture-Mod-(Part-2)) + +**This next section is where we will sort of split off because how one would go about this can vary. You can still follow along just by clicking **[Part 2](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BTutorial%5D--How-to-make-a-Texture-Mod-(Part-2))**, but there are two ways we can now integrate this modified texture back into the game.** + +Main Route 1 +- **[Part 2](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BTutorial%5D--How-to-make-a-Texture-Mod-(Part-2))** describes how to do it where we use **[Telltale Script Editor](https://github.com/Telltale-Modding-Group/Telltale-Script-Editor)** to build the textures into a custom .ttarch2 archive, and this can either added in manually or can be added in using the **[Telltale Mod Launcher](https://github.com/Telltale-Modding-Group/TelltaleModLauncher)**. **We recommend it this way** as it's non-destructive to the game files, and distribution of this mod is made much easier as the **[Telltale Script Editor](https://github.com/Telltale-Modding-Group/Telltale-Script-Editor)** builds the final mod into a .zip file that is compatible with the **[Telltale Mod Launcher](https://github.com/Telltale-Modding-Group/TelltaleModLauncher)**. + +Alternative Route 1 +- With the D3DTX files you can actually drop them in the Game Directory Archives/Packs folder that contain the .ttarch2 archives and the game will actually see it and load it up. + +Alternative Route 2 +- This is the old way of doing it, it's more complicated and destructive but it's another way of doing it, it involves using **[ttarchext](http://aluigi.altervista.org/papers.htm#ttarchext)** which is a console application and will require you to manually extract the archive, replace the texture file, repack the archive, and replace the original archive with the modified one. This is an acceptable option, However, as stated, it is destructive to the game files and distribution would require you to send the whole archive which can get difficult fast as txmesh archives happen to be the biggest ones in size in the game files. + +**So on to **[Part 2](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BTutorial%5D--How-to-make-a-Texture-Mod-(Part-2))** where we build this texture into a mod ready file!** + +For the record, the final result after integrating it into The Walking Dead Definitive Edition (and **[Part 2](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/wiki/%5BTutorial%5D--How-to-make-a-Texture-Mod-(Part-2))** will describe how to get the mod built/tested/ready). + +![result](https://github.com/Telltale-Modding-Group/DDS-D3DTX-Converter/blob/main/tutorial-screenshots/result.png) \ No newline at end of file diff --git a/wiki/tutorials/tutorial_prelude.md b/wiki/tutorials/tutorial_prelude.md index cf6a007..40cbcf7 100644 --- a/wiki/tutorials/tutorial_prelude.md +++ b/wiki/tutorials/tutorial_prelude.md @@ -26,44 +26,41 @@ The main steps are: #### What are textures? Textures are images which are applied to models. These models include, but are not limited to characters, objects, maps, items, menus, etc. -#### What are .d3dtx files? -These are file formats in which Telltale store their textures in. It's properitery, meaning it cannot be opened using any other software other than Telltale-related ones like Telltale Explorer or Telltale Texture Mod Tool. They are very customized and differ from game to game. More information can be found here. +#### What are D3DTX files? +These are file formats in which Telltale store their textures in. It's propriety, meaning it cannot be opened using any other software other than Telltale-related ones like Telltale Explorer or Telltale Texture Mod Tool. They are very customized and differ from game to game. More information can be found here. I will often use "Telltale textures" as a synonym. -#### Where are the Telltale textures files? I only find .ttarch files. -They are located in the respectable game's directory in those .ttarch archives. However, those archives cannot be opened with normal archive software like 7zip or WinRAR. For that case we use Telltale Explorer. +#### Where are the Telltale textures files? I only find TTARCH files or LENC files in the game's directory. +They are located inside those TTARCH archives. However, they cannot be opened with normal archive software like 7zip or WinRAR. For that case we use Telltale Explorer. -#### What are .dds (Direct Draw Surface) files? -Direct Draw Surface is a Microsoft file format like .png or .jpg. However, unlike them, this format supports multiple texture layouts, surface formats and mipmaps. - -#### What is the difference between .d3dtx and .dds? -Telltale's texture files can be only read by their engine, while .dds is a more common format among games. .d3dtx store a lot more information than a standard .dds file. +#### What are DDS (Direct Draw Surface) files? +Direct Draw Surface is a Microsoft file format like PNG or JPEG. However, unlike them, this format supports multiple texture layouts, surface formats and mipmaps (or mips). +#### What is the difference between D3DTX and DDS? +Telltale's texture files can only be read by their engine, while DDS is a more common format among games. D3DTX stores a lot more information than a DDS file. #### How does this converter work? -When we convert the .d3dtx files, we generate their .dds analogues, which can be opened in image editing software. -Since .d3dtx files store additional information that other files can't store including .dds, we need to find a way to preserve that data. For that case we generate a **.json** file. It's **very** important. This file is used in the conversion process from .dds to .d3dtx or other image formats to .dds. +When we convert the **extracted D3DTX** files, we generate their DDS analogues, which can be opened in image editing software. +Since D3DTX files store additional information that other files can't store including DDS, we need to find a way to preserve that data. For that case we automatically generate a **JSON** file. It's **very** important, because it's used in all conversion processes. Without it, the textures won't be converted back. -#### What software do I need to edit .d3dtx? +#### What software do I need to edit D3DTX? - For extracting use **[Telltale Explorer](https://quickandeasysoftware.net/software/telltale-explorer)**. It has a GUI with an in-built image viewer and filtering options. There's also **[ttarchext](http://aluigi.altervista.org/papers.htm#ttarchext)**, but it's outdated. - For converting use the Telltale Texture Mod Tool. -- For editing (.dds) use **[Paint.NET](https://www.getpaint.net/)**, **GIMP** or **Photoshop**. -- For advanced editing (super rare cases) use the **NVIDIA Texture Tools Exporter** or the legacy **DirectX Texture Tool** depending on the game. -- For debugging purposes use Lucas's **Telltale Inspector**. -TL:DR There are lot of tools, but the most important ones are Telltale Explorer, an image editing software which supports .dds and Telltale Texture Mod Tool. +- For editing (DDS) use **[Paint.NET](https://www.getpaint.net/)**, **[GIMP](https://www.gimp.org/downloads/)** or **Photoshop** with **[NVIDIA's Texture Tools Exporter](https://developer.nvidia.com/texture-tools-exporter)**. +- For advanced editing (super rare cases) use the **[NVIDIA Texture Tools Exporter](https://developer.nvidia.com/texture-tools-exporter)** or the legacy **[DirectX Texture Tool](https://www.microsoft.com/en-us/download/details.aspx?id=8109)**. +- For debugging purposes use Lucas's **[Telltale Inspector](https://github.com/LucasSaragosa/TelltaleInspector)**. +***TL:DR*** There are lot of tools, but the most important ones are Telltale Explorer, an image editing software which supports DDS and Telltale Texture Mod Tool. -##### I have heard about Telltale Explorer can export the texture files as .dds. What's wrong and why can't I use it? +#### I have heard that Telltale Explorer can export the texture files as DDS. What's wrong with it and why can't I use it? Importing the edited textures would be impossible. Furthermore, some surface formats are exported incorrectly. #### Which image editor should I choose? -Usually the answer to that one is the one you are most comfortable with. If you don't have experience with any of them, I recommend Paint.NET on Windows or GIMP on Linux. Both will cover 99.9% of the cases. Paint.NET is the simplest one to use and we will work with it for this tutorial. -Photoshop is paid, but it has access to the NVIDIA texture tool. +- Usually the answer to that question is - the one you are most comfortable with. If you don't have experience with any of them, I recommend Paint.NET on Windows or GIMP on Linux. Both will cover 99.9% of the cases. For this tutorial we will use Paint.NET as it's very simple to use. +- Photoshop is paid, but it has access to the NVIDIA texture tool. ##### For advanced users: -Paint.NET has a lot of surface formats support, but it lacks in other areas. GIMP has custom mipmaps options (you can edit the amount of mipmaps you need), has support for some uncommon file formats which cannot be found in Paint.NET and it's a lot more powerful. - -#### I get an error: "Error during previewing image. Check if the image is valid. Error message:Unimplemented format: [Format]". -This is a common error you will get when previewing textures with surface formats like A8 or RGBA16. This error **ONLY** occurs when **previewing** the image. Converting it works fine and at the moment I can't do anything about it. The library I am using does support them. +- Paint.NET has a lot of surface formats support, but it lacks some editing tools and some legacy surface formats. +- GIMP has custom mipmaps options (you can edit the amount of mipmaps you need), support for some uncommon surface formats which cannot be found in Paint.NET and it's a lot more powerful. **It's also worth mentioning that you need to be mindful of the textures you select.** Typically *(unless you are an experienced texture artist)* you would only really need to be modifying the **[diffuse textures](https://www.reallusion.com/iclone/help/iclone3/15_multiple_channel_texture_mapping/types_of_maps.htm)**. @@ -81,7 +78,7 @@ I don't recommend GIMP as the built-in DDS plugin doesn't support the newer DDS ### Critical Note -Once again it's very important to mention that a lot of **.d3dtx** textures have **[Mip Maps](http://archive.gamedev.net/archive/reference/programming/features/dxmipmap/mipmaps.gif)**, mipmaps are basically lower resolution textures that are embedded in the file and are used at a distance in the game engine to prevent **[aliasing and artifacts](https://gdbooks.gitbooks.io/legacyopengl/content/Chapter7/mip1.png)**. +Once again it's very important to mention that a lot of **D3DTX** textures have **[Mip Maps](http://archive.gamedev.net/archive/reference/programming/features/dxmipmap/mipmaps.gif)**, mipmaps are basically lower resolution textures that are embedded in the file and are used at a distance in the game engine to prevent **[aliasing and artifacts](https://gdbooks.gitbooks.io/legacyopengl/content/Chapter7/mip1.png)**. The **Compression Type** format is also something that you have to keep in mind when modifying/saving these textures.