Skybox (GoldSrc): Difference between revisions
Ktajxrhdktjg (talk | contribs) mNo edit summary |
SirYodaJedi (talk | contribs) mNo edit summary |
||
Line 3: | Line 3: | ||
Skyboxes in {{gldsrc|4}} are simple "cubemap" textures that display in the background behind the level. | Skyboxes in {{gldsrc|4}} are simple "cubemap" textures that display in the background behind the level. | ||
{{bug|Skyboxes are always filtered in OpenGL mode with {{code|GL_LINEAR}}, regardless of {{code|GL_TEXTUREMODE}} setting ([https://github.com/ValveSoftware/halflife/issues/2606 relevant issue on GitHub])}} | {{bug|Skyboxes are always filtered in OpenGL mode with {{code|GL_LINEAR}}, regardless of {{code|GL_TEXTUREMODE}} setting ([https://github.com/ValveSoftware/halflife/issues/2606 relevant issue on GitHub])}} | ||
{{todo|Mention and explain using an MDL skybox for simulated 512x512 (or even 1024x1024!) skies outside of {{Sven}}.}} | |||
== Adding sky to a map == | == Adding sky to a map == |
Revision as of 19:51, 31 December 2023

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.
Skyboxes in GoldSrc are simple "cubemap" textures that display in the background behind the level.


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.


Changing the displayed skybox


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:
- Go to the Map menu
- Choose Map Properties... from the drop down list
- In the Object Properties window, select the enviroment map (cl_skyname) field.
- 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 ), 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.

GIMP export settings for TGA skyboxes; RLE compression is optional
GIMP export settings for BMP skyboxes (optional in Steam release)
Creating a skybox for GoldSrc, using Source
It is possible to create an area of a Source map into a Skybox to be used in
GoldSrc. Here's an simple example:
- Create a large outdoor area with some displacement maps and treelines, and fog to hide the edges. Let's call it carrotjuice.
- Load the carrotjuice map ingame and turn cheats on (sv_cheats 1).
- Activate noclip mode by simply opening the console and enter noclip and hit Enter.
- Fly to the center of where you want the skybox.
- Open up the console and type mat_envmaptgasize 256, hit Enter.
- 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:
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.