Difference between revisions of "Skybox (2D)"

From Valve Developer Community
Jump to: navigation, search
 
m
Line 6: Line 6:
 
# Convert the [[TGA]] images to [[VTF]] (this will create a $SKYNAME.txt which you will later edit then rename to $SKYNAME.vmt)
 
# Convert the [[TGA]] images to [[VTF]] (this will create a $SKYNAME.txt which you will later edit then rename to $SKYNAME.vmt)
 
# After conversion, open the .txt and add:
 
# After conversion, open the .txt and add:
<pre>
+
 
"UnlitGeneric"
+
"UnlitGeneric"
{
+
  {
// Original shader: BaseTexture
+
  // Original shader: BaseTexture
"$basetexture" "skybox/$SKYNAME"
+
  "$basetexture" "skybox/$SKYNAME"
"$nofog" 1
+
  "$nofog" 1
$ignorez 1
+
  $ignorez 1
}
+
  }
</pre>
+
 
 
*For each file, append the appropriate image tag to the sky name (i.e. bk, ft, rt, lf, up, dn)
 
*For each file, append the appropriate image tag to the sky name (i.e. bk, ft, rt, lf, up, dn)
 
*Rename the .txt files to .vmt
 
*Rename the .txt files to .vmt

Revision as of 10:49, 28 June 2005

In Source, the skybox is a series of six images, joined together to make a cube. The cube is then locked to the player's viewpoint and acts as the most distant area of a map, usually the sky. Because the skybox is fixed to the player's viewport, it never changes perspective, allowing the cube to appear as a seamless whole.

Creating a 2D skybox

  1. Prepare your TGA files (i.e. skynameBK.tga, skynameFT.tga, skynameUP.tga, skynameDN.tga, skynameRT.tga, skynameLF.tga)
  2. Convert the TGA images to VTF (this will create a $SKYNAME.txt which you will later edit then rename to $SKYNAME.vmt)
  3. After conversion, open the .txt and add:
"UnlitGeneric"
 {
 // Original shader: BaseTexture
 "$basetexture" "skybox/$SKYNAME"
 "$nofog" 1
 $ignorez 1
 }
  • For each file, append the appropriate image tag to the sky name (i.e. bk, ft, rt, lf, up, dn)
  • Rename the .txt files to .vmt
  • Now go into your mod's materials folder and create the folder skybox.
  • Copy your new VTF and VMT files into the skybox folder.
  • In Hammer, go to Map > Map Properties > Skybox Texture Name and type in your skyname, without the side tags.