This article's documentation is for anything that uses the Source engine. Click here for more information.


From Valve Developer Community
Jump to: navigation, search
English (en)Русский (ru)Español (es)中文 (zh)


VBSP VBSP is the tool that compiles a raw VMF file into Source 1's BSP format. It is generally followed by VVIS and VRAD.

VBSP will:

While the resulting BSP file can be played directly it has no visibility control (poor performance) and no lighting.

Icon-Bug.pngBug:In non-Left 4 Dead engine branch Left 4 Dead engine branch games, .mdl files that have the IDST1 header will fail to load for VBSP, see VRAD's bugs.
Icon-Bug.pngBug:In Source 2013 Source 2013 and possibly other engine branches, smoothing groups are not properly written for func_detail brush faces. This is fixed in the Slammin' Source Map Tools Slammin' VBSP and in Mapbase Mapbase' VBSP, and code for this fix can be found in pull request 391 on GitHub.
Icon-Bug.pngBug:VBSP doesn't recognize custom LightmappedGeneric shaders, and thus it won't allow VRAD to generate lightmaps for them. This is fixed in Slammin' Source Map Tools Slammin' VBSP and in Mapbase Mapbase' VBSP.
Note.pngNote:VBSP can also compile MAP files with the "mapversion" "400" KV in worldspawn.

Launch options


<vbsp.exe path> [options] <VMF File>

For example:

"Half-Life 2\bin\vbsp.exe" -onlyents sdk_trainstation_01

This will re-embed the entity block without affecting the world.

Common options

Note.pngNote:-onlyents and -keepstalezip will mark the map as stale by embedding the file stale.txt into the BSP. Loading stale maps in the engine will cause a "This map is not final!!" warning message in the console.
Turn on verbose output (also shows more command-line options). Use without any other parameters.
Only import the entities from the VMF. Brushes and internal entities are not modified. Brush Entities' boundaries will not be modified, however, their Keyvalues will be. Conserves existing lighting and vis data.
Only update static and detail props (i.e. the internal entities). Does not generate a .prt file, making VVIS fail!
Writes glview data to the VMF's directory. -tmpout will cause the files will be written to \tmp instead.
Removes func_detail brushes. The geometry left over is what affects visibility.
Get rid of water brushes.
Run as an idle-priority process.
Override the VPROJECT environment variable.
Specify the folder of the gameinfo.txt file.
Includes an extra base directory for mounting additional content (like Gameinfo.txt entries). Useful if you want to separate some assets from the mod for whatever reason.
Embed the contents of <directory> in the packfile.
Confirm:Which game introduced/removed this option, if any at all? Not present in any current games.
-instancepath<directory> (only in Portal 2: Community Edition)
Overrides InstancePath key in gameinfo.

Advanced options

