Installing a skybox in Hammer
Every sky here ships as a flat set of VTF and VMT files that Source already knows how to read. Getting one into a map is a folder, a name, and a paste. This guide will use Clear Morning / 17 as an example.
Download the Source set
Open any sky in the library and take the download marked Source engine. It is a small 7z archive, usually a few megabytes. The EXR download on the same page is the original 32-bit panorama the sky was rendered from. You do not need it for Source. It is there for relighting, or for engines that take an equirectangular image directly.
Inside the archive are the six faces of the cube in LDR, the same six in HDR, and a VMT for each. Current skies also include a small VMF holding the lighting entities for that sky, already filled in. There are no folders to preserve.
sky_cloudy017_hdr_lighting.vmf sky_cloudy017bk.vtf sky_cloudy017bk.vmt sky_cloudy017dn.vtf sky_cloudy017dn.vmt sky_cloudy017ft.vtf sky_cloudy017ft.vmt sky_cloudy017lf.vtf sky_cloudy017lf.vmt sky_cloudy017rt.vtf sky_cloudy017rt.vmt sky_cloudy017up.vtf sky_cloudy017up.vmt sky_cloudy017_hdrbk.vtf sky_cloudy017_hdrbk.vmt …and the other five _hdr faces
Put the files where the game looks
Extract everything into the materials/skybox/ folder of the game you are mapping for. Hammer reads from the same place the game does, so one copy serves both. Under your Steam library's steamapps/common/ that is:
| Garry's Mod | GarrysMod/garrysmod/materials/skybox/ |
|---|---|
| Team Fortress 2 | Team Fortress 2/tf/materials/skybox/ |
| Counter-Strike: Source | Counter-Strike Source/cstrike/materials/skybox/ |
| Half-Life 2 | Half-Life 2/hl2/materials/skybox/ |
| Source SDK Base 2013 mod | sourcemods/<your mod>/materials/skybox/ |
If the skybox folder does not exist yet, create it. The stock skies live inside the game's VPK archives, so an empty materials folder is normal.
Name the sky in Hammer
In Hammer, open Map › Map Properties and set SkyBox Texture Name to the sky's name exactly as it appears on its page here, including the _hdr. For Clear Morning / 17 that is:
- Sky name
Source builds the six face names by appending bk, dn, and so on. The _hdr materials use the engine's sky shader and point at both the LDR and HDR faces, so this one name covers both compile modes. The copy button next to the name on each sky's page gives you exactly this string.
Match the sun
The sky is only a picture. Its light comes from a light_environment entity. The quickest route is the VMF in the archive: open sky_cloudy017_hdr_lighting.vmf in Hammer, select everything, copy, and paste into your map. It carries a light_environment, an env_sun, an env_fog_controller, an env_tonemap_controller, and a logic_auto that sets the exposure range on spawn. All of it is already tuned to this sky.
If you would rather set it by hand, or already have a light_environment, each sky's page lists the values that were used for its previews. They line up with Hammer's property names like this:
- Pitch Yaw Roll
- Pitch
- Brightness
- Ambient
The site calls the first one Sun Angle and the rest keep their Hammer names. Brightness and Ambient are four numbers: red, green, blue, and intensity. Leave BrightnessHDR and AmbientHDR at their default of -1 -1 -1 1, which tells VRAD to reuse the same values for the HDR pass. Treat all of this as a starting point. A map with a lot of interior space often wants a stronger ambient than the open previews do.
Match the fog
Fog is what keeps the far edge of a map from reading as a hard line against the sky. The pasted VMF already includes an env_fog_controller with fog enabled and both colours set. If you are adding your own, use the two colours from the sky's page. Distances are up to you; the colours are what tie the horizon to the sky.
- Primary
- Secondary
If the map has a 3D skybox, give the sky_camera the same fog colours so the two halves of the horizon agree.
Compile with HDR
The set includes HDR faces, so let VRAD build both lighting passes. In the normal compile dialog tick HDR; in expert mode run VRAD with -both. The game then picks the right faces from the player's own HDR setting. An LDR-only compile is fine too. It simply ignores the _hdr files.
Ship the files with your map
A compiled BSP does not contain the sky. Anyone who loads your map without these files in their own materials/skybox/ folder will see the pink-and-black missing-texture pattern where the sky should be. Two ways to avoid that:
- Pack them into the BSP. CompilePal's Pack step, VIDE, or bspzip will embed the twenty-four files. This is the usual choice for TF2, CS:S, and mods.
- Ship them beside the map. For a Garry's Mod Workshop addon, put the files in the addon's own materials/skybox/ folder next to maps/. The addon mounts them for everyone who subscribes.
Preview without recompiling
To try a sky on a map you already have, load the map on a listen server and type sv_skyname sky_cloudy017_hdr in the console. The sky swaps in place. The lighting does not change, since that was baked at compile time, but it is the quickest way to judge whether a sky suits the map before committing to it.
One Garry's Mod note: env_skypaint and a texture skybox are either/or. That entity only works when the map's sky name is painted, which is how the stock gm_ maps are built. To use one of these skies, set the sky name as in Name the sky in Hammer and leave env_skypaint out of the map.
If something looks wrong
- Pink and black checkerboard
- The files are not in materials/skybox/, or the sky name does not match their base name. Check for an extra folder level from the extraction.
- Sky is right, map is too dark or too flat
- The light comes from light_environment, not the texture. Recheck the pitch and the two colour values, then recompile with VRAD.
- Looks fine for you, broken for others
- The files were never packed or shipped. See Ship the files with your map.
- Sky is washed out or blown out in HDR
- The map's tonemap settings are doing that, not the sky. The env_tonemap_controller and logic_auto in the included VMF set a modest auto-exposure range that usually settles it.
Credit
Every sky is CC BY 4.0. Use it in anything, commercial or not, and credit it somewhere people can see, such as the map's Workshop description:
Skybox: sky_cloudy017_hdr by Jacob Robbins, sourceskyboxes.com