BSPX

From Valve Developer Community
Jump to navigation Jump to search
Wikipedia - Letter.png
This article has not been added to any content Wikipedia icon categories. Please help out by Wikipedia icon adding categories.

Stub

This article or section is a stub. You can help by expanding it.

BSPX is a standard for adding new lumps to id Tech 2 id Tech 2, id Tech 3 id Tech 3, and GoldSrc 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.

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

Todo: other lumps; see FTE and Ericw-tools source codes

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 Hammer 4.x's face edit window).

The 2023 Quake II Quake II remaster uses DECOUPLED_LM with a luxel scale of 8 on all maps except for the Quake II 64 maps.

LIGHTING_E5BGR9

Used for HDR lightmaps. Functions similarly to the RGBE8 lightmaps in Source 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 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 II, Quake III Quake III, and Source 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).

External links