Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How to make a Glowing Texture for Hammer with gimp

A Tutorial for Half-Life 2

Members see zero ads. Membership is 100% free

A detailed guide to creating a glowing texture with gimp and vtfedit for all Half-Life 2 mods

If you're like me you prefer to use Gimp for photo editing / texture creation, but when it comes to making glowing textures to import into hammer you hit a wall. The process Ankh describes (link) simply doesn't translate into gimp. Being me, I decided to figure out how to do it and share the results in a tut. It's not nearly as scary as it looks btw, I just went out of my way to really explain things.
Part 1: Preparing the Image The first thing you need to do, obviously, is have an image/texture you want to glow in game.


Whether you hand-draw it or use Google to find something, for the purpose of this tutorial it doesn't matter as long as you can open it in gimp and have it all saved on one layer with a generic name (do not name it RGB, Red, Blue, Green, or Alpha,!)


Using the wand selection tool or whichever combination of selection tools is most convenient to your image, select the area you want to glow in game (Note that you can select the area you do not want to glow and then invert the selection by selecting 'invert' under the selection menu if that is more convenient). Use the 'add to selection' option to fine tune your selection; when you have a selection tool active there will be 4 small pink and white boxes next to the word 'mode' on the tools pallet: these control adding/subtracting from the current selection. Take your time with this step, the better job you do here the better it will look in-game.


Once everything selected how you want it to be, right-click on the layer in the layer pallet and select "Add Layer Mask" as shown above.

This will open a dialog box with a few potions, you want to tell gimp to initialize layer mask to 'selection' and the click add.


This will be the result. Gimp will add the 'mask' layer next to the layer the image is on, and in the editor it will only show the area that's not masked (ie, the area that will glow in-game). If the wrong area is shown, undo the mask creation and re-make it but this time check to 'invert mask' option in the dialog box.

Now we need to save the image out of gimp. First make sure the whole image is selected instead of just the masked section (ctrl > a), then go up to File and select Save As. The name doesn't matter much at this point since we will be renaming it in the next step. It is very important that you save the file as a TARGA by adding the .tga file extension after the name of your image (example.tga). Gimp will give you 3 popups when you save as a tga, on them you want to click Confirm, Export, and on the final one uncheck RLE Compression before clicking save. For now just save the image to your desktop / somewhere it's easy to find
Part 2: Importing to and Saving from VTFEdit Now that we have our fancy tga file all ready to go, install and launch VTFEdit and select File > Import. Browse to where you saved the tga file we just created and open it.


When an image is first opened in VTFEdit, this screen will get thrown at you. Advanced users may want to poke around, but for our purposes just click ok.


This is what you should see in VTFEdit afterwards. If you select View > Mask as shown you should only see the area of your texture that will glow. If your image is scrambled and black and white, you gave a layer a improper name back in part 1 (such as 'alpha', 'r', etc). If you can't get it to toggle, there is a problem with the mask we made in the tga.

Assuming everything looks good, we need to save the tga as a vtf so Hammer and the source engine recognize it. This is pretty straight forward, select File > Save and give it a name. This is where the name does matter, it should be something that tells you what it is (use a underscore to separate words, IE glowing_light)(the name you use will be searchable in hammer)(the correct file extension will automatically be added). Save the newly created file on the desktop / somewhere easy to find for the next step.

With the tga image saved out as a vtf texture, we now need to make a vmf file for it which tells Hammer where it is and what it does. I'll show you the easy way to do this, but be aware that you can manually do all of this too.

First, browse to the main folder for the game you want to use this texture in (for example, C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2). In this folder there will be a folder named with the initials of the game (tf, css, dod, etc); open that folder and create a new folder named 'materials' inside it, if there isn't already one. Open the materials folder and copy the vtf file we made into it. (note that you can create sub-folders in the materials folder, IE you can have a folder for glowing textures named 'glowing')(any folders in the materials folder will be searchable in hammer, IE searching for 'glowing' will display all the textures inside the glowing folder)(again, use underscores to separate words)


With the vtf file copied into the right folder open it in VTFEdit (should be able to just double-click it) and click on the Tools menu, and select Create VMF File. Again, there are a lot of options here for advanced users to play with, but for our purposes just click ok and save the file on your desktop / where it's easy to find. This vmf file will need to be copied into the same folder as the vtf file.


