Difference between revisions of "Cubemaps"

From Team Fortress Wiki
Jump to: navigation, search
(Rewrite to better explain missing cubemaps)
Line 2: Line 2:
 
{{otherWikis|{{vdc|Cubemaps}}}}
 
{{otherWikis|{{vdc|Cubemaps}}}}
 
{{Quotation|'''The Engineer''' after successfully building new cubemaps|We did it! With a little help from Mother Science.|sound=Cm_engie_gamewon_14.mp3}}
 
{{Quotation|'''The Engineer''' after successfully building new cubemaps|We did it! With a little help from Mother Science.|sound=Cm_engie_gamewon_14.mp3}}
[[File:Env_cubemap.png|thumb|Default icon.]]
+
[[File:Env_cubemap.png|thumb|The entity icon used by [[Hammer editor|Hammer]]]]
 
'''Cubemaps''' store data about a reflective object's surroundings, and are used to correctly render its appearance. Most [[Source engine]] games rely on cubemaps, including ''Team Fortress 2''.
 
'''Cubemaps''' store data about a reflective object's surroundings, and are used to correctly render its appearance. Most [[Source engine]] games rely on cubemaps, including ''Team Fortress 2''.
  
 
== Implementation ==
 
== Implementation ==
Cubemap entities are placed at eye level (about ~64 Hammer units (Hu)) to create the most realistic reflections. If an area of a map differs in lighting or size, another cubemap is typically placed.
+
Cubemap entities are placed at eye level (about ~64 [[Hammer unit|Hu]]) to create the most realistic reflections. If an area of a map differs in lighting or size, another cubemap is needed to ensure correct reflections.
  
Once lighting is compiled and the map is running, the map author uses the console command "buildcubemaps" to generate the reflections.
+
Once lighting is compiled and the map is running, the map author uses the console command {{code|buildcubemaps}} to generate the reflections.
  
 
== Missing cubemaps ==
 
== Missing cubemaps ==
If no cubemap entities are placed in a map and built, reflections default to the [[skybox]] texture or to a purple and black checkerboard pattern. This issue is common in maps that are still under development, although mapmakers sometimes use more palatable placeholder/dummy textures.
+
If no cubemap entities are placed in a map or the cubemaps aren't built, reflections are supposed to default to the [[skybox]] texture. This issue is common in maps that are still under development.
  
There is no default cubemap in ''Team Fortress 2'' ''per se'', and therefore it must be built manually when necessary. This is usually achieved by entering {{cvar|buildcubemaps}} in console when mapmaking, for example.
+
Because of a bug in [[vdc:VBSP|VBSP]], the skyboxes in ''Team Fortress 2'' can't be used as the default cubemap, and therefore the engine falls back to the missing texture pink checkerboard texture. This makes it glaringly obvious when the cubemaps have not been built and complicates building the cubemaps by requiring specular reflections disabled ({{cvar|mat_specular}}) to avoid the ugly reflections being saved in the built cubemaps.

Revision as of 02:08, 13 March 2019

We did it! With a little help from Mother Science.
The Engineer after successfully building new cubemaps
The entity icon used by Hammer

Cubemaps store data about a reflective object's surroundings, and are used to correctly render its appearance. Most Source engine games rely on cubemaps, including Team Fortress 2.

Implementation

Cubemap entities are placed at eye level (about ~64 Hu) to create the most realistic reflections. If an area of a map differs in lighting or size, another cubemap is needed to ensure correct reflections.

Once lighting is compiled and the map is running, the map author uses the console command buildcubemaps to generate the reflections.

Missing cubemaps

If no cubemap entities are placed in a map or the cubemaps aren't built, reflections are supposed to default to the skybox texture. This issue is common in maps that are still under development.

Because of a bug in VBSP, the skyboxes in Team Fortress 2 can't be used as the default cubemap, and therefore the engine falls back to the missing texture pink checkerboard texture. This makes it glaringly obvious when the cubemaps have not been built and complicates building the cubemaps by requiring specular reflections disabled (mat_specular) to avoid the ugly reflections being saved in the built cubemaps.