# Univerxel <!-- omit in toc -->

Work in progress galaxy down to atom (mostly centimeter) online voxel game

## Table of Contents <!-- omit in toc -->

- [About The Project](#about-the-project)
  - [Built With](#built-with)
- [Run it](#run-it)
  - [Prerequisites](#prerequisites)
  - [Usage](#usage)
- [Build](#build)
  - [Prerequisites](#prerequisites-1)
    - [Optionally](#optionally)
  - [Installation](#installation)
    - [Additionally](#additionally)
  - [Windows](#windows)
- [RoadMap](#roadmap)
- [License](#license)
- [Contact](#contact)


<!-- ABOUT THE PROJECT -->
## About The Project

Experimental project using OpenGL and Vulkan.


### Built With

* C++
* OpenGL
* Vulkan
* ImGui
* PicoQUIC
* FasNoiseSIMD
* Love and insomnia


<!-- GETTING STARTED -->
## Run it

Get a release compatible with your system window library and processor capabilities, or [build](#build) it

### Prerequisites

* OpenGL or Vulkan driver
* OpenSSL 1.1+

### Usage

```sh
./univerxel
```

Edit `config.toml`
<!-- MAYBE: config description -->

Profit !

## Build

To get a local copy up and running, follow these simple steps.

### Prerequisites

* C++17
* CMake 3.11
* System window headers *(xorg-dev)*
* OpenGL, Vulkan and OpenSSL headers

#### Optionally

* Python: utility scripts
* [Tracy](https://github.com/wolfpld/tracy) v0.7: profiling
* [glslc](https://github.com/KhronosGroup/glslang): build vk shaders
* Imagemagick: build textures (convert jpg to png)
* [Compressonator](https://github.com/GPUOpen-Tools/compressonator): build textures (compress dds)

### Installation

1. Clone the project repo
```sh
git lfs clone --recursive https://framagit.org/univerxel/univerxel.git
```
2. Create build folder and move
```sh
mkdir build && cd build
```
3. Setup CMake
```sh
cmake <options> ..
```

CMake options: `-DKEY=VAL`

Key | Usage | Default
--- | --- | ---
SIMD_LEVEL | SIMD processor acceleration (sse2, sse4.1, avx2, avx512f) | `avx2`
USE_FMA | Fast math | `1`
CMAKE_BUILD_TYPE | Level of optimization | `Release`
PROFILING | Tracy profiling | `0`
LOG_DEBUG | Debug logs | `0`
LOG_TRACE | Trace logs | `0`
NATIVE | Optimize for native CPU | `0`

1. Compile
```sh
cmake --build . --parallel --target <target>
```

Target | Description
--- | ---
univerxel | All in one
univerxel-server | Standalone server
univerxel-client | Light client
docs | Doxygen documentation


#### Additionally

5. Recompile Vulkan shaders
```sh
cd resource/shaders-src
./compile.sh # Use glslc
GLSL="glslValidator -V" ./compile.sh # Other glslang compiler
```

6. Rebuild textures
```sh
cd resource/textures-src
./compile.sh # Build all texture dds
./merge.py <args> # Combine grey images to RGB
```

### Windows

1. Setup Visual Studio 2017+ with C++
2. Clone picotls and picoquic in a separate directory
3. Set `%OPENSSL64DIR%` and check `WindowsPort.md` and `Readme.md` note from respective library
4. Compile then with MsBuild
5. Copy picoquic.lib, picotls-openssl.lib and picotls-fusion.lib to build/libs
6. Build univerxel with cmake `-A x64` and MsBuild

<!-- ROADMAP -->
## RoadMap

See [Features](TODO.md)

<!-- LICENSE -->
## License

Distributed under the MIT License. See [LICENSE](LICENSE) for more information.



<!-- CONTACT -->
## Contact

Shu - [/me](https://git.wadza.fr/me) - me@wadza.fr

[Public repository](https://framagit.org/univerxel/univerxel)
