ArturAiwasan / hlbsp-converter

Half-Life bsp map to gltf converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hlbsp-converter

A tool to convert bsp maps (Half-Life and other GoldSrc games) into glTF scenes.

Key features:

  • Export embedded texture, and optionally from wads
  • Lightmaps!
  • Option to exclude sky polygons
  • BSP31 support (Xash3D)
  • Basic VBSP support (Source Engine)
  • Extract all textures from wad as pngs

Usage

To export map

./bsp-converter <path/to/map.bsp> [options]

or

./bsp-converter <map-name> -game <path/to/game/dir/> [options]

To extract textures from wad

./bsp-converter path/to/file.bsp

To convert vtf texture to png

./bsp-converter path/to/file.vtf

Options

  • -lm <number> - set a maximum lightmap atlas size (default 2048). Actual size is calculated based on surfaces and can be smaller.
  • -skip_sky - exclude polygons with 'sky' texture from export
  • -lstyle <number>|all|merge - export lightmap with a specified lightstyle index or all lightyles, or merge into one.
  • -uint16 - sets index buffer type to usigned short. Useful for old mobile GPU without GL_OES_element_index_uint. Will split models into smaller meshes if required.
  • -tex - export all textures, including loaded from wads.
  • -game <path> - directory containing "maps" dir and .wad files
  • -v - verbose log

Extras

Project also contains:

  • plugin for Blender automating lightmap materials setup.
  • Some shaders for Unity to add custom lightmaps

Dependencies (already included)

Acknowledgments

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Half-Life bsp map to gltf converter

License:MIT License


Languages

Language:C++ 65.8%Language:C 33.7%Language:ShaderLab 0.2%Language:Python 0.2%Language:CMake 0.0%