Steam Group Facebook Twitter Google+ Announcements
Texture Mods - Lesson 3.4b Opening and Saving Files for VTF Use in GIMP
Transcript

So, you are insistent on using GIMP for creating texture mods. Then welcome to lesson 3.4b Opening and Saving Files for VTF Use in GIMP presented by MLPTF2Mods.com. If you use Photoshop, you should be checking out lesson 3.4a which is specifically designed for Photoshop. This lesson will be less conventional than all the other lessons for as GIMP requires a different sort of explanation that doesn’t follow a strict linear progression of steps. Also take heed for this is not, I repeat, this is not a tutorial for how to use GIMP. With that said, let’s proceed.

In theory, the process should be as simple as opening the TARGA file from the last lesson in GIMP, modifying the texture’s design using the image editing tools, then exporting the file as a TARGA so it can be imported by VTFEdit. However, due to how GIMP handles things such as alpha channels, transparency, the way layers merge and interact, and the subtleties of the export function, it is not that straight forward. I am going to do my best to explain each part and what you need to look out for, starting with the alpha channel.

As explained in the previous lesson, the alpha channel is a hidden layer in the form of a grayscale image that carries information to be used by the texture’s related material file. You do not want to lose this layer of information. GIMP chooses to interpret alpha channels as transparency for an image. This will prevent you from immediately being able to edit the texture once opened in GIMP. I am going to start by showing you how to convert the alpha channel to a layer mask that can be disabled.

Open up the TARGA file from the last lesson in GIMP. Notice the image is currently transparent. Right click on the layer in the layers panel and select to add layer mask. In the dialog box, select to transfer the layer’s alpha channel and click add confirming your selection. The alpha layer has been converted to a layer mask. Now when you right click on the layer, select to disable the layer mask. The RGB layer will now be fully visible. We opted to temporarily disable the transparency since once we are finished editing the texture, we will need to re-enable the layer mask before exporting to retain the information that is stored in the texture’s alpha layer.

Right now, I am going to quickly modify the texture to resemble something vaguely Rarity related. It is going to look rather similar to Rarity’s Bodkin v1 on the site. But this quick modification is just to give us something to compare against the original once we get it in game. Once finished, I will use the opportunity to illustrate how GIMP handles merging layers.

As a precaution, I am going to take the opportunity to save it in GIMP’s format so I can come back to it at a later time or incase something happens while working on it.

Now that I’ve got a finished looking product, we can talk about layers. As mentioned, we need to re-enable the layer mask before exporting. When I do re-enable the mask, you can see the separate cutie mark layer remains above the mask and uneffected. This is not ideal for two reasons. To illustrate why, I will export the file to show you the consequences leaving it on its own layer.

Pardon the fact I am using Photoshop to easily preview these TARGA files. First thing you may notice about the exported file is that the texture lost some details in strange ways. Most visible losses are within handle wrapping. It just so happens that these detail losses coincide with the design of the alpha layer. At this time I am uncertain as to why. But as we will discover later, the issue can be remedied. Now if we go to look at the alpha channel, we can see the cutie mark has disrupted the grayscale image in an undesired way. We want to avoid that as well. Let’s see what can be done about it.

Your first instinct might be to merge the layers together. However, no matter which way you choose to merge the layers, you will lose the mask we must keep. There are different options available to address this problem. My personal suggestion is to cut the cutie mark from its layer, paste it onto the base layer, then anchor it in position from the floating selection. When we re-enable the layer mask, which you can notice is still in tact, it applies the mask over the cutie mark as it should. We export this as the finished product. Make sure it is saving in TGA format. I will maintain the name c_shogun_kunai but create a folder titled finished to keep it separate from the original.

This time, when previewing the TARGA file we just made, the texture isn’t missing any details. This was remedied by there being only one layer in the GIMP file we exported. If we look at the alpha layer, we see it has retained it’s original appearance. This file is ready to be converted back into a VTF using VTFEdit.

Before wrapping things up, I’d like to demonstrate what happens when we export a file with two layers; one of which hidden. As you see I have added a new blank layer and have hidden it causing no visual difference from the file we previously exported. When previewing it, the details are once again missing. What this means is that regardless of whether you hide extra layers or not, the texture will not export properly. You must only have one layer when exporting.

To reiterate what we have learned, you must retain the alpha layer, the layer mask must be enabled when exporting the texture, there must be only one layer when exporting the texture, the texture should be exported in TGA format, and merging the contents of layers without losing the layer mask is not straightforward. If you keep those things in mind when working with GIMP, you will find success.

That wraps up the general concepts of opening and saving files for VTF use in GIMP. By no means is it a simple task, but GIMP maintain a solid internal logic for how it handles processes. We are now ready to move on to the next lesson about importing and saving textures using VTFEdit.