vbsp

Crates.iovbsp
lib.rsvbsp
version0.9.1
created_at2022-02-18 19:54:05.311766+00
updated_at2025-04-19 16:50:40.515083+00
descriptionRust parser for valve bsp files.
homepagehttps://github.com/icewind1991/vbsp
repositoryhttps://github.com/icewind1991/vbsp
max_upload_size
id534855
size124,054
Robin Appelman (icewind1991)

documentation

README

VBSP

Rust parser for valve bsp files.

Mainly tested with Team Fortress 2 and Counter Strike Source files, other source games using bsp versions 19, 20 or 21 might also work.

Adding other sourcemod variants should be fairly straight forward and pull requests for them are welcome.

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.

Commit count: 205

cargo fmt