Commit f926939c authored by Florian Oetke's avatar Florian Oetke

Merge branch 'develop' into 'master'

GDW WS18/19

See merge request !1
parents f9699ca1 e85248b7
Pipeline #3151 passed with stage
in 12 minutes and 45 seconds
*.hpp linguist-language=c++
*.hxx linguist-language=c++
*.cpp linguist-language=c++
*.cxx linguist-language=c++
*.inl linguist-language=c++
*.h linguist-language=c
*.c linguist-language=c
dependencies/assimp/*.h linguist-language=c++
dependencies/asyncplusplus/*.h linguist-language=c++
dependencies/doctest/*.h linguist-language=c++
dependencies/moodycamel/*.h linguist-language=c++
dependencies/plog/*.h linguist-language=c++
dependencies/robin-map/*.h linguist-language=c++
*.mmf filter=lfs diff=lfs merge=lfs -text
*.ktx filter=lfs diff=lfs merge=lfs -text
...@@ -37,8 +37,6 @@ CMakeLists.txt.user ...@@ -37,8 +37,6 @@ CMakeLists.txt.user
assets/*.log assets/*.log
assets/assets_ext
assets/extensions
assets/ImageTool.jar assets/ImageTool.jar
......
...@@ -5,57 +5,66 @@ stages: ...@@ -5,57 +5,66 @@ stages:
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
build_gcc: .cache-paths-spec: &cache-paths
stage: build - build
script:
- export CC=gcc .linux-cache-spec: &linux-cache-spec
- export CXX=g++ cache:
- mkdir -p build key: ${CI_COMMIT_REF_SLUG}-${CI_JOB_NAME}
- cd build paths: *cache-paths
- mkdir -p bin
- rm -rf src .windows-cache-spec: &windows-cache-spec
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON .. cache:
- cmake --build . --target src/install paths: *cache-paths
- cmake --build . --target test key: "%CI_COMMIT_REF_SLUG%-%CI_JOB_NAME%-%CI_RUNNER_ID%"
.windows-task: &windows-task
tags:
- windows
only:
variables:
- $WINDOWS_CI
.artifact-spec: &artifact-spec
artifacts: artifacts:
name: "mirrage"
paths: paths:
- build/bin - mirrage
expire_in: 1 day expire_in: 1 day
cache:
key: "gcc_${CI_COMMIT_REF_SLUG}"
paths:
- build
build_clang: .build-ninja-linux: &build-ninja-linux
stage: build stage: build
script: script:
- export CC=clang - cmake -E make_directory build
- export CXX=clang++
- mkdir -p build
- cd build - cd build
- mkdir -p bin - cmake -E remove_directory src
- rm -rf src - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../../mirrage -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON .. - cmake --build .
- cmake --build . --target src/install - cmake --build . --target src/install
- cmake --build . --target test - cmake --build . --target test
- wget https://github.com/lowkey42/mirrage/releases/download/v0.2/model_data_lbs.tar.xz || true <<: *linux-cache-spec
- cd bin/bin <<: *artifact-spec
- tar xf ../../model_data_lbs.tar.xz
artifacts: build-gcc:
paths: variables:
- build/bin CC: "gcc"
expire_in: 1 week CXX: "g++"
cache: <<: *build-ninja-linux
key: "clang_${CI_COMMIT_REF_SLUG}"
paths: build-clang:
- build variables:
CC: "clang"
CXX: "clang++"
<<: *build-ninja-linux
build_scanbuild: build-scanbuild:
stage: build stage: build
script: script:
- export CC=clang - export CC=clang
- export CXX=clang++ - export CXX=clang++
- export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc --all)
- echo "Build parallelism:" ${CMAKE_BUILD_PARALLEL_LEVEL}
- mkdir -p build - mkdir -p build
- cd build - cd build
- scan-build --use-c++=clang++ --use-cc=clang cmake -DMIRRAGE_FORCE_LIBCPP=ON -DMIRRAGE_ENABLE_COTIRE=OFF -G "Unix Makefiles" .. - scan-build --use-c++=clang++ --use-cc=clang cmake -DMIRRAGE_FORCE_LIBCPP=ON -DMIRRAGE_ENABLE_COTIRE=OFF -G "Unix Makefiles" ..
...@@ -66,4 +75,33 @@ build_scanbuild: ...@@ -66,4 +75,33 @@ build_scanbuild:
expire_in: 1 week expire_in: 1 week
when: always when: always
build-mingw:
stage: build
script:
- cmake -E make_directory build
- cd build
- cmake -E remove_directory src
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../../mirrage -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_ENABLE_COTIRE=OFF -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
- cmake --build .
- cmake --build . --target src/install
- cmake --build . --target test
variables:
CC: "gcc"
CXX: "g++"
<<: *windows-task
<<: *windows-cache-spec
<<: *artifact-spec
build-msvc:
stage: build
script:
- cmake -E make_directory build
- cd build
- cmake -E remove_directory src
- cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX:PATH=../../mirrage -DMIRRAGE_EXPORT_EXECUTABLE=ON -DMIRRAGE_ENABLE_BACKWARD=OFF ..
- cmake --build . --config Release -- /m
- cmake --build . --config Release --target src/install
- cmake --build . --config Release --target RUN_TESTS
<<: *windows-task
<<: *windows-cache-spec
<<: *artifact-spec
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
url = https://github.com/bombela/backward-cpp.git url = https://github.com/bombela/backward-cpp.git
[submodule "dependencies/plog"] [submodule "dependencies/plog"]
path = dependencies/plog path = dependencies/plog
url = https://github.com/SergiusTheBest/plog.git url = https://github.com/lowkey42/plog.git
[submodule "dependencies/assimp"] [submodule "dependencies/assimp"]
path = dependencies/assimp path = dependencies/assimp
url = https://github.com/assimp/assimp.git url = https://github.com/assimp/assimp.git
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
[submodule "dependencies/magic_get"] [submodule "dependencies/magic_get"]
path = dependencies/magic_get path = dependencies/magic_get
url = https://github.com/apolukhin/magic_get.git url = https://github.com/apolukhin/magic_get.git
[submodule "dependencies/nuklear"]
path = dependencies/nuklear
url = https://github.com/vurtun/nuklear.git
[submodule "dependencies/physfs"] [submodule "dependencies/physfs"]
path = dependencies/physfs path = dependencies/physfs
url = https://github.com/lowkey42/physfs.git url = https://github.com/lowkey42/physfs.git
...@@ -37,3 +34,12 @@ ...@@ -37,3 +34,12 @@
[submodule "dependencies/doctest"] [submodule "dependencies/doctest"]
path = dependencies/doctest path = dependencies/doctest
url = https://github.com/onqtam/doctest.git url = https://github.com/onqtam/doctest.git
[submodule "dependencies/SDL"]
path = dependencies/SDL
url = https://github.com/SDL-mirror/SDL.git
[submodule "dependencies/crunch"]
path = dependencies/crunch
url = https://github.com/lowkey42/crunch.git
[submodule "dependencies/imgui"]
path = dependencies/imgui
url = https://github.com/ocornut/imgui.git
cmake_minimum_required(VERSION 3.2 FATAL_ERROR) cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(mirrage LANGUAGES C CXX) project(mirrage LANGUAGES C CXX)
...@@ -25,3 +25,6 @@ endif() ...@@ -25,3 +25,6 @@ endif()
add_subdirectory(dependencies) add_subdirectory(dependencies)
add_subdirectory(src) add_subdirectory(src)
if(MSVC_IDE AND MIRRAGE_BUILD_DEMO)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT demo)
endif()
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
## Mirrage ## Mirrage
Mirrage (Mirrage Indirect Radiance Renderer And Game Engine) is a Vulkan based deferred renderer with bits and pieces of a simple game engine, that has been developed as part of my CS Bachelor thesis about screen-space global illumination. As such it is (at least in its current state) mostly just a fancy renderer with a simple demo application and just enough engine stuff (ECS, input, ui, glue-code) to keep that running. But in the future I will hopefully get it to an actually usefull state and use it as a basis for my future projects. Mirrage (Mirrage Indirect Radiance Renderer And Game Engine) is a Vulkan based deferred renderer with bits and pieces of a simple game engine, that has been developed as part of my CS Bachelor thesis about screen-space global illumination. As such it is (at least in its current state) mostly just a fancy renderer with a simple demo application and just enough engine stuff (ECS, input, ui, glue-code) to keep that running. But in the future I will hopefully get it to an actually useful state and use it as a basis for my future projects.
The repository at <a href="https://github.com/lowkey42/mirrage">GitHub</a> is a read-only mirror and the main repository is located on <a href="https://gitlab.com/lowkey42/mirrage">Gitlab.com</a>.
WIP API documentation/examples: <https://gitlab.com/lowkey42/mirrage/wikis/Documentation>
### Demo ### Demo
<a href="http://www.youtube.com/watch?feature=player_embedded&v=gHHLuwjDiZo" target="_blank"><img src="screenshots/video_thumbnail2.jpeg" alt="Demo Video" height="180" border="10" /></a> <a href="http://www.youtube.com/watch?feature=player_embedded&v=gHHLuwjDiZo" target="_blank"><img src="screenshots/video_thumbnail2.jpeg" alt="Demo Video" height="180" border="10" /></a>
...@@ -18,44 +21,56 @@ Mirrage (Mirrage Indirect Radiance Renderer And Game Engine) is a Vulkan based d ...@@ -18,44 +21,56 @@ Mirrage (Mirrage Indirect Radiance Renderer And Game Engine) is a Vulkan based d
| ![](screenshots/front.jpeg) | ![](screenshots/light_cube.jpeg) | | ![](screenshots/front.jpeg) | ![](screenshots/light_cube.jpeg) |
### Dependencies ### Dependencies
Required: Required:
- CMake >= 3.8 - CMake >= 3.9
- SDL2 >= 2.0.8
- Vulkan + Vulkan-HPP >= 1.1.80 - Vulkan + Vulkan-HPP >= 1.1.80
- GLSLC (if MIRRAGE_COMPILE_SHADERS is ON) - GLSLC
Included in this repository: Included in this repository:
- Assimp 3.3.1 (only for mesh-converter) - Assimp 3.3.1 (only for mesh-converter)
- crunch (only for mesh-converter): "Crunch Library Copyright (c) 2010-2016 Richard Geldreich, Jr., Tenacious Software, and Binomial LLC"
- glm - glm
- gsl - gsl
- moodycamel - moodycamel
- nuklear - nuklear
- physicsFS - physicsFS
- SDL2
- SF2 - SF2
- stb_image (only for mesh-converter) - stb_image (only for mesh-converter)
### Supported Compilers ### Supported Compilers
- GCC >= 7
- Clang >= 5 - GCC >= 8
- Clang >= 7
- MSVC 19.14 (Visual Studio 2017 15.7)
### Build from Source ### Build from Source
- git clone https://github.com/lowkey42/mirrage.git
- git lfs install
- git clone --recurse-submodules https://gitlab.com/lowkey42/mirrage.git
- mkdir mirrage_build - mkdir mirrage_build
- cd mirrage_build - cd mirrage_build
- cmake ../mirrage - cmake ../mirrage
- cmake --build . - cmake --build .
In order to execute the compiled demo application, the src/demo/demo binary has be be executed from the working directory assets (the folder containing the archives.lst) and this folder has to contain the required models (Sponza and Conrnell-Box) in its extensions sub-directory. This assets can be downloaded from the latetest release.
The project can be further configured by setting the following CMake-Properties (-DPROP=ON/OFF): The project can be further configured by setting the following CMake-Properties (-DPROP=ON/OFF):
- MIRRAGE_BUILD_DEMO: Build the demo application (Default: ON when building the engine directly, OFF when including it from another CMake-Project)
- MIRRAGE_BUILD_MESH_CONVERTER: Also build the mesh converter that can be used to converter models into the engine specific data format (Default: OFF) - MIRRAGE_BUILD_MESH_CONVERTER: Also build the mesh converter that can be used to converter models into the engine specific data format (Default: OFF)
- MIRRAGE_COMPILE_SHADERS: Also compile the glsl shaders into SPIR-V (requires GLSLC) - MIRRAGE_ENABLE_BACKWARD: Enable stacktraces (Default: ON on Linux, OFF on Windows because the underlying library backward-cpp doesn't currently support Windows)
- MIRRAGE_ENABLE_CLANG_FORMAT: Includes an additional clangformat target, that can be used to automatically format all source files in the project - MIRRAGE_ENABLE_CLANG_FORMAT: Includes an additional clangformat target, that can be used to automatically format all source files in the project
- MIRRAGE_ENABLE_LTO: Activates link time optimizations on gcc/clang (Default: OFF) - MIRRAGE_ENABLE_LTO: Activates link time optimizations on gcc/clang (Default: OFF)
- MIRRAGE_SAN: Build with clang sanatizers (address, integer, undefined and address-use-after-scope) (Default: OFF) - MIRRAGE_SAN: Build with clang sanatizers (address, integer, undefined and address-use-after-scope) (Default: OFF)
- MIRRAGE_ENABLE_COTIRE: Enables automatic precompiled headers through cotire
- MIRRAGE_USE_LIBCPP: Uses libc++ instead of libstdc++ when compiling with clang (Default: ON) - MIRRAGE_USE_LIBCPP: Uses libc++ instead of libstdc++ when compiling with clang (Default: ON)
- MIRRAGE_OPTIMIZE_NATIVE: Compile with -march=native (Default: OFF)
core_assets
demo_assets demo_assets
extensions/* extensions/*
cfg:input_mapping = settings/input_mapping.json
cfg:graphics = graphics-cfg.json
cfg:renderer = renderer-cfg.json
cfg:sounds = sounds-cfg.json
cfg:language = language-cfg.json
cfg:languages_info = settings/languages.json
cfg:gui = settings/gui.json
loc: = loc/
pl_cache: = pipeline_caches
font: = fonts/
font:test_font = fonts/droid_sans.ttf
shader: = shader/
vert_shader:blit = shader/bin/fullscreen.vert.spv
frag_shader:blit = shader/bin/blit.frag.spv
vert_shader:debug_draw = shader/bin/debug_draw.vert.spv
frag_shader:debug_draw = shader/bin/debug_draw.frag.spv
vert_shader:light_directional = shader/bin/fullscreen.vert.spv
frag_shader:light_directional = shader/bin/light_directional.frag.spv
vert_shader:light_point = shader/bin/light_point.vert.spv
frag_shader:light_point = shader/bin/light_point.frag.spv
vert_shader:shadow_model = shader/bin/shadow_model.vert.spv
vert_shader:shadow_model_animated = shader/bin/shadow_model_animated.vert.spv
vert_shader:shadow_model_animated_dqs = shader/bin/shadow_model_animated_dqs.vert.spv
frag_shader:shadow_model = shader/bin/shadow_model.frag.spv
vert_shader:model = shader/bin/model.vert.spv
vert_shader:model_animated = shader/bin/model_animated.vert.spv