7 releases (breaking)

0.6.0 Aug 29, 2024
0.5.0 Dec 27, 2023
0.4.1 Dec 21, 2023
0.3.0 Dec 20, 2023
0.1.0 Feb 18, 2022

#248 in Game dev

Download history 24/week @ 2024-07-29 139/week @ 2024-08-26 16/week @ 2024-09-16 32/week @ 2024-09-23 23/week @ 2024-09-30

71 downloads per month
Used in tf-asset-loader

MIT license

110KB
3K SLoC

VBSP

Rust parser for valve bsp files.

Currently only supports the tf2 version of bsp files, but adding other sourcemod variants should be fairly straight forward.

Example usage

fn main() -> Result<(), vbsp::BspError> {
    let data = std::fs::read("maps/cp_steel.bsp")?;
    let bsp = vbsp::Bsp::read(&data)?;
    println!("{:?}", bsp);

    Ok(())
}

See vbsp-to-gltf or vbspviewer for some more examples of how to use the bsp data.

TODO

  • smooth normals for displacements
  • smooth normals for faces

Credits

This project is adapted from the quake bsp parser and wouldn't be possible without information from the source engine wiki.

Dependencies

~10MB
~158K SLoC