Template:Archived Page History/Cubemaps/en: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (clean up, replaced: {{ModernTip| → {{tip| (4), {{ModernWarning| → {{warning| (4), {{ModernNote| → {{note| (9), {{ModernWorkaround| → {{workaround| (3))
Line 8: Line 8:
{{todo|Document {{ent|building_cubemaps}} cvar. Seems to disable bloom while HDR is enabled? No apparent function in SDR mode. It resets to 0 after cubemaps are built.}}
{{todo|Document {{ent|building_cubemaps}} cvar. Seems to disable bloom while HDR is enabled? No apparent function in SDR mode. It resets to 0 after cubemaps are built.}}
Building cubemaps is the process of generating their textures to then use them as reflections. For technical reasons, this process is not automated and is up to the user to do so; until then, existing '''env_cubemaps''' will remain unused and the map, depending on the game, will display either generic or "missing" textures as reflections due to nonexistent cubemaps.
Building cubemaps is the process of generating their textures to then use them as reflections. For technical reasons, this process is not automated and is up to the user to do so; until then, existing '''env_cubemaps''' will remain unused and the map, depending on the game, will display either generic or "missing" textures as reflections due to nonexistent cubemaps.
{{ModernWarning|To build cubemaps, your game's screen resolution needs to be at least 4 times higher than the highest [[env cubemap#Keyvalues|size]] of an existing '''env_cubemap''', or else attempting to build them will either fail or even cause the game to crash. For example: if the highest '''env_cubemap''' sizes 128x128, a resolution of 512x512 will be needed. (''128 × 4 = '''512''' -> 720x576 or higher'')}}
{{warning|To build cubemaps, your game's screen resolution needs to be at least 4 times higher than the highest [[env cubemap#Keyvalues|size]] of an existing '''env_cubemap''', or else attempting to build them will either fail or even cause the game to crash. For example: if the highest '''env_cubemap''' sizes 128x128, a resolution of 512x512 will be needed. (''128 × 4 = '''512''' -> 720x576 or higher'')}}
{{ModernNote|Newly-built cubemaps will display after relaunching the game or changing aspect ratios.}}
{{note|Newly-built cubemaps will display after relaunching the game or changing aspect ratios.}}
{{ModernNote|Its possible the game may appear to freeze during building of cubemaps. But it keeps on building cubemaps in the background. Be patient and do not close the game, or unfocus the game (Alt-Tabbing) as it may cause the game to crash. }}
{{note|Its possible the game may appear to freeze during building of cubemaps. But it keeps on building cubemaps in the background. Be patient and do not close the game, or unfocus the game (Alt-Tabbing) as it may cause the game to crash. }}
{{ModernTip|Maxing out the game's visual settings before building cubemaps will generate their textures in the best-possible quality for the '''env_cubemaps'''<nowiki>'</nowiki> size.}}
{{tip|Maxing out the game's visual settings before building cubemaps will generate their textures in the best-possible quality for the '''env_cubemaps'''<nowiki>'</nowiki> size.}}
{{ModernTip|The <code>buildcubemaps</code> command optionally accepts the number of iterations to perform. For example, <code>buildcubemaps 2 </code> will build cubemaps twice. This is useful when recursive reflections are needed to look correct, e.g. two buildings reflecting each other.
{{tip|The <code>buildcubemaps</code> command optionally accepts the number of iterations to perform. For example, <code>buildcubemaps 2 </code> will build cubemaps twice. This is useful when recursive reflections are needed to look correct, e.g. two buildings reflecting each other.
{{Bug|Currently in {{p2ce}}, this does not work properly. To work around this, run buildcubemaps, let the map reload, then run the command again.}}}}
{{Bug|Currently in {{p2ce}}, this does not work properly. To work around this, run buildcubemaps, let the map reload, then run the command again.}}}}
{{ModernWarning|Games running on Vulkan, like {{l4d2}}, will not pause the screen during building cubemaps, but the screen will violently flash black and white. But you must not alt tab out of this process to stop the flashing. If you are prone to epileptic seizures you should either look away or walk away from the computer.}}
{{warning|Games running on Vulkan, like {{l4d2}}, will not pause the screen during building cubemaps, but the screen will violently flash black and white. But you must not alt tab out of this process to stop the flashing. If you are prone to epileptic seizures you should either look away or walk away from the computer.}}
{{ModernWarning|If you had used the command <code>Nav_Show_Ladder_Bounds</code> before building a cubemap, the green boxes will also be baked into the cubemap.}}
{{warning|If you had used the command <code>Nav_Show_Ladder_Bounds</code> before building a cubemap, the green boxes will also be baked into the cubemap.}}
{{ModernNote|Lights enable sprite that use texture <code>engine/lightsprite</code> while building cubemaps. Only in {{Strata|4}} games you can disable sprite manually for each light (by default sprite is disabled in {{Strata|4}} games). To remove this sprite in other games you'll need to rewrite <code>.vmt</code> of the texture.}}
{{note|Lights enable sprite that use texture <code>engine/lightsprite</code> while building cubemaps. Only in {{Strata|4}} games you can disable sprite manually for each light (by default sprite is disabled in {{Strata|4}} games). To remove this sprite in other games you'll need to rewrite <code>.vmt</code> of the texture.}}
=== Before building ===
=== Before building ===
{{ModernTip|Maps for {{css}}'''Counter-Strike: Source''' and some other games are known for including pre-built, blank cubemaps after being compiled (even if there are no '''env_cubemaps''' in them). It is recommended to delete these cubemaps before building new ones, as explained [[#Deleting cubemaps|here]].}}
{{tip|Maps for {{css}}'''Counter-Strike: Source''' and some other games are known for including pre-built, blank cubemaps after being compiled (even if there are no '''env_cubemaps''' in them). It is recommended to delete these cubemaps before building new ones, as explained [[#Deleting cubemaps|here]].}}
{{ModernTip|It is recommended that you disable any addons (especially on {{gmod|4}}) prior to building cubemaps for both LDR and HDR, as it will significantly speeds up loading times.}}
{{tip|It is recommended that you disable any addons (especially on {{gmod|4}}) prior to building cubemaps for both LDR and HDR, as it will significantly speeds up loading times.}}


=== LDR ===
=== LDR ===
{{ModernNote|This step does not apply to {{l4d}} '''Left 4 Dead''' and {{csgo}}'''Counter-Strike: Global Offensive''' as its maps are compiled in [[#HDR|HDR mode]] only.}}
{{note|This step does not apply to {{l4d}} '''Left 4 Dead''' and {{csgo}}'''Counter-Strike: Global Offensive''' as its maps are compiled in [[#HDR|HDR mode]] only.}}
Building cubemaps on a map compiled in '''LDR''' (''Low Dynamic Range'') mode will generate textures only for that mode, regardless of your game's ''High Dynamic Range'' video setting. To build the cubemaps, submit the following commands into the game's console:
Building cubemaps on a map compiled in '''LDR''' (''Low Dynamic Range'') mode will generate textures only for that mode, regardless of your game's ''High Dynamic Range'' video setting. To build the cubemaps, submit the following commands into the game's console:
{| class="wikitable"
{| class="wikitable"
Line 82: Line 82:
=== Half-Life: Source ===
=== Half-Life: Source ===
{{ModernBug|Building cubemaps in {{hls}}'''Half-Life: Source''' is currently not possible as their textures, despite being generated, aren't embedded into the map file afterward.
{{ModernBug|Building cubemaps in {{hls}}'''Half-Life: Source''' is currently not possible as their textures, despite being generated, aren't embedded into the map file afterward.
{{ModernWorkaround|Move the map file into the "maps" folder of a game of the same engine branch (such as {{hl2}}'''Half-Life 2'''), build its cubemaps in that game, then move the file back into '''Half-Life: Source'''<nowiki>'</nowiki>s folder.}}}}
{{workaround|Move the map file into the "maps" folder of a game of the same engine branch (such as {{hl2}}'''Half-Life 2'''), build its cubemaps in that game, then move the file back into '''Half-Life: Source'''<nowiki>'</nowiki>s folder.}}}}


=== Portal 2 ===
=== Portal 2 ===
{{ModernBug|Building cubemaps in {{portal2}}'''Portal 2''' will fail if the BSP is not in the highest-numbered DLC folder (dlc2 by default).
{{ModernBug|Building cubemaps in {{portal2}}'''Portal 2''' will fail if the BSP is not in the highest-numbered DLC folder (dlc2 by default).
{{ModernWorkaround|Either manually move the map there first, edit the "'''place compiled maps in this directory before running the game'''" option in the [[Hammer_Build_Programs|Build Programs]] options tab to do so automatically, or create a {{path|portal2_dlc3}} folder, create a {{path|maps}} folder in that folder, and put all your custom maps in there. The game will automatically recognize the dlc3 folder, so no gameinfo editing is necessary}}}}
{{workaround|Either manually move the map there first, edit the "'''place compiled maps in this directory before running the game'''" option in the [[Hammer_Build_Programs|Build Programs]] options tab to do so automatically, or create a {{path|portal2_dlc3}} folder, create a {{path|maps}} folder in that folder, and put all your custom maps in there. The game will automatically recognize the dlc3 folder, so no gameinfo editing is necessary}}}}


=== Source Filmmaker ===
=== Source Filmmaker ===
[[Image:Cubemap_bug_sfm.jpg|thumb|right|300px|Improper rendering of an HDR cubemap's face in Source Filmmaker.]]
[[Image:Cubemap_bug_sfm.jpg|thumb|right|300px|Improper rendering of an HDR cubemap's face in Source Filmmaker.]]
{{ModernBug|'''HDR''' cubemaps sizing lower than 128x128 built in {{tf2}}'''Team Fortress 2''' and some other games usually display graphical artifacts on reflections due to the last face of each cubemap not rendering properly in {{sfm}}'''Source Filmmaker'''. While rebuilding cubemaps in it would normally fix the issue, it is currently not possible to do so as '''Source Filmmaker''' generates blank textures.
{{ModernBug|'''HDR''' cubemaps sizing lower than 128x128 built in {{tf2}}'''Team Fortress 2''' and some other games usually display graphical artifacts on reflections due to the last face of each cubemap not rendering properly in {{sfm}}'''Source Filmmaker'''. While rebuilding cubemaps in it would normally fix the issue, it is currently not possible to do so as '''Source Filmmaker''' generates blank textures.
{{ModernWorkaround|If recompiling a special version of an affected map with '''env_cubemaps''' now sizing 128x128 is not an option, move the map file into {{as}}'''Alien Swarm'''<nowiki>'</nowiki>s "maps" folder, build its cubemaps in that game, then move the file back into '''Source Filmmaker'''<nowiki>'</nowiki>s folder.}}}}
{{workaround|If recompiling a special version of an affected map with '''env_cubemaps''' now sizing 128x128 is not an option, move the map file into {{as}}'''Alien Swarm'''<nowiki>'</nowiki>s "maps" folder, build its cubemaps in that game, then move the file back into '''Source Filmmaker'''<nowiki>'</nowiki>s folder.}}}}
{{ModernNote|'''Alien Swarm'''<nowiki>'</nowiki>s "gameinfo.txt" file needs to be edited for this procedure so that the game can have access to assets used by other games' maps not to build cubemaps with missing textures or models. The file's "SearchPaths" section should be like this:}}
{{note|'''Alien Swarm'''<nowiki>'</nowiki>s "gameinfo.txt" file needs to be edited for this procedure so that the game can have access to assets used by other games' maps not to build cubemaps with missing textures or models. The file's "SearchPaths" section should be like this:}}
  "SearchPaths"
  "SearchPaths"
  {
  {
Line 103: Line 103:
  '''"Game" "..\SourceFilmmaker\game\hl2"'''
  '''"Game" "..\SourceFilmmaker\game\hl2"'''
  }
  }
{{ModernNote|{{tf2}}'''Team Fortress 2''' configurations were used for the example; consider replacing game subfolders (only those within '''Source Filmmaker''' paths) with the ones needed.}}
{{note|{{tf2}}'''Team Fortress 2''' configurations were used for the example; consider replacing game subfolders (only those within '''Source Filmmaker''' paths) with the ones needed.}}


== Deleting cubemaps ==
== Deleting cubemaps ==
Line 109: Line 109:
  ..\..\bin\bspzip -deletecubemaps mapname.bsp
  ..\..\bin\bspzip -deletecubemaps mapname.bsp
{{note|Replace "''mapname''" with the map's actual name.}}
{{note|Replace "''mapname''" with the map's actual name.}}
{{ModernWarning|Deleting cubemaps actually deletes all the texture ("[[Valve Texture Format|.vtf]]") files embedded into the map at the time, so it's recommended not to embed custom textures before deleting cubemaps.}}
{{warning|Deleting cubemaps actually deletes all the texture ("[[Valve Texture Format|.vtf]]") files embedded into the map at the time, so it's recommended not to embed custom textures before deleting cubemaps.}}
{{modernBug|(tested in {{src13mp}}){{code|-deletecubemaps}} may actually delete the entire PAKFILE lump, rendering the map broken! Use {{vide|4}} instead.}}
{{modernBug|(tested in {{src13mp}}){{code|-deletecubemaps}} may actually delete the entire PAKFILE lump, rendering the map broken! Use {{vide|4}} instead.}}
{{confirm|Deleting {{file|cubemapdefault|vtf}} and {{file|cubemapdefault.hdr|vtf}} might mess building the other cubemaps....}}
{{confirm|Deleting {{file|cubemapdefault|vtf}} and {{file|cubemapdefault.hdr|vtf}} might mess building the other cubemaps....}}
Line 116: Line 116:
In cases where a map has to be recompiled with minor changes and its built cubemaps vanish as a result, extracting them beforehand will make it not necessary to go through the whole cubemap-building process again until it actually becomes so. To extract its cubemaps with '''BSPZIP''', create a folder that will contain the extracted cubemaps inside the "maps" one, then execute the following command:
In cases where a map has to be recompiled with minor changes and its built cubemaps vanish as a result, extracting them beforehand will make it not necessary to go through the whole cubemap-building process again until it actually becomes so. To extract its cubemaps with '''BSPZIP''', create a folder that will contain the extracted cubemaps inside the "maps" one, then execute the following command:
  ..\..\bin\bspzip -extractcubemaps mapname.bsp "foldername"
  ..\..\bin\bspzip -extractcubemaps mapname.bsp "foldername"
{{ModernNote|Replace "''mapname''" with the map's actual name, and "''foldername''" with the actual name of the folder to extract cubemaps into.}}
{{note|Replace "''mapname''" with the map's actual name, and "''foldername''" with the actual name of the folder to extract cubemaps into.}}




Line 131: Line 131:
  materials/maps/mapname/cubemapdefault.vtf
  materials/maps/mapname/cubemapdefault.vtf
  '''foldername\materials\maps\mapname\cubemapdefault.vtf'''
  '''foldername\materials\maps\mapname\cubemapdefault.vtf'''
{{ModernNote|Replace "''mapname''" with the map's actual name, the cubemaps' filenames with correct ones, and "''foldername''" with the actual name of the folder that contains the extracted cubemaps.}}
{{note|Replace "''mapname''" with the map's actual name, the cubemaps' filenames with correct ones, and "''foldername''" with the actual name of the folder that contains the extracted cubemaps.}}
A file requires two dedicated lines (paths): the first line represents the path it will use within the map file, while the second one is the actual location of the file to embed into the map file. Relative location paths were used for the example, but they can also be absolute. Once the text file is ready, execute the following command:
A file requires two dedicated lines (paths): the first line represents the path it will use within the map file, while the second one is the actual location of the file to embed into the map file. Relative location paths were used for the example, but they can also be absolute. Once the text file is ready, execute the following command:
  ..\..\bin\bspzip -addlist mapname.bsp textfile.txt newmapname.bsp
  ..\..\bin\bspzip -addlist mapname.bsp textfile.txt newmapname.bsp
{{ModernNote|Replace "''mapname''" with the map's actual name, "''textfile''" with the text file's actual name, and "''newmapname''" with either the map's actual name, or a new name not to overwrite the original file (and instead create a separate one).}}
{{note|Replace "''mapname''" with the map's actual name, "''textfile''" with the text file's actual name, and "''newmapname''" with either the map's actual name, or a new name not to overwrite the original file (and instead create a separate one).}}
== Renaming a map ==
== Renaming a map ==
Built cubemaps are saved into a folder within the map file that uses its name; renaming it will cause the cubemaps not to load alongside the map, and therefore it will act as if there were none. To fix that, either delete then rebuild the cubemaps, or extract then embed them back (with their folder's name matching that of the map).
Built cubemaps are saved into a folder within the map file that uses its name; renaming it will cause the cubemaps not to load alongside the map, and therefore it will act as if there were none. To fix that, either delete then rebuild the cubemaps, or extract then embed them back (with their folder's name matching that of the map).

Revision as of 00:15, 4 January 2024

Flag-white.pngEnglish (en)
Env cubemap.png
Specular reflections on props
(exaggerated using r_showenvcubemap)

A cubemap is a texture that represents a three-dimensional rendering of an area. The Source Engine uses env_cubemap entities as sampling points to generate these textures, which are then automatically embedded into the map file. Cubemaps, when built, are reflected on surfaces that use the $envmap parameter (with env_cubemap as its value).


Building cubemaps

Todo: Document building_cubemaps cvar. Seems to disable bloom while HDR is enabled? No apparent function in SDR mode. It resets to 0 after cubemaps are built.

Building cubemaps is the process of generating their textures to then use them as reflections. For technical reasons, this process is not automated and is up to the user to do so; until then, existing env_cubemaps will remain unused and the map, depending on the game, will display either generic or "missing" textures as reflections due to nonexistent cubemaps.

Warning.pngWarning:To build cubemaps, your game's screen resolution needs to be at least 4 times higher than the highest size of an existing env_cubemap, or else attempting to build them will either fail or even cause the game to crash. For example: if the highest env_cubemap sizes 128x128, a resolution of 512x512 will be needed. (128 × 4 = 512 -> 720x576 or higher)
Note.pngNote:Newly-built cubemaps will display after relaunching the game or changing aspect ratios.
Note.pngNote:Its possible the game may appear to freeze during building of cubemaps. But it keeps on building cubemaps in the background. Be patient and do not close the game, or unfocus the game (Alt-Tabbing) as it may cause the game to crash.
Tip.pngTip:Maxing out the game's visual settings before building cubemaps will generate their textures in the best-possible quality for the env_cubemaps' size.
Tip.pngTip:The buildcubemaps command optionally accepts the number of iterations to perform. For example, buildcubemaps 2 will build cubemaps twice. This is useful when recursive reflections are needed to look correct, e.g. two buildings reflecting each other.
Icon-Bug.pngBug:Currently in Portal 2: Community Edition, this does not work properly. To work around this, run buildcubemaps, let the map reload, then run the command again.  [todo tested in ?]
Warning.pngWarning:Games running on Vulkan, like Left 4 Dead 2, will not pause the screen during building cubemaps, but the screen will violently flash black and white. But you must not alt tab out of this process to stop the flashing. If you are prone to epileptic seizures you should either look away or walk away from the computer.
Warning.pngWarning:If you had used the command Nav_Show_Ladder_Bounds before building a cubemap, the green boxes will also be baked into the cubemap.
Note.pngNote:Lights enable sprite that use texture engine/lightsprite while building cubemaps. Only in Strata Source Strata Source games you can disable sprite manually for each light (by default sprite is disabled in Strata Source Strata Source games). To remove this sprite in other games you'll need to rewrite .vmt of the texture.

Before building

Tip.pngTip:Maps for Counter-Strike: SourceCounter-Strike: Source and some other games are known for including pre-built, blank cubemaps after being compiled (even if there are no env_cubemaps in them). It is recommended to delete these cubemaps before building new ones, as explained here.
Tip.pngTip:It is recommended that you disable any addons (especially on Garry's Mod Garry's Mod) prior to building cubemaps for both LDR and HDR, as it will significantly speeds up loading times.

LDR

Note.pngNote:This step does not apply to Left 4 Dead Left 4 Dead and Counter-Strike: Global OffensiveCounter-Strike: Global Offensive as its maps are compiled in HDR mode only.

Building cubemaps on a map compiled in LDR (Low Dynamic Range) mode will generate textures only for that mode, regardless of your game's High Dynamic Range video setting. To build the cubemaps, submit the following commands into the game's console:

Command Description
mat_specular 0 Disables reflections. Required to properly build cubemaps
map cs_mymap Loads a map; replace "cs_mymap" with the map's actual name
sv_cheats 1 Enables the use of cheat commands. Required to build cubemaps
buildcubemaps Starts building cubemaps. Optionally, specify the number of iterations (default is 1)
disconnect Unloads the map, returning you to the main menu
mat_specular 1 Enables reflections
quit (optional) Closes the game. Relaunching it is required to display newly-built cubemaps


HDR

Building cubemaps on a map compiled with HDR support needs to be done twice - once for each mode (HDR and LDR). As opposed to a LDR map's case, your game's High Dynamic Range video setting has to be set to "Full" to build HDR cubemaps, and to "None" to build LDR ones. To build the cubemaps, submit the following commands into the game's console:

Command Description
mat_specular 0 Disables reflections. Required to properly build cubemaps
map cs_mymap Loads a map; replace "cs_mymap" with the map's actual name
sv_cheats 1 Enables the use of cheat commands. Required to build cubemaps
buildcubemaps Starts building cubemaps. Optionally, specify the number of iterations (default is 1)
disconnect Unloads the map, returning you to the main menu
sv_cheats 0 Disables cheat commands. Prevents command mat_reloadallmaterials from unnecessarily self-executing and briefly freezing the game
mat_hdr_level 0 Switches to LDR mode (from HDR); submit mat_hdr_level 2 instead if LDR cubemaps were built first
map cs_mymap Loads the map again to build cubemaps for the new mode
sv_cheats 1
buildcubemaps Starts building cubemaps for the new mode. Optionally, specify the number of iterations (default is 1)
disconnect
mat_specular 1 Enables reflections
mat_hdr_level 0/1/2 If necessary, switches back to the mode it was before having submitted mat_hdr_level 0/2
quit (optional) Closes the game. Relaunching it is required to display newly-built cubemaps


Half-Life: Source

Template:ModernBug

Portal 2

Template:ModernBug

Source Filmmaker

Improper rendering of an HDR cubemap's face in Source Filmmaker.

Template:ModernBug

Note.pngNote:Alien Swarm's "gameinfo.txt" file needs to be edited for this procedure so that the game can have access to assets used by other games' maps not to build cubemaps with missing textures or models. The file's "SearchPaths" section should be like this:
"SearchPaths"
{
	"Game"	"|gameinfo_path|."
	"Game"	"swarm_base"
	"Game"	"platform"
	"Game" "..\SourceFilmmaker\game\usermod"
	"Game" "..\SourceFilmmaker\game\tf_movies"
	"Game" "..\SourceFilmmaker\game\tf"
	"Game" "..\SourceFilmmaker\game\hl2"
}
Note.pngNote:Team Fortress 2Team Fortress 2 configurations were used for the example; consider replacing game subfolders (only those within Source Filmmaker paths) with the ones needed.

Deleting cubemaps

Several tools make it possible to delete unnecessary or outdated cubemaps; of them all, BSPZIP not only is an official one, but is also the easiest and safest option for this procedure without potentially corrupting the map. To delete the cubemaps, execute the following command within the "maps" folder:

..\..\bin\bspzip -deletecubemaps mapname.bsp
Note.pngNote:Replace "mapname" with the map's actual name.
Warning.pngWarning:Deleting cubemaps actually deletes all the texture (".vtf") files embedded into the map at the time, so it's recommended not to embed custom textures before deleting cubemaps.

Template:ModernBug

Confirm:Deleting 🖿cubemapdefault.vtf and 🖿cubemapdefault.hdr.vtf might mess building the other cubemaps....

Extracting cubemaps

In cases where a map has to be recompiled with minor changes and its built cubemaps vanish as a result, extracting them beforehand will make it not necessary to go through the whole cubemap-building process again until it actually becomes so. To extract its cubemaps with BSPZIP, create a folder that will contain the extracted cubemaps inside the "maps" one, then execute the following command:

..\..\bin\bspzip -extractcubemaps mapname.bsp "foldername"
Note.pngNote:Replace "mapname" with the map's actual name, and "foldername" with the actual name of the folder to extract cubemaps into.


Embedding cubemaps

To make a map use extracted cubemaps, create a text file that will be used by BSPZIP - the file should be created inside the "maps" folder, and will contain paths to the files to embed into the map file. The file's content should be like this:

materials/maps/mapname/c-128_384_64.hdr.vtf
foldername\materials\maps\mapname\c-128_384_64.hdr.vtf
materials/maps/mapname/c-128_384_64.vtf
foldername\materials\maps\mapname\c-128_384_64.vtf
materials/maps/mapname/c448_-256_64.hdr.vtf
foldername\materials\maps\mapname\c448_-256_64.hdr.vtf
materials/maps/mapname/c448_-256_64.vtf
foldername\materials\maps\mapname\c448_-256_64.vtf
materials/maps/mapname/cubemapdefault.vtf
foldername\materials\maps\mapname\cubemapdefault.vtf
Note.pngNote:Replace "mapname" with the map's actual name, the cubemaps' filenames with correct ones, and "foldername" with the actual name of the folder that contains the extracted cubemaps.

A file requires two dedicated lines (paths): the first line represents the path it will use within the map file, while the second one is the actual location of the file to embed into the map file. Relative location paths were used for the example, but they can also be absolute. Once the text file is ready, execute the following command:

..\..\bin\bspzip -addlist mapname.bsp textfile.txt newmapname.bsp
Note.pngNote:Replace "mapname" with the map's actual name, "textfile" with the text file's actual name, and "newmapname" with either the map's actual name, or a new name not to overwrite the original file (and instead create a separate one).

Renaming a map

Built cubemaps are saved into a folder within the map file that uses its name; renaming it will cause the cubemaps not to load alongside the map, and therefore it will act as if there were none. To fix that, either delete then rebuild the cubemaps, or extract then embed them back (with their folder's name matching that of the map).

Todo: Ficool2 has a tool that can automate this.

See also