Once you have copied the vmf file into the same folder as the vtf file, open it in VTFEdit. You will see something like in the picture above, except I have added the line "$Selfillum" "1" at the bottom; this tells Hammer and the source engine that the texture has a imbedded mask and that it is supposed to glow. Make sure you add that to your vmf file.

Also note the location string; this tells hammer where the texture is. Because we did this the easy way VTFEdit has given it the proper address and shortened it already, but if we were manually doing things we would be editing this line too.

Once you've added the selfillum line and decided the location string looks right, save the vmf and your done!


This is what you should see in hammer when you locate your new texture (open the texture browser and type the texture's name or the folder's name). Note the little icons that are next to the preview, this tells us everything is correct. If your texture is full of purple and black squares, there is most likely an error in the vmf, make sure the vtf is where the vmf claims it is. Run a quick compile and enjoy!
Remeber, when using custom textures in source maps you need to pack them into the map.bsp for other people to see them! Pakrat is one of the most common programs to use for this. That's all there is to it, if you run into any problems please feel free to PM me for help.

Comments

Sign up to access this!
  • JorisCeoen avatar
    JorisCeoen username pic Joined 8y ago
    Unavailable
    30,851 points Ranked 154th
    29 medals 3 legendary 3 rare
    • 1st Place - Famous Landmarks Mapping Contest Medal icon
    • 1st Place - Marble Tracks Redux Contest Medal icon
    • Returned 5000 times Medal icon
    • Returned 1000 times Medal icon
    • 6 years a member Medal icon
    • Thanked 50 submitters Medal icon
    access_time 6y
    Wow this tutorial is amazing, very detailed and very clear! This made me realize that GIMP is not too far from Adobe at all, it's just very different in certain options but ultimatly it all comes down to the same thing :) Thanks!!!
    Level Design, Modeler, YouTube avatar
    Mantra
    Level Design, Modeler, YouTube
    URL to post:
  • Revers3 avatar
    Revers3 Joined 7y ago
    Offline
    1,884 points Ranked 20918th
    access_time 7y
    This tut is so long I can't remember it... Btw nice tut I like it very helpful
    No avatar
    Mantra
    No
    URL to post:
  • Coffee009 avatar
    Coffee009 Joined 9y ago
    Offline
    1,456 points Ranked 21944th
    8 medals 1 rare
    • 6 years a member Medal icon
    • Returned 100 times Medal icon
    • Reached 1,000 Points Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • 1 year a member Medal icon
    access_time 8y
    Very helpful!
    Coffee Addict avatar
    Mantra
    Coffee Addict
    URL to post:
  • K@rt avatar
    K@rt Joined 10y ago
    Offline
    11,727 points Ranked 485th
    16 medals 1 rare
    • 6 years a member Medal icon
    • Mapper of the Month, July 2012 Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    • Reached 7,500 Points Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    access_time 8y
    Very nice and detailed, so many people are vague about certain aspects of their tuts. Maybe I would have mentioned however that you can still "paint" directly on the layer mask in the same way you can paint to the alpha chanel in photoshop, using all the normal tools, fill, paint, smudge etc. In the layer dialog you just need to select either the mask or the layer to tell it which one you want to work on. And also maybe to explain that changing the transparency of the masked area effects how brighly the selfillum will glow. But other than that, very nice and consise!
    Messiah
    URL to post:

Embed

menu
Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Key Authors
Burnfingers
Everything

Submitter

Burnfingers avatar
Burnfingers username pic Joined 12y ago
Offline
131,256 points Ranked 20th
24 medals 1 legendary 3 rare
  • 10 years a member Medal icon
  • Reached 75,000 Points Medal icon
  • 6 years a member Medal icon
  • Submitted 20 Gamefiles Medal icon
  • Became a Studio Leader Medal icon
  • Reached 1,000 Points Medal icon
Burnfingers avatar
Burnfingers

Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Intermediate

Attributes

Genre
Texturing

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • favorite 3
  • remove_red_eye 14.6k
  • mode_comment 4
  • access_time 8y
  • access_time 5y

More from Submitter

menu

WiPs by Submitter

menu

More Mapping Tutorials