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

From Team Fortress Wiki
Jump to: navigation, search
(Updated for betterlyness)
Line 1: Line 1:
 
<onlyinclude></onlyinclude>
 
<onlyinclude></onlyinclude>
 
{{stub}}
 
{{stub}}
This tutorial will document the current method of painting hats in Photoshop.  Note:  Please check on [[Template:Painted variants]] which hat's need to be done, and which hats have been done.  Please note that the generated images may differ slightly to the hats in-game due to TF2's lighting mechanics.
+
This tutorial will document the current method of painting hats HLMV.
  
 
== Setting up HLMV ==
 
== Setting up HLMV ==
For your images to be of adequate quality for us to accept, 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.
+
We want the images to be the best quality possible, sp 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.
  
 
=== <code>Dxsupport.cfg</code> ===
 
=== <code>Dxsupport.cfg</code> ===
Line 15: Line 15:
 
"ConVar.mat_forceaniso" "8"
 
"ConVar.mat_forceaniso" "8"
 
"ConVar.mat_picmip" "-10"</pre>
 
"ConVar.mat_picmip" "-10"</pre>
 +
: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.
  
=== Inside HLMV ===
+
=== HLMV Options ===
 
# Open up Model Viewer via the Source SDK.
 
# Open up Model Viewer via the Source SDK.
 
# Check (if it's not already checked) the <code>Normal Mapping</code> checkbox.
 
# Check (if it's not already checked) the <code>Normal Mapping</code> checkbox.
# Set the background colour to white: <code>Options... > Background Color...</code>
+
# Set the background colour to white for each item: <code>Options... > Background Color...</code>
 
# Full-screen HLMV (so you get a nice big image).
 
# Full-screen HLMV (so you get a nice big image).
# 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.
+
# 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.
 
  
== The Shortcut ==
+
=== 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.
+
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:
 +
# Copy this contents of this directory <code>T:\Steam\steamapps\username\team fortress 2\bin</code> to this one <code>T:\Steam\steamapps\username\sourcesdk\bin\orangebox\bin</code>, overwriting where necessary.
  
