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

Skybox (GoldSrc): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 14: Line 14:
{{note|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.}}
{{note|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|You should avoid making a skybox by drawing a big hollowed out cube with the {{code|sky}} texture around your map. This can drastically increase VIS compile times.}}
{{warning|You should avoid making a skybox by drawing a big hollowed out cube with the {{code|sky}} texture around your map. This can drastically increase VIS compile times.}}
{{bug|[[VHLT]] expects the {{code|sky}} tool texture to be lowercase and will not compile skies correctly if the tool texture does not fit these critera.}}
{{bug|[[VHLT]] expects the {{code|sky}} tool texture to be lowercase and will not compile skies correctly if the tool texture does not fit these criteria.}}


== Changing the displayed skybox ==
== Changing the displayed skybox ==

Revision as of 09:25, 29 July 2023

Half-Life SDK/Textures
Broom icon.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)  [todo tested in ?]


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 sky tool texture to be lowercase and will not compile skies correctly if the tool texture does not fit these criteria.  [todo tested in ?]

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.

Creating a Custom 2D Skybox Texture

Skybox textures in GoldSrc MUST be 256x256 (except'in Sven Co-op), and they follow the same naming convention as 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!

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

See also

External links