SamuZai
OwO_SFM
OwO_SFM

patreon


Tutorial: Using Substance Painter to edit SFM textures

As some of you may or may not know, I've started to release some more retextures over the last few months. 

These have all been produced using a program called Substance Painter. 

Substance Painter allows you to effectively create your textures by painting them onto the model itself. It's become standard practice within the games industry since it can create assets ready for modern engines with ease, but it's also pretty useful if you're like me and need to edit a pre-existing texture dramatically. Trying to do it in photoshop can be fine for simple edits until you need something to, say, wrap around an arm or thigh. If you don't have the UV net, that can take a lot of time to do. It also gets more awkward if we want to add more detail onto normal maps. Substance makes these two processes in particular much easier for myself.


In this tutorial, I'm going to cover preparing a model from source to substance, doing some very basic edits, and then getting it back into source. Very basic understanding of blender and override materials are required.


To begin, make sure you have: 

-A version of Blender installed with Blender Source Tools installed (The 2.8 series will be used in this tutorial.)

-VTFEdit 

-Crowbar 

-Substance Painter (duh)

It's worth noting that Substance Painter is owned by Adobe and as such is not free software. It can be bought on Steam for around $150, but you can also download a free trial or, if you're a student, get yourself 3-5 years of licenses for free. I will neither condone nor condemn other ways to get it. I'm using the 2019 edition so, some things might have slightly changed in the 2020 version.


My goal in this tutorial as to add some small details to Shantae, based on the augs/markings V has in Cyberpunk 2077. It's not a dramatic edit, but it will demonstrate the core functions of painter you'd need to make it happen. This is not a substance 101 and won't cover the more powerful features of the program, such as generators.

Open up crowbar and enter the decompile tab. Find a character you want to decompile. Make sure to output it into a work folder you can easily find, and click decompile.

Next, find your models textures and open them up in VTFEdit, then export them as a tga to where you decompiled. If you don't know where the materials are, just open up the zip that you originally downloaded the model from, figure out where the downloads materials folder leads to, and go from there. Make sure you do the same with their normal texture (if they have one).

 Since we're only targeting the face, we only need the face textures here. Obviously be sure to export more textures depending on what you need to work on, but DO NOT EXPORT OUT EYES. Eyes in the source engine are very weird in their implementation and do not look right in substance. 


Now open up blender, go to the import tab, and select Source Engine. I recommend that you open up the .qc file. This loads up every model, so it may take a minute to read everything.

With the model imported, you may see a bunch of tiny dots and bones in the model. Get rid of them.

You may need to do some cleanup after deleting them. I fixed Shantae's  foot and rotated her back to face the camera.


Now select everything and export. FBX is generally used for video games, but if something looks odd when you import it, .OBJ can be okay too.


Open up Substance and go to file > new. Create a NON-PBR project and import the model. PBR adds a lot of values that aren't needed in source if you're just editing the textures of a pre existing models.  Document resolution depends on how much fine detail you want in your project and can be adjusted in the TEXTURE SET SETTINGS tab. Be warned that this does increase filesize (I have substance saves up to 4gb big!) and, when exported, can eat up the 3.5gb of memory SFM can use before it crashes.

You're probably a bit intimidated by this UI. Don't worry, just scroll down the Texture Set List until you find the material that you want to work with. Source requires material names to match their texture names, so this should be easy. Hide the other materials with the eye icon too if need be. This can help with getting into places obscured by other models. Create a fill layer.

Take your .tga textures and drag them into the shelf. Set them to import as a texture in your project.

Drag the texture onto DIFFUSE and the normal into NORMAL.

And there we go! We now have the original textures ready for us to overlay onto.

Let's add another fill layer. When you do this, Shantae's face will become white again. That's because we don't have a mask to establish where this new layer can and can't appear. Click on the grey box under diffuse and give it a brown-ish color like the reference. Alternatively, click and hold on the eyedrop and select a color from any window you currently have on screen. 

Let us now begin to isolate where this layer will appear. Click on add mask > add black mask

The layer now has a black box next to itself in the layers tab. From here, you can draw wherever you like. As a protip, control + right click + mouse up/down affects the hardness of the brush. There is also mirroring and "lazy mouse" (mouse smoothing if you don't have a tablet) that you can play with here.

Holding Shift after clicking anywhere lets you stamp a line of your brush, shift and control let you snap it to 45 degree angles.

If your mask reaches somewhere you don't like, you can use the eraser. For some parts of the model though, polygon fill might be better. Polygon fill lets you choose between filling per triangle, per polygon (four sides), per object, or per UV. Choose the latter for cleanup and make sure the color is black (0) to remove from the mask. Make it white (1) to add.

Click back onto your layer and now drag Height to the left to "lower" the texture into the model. It's actually just trickery with normals!

 If you want to add some detailing, you can click the alphas tab and double click a shape you like to make that your bruch shape. Same goes for brushes. It's up to you from here on what you want to do in terms of refinement. I added some crappy buzzcut to her hair with the height going up. Don't make my mistake and forget to add V's eyeshadow.

If you're ready to go, click on file > export textures. Set the export to somewhere intelligent, the padding to dilation + background color, and the config to SpecGloss (non PBR). Deselect any material you didn't edit.


You should have something like this:

Import ONLY the diffuse and normal textures into VTFEdit and save them as .VTF's in the original materials folder (in this case, materials>models>rafaknight>shantae). Make sure to give them unique names that you can remember.


All that's left now is to preview them in Source! Use material overrides on shantae with the following string attributes:

$basetexture for the DIFFUSE

$bumpmap for the NORMAL

We've got a city to burn.

This only scratches the surface of what painter could do and I suggest you toy around with it if you're interested. 

If you've made it this far though, thank you for reading this!


More Creators