BSPX
BSPX is a standard for adding new lumps to id Tech 2, id Tech 3, and GoldSrc BSP files, which are used to add additional features to be used by source ports or custom renderers without breaking vanilla compatibility. As BSPX lumps are placed at the end of the BSP file, they are not loaded by vanilla engines, so a BSP with BSPX lumps is backwards compatible.
Contents
Structure
typedef struct {
char lumpname[24]; // up to 23 chars, zero-padded
int fileofs; // from file start
int filelen;
} bspx_lump_t;
typedef struct {
char id[4]; // 'BSPX'
int numlumps;
bspx_lump_t lumps[1];
} bspx_header_t;
Lumps
DECOUPLED_LM
"Decouples" lightmap scale, alignment, and rotation from those of texels.
Compile with ericw-tools using _world_units_per_luxel
KV in worldspawn or -world_units_per_luxel #
in QBSP, wherein # is the luxel scale (like in Hammer 4.x's face edit window).
The 2023 Quake II remaster uses DECOUPLED_LM with a luxel scale of 8 on all maps except for the Quake II 64 maps.
Unnecessary and possibly incompatible with Quake III's BSP format, which stores lightmaps as pages in the BSP file (or externally) instead of paginating at load time, and has no direct correlation between texel size and luxel size. Q3Map2 and some games support -lightmapsize
switch to use external TGA lightmaps, but for vanilla Quake III, use the q3map2_lightmapsize
parameter in the given material; see explanation.
LIGHTING_E5BGR9
Used for HDR lightmaps. Functions similarly to the RGBE8 lightmaps in Source, but with an additional bit of precision per color instead of having the exponent be 8 bits.
ENVMAP
Defines where cubemaps are found (Does not store the cubemaps themselves). Can be generated (alongside SURFENVMAP) from env_cubemap
entities by loading the BSP in FTE and running the mod_findcubemaps
console command.
The following FGD entry represents the expected syntax:
@PointClass color(0 0 255) iconsprite("sprites/editor/env_cubemap.spr") = env_cubemap :
"An entity that creates a sample point for the Cubic Environment Map."
[
size(choices) : "Cubemap Size" : 0 : "Resolution of the cubemap." =
[
0 : "Default"
1 : "1x1"
2 : "2x2"
4 : "4x4"
8 : "8x8"
16 : "16x16"
32 : "32x32"
64 : "64x64"
128 : "128x128"
256 : "256x256"
]
]
SURFENVMAP
Used alongside ENVMAP lump to store what cubemap index each brush surface should use.
BRUSHLIST
Store actual brush information for collision, like Quake II, Quake III, and Source, allowing for arbitrary hull sizes. This also bypasses max clipnode limits without requiring an upgraded format such as BSP2.
Only practical for clipnode-based formats like BSP29, BSP30, and BSP2 (BSP38 and derivatives store this information already).
PAKFILE
A ZIP file, used like BSP's pakfile lump. For best compatibility, should be Deflate or uncompressed, and should be the last lump in the BSP.
The name of this lump is theoretical; the only id Tech 2 source port which supports zip files embedded in the BSP is FTE, which just looks for concatenated zip files, regardless of if they are formatted as a lump.
RGBLIGHTING
Equivalent to the 24-bit lightmap lump from a BSP30. Used as an alternative for external LIT files when using BSP29 or monochromatic BSP2, while maintaining a 8-bit monochromatic fallback for Quake engines that don't support this lump.
Only practical for Quake and Hexen II engines; GoldSrc, Quake II and Quake III map files store 24-bit true color lightmaps already.
VERTEXNORMALS
Stores vertex normal data for brushes, necessary for accurate smoothing when using real-time light sources instead of prebaked lightmaps.
LIGHTINGDIR
"Deluxemaps", designed for use with normal mapped surfaces that have lightmaps. Effectively a normal map which is stored like the lightmaps.
LMSTYLE16
Todo:
Deprecated Lumps
These BSPX lumps have been deprecated by newer BSPX lumps.
LMSHIFT
Deprecated by DECOUPLED_LM
LMOFFSET
Deprecated by DECOUPLED_LM
LMSTYLE
Deprecated by LMSTYLE16