This article's documentation is for the "GoldSrc" engine. Click here for more information.
Quake1-16px.png
Quake2-16px.png
Quake3-16px.png

BSPX

From Valve Developer Community
Jump to: navigation, search

Stub

This article or section is a stub. You can help by adding to 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

Blank image.pngTodo: More info; see FTE 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).

PAKFILE

A ZIP file, used like Source BSP's pakfile lump. For best compatibility, should be Wikipedia icon Deflate or uncompressed, and should be the last lump in the BSP.

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 Quake and Hexen II Hexen II engines; GoldSrc GoldSrc, Quake II 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" for use with normal mapped surfaces that have lightmaps.

Confirm.pngConfirm: Is this effectively the same as Source Source's bumped lightmaps? (just with OpenGL normals instead of DirectX normals)

LMSTYLE16

Blank image.pngTodo:

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

External links