# Copy this directory <code>T:\Steam\steamapps\username\team fortress 2\bin</code> to this one <code>T:\Steam\steamapps\username\sourcesdk\bin\orangebox\bin</code>, overwriting where necessary.
+
== Modify VMT Files ==
# Using [http://nemesis.thewavelength.net/index.php?p=26 GCFScape], open up <code>Steam\steamapps\team fortress 2 materials.gcf</code>.
+
{| class="wikitable grid" style="float: right;"
# Navigate inside this GCF to the the directory listed under "VMTs Loaded".
+
! class="header" | Name
# Extract the red team VMT files and put them in the same directory as in the GCF - but in the <code>team fortress 2/tf</code> folder. For example, Tough Guy's Toque would use <code>heavy_stocking_cap.vmt</code>, and those files should be placed in: <code>T:\Steam\steamapps\username\team fortress 2\tf\materials\models\player\items\heavy</code>.
+
! class="header" | Color
# Open the VMT file in any text editor, and position the camera in hlmv to take screenshots.
+
! class=header | rgb
# Near the top of the VMT, change <code>"$detailblendfactor" .01</code> to <code>"$detailblendfactor" .00</code> to fix fire decal glitches.
+
|-
 +
| A Deep Commitment to Purple
 +
| style="background:#7D4071" | <font color="white">#7D4071</font>
 +
| {125 64 113}
 +
|-
 +
| Muskelmannbraun
 +
| style="background:#A57545" | #A57545
 +
| {165 117 69}
 +
|-
 +
| Aged Moustache Grey
 +
| style="background:#7E7E7E" | #7E7E7E
 +
| {126 126 126}
 +
|-
 +
| Noble Hatter's Violet
 +
| style="background:#51384A" | <font color="white">#51384A</font>
 +
| {81 56 74}
 +
|-
 +
| [[Australium]] Gold
 +
| style="background:#E7B53B" | #E7B53B
 +
| {231 181 59}
 +
|-
 +
| Peculiarly Drab Tincture
 +
| style="background:#C5AF91" | #C5AF91
 +
| {197 175 145}
 +
|-
 +
| Color No. 216-190-216
 +
| style="background:#D8BED8" | #D8BED8
 +
| {216 190 216}
 +
|-
 +
| [[Radigan Conagher]] Brown
 +
| style="background:#694D3A" | #694D3A
 +
| {105 77 58}
 +
|-
 +
| Indubitably Green
 +
| style="background:#729E42" | #729E42
 +
| {114 158 66}
 +
|-
 +
| Ye Olde Rustic Color
 +
| style="background:#7C6C57" | #7C6C57
 +
| {124 108 87}
 +
|-
 +
| [[Mann Co.]] Orange
 +
| style="background:#CF7336" | #CF7336
 +
| {207 115 54}
 +
|-
 +
| [[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}
 +
|}
 +
# Extract the relevant VMT to the right place. For example, Tough Guy's Toque would use <code>heavy_stocking_cap.vmt</code>, and those files should be placed in: <code>T:\Steam\steamapps\username\team fortress 2\tf\materials\models\player\items\heavy</code>.
 +
# Open the VMT file in VTFEdit or any text editor, and position the camera in HLMV to take screenshots.
 +
# Near the top of the VMT, change <code>"$detailblendfactor" .01</code> to <code>"$detailblendfactor" .00</code>. This removes the faint fire overlay (most noticeable on black painted items).
 
# Create a new line in the VMT file underneath <code>"$colortint_base" "{VALUE}"</code> and fill it with this content <code>"$color2" "{R G B}"</code>.
 
# Create a new line in the VMT file underneath <code>"$colortint_base" "{VALUE}"</code> and fill it with this content <code>"$color2" "{R G B}"</code>.
# Using [http://www.drpeterjones.com/colorcalc/ this site], convert the hexadecimal color representations of the paint cans to RGB values, and replace <code>"{R G B}"</code> with their corresponding values.
+
# Paste the relevant RGB value found in the table to the left.
# Hit F5 in hlmv and take a screenshot of this color.
+
# Hit F5 in HLMV and take a screenshot of this color, and paste it in a photoshop document.
 
# Repeat steps 8-9 for each color.
 
# Repeat steps 8-9 for each color.
# Organise the screenshots as in "Organise the screenshots" step 1.
 
# Skip directly to the Wiki-Work section.
 
  
== Pre-painting preperation ==
+
=== Export and the images ===
=== Extracting textures ===
 
# Open the hat you've chosen to do the images for in HLMV (and follow the Inside HLMV steps above).
 
# In Model Viewer switch to the 'Model' tab, and look under "VMTs Loaded".
 
# Using [http://nemesis.thewavelength.net/index.php?p=26 GCFScape], open up <code>Steam\steamapps\team fortress 2 materials.gcf</code>
 
# Navigate inside this GCF to the the directory listed under "VMTs Loaded".
 
# Extract the red team texture files and put them in the same directory as in the GCF - but in the <code>team fortress 2/tf</code> folder.  For example, Tough Guy's Toque would use <code>heavy_stocking_cap.vtf</code> and <code>heavy_stocking_cap.vmt</code>, and those files should be placed in: <code>T:\Steam\steamapps\username\team fortress 2\tf\materials\models\player\items\heavy</code>.
 
 
 
=== Readying Photoshop ===
 
# Open [http://dl.dropbox.com/u/1961029/Paint/paint%20texture%20template.psd this file] in Photoshop.
 
# Open the .vtf file in Photoshop.
 
# Copy the contents of the texture in to the PSD, above the white background layer.
 
# Back in the texture file, go on to "Channels" and copy over the Alpha channel to the PSD.
 
# In the PSD ctrl+click the thumbnail of the alpha channel, go back into layers and click the group: <code>Tints</code>, and add a layer mask.
 
# Go back into "Channels" and drag the Alpha channel in to the bin.
 
#: ''This all may seem a bit long-winded, but it's necessary to ensure the where you're painting is aligned perfectly. Copy-pasting the alpha channel sometimes causes the layer mask to be misaligned.''
 
# Open up the .VMT file for the texture in a text editor.
 
# Find the line: <code>"$blendtintcoloroverbase"</code>
 
# The value next to that line determines the transparency of your layer mask.  <code>"1"</code> would mean the Opacity of the Tints group is 100%.  <code>"0.5"</code> would be 50% opacity, and so on. (There may be some exceptions to this, compare with in-game screenshots if possible.)
 
# Save the PSD where the texture files are located, with the same name as the texture file.
 
# Close the .VTF from Photoshop.
 
 
 
== Time to get the painted images! ==
 
=== Get the screenshots ===
 
# (In the PSD) Open up the Tints group and toggle on the first colour: ''7D4071''.
 
# <code>File... > Save As</code> and change the file type to "VTF", save and overwrite the existing VTF.
 
#:  If you've named the PSD correctly, you can do this really fast with keyboard shortcuts:  Ctrl-Shift-S, Tab, V, Enter, Enter.
 
# Switch to Model Viewer and hit F5.  If you've done everything prcoperly, the texture should update.
 
# Alt-Printscreen the Model Viewer window.
 
# Head back in to Photoshop and Ctrl+N (new file), hit enter and paste the screenshot you just took.
 
# Repeat steps 1 through 4 for all the colours.  Do not skip any colours, nor select different layers in the documents for screenshots.
 
 
 
=== Organise the screenshots ===
 
Now you should have screenshots for all of the paint colours.  They will be ordered as the colours are in the Tints group.
 
# Ctrl+Tab between the PSD and screenshots document and name each of the screenshots to the colour value of the tint (or some other name that you easily associate with the paint colours, such as ''orange'', ''rustic'', ''violet'').
 
# Once they're all named, select the crop tool and crop the document around the hat.
 
# Select the topmost screenshot (it should be called <code>141414</code>).
 
# Using the magic wand tool (A tolerance of around 10 seems to provide the best results), select the white background of the hat and hit delete. Make sure to check for islands of white background present that you might not have selected.
 
# Select each of the layers and hit delete (the selection made with the magic wand tool should not go away).
 
 
 
=== Export the images ===
 
 
# Go to <code>File... > Scripts... > Export layers to file</code> and set the destination to wherever you see fit, and the file-type to PNG-8.
 
# Go to <code>File... > Scripts... > Export layers to file</code> and set the destination to wherever you see fit, and the file-type to PNG-8.
 
# Ensure <code>Transparency</code> and <code>Trim layers</code> are both ticked, and hit <code>Run</code>.
 
# Ensure <code>Transparency</code> and <code>Trim layers</code> are both ticked, and hit <code>Run</code>.
 
+
# Upload a new version of the existing files on the wiki.
== Wiki-work! ==
 
By now you should have all the images ready to upload to the Wiki... so let's do that!
 
 
 
=== Implementing the template ===
 
# Open up the article for the hat you've done the images for.
 
# Hit edit and add the following lines above Trivia:
 
<pre>==Painted variants==
 
{{Painted variants}}</pre>
 
:3. Hit show preview, and the template will be in place. Open in new tabs all of the red links for the images needed to be uploaded.
 
 
 
=== Uploading the images ===
 
For each of the tabs do the following:
 
# Select your image to be uploaded.  The file name for the painted images will contain the colour ID that's also listed on the upload page as the file you're uploading, so finding the right image should be easy.
 
# Add the following to the Summary: {{tlx|pid|subst=y}}. No need to select a license, it is done automatically.
 
# Upload the file!
 
  
 
=== Amend the appropriate pages ===
 
=== Amend the appropriate pages ===
Once all the files are uploaded, do the following:
+
Once all the files are uploaded, go to [[User:Pilk/Painted_items]] and add {{code|1={{!}}updated=y}} to the row template for that item. You're officially done!
# Hit show preview again on the Hat's article, to ensure all images show up.
 
#: If you still have red links then you've missed a file when uploading.  Just hit the red link and upload.
 
#: If images aren't showing up then just hit show preview again, they should show up this time.
 
# If all is well, save the Hat's article.
 
# Once you've done the above, open up [[Template:Painted variants]] and find the hat you've just done in the table at the bottom of the page, and replace {{tlx|c|2=x|3=<span></span>}} with {{tlx|c|2=done|3=<span></span>}}.
 
# Show preview to check you've changed the correct item.
 
# Save the table.
 

Revision as of 10:08, 5 October 2010

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

Setting up HLMV

We want the images to be the best quality possible, sp 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.

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.

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. Copy this contents of this directory T:\Steam\steamapps\username\team fortress 2\bin to this one T:\Steam\steamapps\username\sourcesdk\bin\orangebox\bin, overwriting where necessary.

Modify VMT Files

Name Color rgb
A Deep Commitment to Purple #7D4071 {125 64 113}
Muskelmannbraun #A57545 {165 117 69}
Aged Moustache Grey #7E7E7E {126 126 126}
Noble Hatter's Violet #51384A {81 56 74}
Australium Gold #E7B53B {231 181 59}
Peculiarly Drab Tincture #C5AF91 {197 175 145}
Color No. 216-190-216 #D8BED8 {216 190 216}
Radigan Conagher Brown #694D3A {105 77 58}
Indubitably Green #729E42 {114 158 66}
Ye Olde Rustic Color #7C6C57 {124 108 87}
Mann Co. Orange #CF7336 {207 115 54}
Zephaniah's Greed #424F3B {66 79 59}
An Extraordinary Abundance of Tinge #E6E6E6 {230 230 230}
A Distinctive Lack of Hue #141414 {20 20 20}
  1. Extract the relevant VMT to the right place. For example, Tough Guy's Toque would use heavy_stocking_cap.vmt, and those files should be placed in: T:\Steam\steamapps\username\team fortress 2\tf\materials\models\player\items\heavy.
  2. Open the VMT file in VTFEdit or any text editor, and position the camera in HLMV to take screenshots.
  3. Near the top of the VMT, change "$detailblendfactor" .01 to "$detailblendfactor" .00. This removes the faint fire overlay (most noticeable on black painted items).
  4. Create a new line in the VMT file underneath "$colortint_base" "{VALUE}" and fill it with this content "$color2" "{R G B}".
  5. Paste the relevant RGB value found in the table to the left.
  6. Hit F5 in HLMV and take a screenshot of this color, and paste it in a photoshop document.
  7. Repeat steps 8-9 for each color.

Export and 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.

Amend the appropriate pages

Once all the files are uploaded, go to User:Pilk/Painted_items and add |updated=y to the row template for that item. You're officially done!