Ova

How to Rotate the Skybox in Hammer Editor?

Published in Hammer Editor Skybox 4 mins read

You don't directly "rotate" the skybox entity itself in Hammer editor. Instead, the perceived rotation of the skybox relative to your level is primarily achieved by rotating your entire map geometry or by adjusting environmental lighting entities that project elements onto the sky.

Understanding Skybox Orientation in Hammer

The skybox in Hammer is a static environment that wraps around your map. It's typically composed of six pre-rendered textures that represent the distant horizon and sky. Its orientation is fixed relative to the world's cardinal directions (North, South, East, West). Therefore, to change how the skybox appears in relation to your playable area, you either move your playable area within the skybox or adjust elements projected onto it.

Method 1: Rotating the Entire Map Geometry

This is the most direct way to change the skybox's orientation relative to your level. By rotating all the brushes and entities that make up your map, the fixed skybox environment will appear rotated from the perspective of your level.

Steps to Rotate Your Entire Level

  1. Open Your Map: Load your .vmf file in Hammer Editor.
  2. Select All Objects: Press CTRL+A on your keyboard. This will select all brushes, entities, and models in your map.
  3. Open Rotate Dialog: Press CTRL+M to open the Rotate Objects dialog box.
  4. Enter Rotation Value: In the dialog, enter the desired rotation in degrees. For example, enter 90 for a quarter turn clockwise, or 180 for an opposite orientation.
    • Important Note: When rotating mass amounts of brushes and entities, it is generally recommended and safest to use increments of 90 degrees (e.g., 90, 180, 270) to avoid potential geometry misalignments or precision errors that can lead to compile issues or visual glitches.
  5. Apply Rotation: Click OK or Apply.

After performing this action, your entire map will be rotated. You may then need to make minor adjustments to specific entities, particularly those with absolute angles keyvalues (like info_player_start, light_environment etc.), to ensure they are correctly aligned with the new map orientation.

Method 2: Adjusting Environmental Lighting and Sky Entities

While this doesn't rotate the skybox textures themselves, it allows you to rotate specific elements within the skybox, such as the sun, moon, or the direction of the primary light source. This can significantly change the visual appearance and mood of your skybox.

Using light_environment / worldspawn Properties (Source Engine)

For Source Engine games, the global lighting and celestial body direction are often controlled by the light_environment entity and properties within the worldspawn entity.

  1. Select light_environment: Find and select your light_environment entity (if present) in the 2D or 3D view, or from the Entity Report (Map > Entity Report).
  2. Adjust Angles: Open its Properties (Alt+Enter). The PitchYawRoll (or angles) key-value defines the direction of the sun/moon and thus the shadows cast in your level.
    • The Yaw component (the middle value) is most commonly adjusted to rotate the sun's position around the map's horizon. For example, 0 0 0 might represent the sun due north, while 0 90 0 would place it due east.
  3. Modify worldspawn Properties: Alternatively, you can access the worldspawn entity properties via Map > Map Properties. Look for key-value pairs related to sun angles or similar global lighting settings (e.g., sunangles). Adjusting these values will directly rotate the light source projected onto the skybox, changing the apparent position of the sun/moon and the direction of shadows.

This method is effective for altering the direction of light and the visible celestial bodies within the skybox, providing the impression of rotation without physically rotating the entire map.

Summary of Skybox Rotation Methods

Method Description Hammer Action Effect on Skybox
Rotate Entire Map Selecting all brushes and entities and rotating them. The skybox remains static, but the map's orientation changes relative to it. CTRL+A (Select All) then CTRL+M (Rotate) Skybox visually rotates relative to your map geometry.
Adjust Environmental Lights Modifying angles properties of light_environment or sunangles in worldspawn properties. Entity Properties (Alt+Enter) Rotates the direction of the sun/moon and shadows within the skybox, not the textures.

Remember, the skybox textures themselves are static images. For more advanced "rotation" of the skybox itself (e.g., changing the position of specific clouds or unique features within the skybox texture), you would typically need to modify or create custom skybox textures outside of Hammer. For more in-depth information, you can always refer to the Valve Developer Wiki.