-autoviscluster # (in all games since Counter-Strike: Global Offensive)
Blank image.pngTodo: Used on dz_sirocco, found in scripts/mapautocompile.txt.
Don't bring up graphical UI on vproject errors.
Control the number of threads vbsp uses (defaults to the # of processors (times 2 for Hypertreading/SMT CPU's) on your machine).
If -v is on, this disables verbose output for submodels.
Don't join face vertexes together.
Don't chop out intersecting brush areas.
Emit unique face edges instead of sharing them.
Don't fixup any t-junctions.
Don't fixup t-junctions on func_detail.
Compiles all triggers as if they were using Nodraw texture, only affects triggers using a texture with %CompileTrigger.
By default, vbsp removes the 'outer shell' of the map, which are all the faces you can't see because you can never get outside the map. -noopt disables this behavior.
Don't prune neighboring solid nodes.
Don't merge together chopped faces on nodes.
Don't merge together chopped faces on water.
Don't subdivide faces for lightmapping.
vbsp will warn when brushes are output with a volume less than this number (default: 1.0).
Mark all detail geometry as normal geometry (so all detail geometry will affect visibility).
-alldetail (only in Alien SwarmDota 2 Alien Swarm: Reactive Drop)
Convert all structural brushes to detail brushes, except func_brush entities whose names begin with structure_.
Stop processing the map if a leak is detected. Whether or not this flag is set, a leak file will be written out at <vmf filename>.lin, and it can be imported into Hammer Hammer.
-noleaktest (only in Slammin' Source Map Tools)(also in Mapbase)
Disables leaktest as it's enabled by default.
Force all surfaces to be treated as if they were bumpmaped (generating three lightmaps for the surface instead of one), regardless of if they actually are.
Snap axial planes to integer coordinates.
-block # #
Control the grid size mins that vbsp chops the level on.
Icon-Bug.pngBug:Causes VBSP to fail completely.
-blocks # # # #
Enter the mins and maxs for the grid size vbsp uses.
-blocksize<int> (in all games since Counter-Strike: Global Offensive)(also in Slammin' Source Map Tools)
Control the size of each grid square that vbsp chops the level on. Default is 1024.
Dump static props to staticprop*.txt.
Write files with collision info.
Enable vis calculations in 3D Skybox leaves.
Tip.pngTip:Use this if the 3D skybox room can be accessed without noclip.
Scale all lightmaps by this amount (default: 1.0).
Force lightmaps to be generated for all surfaces even if they don't need lightmaps.
Blank image.pngTodo: Currently unknown.
Keep the BSP's zip files intact but regenerate everything else.
-visgranularity # # # (in all games since Counter-Strike: Global Offensive)(also in Slammin' Source Map Tools)
Force visibility splits # of units along X, Y, Z.
Substitute materials according to materialsub.txt in content\maps.
Write large minidumps on crash.
Fix Physics entities fall through displacements at cost of bigger BSP size.
Treat %CompileTrigger surfaces as nodraw, and treat %CompileWater surfaces as having %CompileNoLight (but not %CompileSlime). Implies -nodrawtriggers.
-maxluxelscale (only in Slammin' Source Map Tools)
Lets you limit the maximum luxel scale in your map.
-nodefaultcubemap (only in Slammin' Source Map Tools)
Disables automatic skybox cubemap generation.
-defaultcubemap (only in Mapbase)
By default in Mapbase "dummy" cubemaps are not generated during map compilation but can be forced to generate again by this parameter.
-allowdynamicpropsasstatic (only in Garry's Mod)
Allow all models with the 'static' flag in the model viewer to be used on prop_static, even when their propdata doesn't contain 'allowstatic'.

Static Prop Combine

(in all games since Counter-Strike: Global Offensive)

Merges static props together according to the rules defined in scripts/hammer/spcombinerules/spcombinerules.txt. This lowers the number of draw calls, increasing performance. It can also be used to lower the number of static props present in a map. See Static Prop Combine.
Automatically generate static prop combine rules for props that VBSP deems should be combined.
Note.pngNote:This does not write to spcombinerules.txt.
Instead of using the distance limit, combine all props in the group that share visclusters.
Lists models sharing the same material that should be added to spcombinerules.txt.
Set the minimum number of props in a combine group required to create a combined prop.
Tip.pngTip:Valve had this set to 3 for the new Dust 2.
Confirm:Prints the combine rules? Hasn't been working for me.
Confirm:Does this color the instances?
Don't delete the autogenerated QCs and unpacked model files after finishing.
Combine props, even if they have differing Render in Fast Reflections settings.
Combine props, even if they have differing Ignore Normals settings.
Combine props, even if they have differing Disable Shadows settings.
Combine props, even if they have differing Disable Vertex lighting settings.
Combine props, even if they have differing Disable flashlight settings.
Combine props, even if they have differing Disable Self-Shadowing settings.
Combine props, even if they have differing Disable ShadowDepth settings.

Nonfunctional Options

Force it to write physics data for linux multiplayer servers. (It will automatically write this data if it finds certain entities like info_player_terrorist, info_player_deathmatch, info_player_teamspawn, info_player_axis, or info_player_coop.)
Obsolete-notext.pngDeprecated:(removed since Source 2007) All modern branches of Source use the same physics data on all platforms.
Force it to not write physics data for linux multiplayer servers, even if there are multiplayer entities in the map.
Use virtual (not precomputed) displacement collision models

Console output

Blank image.pngTodo: Add descriptions for other VBSP outputs (WriteBSP, PruneNodes, ProcessBlock_Thread, etc).

VBSP prints various information about the compile process to the console. Note that output from older versions of the tool can be different.

Patching WVT material: material path to patched WVT material
The map contains WorldVertexTransition materials that are being used on non-displacement faces. VBSP patches these materials to use a different material shader (such as LightmappedGeneric) so that they properly render on these map faces.
T-junctions are created when func_detail brushes touch world geometry. To avoid visual cracks or seams, VBSP fixes up these T-junctions.
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Detail props are being placed in the map.

See also