|
|
|
|
|
|
|
|
| Links |
|
|
|
Making Sky Textures - By Raeven0 |
|
This tutorial was last updated on Jul 31, 2006.
See also Making a Custom HL2 Texture, which lays out the process of making a texture. This tutorial is specifically for making sky textures, and the writer (that's me) assumes that the reader (that's you) knows how to make a texture already.
To make a custom sky environment, you will need six TGA images: one for up, one for down, and four for the four cardinal directions. How exactly to make those TGAs is for another tutorial; for now, I'll simply explain how to implement the TGAs you've got.
In theory, you can use whatever (valid) dimensions you want for the sky TGAs. Compare 1024x1024 with 512x512:

(Click for Larger Image)
In fact, the fuzziness of the 512x512 image is most likely due to my downsizing the 1024x1024 image to make it. If I had taken that picture in 512x512 and not downsized it, it probably would not have been so fuzzy. Furthermore, Valve used 512x512 for its skies.
First, take your six TGA images and give them a common name, like raemars; then, attach one of these suffixes to the filename:
ft
bk
lf
rt
up
dn
That is, you should have six images with the following names:
raemarsft
raemarsbk
raemarslf
raemarsrt
raemarsup
raemarsdn
These six suffixes correspond to the side of the sky environment that the TGA will be. The TGA you've named raemarsup, for example, will be the top of the finished sky environment; the image named raemarslf will be the west side; etc.
The image suffixes with their corresponding directions are:
ft - south
bk - north
lf - west
rt - east
up - up
dn - down
For UP, the bottom side of the image will align to the eastern side of the sky; that is, the bottom of the image points east. For DN, the top side of the image aligns to the eastern side of the sky--the top side of DN points east.
Summary so far:
raemarsft.tga - the image to display on the southern side of the sky environment
raemarsbk.tga - the image to display on the northern side of the sky environment
raemarslf.tga - the image to display on the western side of the sky environment
raemarsrt.tga - the image to display on the eastern side of the sky environment
raemarsup.tga - the image to display for the top of the sky environment, bottom side pointing east
raemarsdn.tga - the image to display for the bottom of the sky environment, top side pointing east
As in the other tutorial, you must now move the images to the materialsrc folder if they're not already there, and make TXT files for each of them. However, this time, the text files should not be empty. Open each one and write the following text into it:
"skybox" "1"
You should have six TXT files, one for each TGA, each with the above text in it. This text forces VTEX to compile the image as a sky texture, so that it tiles flawlessly with other sky textures. Compare a sky without this parameter and a sky with it:

(Click for Larger Image)
NOW, you can click and drag all six TGAs onto vtex.exe (or compile them with your fancy VTEXGUI or however you like to compile textures). The following text should appear in the vtex window:
'skybox' detected. Treating skybox like a cubemap for edge-matching purposes.
implicity [sic] disabling nice filtering
This indicates that the skybox parameter was properly processed. Be patient; compiling sky textures takes longer than normal textures!
Next, move over to the materials directory and create a new skybox folder if there isn't one already. Move all your VTFs into there.
LAST STEP, I PROMISE.
Make the VMT files for your sky images, like this:
"UnlitGeneric"
{
"$basetexture" "skybox/INSERT TEXTURE HERE"
"$nofog" "1"
}
This is a special VMT. The "UnlitGeneric" line forces the texture to be unaffected by lights (because it would look very awkward otherwise!). The "$nofog" line forces the texture to be unaffected by fog (again, because it would look awkward otherwise). Valve sometimes also adds an "$ignorez" "1" line to its VMTs, but this seems unnecessary.
I told you it was the last step; compile and see how your sky looks! If the up or down images look wrong, check and ensure that the top sides of the UP and DOWN images match perfectly to the east (rt) image. If the side images look bad, make sure you named them properly (north bk, east rt, etc.).
Still need help? Ask your questions in one of our HELP FORUMS
|
|
|
| Comments |
| College Professor - Nov 18, 2008 |
| I'm sorry but if west is left, east is right, then that can only mean that front is north and back is south. Not the other way around, have you ever seen a compass? Please update your tutorial so that people are not falsely orienting their sky backgrounds. |
| Daniel - Aug 17, 2008 |
When I try to convert the tga files to vtf the complier says
"TGA file is an incorrect size error"
what does this mean and how do i fix it? |
| Roger - Sep 16, 2007 |
| *.VMT |
| SharpS - Sep 15, 2007 |
| I got it working by making individual VMF files for each direction. |
| SharpS - Sep 15, 2007 |
| I also have the problem that Steve has- it's really annoying |
| steve - Mar 29, 2007 |
i have triedand triedthis now.
For some reaosn though when i try and compile the level the texture cant be found.
the skybox ends up drawing the lastthing on screen, so in most cases the grass texture!
any ideas onhow to stop this? |
[1 extra comment]
|
|
|
|