Env cubemap

It specifies a location for which a cubemap will be generated when the console command is executed. Materials with will use the nearest cubemap as their reflection.
__TOC__
== Keyvalues ==
:*0: Default (usually 32x32, depending on the game)
:*1: 1x1
:*2: 2x2
:*3: 4x4
:*4: 8x8
:*5: 16x16
:*6: 32x32
:*7: 64x64
:*8: 128x128
:*9: 256x256
:*10: 512x512 ¹ 
:*11: 1024x1024 ¹ ² 
:*12: 2048x2048 ¹ ² 
:*13: 4096x4096 ¹ ² ³ 
¹ - To render higher resolution cubemaps than 256x256, see below.
² - Higher resolution (1024px or higher), may not work in some games. See #Higher_Resolution_Cubemaps.</br>
³ - Building cubemaps on 4096x4096 requires the game runs on 16K resolution (which requires very powerful GPU (such as RTX 4090) with large VRAM to handle).
== Higher Resolution Cubemaps ==
Simply type in a value 10 or more (you don't need to disable SmartEdit). That will give the resolution corresponding to the next powers of 2 (512x512, 1024x1024, 2048x2048).
== Placement ==
Declaring areas for cubemaps to cover is simple, just place an env_cubemap point entity inside the space of a map. When the map is compiled with VBSP, world geometry surfaces automatically associate themselves with the nearest env_cubemap and will use the cubemap generated from it. Entities associate themselves with the env_cubemap closest to their origin (alternatively, a cubemap can be applied to specific brush faces in the cubemap's properties); moving entities will dynamically change which cubemap they use. It is important to choose env_cubemap positions properly for both aesthetic and performance issues.
Cubemaps are used in a few specific ways, and should be placed accordingly. Some cubemaps are used for reflections on static world geometry. Others are used with player entities, including NPCs. And the rest are used for any non-player reflective entities. The optimal placement of env_cubemap entities corresponds with each of these uses, to ensure the maximal benefit, visually and in performance. Here are a few simple heuristics to follow:
* If a cubemap is intended for NPCs or the player, the env_cubemap should be placed at eye-level (usually 64 hammer units) above the ground. This way, the cubemap will most accurately represent the world from the perspective of the player. 
* If a cubemap is intended for static world geometry, the env_cubemap should be a fair distance (as a rule of thumb, 16 Hammer units) away from all brush surfaces.
*A different cubemap should be taken in each area of distinct visual contrast. A hallway with bright yellow light will need its own env_cubemap, especially if it is next to a room with low blue light. Without two env_cubemap entities, reflections and specular highlights will seem incorrect on entities and world geometry in one of the areas.
* Location changes, such as one room-to-room, room-to-outside and general location changes with great visual changes need env_cubemap entities with equal distance in both locations to the transition point. For example 16 units away from the doorway into each rooms. That way the cubemap transition between locations is smooth. This will prevent the cubemap from showing the outside location inside the room and vice versa.
* Cubemaps set in a very dark area, as well as cubemaps outside of the playable area can use very small resolutions. Dark cubemaps barely reflect anything but the few bright spots to begin with, Using smaller ones barely makes any visual difference.
== Building Cubemaps ==
For general and game specific information about building cubemaps, visit the Cubemaps page.
== See also ==
*
*
Category:Cubemaps