Skip to content
This repository was archived by the owner on Dec 24, 2023. It is now read-only.

tmp64/BSPRenderer

Repository files navigation

BSPRenderer

This is a Half-Life 1 BSP loader and renderer written in C++ and OpenGL 3.3 Core. It was designed to be later hacked into intergrated into Xash3D or GoldSrc.

The project is made up from several static libraries and executables.

Name Purpose Docs
appfw Utility library the provides dev console, platform info. Link
bsp Library for reading BSP and WAD files. Link
renderer Provides rendering of BSP world surfaces as well as text rendering. Link
bspviewer A utility for opening BSP maps and viewing them. Used to test the renderer. Link
rad Radiosity simulator for generating cutom lightmaps. Not yet finished. -

You can find documentation for individual projects in their directory in /src/.

Build requirements

  • OpenGL mathematics library (GLM)
  • SDL2 library
  • Freetype library

Note: code is designed to be portable but was only tested on Windows with Visual Studio 2017. Some patches may be required.

Lighting

Renderer doesn't load lightmaps stored in .bsp file like the GoldSrc engine does. Instead it loads custom lightmaps generated by rad utility. However, the utility is only half-done and has a lot of problems.

  • VIS data embeded into BSP file is not used. On any non-tiny maps it would eat all available RAM and crash.
  • Visibility between patches is not checked. That means there are no shadows. See BSPTree::recursiveTraceLine in rad/src/bsp_tree.cpp for details.
  • It doesn't read texture color for proper lighting simulation.
  • Completely single-threaded.
  • All settings (patch size, map name, bounce count) are hardcoded in rad/src/main.cpp.
  • Extremely slow in debug build.

When lightmap data is not available, there is r_fullbright 1 which disables lighting and shows everything in max brightness and r_fullbright 4 which enables basic direct lighting.

Screenshots

Crossfire with basic lighting

Preview of custom lighting

Preview of custom lighting (lightmap only)

Credits

A lot of rendering code is based on Xash3D so thanks to everyone who worked on it. Also thanks to id Software for open-sourcing Quake engine code which helped massively.

About

Half-Life 1 map renderer in C++ and OpenGL 3.3 Core

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published