Texture Editing - How to recolor models

edited April 2016 in Tutorials

Note: As of the Spring Cleaning Patch, this method seems to be no longer reliable for base items.

This simple tutorial shows the process of finding, decompiling and editing textures with the purpose of recoloring models:

img

Basically we are going to get the compiled texture, decompile it to be able to edit in in a graphic suite, then compile it back and place it on the same name and path of the original, effectively overriding the existing texture on the main game.

Step 0. Required software

Step 1. Get VTEX_C

First, identify the required vtex_c by going to the material you want to edit textures from.

img

Then search that file in GFScape and Extract it

img

Step 2. Generate TGA

Use VRF to get a picture out of the file you got from the vpk.

img

Right click -> Save

Step 3. Edit at will

Open the file in Photoshop/Gimp and edit it as you wish.

img

Save as TGA.

Step 4. Create VTEX_C

Use modkit to turn the TGA into a compiled texture

img

(In theory modkit can decompile too but its not as easy and fast process as VRF)

Step 5. Save on the same path name

Modkit will put your vtex_c in the game materials folder with the same name than its source.

Make sure the name and paths are the same as the asset you want to override. The changes should be visible in the asset browser on the vmat and vmdl

img


This same method can be applied to any texture and model in the game. Have fun!

For Masks recoloring, check here down this thread

The concept of Modding Community doesn't go well together with Competitive Business
My Project Page || My GitHub Profile ||

Comments

  • edited January 2016 Posts: 12

    If you are willing to use particles (if you aren't yet using particles for this), you can completely bypass overriding the default texture asset and instead create different textures (renamed, of course) which then can be used to override the model's texture in the render model particle in PET (there is an option to use an override material for the render model renderer).

  • Posts: 1,668

    @Toyoka not only that is harder but how would you handle recoloring different parts or different colors? In some of these recolors I didn't just place a green tint over the whole model, but selected particular areas and modified a particular channel levels. If I wanted to recolor something black and red it would be basically impossible with particles.

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Noya, won't this just edit it on our own client or am i misunderstanding?

    I think i am misunderstanding so could you please assist :p

  • Posts: 213

    This is aimed at custom games, so you distribute the new texture file with your game mode and everyone would have the texture override.

  • Posts: 1,668

    That's right. The same applies to particles and really everything, you distribute new files and the game prioritizes those over the base files.

    Some purple fiends

    img

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • edited April 2016 Posts: 1,668

    Expansion: Recoloring textures with Masks

    http://i.imgur.com/5Uihc3U.jpg

    Step 1. Get your texture

    For this, I extracted this tower_dragon_white_color_psd_65e497bc.vtex_c from the VPK, and used VRF to open it.

    If you want, edit it a bit using any software, so that the areas you want to recolor are a bit grayed out.

    http://i.imgur.com/8KEiPc9.png

    Save with _color.png extension (tga and psd are also valid)

    Step 2. Create a tint mask

    Select the areas you want to tint. Fill them with white color. Invert the selection and fill the rest with black. Save with _mask.png extension (tga and psd are also valid)

    http://i.imgur.com/I4GYAjC.png

    Step 3. Create the material

    Open the material editor, create a new file and save it on the same place than the original.

    Afterwards, add the _color file, select the Tint Mask checkbox and add the _mask file.

    http://i.imgur.com/9iMV8co.jpg


    And it's done! Now you can use different unit:SetRenderColor(r,g,b) and get great results like this:

    http://i.imgur.com/9s8Zpx3.jpg

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 115

    :goodjob: good shit

    sunshine, hurricane

    all the highs & lows

  • vVvvVv
    edited July 2016 Posts: 65

    models/heroes/beastmaster/beastmaster_bird.vmdl doesn't seem to have that vtex field. What to do in such case? Just want to recolor it to black.

  • Posts: 32

    There is bird_color.vmat Use GCFScape to extract .vtex_c file (bird_color_psd_...) then use D2ModKit to make .tga file. Recolor as you want and create new .vmat in the same path as dota source .vmat.

  • vVvvVv
    Posts: 65

    It creates 7 tga(s) do I have to recolor all?

  • Posts: 32

    Choose one of them. Depends only on quality you want.

  • Posts: 2

    Hey Noya, I used your guide to retexture a few models, everything was going great up until one of them stealthed. It seems the shader that allows texture tint masks doesn't support stealth, and vice-a-versa. Do you have any ideas for a work around?

  • Posts: 115

    Try using the hero shader

    sunshine, hurricane

    all the highs & lows

  • Posts: 2

    Yeah, that is what I switched it to in order to enable the stealth effect. It doesn't look like the hero shader supports texture tint masks though.

  • edited October 2016 Posts: 29

    What is the correct way to recolor a texture with masks when the model uses cosmetic items? I've followed the steps and ended up with a creature like this Recolored Sven . I have made a mask for the texture of his base bodel, but it looks like the mask was applied to everything.

    edit: It works perfectly with no wearables. Recolored Base Model Just wearables causing trouble.