Skip to content

Latest commit

 

History

History
104 lines (77 loc) · 5.11 KB

README.md

File metadata and controls

104 lines (77 loc) · 5.11 KB

Build Linux GCC Build Linux Clang Build with Windows MinGW (MSYS2)
Note: it takes 30 minutes to build all three, so not every commit is tested to save actions minutes

Lum

Lum is a voxel* renderer** built with Vulkan. Currently, it's only available in a form of C99/C++ API, but might (on request) be ported (in form of bindings) into Unity / Unreal / languages that support C interop. Currently, it is also in process of porting to Rust (in pure Rust form).

* Note: In Lum, "voxel" refers to a small, grid-aligned cube with a single material. Lum expects you to group voxels into blocks and blocks into world, but also supports non-grid-aligned models at a minor performance cost.
** Note: Lum also has ECS (check it out!), input, Ui, meshloader (and will have voxel physics engine), but it's stil mostly GPU code - so it's called renderer

If you have ideas or suggestions for the API, feel free to open an issue
Note: Lum is not production-ready. It is slowly getting polished (via making an actual game), but some core features are missing (e.g. world size control) / unclear (measurement units, blocks<=>voxels)

Some demo footage
Sequence.01.webm

Some (demo) benchmarks:

  • Intel Iris XE (integrated gpu!) - <7 mspf in FullHD
  • NVIDIA 1660s - ~1.6 mspf in FullHD

Feature-list

md file with Lum:Renderer features

Installation

Prerequisites

  • C++23 Compiler

    • Recommended: MSYS2 MinGW for Windows, GNU C++ for Linux.

    • See the badges above for compilers that are verified to work.

    • Note: MSVC is not currently supported. If you have experience with MSVC and are willing to contribute, help is welcome!

  • CMake 3.22 or newer

  • Vulkan support

  • on Linux, GLFW will ask you to install multiple different packages. You can do it in advance :

    • for Debian / Ubuntu / Mint:
      sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config build-essential libxkbcommon-dev libwayland-dev
    • for Fedore / Red Hat:
      sudo dnf install wayland-devel libxkbcommon-devel libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel
    • for FreeBSD:
      pkg install wayland libxkbcommon evdev-proto xorgproto

Build Instructions

  1. Clone the repository with it's submodules:
git clone https://github.com/platonvin/lum.git
cd lum
git submodule update --init --recursive
  1. Build using CMake :
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .

To improve performance for release builds, you can enable LTO (Link Time Optimization) :

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
cmake --build .

For faster builds, you can install Ninja and add -G "Ninja" to your CMake command

cmake -G "Ninja" .. -DCMAKE_BUILD_TYPE=Release

Note: this will only build lum library, not demo. For demo, go to examples

Integration

To use Lum as a subproject in your CMake project: See examples/CMakeLists.txt for integration details.
If you're using a different build system, include include/lum.hpp (or include/clum.h) and link against the lum, lumal, glfw3, freetype, brotlidec and some os-specific libraries*. Note that Lum also builds them (so they can be found in lum/lib (or lum/examples/lib, if building examples))
Note: for C++ api (lum.hpp) you will also need glm to be in path (so #include <glm/glm.hpp> is possible). You can use "pocket" lum's glm installation at lum/external/lum-al/external/glm

  • for windows, also link with gdi32
  • for linux, also link with dl

Usage:

Demo controls

  • WASD for camera movement
  • Arrows for robot movement
  • Enter for shooting particles
  • 0 to remove block underneath
  • 1-9 and F1-F5 to place matching blocks (btw world is saved to a file)
  • "<" and ">" to rotate camera
  • "Page Up" and "Page Down" to zoom in/out
  • Esc to close demo