This article's documentation is for the "GoldSrc" engine. Click here for more information.

Skybox (GoldSrc)

From Valve Developer Community
Jump to: navigation, search
Half-Life SDK/Textures
Icon-broom.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.
The default desert skybox

Skyboxes in GoldSrc GoldSrc are simple "cubemap" textures that display in the background behind the level.

Icon-Bug.pngBug:Skyboxes are always filtered in OpenGL mode with GL_LINEAR, regardless of GL_TEXTUREMODE setting (relevant issue on GitHub)
Blank image.pngTodo: Mention and explain using an MDL "skybox" for simulated 512x512 (or even 1024x1024!) skies outside of Sven Co-op.

Adding sky to a map

Simply texture a world brush (not a brush entity) with the sky texture.

In-game, the skybox will be seen through each surface that sky is applied to.

sky brushes do not need to be box-shaped.

Note.pngNote:Ideally, your skybox should somewhat "wrap" around your map such that there is only a very small/zero amount of space between the play-space and the skybox itself, though it's usually not necessary to have the skybox "hugging" the bounds of the map to achieve reasonable compile times. Leaving some visible space between the playable space and the skybox can improve gameplay and world believableness.
Warning.pngWarning:You should avoid making a skybox by drawing a big hollowed out cube with the sky texture around your map. This can drastically increase VIS compile times.
Icon-Bug.pngBug:VHLT expects the first three characters of any sky tool texture to be all lowercase and will not compile skies correctly if the tool texture does not fit these criteria.
Icon-Important.pngImportant:The skybox is always drawn behind all other visible geometry! Don't put any geometry behind a sky brush if it is part of the same PVS[Clarify].

Changing the displayed skybox

Changing a map's skybox in J.A.C.K. J.A.C.K.

By default, no skybox is defined, so GoldSrc defaults to the desert skybox. You can change it by setting the skybox name in Hammer's Map Properties dialog. With the correct map opened, follow these steps:

  1. Go to the Map menu
  2. Choose Map Properties... from the drop down list
  3. In the Object Properties window, select the enviroment map (cl_skyname) field.
  4. Enter the name of the skybox you wish to display. If using a supported FGD, J.A.C.K. J.A.C.K. will show a drop down list of skyboxes available to the current game configuration.
Note.pngNote:If a skybox name includes an underscore before the suffix, include that as well.

Creating a Custom 2D Skybox Texture

Skybox textures in GoldSrc MUST be 256x256 (exceptin Sven Co-op), and they follow the same naming convention as Quake II Quake II and Source Source, as so:

<skyname>BK
<skyname>DN
<skyname>FT
<skyname>LF
<skyname>RT
<skyname>UP

Both TGA and BMP images are supported, but TGA is recommended for quality and compatibility reasons.
Software mode defaults to BMP skyboxes, and reads the TGA version if a BMP version is not present.
OpenGL mode defaults to TGA skyboxes. It will attempt to use the BMP version if a TGA version is not present, but not all modern GPUs support this.
Skybox textures must be encoded using the following settings

Format TGA BMP
Resolution 256 x 256 256 x 256
Color depth 24-bit (true color) 8-bit (256 colors, no fewer)
Compression Uncompressed or RLE compression Uncompressed
Additional settings Image origin: Bottom-Left Compatibility: No color space information

Skybox textures must be put in 🖿<moddir>\gfx\env\, or a subfolder thereof.

Tip.pngTip:(only in Sven Co-op) Sven Co-op supports 512x512 and 1024x1024 skybox textures, in addition to 256x256.
Warning.pngWarning:Avoid leaving an alpha channel in the skybox textures; this can result in the sky faces appearing upside-down!
Note.pngNote:This will affect ports of skyboxes from the 2023 Quake II Quake II remaster, which almost all would otherwise be compatible.

Creating a skybox for GoldSrc, using Source

It is possible to create an area of a Source Source map into a Skybox to be used in GoldSrc GoldSrc. Here's an simple example:

  1. Create a large outdoor area with some displacement maps and treelines, and fog to hide the edges. Let's call it carrotjuice.
  2. Load the carrotjuice map ingame and turn cheats on (sv_cheats 1).
  3. Activate noclip mode by simply opening the console and enter noclip and hit Enter.
  4. Fly to the center of where you want the skybox. Use setpos if a specific coordinate is desired.
  5. Open up the console and type mat_envmaptgasize 256, hit Enter.
  6. Now type envmap and press Enter. Now, 6 TGA files are now created and saved into a folder named cubemap_screenshots in your Source game's mod folder ( i.e. for Portal 2 Portal 2: 🖿Steam\steamapps\common\Portal 2\portal2\cubemap_screenshots).

Since the mapname was carrotjuice, the name of the 6 TGA files are as following:

🖿carrotjuicert.tga (Right)
🖿carrotjuiceft.tga (Front)
🖿carrotjuicelf.tga (Left)
🖿carrotjuicebk.tga (Back)
🖿carrotjuiceup.tga (Up)
🖿carrotjuicedn.tga (Down)

You can now copy or move these to your mod's 🖿gfx\env folder, to use it as skybox in a level.

Note.pngNote:If the cubemap screenshots include the hud (such as in Left 4 Dead 2), bind envmap to a key instead of using it from the console.

See also

External links