Cubemaps (Source 2): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
[[File:Env_cubemap.png|left]]
[[File:Env_cubemap.png|left]]
[[File:Specular.jpg|thumb|right|300px|An example of specular reflections on some models (exaggerated through {{cmd|r_showenvcubemap}}).]]
[[File:Specular.jpg|thumb|right|300px|An example of specular reflections on some models (exaggerated through {{cmd|r_showenvcubemap}}).]]
A '''cubemap''' is a texture that represents a three-dimensional rendering of an area. {{source2|4.1}} has {{ent|env_cubemap|engine=source2}} and/or {{ent|env_cubemap_box}} entities as sampling points to generate these textures, which are then integrated into the [[VPK|map file]]. <!-- old stuff for S1 commented out. !!! Cubemaps, when [[#Building cubemaps|built]], are reflected on materials that use the [[$envmap]] parameter (surfaces such as reflective glass, tiles, water, etc.) A map without built or existing '''env_cubemap''' or '''env_cubemap_box''' entities will instead use other kinds of "reflections" that don't properly depict it. --> Cubemaps in Source 2 are also [[Parallax Corrected Cubemaps|parallax corrected]] if {{code|env_cubemap_box}} is used.
A '''cubemap''' is a texture that represents a three-dimensional rendering of an area. {{source2|4.1}} has {{ent|env_cubemap|engine=source2}}, {{ent|env_cubemap_box}} and/or [[#Entities|other cubemap entities]] as sampling points to generate these textures, which are then integrated into the [[VPK|map file]]. <!-- old stuff for S1 commented out. !!! Cubemaps, when [[#Building cubemaps|built]], are reflected on materials that use the [[$envmap]] parameter (surfaces such as reflective glass, tiles, water, etc.) A map without built or existing '''env_cubemap''' or '''env_cubemap_box''' entities will instead use other kinds of "reflections" that don't properly depict it. --> Cubemaps in Source 2 are also [[Parallax Corrected Cubemaps|parallax corrected]] if {{code|env_cubemap_box}} is used.


{{Todo|Document about [[env_cubemap_fog]].}}
{{Todo|Document about [[env_cubemap_fog]].}}
== Entities ==
* {{ent|env_cubemap|engine=2}} {{only|{{svrh}} {{hla}}}}
* {{ent|env_cubemap_box}} {{only|{{svrh}} {{hla}} {{cs2}}}}
* {{ent|env_cubemap_fog}} {{only|{{svrh}} {{hla}} {{cs2}}}}
* {{ent|env_combined_light_probe_volume}} {{only|{{svrh}} {{hla}} {{cs2}}}}


==Preview==
==Preview==

Revision as of 01:55, 8 February 2025

English (en)中文 (zh)Translate (Translate)
Env cubemap.png
An example of specular reflections on some models (exaggerated through r_showenvcubemap).

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

New in Source 2 Hammer. 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.
Command Description
map map_name Loads the map; replace "map_name" with the map's actual name
buildcubemaps Begins building cubemaps.
Note.pngNote:Source 2 does not support building cubemaps with number of iterations (e.g.: buildcubemaps 2). (Confirmed on Counter-Strike 2)