Pick up the crowbar of research scientist Gordon Freeman, who finds himself on an alien-infested Earth being picked to the bone, its resources depleted, its populace dwindling. Freeman is thrust into the unenviable role of rescuing the world from the wrong he unleashed back at Black Mesa. And a lot of people, people he cares about, are counting on him.

Report article RSS Feed How to Create an Animated Texture

This tutorial will show you how to make your own animated textures for various source games.

Posted by griffjoshua on Oct 2nd, 2010
Intermediate Textures.

Creating an animated texture for games like Half-Life 2, Team Fortress 2 or any other source game isn't difficult at all. Just follow this tutorial, and you'll be able to make your own animated textures with ease.

The following programs I'll be using won't cost you anything. You can download them for free from these links below.

- GIF Splitter (Optional)
- VirtualDub (Optional
- Paint.NET (Optional)
- VTFEdit

Step 1 - Creating the images for your animation

You can either use GIF Splitter for short animations, or Virtual Dub for long animations. If you're using a video clip for your animation, save it as an "Image sequence" and make sure it plays at 30 FPS (Frames Per Second).

Here, I've picked a swirling animation, and now I'm going to split the animation and place a folder on my desktop with every picture that's been split.

Step 2 - Changing the image format

If you open up the folder, you'll see the images named "IMG00000", "IMG00001", etc. You'll need to edit these pictures using Paint.NET, Photoshop, GIMP or any other graphics editing program you prefer to use that supports the TGA format.

Not much editing is required, you only need to change the image format. If you want to resize the image, that's up to you.

Make sure you save the images in a TGA. format with these settings shown below.

Keep the images uncompressed with a 32-bit depth, otherwise it won't work.

Make sure you keep the image names in order, like this.

When you're done, open up VTFEdit and we'll start creating your new texture.

Step 3 - Loading your saved images into VTFEdit

Click on "File", "Import" and copy the images that you've made. To select more than one texture, just hold down "Ctrl".

When you've imported the images, this window will open:

Make sure that you apply these settings but, you can change the Width and Height depending on how big your animation is. When you're done, click "OK". "Advanced" and "Resources" arn't important.

You'll see your animation in the main window. If you click on "Play" your animation will be previewed, don't worry if it plays too fast, that's normal. It will preview every frame you've added.

Before saving your animated texture, make sure that "Auto Create VMT File" is enabled. To do this, just click on "Options" and enable it. We'll be adding some code to the VMT file to make the texture animate.

Now save your texture.

Step 4 - Coding and storing your texture

Here, I've saved my texture onto my desktop. You should have these 2 files.

Open the text file, remove all of the text and replace it with this code:

"LightMappedGeneric"
{
"$baseTexture" "animated/swirl"
"$surfaceprop" "Default"
"Proxies"
{
"AnimatedTexture"
{
"animatedTextureVar" "$basetexture"
"animatedTextureFrameNumVar" "$frame"
"animatedTextureFrameRate" "1"
}
}
}

I'll explain what some of this code does.

"$baseTexture" "animated/swirl"

This text tell Hammer where the image is. Make sure it's stored in a folder. Like this,

C:\Program Files\Steam\steamapps\username\half-life 2 episode two\ep2\materials\animated

"$surfaceprop" "Default"
Texture surface type. For example, you can change it to "Wood", "Metal", "Tile", etc.

"animatedTextureFrameRate" "1"
This is the textures frame rate, I'll be switching it to "30".

Save the text file and move it to what game you want to use it with. As shown above, I'll be using Half-Life 2: Episode 2.

Load up the Hammer Editor and you should find your texture under the folder you've saved it in. The texture won't animate in the editor, but it will in-game.

Let's see what it looks like in Half-Life 2: Episode 2.

Thanks for reading, and if you get stuck with anything, just let me know.

Post comment Comments
SteveZombie
SteveZombie Oct 3 2010, 6:01am says:

Should have replaced the wall texture with that swirl. Great tutorial though, really helped alot.

+4 votes     reply to comment
Maxen1416
Maxen1416 Oct 3 2010, 6:37am says:

finally a proper help!
thanks! :D

+4 votes     reply to comment
Death_Octimus
Death_Octimus Dec 2 2010, 12:49am says:

cheers bud saved me some time.

+3 votes     reply to comment
Zim4ikUKR
Zim4ikUKR Jan 30 2011, 4:32am says:

Yay, i know how to make a clouds =) xD

+3 votes     reply to comment
Akito8
Akito8 Jul 5 2011, 9:06pm says:

Thanks man! This helped soo much :D
Now I can plaster the walls of my map with nyancat ~~~

+3 votes     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Icon
Half-Life 2
Platforms
Windows, PS3, X360, XBOX
Developer & Publisher
Valve
Engine
Source
Contact
Send Message
Official Page
Half-life2.com
Release Date
Released Nov 15, 2004
Game Watch
Track this game
Tutorial
Browse
Tutorials
Report Abuse
Report article
Related Games
Half-Life 2
Half-Life 2 Single & Multiplayer First Person Shooter
Related Engines
Source
Source Commercial Released Oct 31, 2004
Related Groups
Valve
Valve Developer & Publisher