Advanced Model Hacking

Credits

Submitter
  • P6: Merchant
    Points: 231,225
  • E1: Helper
    EF: 17
  • C1: Member
  • A6: Elder
    Account Age: 6 years
modderfreak (Creator/Co-creator)
Studio
Avenger Corp.™
Key Authors
modderfreak

Rating

9.8/10
Based off 26 rating(s)

Additional Info

Genre
Modelling, Texturing
Difficulty Level
Intermediate

Stats

Post Count
113
ViewCount
26,412
Date Added
5 years ago
Date Modified
4 years ago

This tutorial will cover how to hack off parts of models through the .vmt trick which are in one texture map. This will allow you to edit models which are enforcing consistency, for example playermodels. With this method, transparency effects are also possible.

Required

Programs:

  • Photoshop or any other advanced picture editing software
  • WordPad, Notepad or any similar editor
Other:
  • A working, updated CSS installation
  • A model & skin you want to hack off parts
Optional:
  • Source-SDK with Half-Life Model Viewer
  • When using Photoshop, the .vtf plugin will come in very handy

Using the trick

Preparing

  • First of all, we need to open the skin we want to edit in our picture-editing software, I will use Photoshop CS3 and Valves default SAS skin for this tutorial.
  • If you have HLMV installed, start it and open the model whose skin you are editing - this will become very handy.

Editing

  • Decide which parts you want to hack off. At this point, it is very important to choose only model parts that have backfaces beneath them or your model will be verbatimly riddled.
  • Search matching parts of the model on the diffuse map. You can use HLMV to find the right places.
  • Now the important part starts: select the skin places with the line tool or any similar tool. Refer to screenshot #2.
  • Change to the alpha channel. In there, paint the whole selection black (the rest of the alpha chanell should be white). These parts of the skins will be invisible. Again, you can use HLMV to instantly check your selections - sometimes, you will have to expand your selection by about one pixel because you can still see parts of the hacked-off model part in HLMV. Refer to screenshot #3.
  • Note: you can also achieve transparency effects through filling the selection with a greytone instead of pure black. -The darker the grey, the less visible the model part will be.

Saving and .vmt code editing

  • Save your skin in a texture format that uses the alpha channel, for example DXT5 compression. Attention: if you save the skin in a texture format that has no alpha channel like DXT1, this will not work!
  • Open up the .vmt file of your skin with your text editor. In my case, the default .vmt of the SAS skin will look like this:
    "vertexlitgeneric" { "$baseTexture" "models\player\ctsas\ctsas" "$envmap" "envcubemap" "$bumpmap" "models/player/ctsas/ctsasnormal" "$normalmapalphaenvmapmask" 1 "$envmapcontrast" 0.3 "$envmapsaturation" 0.7 "$envmaptint" "[ 0.36 0.36 0.36 ]" }

    We will now add this line to it to activate the transparency effect:

    "$translucent" "1"
    If you don't want to make things transparent, but 100% invisible, you should add these commands to the .vmt to achieve a better outcome:
    "$alphatest" "1" "$translucent" "1"
    For all who don't know how to copy and paste, it should look like this:
    "vertexlitgeneric" { "$baseTexture" "models\player\ctsas\ctsas" "$alphatest" "1" "$translucent" "1" "$envmap" "envcubemap" "$bumpmap" "models/player/ctsas/ctsasnormal" "$normalmapalphaenvmapmask" 1 "$envmapcontrast" 0.3 "$envmapsaturation" 0.7 "$envmaptint" "[ 0.36 0.36 0.36 ]" }

You're done. If you followed every step correctly the parts you painted black in the alpha channel will be invisible and the greytones will be transparent ingame. Screenshot #3 is a compare screen of the SAS model so you can see what I hacked off.

  • You must be a member

Comments

    • P1: Beggar
      Points: 25
    • C1: Member
    • A3: Apprentice
      Account Age: 2 years

    I got an costum skin for hl2 with an scope on it, and it tried to make the scope invisible, and i did everything listed but now the weapon shows up as a shiny big red ERROR. Any help please?

    If something isn“t done by the
    • C1: Member
    • A4: Graduate
      Account Age: 3 years

    Really good tutorial. I'm making a No-stock ak47 as we speak ^^

    3p1c w1n ^^
    • P1: Beggar
      Points: 10
    • C1: Member
    • A4: Graduate
      Account Age: 3 years
    Posted by modderfreak
    Posted by serioushans On my gign skin it doesnt have a vmt file :|
    Every texture in the whole game has a .vmt file.

    ok i found it but what do you do with the alphachannel afterwards?

    banana phone!
    • P6: Merchant
      Points: 231,225
    • E1: Helper
      EF: 17
    • C1: Member
    • A6: Elder
      Account Age: 6 years
    Posted by serioushans On my gign skin it doesnt have a vmt file :|

    Every texture in the whole game has a .vmt file.

    Respect is everything.
    • P1: Beggar
      Points: 10
    • C1: Member
    • A4: Graduate
      Account Age: 3 years

    On my gign skin it doesnt have a vmt file :|

    banana phone!
    • P1: Beggar
      Points: 581
    • E1: Helper
      EF: 1
    • C1: Member
    • A4: Graduate
      Account Age: 3 years

    But how do i make the glass spec of my Urban CT invisible?? It doesn't work.

    Ready to strike
    • P1: Beggar
      Points: 738
    • C1: Member
    • A4: Graduate
      Account Age: 4 years

    Does this also work with any textures?

    What am i supposed to write he
    • P1: Beggar
      Points: 23
    • C1: Member
    • A5: Veteran
      Account Age: 4 years

    Thanx allot for tutorials like this Sir :D

    MW2 Sucks, get BC2!
    • P6: Merchant
      Points: 231,225
    • E1: Helper
      EF: 17
    • C1: Member
    • A6: Elder
      Account Age: 6 years
    Posted by LolzMan1325 How do you change to the alpha channel

    Have a look at the third screenshot, down at the right is a bar with the tabs "Layers", "Channels" and "Paths". Usually it'll be on "Layers", showing you your layer structure. Simply click on Channels to change to the channels tab.

    Respect is everything.
    • P2: Drudge
      Points: 2,348
    • C1: Member
    • A4: Graduate
      Account Age: 3 years

    How do you change to the alpha channel

    STOP ASKING ME ABOUT MY FUCKIN
  • You must be a member