Cubemaps (Source 2)

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)
Env cubemap.png
An example of specular reflections on some models (exaggerated by overriding prop materials with materials/dev/spheretest.vmat texture).

A cubemap is a texture that represents a three-dimensional rendering of an area. Source 2 Source 2 has env_cubemap, env_cubemap_box and/or other cubemap entities as sampling points to generate these textures, which are then integrated into the map file. Cubemaps in Source 2 are also parallax corrected if env_cubemap_box is used.

Todo: Document about env_cubemap_fog.

Entities

Preview in Hammer (only in Counter-Strike 2)

You can preview cubemaps by going to "Preview Baked Lighting" menu > Bake All Cubemaps. You can also use "Bake Selected Cubemaps" to preview the selected cubemaps.

Building cubemaps

Note.pngNote:If the option "Build cubemaps on load" is checked in Hammer Build Map dialog, as soon the game loads the map after it is compiled, the cubemaps will be automatically built, and the map will be automatically reloaded.
Note.pngNote:Unlike Source, which displays the building cubemaps process by showing the captured image on each sides, Source 2 will instead hangs while building cubemaps, so look at the console log (in VConsole) instead for progress.

If you didn't enable the option to automatically build cubemaps through Hammer, submit the following commands into the game's console in order to build cubemaps manually:

Command Description
map map_name Loads the map; replace "map_name" with the map's actual name
buildcubemaps Begins building cubemaps. The map will be automatically reloaded, and the new cubemap texture will be shown.
Note.pngNote:Source 2 does not support building cubemaps with number of iterations (e.g.: buildcubemaps 2).(confirmed on Half-Life: Alyx Counter-Strike 2)