Source Filmmaker

Source Filmmaker

1,039 ratings
Changing Textures Using Material Overrides
A handy, step-by-step guide to using Material Overrides to replace a model's texture with another texture. Very useful for all sorts of clever SFMing tricks!
There are a lot of reasons why you'd want to change the texture on one specific instance of a model without changing it for all of the others. Maybe you want to use alpha layers to punch a hole in a zombie to expose it's gooey innards, Left 4 Dead style. Maybe you want to change the text on a billboard without changing it on other billboards. Maybe you want to give two Scouts different hair colours. Or maybe you want to go completely nuts with the Resizable Texture Panels and have access to more than 16 textures. Who am I to judge?

Whatever reason you wanted to do this, doing so before version 9.8.6 of SFM was a real pain - material overrides did not support changing texture paths, so either you'd have to temporarily replace one of the existing skins on the model, or you'd have to hex/recompile a duplicate with the skins you want. Both time-consuming and annoying!

As of 9.8.6, however, this issue has been fixed and you can now change texture paths more or less on a whim. Let's learn how to do it!
  • Source Filmmaker. Obviously.
  • A model you want to change the texture on.
  • A replacement texture... or a tool to whip up a replacement texture. I use Nemesis's VTF Plugin for Photoshop.

For the purposes of this tutorial, I've made a copy of one of the Soldier's textures (soldier_red.vtf), moved it somewhere memorable (where is unimportant, as long as you can remember the path!), renamed it and messed around with it a bit, removing the class decal and recolouring it to be yellow.

(I didn't do a very good JOB of the recolour, mind, but this is fine for demonstration purposes.)
Right! Let's get started. Create a new session, load a map, and create an animationset of the model you made a replacement texture for. Place it as you wish, then duplicate it.

We'll be completely ignoring one of these - he'll act as our "before" model. As for the other one, right click it in the Animation Set Editor and select "Add Override Materials".

Nothing will happen. Nothing visible, anyway - SFM just set up a few little things for us that allows us to change material settings for this animationset and this one alone - our "before" model will remain unaffected, and as soldierly as ever. Now, right click your animationset again and select Show In Element Viewer > Model.
Welcome to the Element Viewer, a place typically intended for experts only. Don't worry! Hold my hand and we'll get through this together.

Click the "+" next to "Materials" at the bottom of the list. A sub-list will open, giving a list of materials used by your model. Click the "+" next to the one you want to override (in this case, soldier_red). You'll see another sub-list, of some cloaking-related parameters. Feel free to ignore that.

Now, right click the material's name (not the mtlName parameter) and select Add Attribute > String.

You'll be asked for a name. Name it "$basetexture" and click OK.

You'll notice that our animationset's body has turned completely black. Don't panic! This is normal, and I guess kind of cool looking if you're, like, 13 years old.

Click in the blank space to the right of the word $basetexture, and enter in the path to your modified vtf file, with the file extension and the "materials" folder removed. So, for example, if your texture was in usermod/materials/replacements/soldier_yellow.vtf, you'd enter in "replacements/soldier_yellow".

And volia! If all has gone well, you should have a model bearing your modified texture, standing next to an unaltered model. If your model has a pink checkerboard instead of your custom texture, you messed up the file path. Check for typos!
So, using this tutorial, you overrode an animationset's $basetexture with one of your own. That's pretty cool, and your brain's probably already full of ideas on what you can do with this. But this isn't everything you can do with material overrides! Here are a few other things you can do, to poke you in advanced directions...

  • Not Just $basetexture: The 9.8.6 patch allows all texture paths to be overridden, not just $basetexture. $bumpmap, $detail and such are all fair game, allowing you to heavily alter a model's visual appearance and artstyle.
  • Not Just Strings, Either: You can also override other elements inside a material, with a little ingenuity - for example, adjusting a model's $phongexponent and $phongboost "int" variables to make it look wet and shiny, like they've just gotten out of water. Check the values in the original .vmt file using a text editor, and be sure to check the Valve Developer Wiki for deeper documentation of everything you could ever possibly want to know.
  • Alpha Layer Fun: As I alluded to in the introduction, you can use alpha layers in your $basetexture for all sorts of things. The official Valve TF2 zombie skins use this to "cut" holes in the player models for the "gory holes" model to sit comfortably in.
  • Have Fun!: Keep this in mind above all else. It's no use making a movie with 75 different, unique Pyros in every shot if you're bored out of your mind while making it. Make stuff in SFM to entertain yourself above all else - the YouTube hits, adoring fans and Saxxy trophies are just a pleasant bonus. :)

I hope you got something out of this tutorial and it helps you with your projects! If you did something cool with this little trick, or if you learn other clever tricks to pull with this stuff, post it in the comments!
< >
[Slasher] Jason Voorhees Sep 11 @ 10:54pm 
what software can i use to open the vtf inside of and edit the textures, im trying gimp, krita, paint, etc. but it all just says "error unkown file type" how do i get this working?
DANNY1 Sep 5 @ 10:17am 
DANNY1 Sep 5 @ 10:12am 
DANNY1 Sep 4 @ 8:03pm 
DANNY1 Sep 4 @ 7:57pm 
DANNY1 Sep 4 @ 7:55pm 
ORIGINAL TEXTURE:usermod\materials\models\roblox_avatars\danny1233654\Torso.vtf
Mr stranger Danger Aug 15 @ 12:29pm 
Figured this stuff out, danka.
Capitán Flint Jul 18 @ 9:23pm 
Burrito Boi what was the answer to the problem?
BurritoBoi Jul 18 @ 5:39pm 
Nevermind, ive figured it out!
BurritoBoi Jul 18 @ 5:37pm 
Im attempting to color a Pyro green using the Team Fortress 2 Classic YLW and GRN teams addon, but Pyro wont change from red no matter what I do. Ive made sure I followed each step, and made sure im entering the VTF file path correctly. Any help?