Difference between revisions of "Template:Painted variants/Tutorial"

From Team Fortress Wiki
Jump to: navigation, search
m (link)
(Modify VMT Files: Rotations in a bit more detail.)
Line 36: Line 36:
 
# When generating hat images, you should use the red team texture and angle the hat slightly forward and facing left or right (get as much of the hat in view as possible).  For example: [[:File:Painted_Tough_Guy's_Toque_7D4071.png]]. All the painted images of a certain hat should be in the same position.
 
# When generating hat images, you should use the red team texture and angle the hat slightly forward and facing left or right (get as much of the hat in view as possible).  For example: [[:File:Painted_Tough_Guy's_Toque_7D4071.png]]. All the painted images of a certain hat should be in the same position.
  
== Modify VMT Files ==
+
== Taking the images ==
{| class="wikitable grid" style="float: right;"
+
=== Rotations ===
! class="header" | Name
+
Before you start taking images, check [[/Tutorial/Rotations]] and see if the item you're painting is noted on there. If it is, follow the "Setting rotations" section, otherwise when you've finished, follow the "Saving rotations" section.
! class="header" | Color
+
==== Setting rotations ====
! class=header | {R G B}
+
# Open regedit.exe (Start - Run)
|-
+
# Navigate to: <code>HKEY_CURRENT_USER\Software\Valve\hlmv</code>
| A Deep Commitment to Purple
+
# For your item, pick the associated directory - these will be listed on the rotations page.
| style="background:#7D4071" | <font color="white">#7D4071</font>
+
# In the right-panel, double click "Rot" and copy-paste the value in the Rotations page for your item.
| {125 64 113}
+
# Close regedit, and re-open your item in HLMV.
|-
+
# If there is a "FOV" value on the Rotations page for your item, you can enter this into HLMV - at the bottom left of the "Render" tab.
| Aged Moustache Grey
+
 
| style="background:#7E7E7E" | #7E7E7E
+
==== Saving rotations ====
| {126 126 126}
+
If your item does not have an entry on the Rotations page...
|-
+
# Open the item in HLMV
| [[Australium]] Gold
+
# Play around with the positioning - positioning it slightly forward, and then left or right - until you get a good view of the hat.  The positioning should show as much of the item as possible.
| style="background:#E7B53B" | #E7B53B
+
# Follow the "Setting rotations" section, however instead of replacing the "Rot" value - copy it.
| {231 181 59}
+
# Make an entry in the Rotations page, in the relevant position, documenting your item.  Note the name of the item, it's registry-folder name and the rotation used.
|-
+
# Commence generating the images, sticking to this rotation.
| Color No. 216-190-216
 
| style="background:#D8BED8" | #D8BED8
 
| {216 190 216}
 
|-
 
| Indubitably Green
 
| style="background:#729E42" | #729E42
 
| {114 158 66}
 
|-
 
| [[Mann Co.]] Orange
 
| style="background:#CF7336" | #CF7336
 
| {207 115 54}
 
|-
 
| Muskelmannbraun
 
| style="background:#A57545" | #A57545
 
| {165 117 69}
 
|-
 
| Noble Hatter's Violet
 
| style="background:#51384A" | <font color="white">#51384A</font>
 
| {81 56 74}
 
|-
 
| Peculiarly Drab Tincture
 
| style="background:#C5AF91" | #C5AF91
 
| {197 175 145}
 
|-
 
| [[Radigan Conagher]] Brown
 
| style="background:#694D3A" | #694D3A
 
| {105 77 58}
 
|-
 
| Ye Olde Rustic Color
 
| style="background:#7C6C57" | #7C6C57
 
| {124 108 87}
 
|-
 
| [[Non-player characters#Zepheniah Mann and Company|Zephaniah]]'s Greed
 
| style="background:#424F3B" | #424F3B
 
| {66 79 59}
 
|-
 
| An Extraordinary Abundance of Tinge
 
| style="background:#E6E6E6" | #E6E6E6
 
| {230 230 230}
 
|-
 
| A Distinctive Lack of Hue
 
| style="background:#141414" | <font color="white">#141414</font>
 
| {20 20 20}
 
|-
 
| Pink as Hell
 
| style="background:#FF69B4" | #FF69B4
 
| {255 105 180}
 
|-
 
| A Color Similar to Slate
 
| style="background:#2F4F4F" | #2F4F4F
 
| {47 79 79}
 
|-
 
| Drably Olive
 
| style="background:#808000" | #808000
 
| {128 128 0}
 
|-
 
| The Bitter Taste of Defeat and Lime
 
| style="background:#32CD32" | #32CD32
 
| {50 205 50}
 
|-
 
| The Color of a Gentlemann's Business Pants
 
| style="background:#F0E68C" | #F0E68C
 
| {240 230 140}
 
|-
 
| Dark Salmon Injustice
 
| style="background:#E9967A" | #E9967A
 
| {233 150 122}
 
|-
 
| An Air of Debonair (RED)
 
| style="background:#654740" | <font color="white">#654740</font>
 
| {101 71 64}
 
|-
 
| An Air of Debonair (BLU)
 
| style="background:#28394D" | <font color="white">#28394D</font>
 
| {40 57 77}
 
|-
 
| Balaclavas are Forever (RED)
 
| style="background:#3B1F23" | <font color="white">#3B1F23</font>
 
| {59 31 35}
 
|-
 
| Balaclavas are Forever (BLU)
 
| style="background:#18233D" | <font color="white">#18233D</font>
 
| {24 35 61}
 
|-
 
| Cream Spirit (RED)
 
| style="background:#C36C2D" | #C36C2D
 
| {195 108 45}
 
|-
 
| Cream Spirit (BLU)
 
| style="background:#B88035" | #B88035
 
| {184 128 53}
 
|-
 
| Operator's Overalls (RED)
 
| style="background:#483838" | <font color="white">#483838</font>
 
| {72 56 56}
 
|-
 
| Operator's Overalls (BLU)
 
| style="background:#384248" | <font color="white">#384248</font>
 
| {56 66 72}
 
|-
 
| Team Spirit (RED)
 
| style="background:#B8383B" | #B8383B
 
| {184 56 59}
 
|-
 
| Team Spirit (BLU)
 
| style="background:#5885A2" | #5885A2
 
| {88 133 162}
 
|-
 
| The Value of Teamwork (RED)
 
| style="background:#803020" | <font color="white">#803020</font>
 
| {128 48 32}
 
|-
 
| The Value of Teamwork (BLU)
 
| style="background:#256D8D" | #256D8D
 
| {37 109 141}
 
|-
 
| Waterlogged Lab Coat (RED)
 
| style="background:#A89A8C" | #A89A8C
 
| {168 154 140}
 
|-
 
| Waterlogged Lab Coat (BLU)
 
| style="background:#839FA3" | #839FA3
 
| {131 159 163}
 
|}
 
  
 
=== VMT Editing ===
 
=== VMT Editing ===

Revision as of 06:04, 1 August 2011

This tutorial will document the current method of painting hats using HLMV.

Setting up HLMV

We want the images to be the best quality possible, so you need to set up Half Life Model Viewer so that it generates high quality images. You can force high quality settings in your graphics cards control panel, but this does not work for some people - so I will document the alternate method.

DLL Support

Instead of modifying VTF files, we can set up HLMV to correctly interpret newer VMT files and modify them directly, allowing us to have fully accurate representation of colors. To support this in-model viewer representation of paint, some SDK DLLs need updating:

  1. Run TF2 to ensure the correct binaries are updated prior to copying.
  2. Each time you run the SDK, but before you open the Model Viewer, we'll need to copy the dlls from TF2 into the SDK. A script has been created for your convenience.
  3. Simply copy the script below into a conventional text editor and save it as a .bat file. Now each time you open the SDK, simply run the saved .bat
@echo off
for /F "tokens=2* delims=	 " %%A in ('REG QUERY "HKCU\Software\Valve\Steam" /v SteamPath 2^>nul') do set _steamdir=%%B
set _steamdir=%_steamdir:/=\%
for /f "tokens=2,3 delims=	 " %%a in ('findstr /C:AutoLoginUser "%_steamdir%\config\SteamAppData.vdf"') do set _steamuser=%%~a
copy "%_steamdir%\steamapps\%_steamuser%\team fortress 2\bin\stdshader_dx9.dll" "%_steamdir%\steamapps\%_steamuser%\sourcesdk\bin\orangebox\bin\stdshader_dx9.dll" >nul
echo Done.
exit /b 0

Dxsupport.cfg

  1. Navigate to this directory T:\Steam\steamapps\username\sourcesdk\bin\orangebox\bin (where T:\ the folder your Steam folder resides in).
  2. Open up Dxsupport.cfg in a text editor of your choice. If you do not have this file, create it with this content.
  3. Find your graphics card within that file, if it is not listed go to the bottom and use ATI Unknown or NVidia Unknown depending on your graphics card manufacturer.
  4. Add or modify the following lines in Dxsupport.cfg - within the section for your graphics card, and save it.
"DxLevel"	"99"
"ConVar.mat_antialias"	"8"
"ConVar.mat_forceaniso"	"8"
"ConVar.mat_picmip"	"-10"
5. Open up a model and ensure there is no anti-aliasing or other quality defects. If there is it's likely your graphics card is not able to render images of high enough quality.

HLMV Options

  1. Open up Model Viewer via the Source SDK.
  2. Check (if it's not already checked) the Normal Mapping checkbox.
  3. Set the background colour to white for each item: Options... > Background Color...
  4. Full-screen HLMV (so you get a nice big image).
  5. When generating hat images, you should use the red team texture and angle the hat slightly forward and facing left or right (get as much of the hat in view as possible). For example: File:Painted_Tough_Guy's_Toque_7D4071.png. All the painted images of a certain hat should be in the same position.

Taking the images

Rotations

Before you start taking images, check /Tutorial/Rotations and see if the item you're painting is noted on there. If it is, follow the "Setting rotations" section, otherwise when you've finished, follow the "Saving rotations" section.

Setting rotations

  1. Open regedit.exe (Start - Run)
  2. Navigate to: HKEY_CURRENT_USER\Software\Valve\hlmv
  3. For your item, pick the associated directory - these will be listed on the rotations page.
  4. In the right-panel, double click "Rot" and copy-paste the value in the Rotations page for your item.
  5. Close regedit, and re-open your item in HLMV.
  6. If there is a "FOV" value on the Rotations page for your item, you can enter this into HLMV - at the bottom left of the "Render" tab.

Saving rotations

If your item does not have an entry on the Rotations page...

  1. Open the item in HLMV
  2. Play around with the positioning - positioning it slightly forward, and then left or right - until you get a good view of the hat. The positioning should show as much of the item as possible.
  3. Follow the "Setting rotations" section, however instead of replacing the "Rot" value - copy it.
  4. Make an entry in the Rotations page, in the relevant position, documenting your item. Note the name of the item, it's registry-folder name and the rotation used.
  5. Commence generating the images, sticking to this rotation.

VMT Editing

  1. Open team fortress 2 materials.gcf in GCFScape.
  2. Extract the relevant VMT to the right place. For example, Tough Guy's Toque would use \tf\materials\models\player\items\heavy\heavy_stocking_cap.vmt, and should be extracted to: T:\Steam\steamapps\username\team fortress 2\tf\materials\models\player\items\heavy.
  3. Open the VMT file in VTFEdit or any text editor, and position the camera in HLMV to take screenshots.
  4. Near the top of the VMT, change "$detailblendfactor" .01 to "$detailblendfactor" .00. This removes the faint fire overlay (most noticeable on black painted items).
  5. Create a new line in the VMT file underneath "$colortint_base" "{VALUE}" and fill it with this content "$color2" "{R G B}". You can find a complete list of colours to copy/paste below.
  6. Paste the relevant RGB value found in the table to the right.
  7. Hit F5 in HLMV and take a screenshot of this color, and paste it in a Photoshop document.
  8. Repeat steps 5-6 for each color.
// Uncomment and re-comment as necessary.
//"$color2" "{}"            // Stock - Copy the value of "$colortint_base" into here.
//"$color2" "{230 230 230}" // An Extraordinary Abundance of Tinge
//"$color2" "{216 190 216}" // Color No. 216-190-216
//"$color2" "{197 175 145}" // Peculiarly Drab Tincture
//"$color2" "{126 126 126}" // Aged Moustache Grey
//"$color2" "{20 20 20}"    // A Distinctive Lack of Hue
//"$color2" "{105 77 58}"   // Radigan Conagher Brown
//"$color2" "{124 108 87}"  // Ye Olde Rustic Color
//"$color2" "{165 117 69}"  // Muskelmannbraun
//"$color2" "{231 181 59}"  // Australium Gold
//"$color2" "{240 230 140}" // The Color of a Gentlemann's Business Pants
//"$color2" "{233 150 122}" // Dark Salmon Injustice
//"$color2" "{207 115 54}"  // Mann Co. Orange
//"$color2" "{255 105 180}" // Pink as Hell
//"$color2" "{125 64 113}"  // A Deep Commitment to Purple
//"$color2" "{81 56 74}"    // Noble Hatter's Violet
//"$color2" "{47 79 79}"    // A Color Similar to Slate
//"$color2" "{50 205 50}"   // The Bitter Taste of Defeat and Lime
//"$color2" "{114 158 66}"  // Indubitably Green
//"$color2" "{128 128 0}"   // Drably Olive
//"$color2" "{66 79 59}"    // Zephaniah's Greed
//"$color2" "{168 154 140}" // Waterlogged Lab Coat (RED)
//"$color2" "{131 159 163}" // Waterlogged Lab Coat (BLU)
//"$color2" "{59 31 35}" // Balaclavas Are Forever (RED)
//"$color2" "{24 35 61}" // Balaclavas Are Forever (BLU)
//"$color2" "{184 56 59}"   // Team Spirit (RED)
//"$color2" "{88 133 162}"  // Team Spirit (BLU)
//"$color2" "{72 56 56}" // Operator's Overalls (RED)
//"$color2" "{56 66 72}" // Operator's Overalls (BLU)
//"$color2" "{128 48 32}" // The Value of Teamwork (RED)
//"$color2" "{37 109 141}" // The Value of Teamwork (BLU)
//"$color2" "{101 71 64}" // An Air of Debonair (RED)
//"$color2" "{40 57 77}" // An Air of Debonair (BLU)
//"$color2" "{195 108 45}" // Cream Spirit (RED)
//"$color2" "{184 128 53}" // Cream Spirit (BLU)

Export and upload the images

  1. Go to File... > Scripts... > Export layers to file and set the destination to wherever you see fit, and the file-type to PNG-8.
  2. Ensure Transparency and Trim layers are both ticked, and hit Run.
  3. Upload a new version of the existing files on the Wiki. Use one of the following codes in the upload summary box to automatically add licensing and proper categories (this saves you from typing out categories or manually selecting a license in the drop down box).
    • {{subst:pid}} for hats.
    • {{subst:pid|misc}} for misc items.
  4. Note the rotation and FOV values you have used on the rotations page, so that other users may pick up where you have left off and to make updating with new paints easier.

Note

The new DLLs will mean most items will appear washed out in the model viewer. In order to fix this (for Vanilla screenshots) change the "$color2" value to the same value as "$colortint_base" and F5.