diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000000000000000000000000000000000..b83e93bd44cd5f80dcf8cdb2bd96edc8e6a767e3
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,16 @@
+*.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
diff --git a/.gitignore b/.gitignore
index d9ea94d0a027d7761c84a7fcbfaf8979f5f835db..8342e342f92717d76068ace53fceab90c4095baf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,8 +37,6 @@ CMakeLists.txt.user
assets/*.log
-assets/assets_ext
-assets/extensions
assets/ImageTool.jar
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f9cf9f4842bacb7dce03def2fba568711abecf06..7d67ae74cc167e3097414f659c0fc3ee5e196f79 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,57 +5,66 @@ stages:
variables:
GIT_SUBMODULE_STRATEGY: recursive
-
-build_gcc:
- stage: build
- script:
- - export CC=gcc
- - export CXX=g++
- - mkdir -p build
- - cd build
- - mkdir -p bin
- - rm -rf src
- - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
- - cmake --build . --target src/install
- - cmake --build . --target test
+
+.cache-paths-spec: &cache-paths
+ - build
+
+.linux-cache-spec: &linux-cache-spec
+ cache:
+ key: ${CI_COMMIT_REF_SLUG}-${CI_JOB_NAME}
+ paths: *cache-paths
+
+.windows-cache-spec: &windows-cache-spec
+ cache:
+ paths: *cache-paths
+ 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:
+ name: "mirrage"
paths:
- - build/bin
+ - mirrage
expire_in: 1 day
- cache:
- key: "gcc_${CI_COMMIT_REF_SLUG}"
- paths:
- - build
-build_clang:
+.build-ninja-linux: &build-ninja-linux
stage: build
script:
- - export CC=clang
- - export CXX=clang++
- - mkdir -p build
+ - cmake -E make_directory build
- cd build
- - mkdir -p bin
- - rm -rf src
- - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
+ - cmake -E remove_directory src
+ - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../../mirrage -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
+ - cmake --build .
- cmake --build . --target src/install
- cmake --build . --target test
- - wget https://github.com/lowkey42/mirrage/releases/download/v0.2/model_data_lbs.tar.xz || true
- - cd bin/bin
- - tar xf ../../model_data_lbs.tar.xz
- artifacts:
- paths:
- - build/bin
- expire_in: 1 week
- cache:
- key: "clang_${CI_COMMIT_REF_SLUG}"
- paths:
- - build
+ <<: *linux-cache-spec
+ <<: *artifact-spec
+
+build-gcc:
+ variables:
+ CC: "gcc"
+ CXX: "g++"
+ <<: *build-ninja-linux
+
+build-clang:
+ variables:
+ CC: "clang"
+ CXX: "clang++"
+ <<: *build-ninja-linux
-build_scanbuild:
+build-scanbuild:
stage: build
script:
- export CC=clang
- export CXX=clang++
+ - export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc --all)
+ - echo "Build parallelism:" ${CMAKE_BUILD_PARALLEL_LEVEL}
- mkdir -p build
- cd build
- 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:
expire_in: 1 week
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
diff --git a/.gitmodules b/.gitmodules
index 7f5d6632c695fdebf05aedf30b40562bc66ea252..561674c0e91f5d944a5f3fb4396482811dfcedf2 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -3,7 +3,7 @@
url = https://github.com/bombela/backward-cpp.git
[submodule "dependencies/plog"]
path = dependencies/plog
- url = https://github.com/SergiusTheBest/plog.git
+ url = https://github.com/lowkey42/plog.git
[submodule "dependencies/assimp"]
path = dependencies/assimp
url = https://github.com/assimp/assimp.git
@@ -19,9 +19,6 @@
[submodule "dependencies/magic_get"]
path = dependencies/magic_get
url = https://github.com/apolukhin/magic_get.git
-[submodule "dependencies/nuklear"]
- path = dependencies/nuklear
- url = https://github.com/vurtun/nuklear.git
[submodule "dependencies/physfs"]
path = dependencies/physfs
url = https://github.com/lowkey42/physfs.git
@@ -37,3 +34,12 @@
[submodule "dependencies/doctest"]
path = dependencies/doctest
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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb4cbab8bfc4d450c71c978f57ba46dfe848dd49..41149b3930cdb1cfa86c280cd696ee29b06555a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(mirrage LANGUAGES C CXX)
@@ -25,3 +25,6 @@ endif()
add_subdirectory(dependencies)
add_subdirectory(src)
+if(MSVC_IDE AND MIRRAGE_BUILD_DEMO)
+ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT demo)
+endif()
diff --git a/README.md b/README.md
index b2083c74633809bb8501337975e4b02c1f915654..fe9666570fb20c29e335b7f33f5a69ffc2c396d9 100644
--- a/README.md
+++ b/README.md
@@ -5,8 +5,11 @@
## 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 GitHub is a read-only mirror and the main repository is located on Gitlab.com.
+
+WIP API documentation/examples:
### Demo
@@ -18,44 +21,56 @@ Mirrage (Mirrage Indirect Radiance Renderer And Game Engine) is a Vulkan based d
|  |  |
+
### Dependencies
+
Required:
-- CMake >= 3.8
-- SDL2 >= 2.0.8
+- CMake >= 3.9
- Vulkan + Vulkan-HPP >= 1.1.80
-- GLSLC (if MIRRAGE_COMPILE_SHADERS is ON)
+- GLSLC
Included in this repository:
- 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
- gsl
- moodycamel
- nuklear
- physicsFS
+- SDL2
- SF2
- stb_image (only for mesh-converter)
+
### Supported Compilers
-- GCC >= 7
-- Clang >= 5
+
+- GCC >= 8
+- Clang >= 7
+- MSVC 19.14 (Visual Studio 2017 15.7)
+
### 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
- cd mirrage_build
- cmake ../mirrage
- 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):
+- 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_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_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_ENABLE_COTIRE: Enables automatic precompiled headers through cotire
- MIRRAGE_USE_LIBCPP: Uses libc++ instead of libstdc++ when compiling with clang (Default: ON)
+- MIRRAGE_OPTIMIZE_NATIVE: Compile with -march=native (Default: OFF)
diff --git a/assets/archives.lst b/assets/archives.lst
index 7157fabd5641b671f578a37fac36e34fa24cdca4..94d4c0b933127c9936ba261b2deffcdbbdca8c70 100644
--- a/assets/archives.lst
+++ b/assets/archives.lst
@@ -1,3 +1,2 @@
-core_assets
demo_assets
extensions/*
diff --git a/assets/core_assets/assets_core_config.map b/assets/core_assets/assets_core_config.map
deleted file mode 100644
index bb021d6eefffdd72cb3dd550d191d76ed9f358f3..0000000000000000000000000000000000000000
--- a/assets/core_assets/assets_core_config.map
+++ /dev/null
@@ -1,10 +0,0 @@
-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
diff --git a/assets/core_assets/assets_core_fonts.map b/assets/core_assets/assets_core_fonts.map
deleted file mode 100644
index 829c0583e39538ed6759b5e2fa5d66f5aa17e191..0000000000000000000000000000000000000000
--- a/assets/core_assets/assets_core_fonts.map
+++ /dev/null
@@ -1,2 +0,0 @@
-font: = fonts/
-font:test_font = fonts/droid_sans.ttf
diff --git a/assets/core_assets/assets_core_shader.map b/assets/core_assets/assets_core_shader.map
deleted file mode 100644
index d38858bb1f1cc2a53b89964de0c66d05b4301828..0000000000000000000000000000000000000000
--- a/assets/core_assets/assets_core_shader.map
+++ /dev/null
@@ -1,96 +0,0 @@
-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
-vert_shader:model_animated_dqs = shader/bin/model_animated_dqs.vert.spv
-frag_shader:model = shader/bin/model.frag.spv
-frag_shader:model_emissive = shader/bin/model_emissive.frag.spv
-frag_shader:model_alphatest = shader/bin/model_alphatest.frag.spv
-
-vert_shader:ui = shader/bin/ui.vert.spv
-frag_shader:ui = shader/bin/ui.frag.spv
-
-vert_shader:taa = shader/bin/fullscreen.vert.spv
-frag_shader:taa = shader/bin/taa.frag.spv
-
-vert_shader:ssao_blur = shader/bin/ssao_blur.vert.spv
-frag_shader:ssao_blur = shader/bin/ssao_blur.frag.spv
-
-vert_shader:ssao = shader/bin/fullscreen.vert.spv
-frag_shader:ssao = shader/bin/ssao.frag.spv
-
-
-vert_shader:gi_blend = shader/bin/fullscreen.vert.spv
-frag_shader:gi_blend = shader/bin/gi_blend.frag.spv
-
-vert_shader:gi_diffuse_reproject = shader/bin/fullscreen.vert.spv
-frag_shader:gi_diffuse_reproject = shader/bin/gi_diffuse_reproject.frag.spv
-
-vert_shader:gi_integrate_brdf = shader/bin/gi_integrate_brdf.vert.spv
-frag_shader:gi_integrate_brdf = shader/bin/gi_integrate_brdf.frag.spv
-
-vert_shader:gi_mipgen = shader/bin/fullscreen.vert.spv
-frag_shader:gi_mipgen = shader/bin/gi_mipgen.frag.spv
-
-vert_shader:gi_sample = shader/bin/fullscreen.vert.spv
-frag_shader:gi_sample = shader/bin/gi_sample.frag.spv
-
-vert_shader:gi_sample_upsample = shader/bin/fullscreen.vert.spv
-frag_shader:gi_sample_upsample = shader/bin/gi_sample_upsample.frag.spv
-
-vert_shader:gi_sample_blend = shader/bin/fullscreen.vert.spv
-frag_shader:gi_sample_blend = shader/bin/gi_sample_blend.frag.spv
-
-vert_shader:gi_sample_spec = shader/bin/fullscreen.vert.spv
-frag_shader:gi_sample_spec = shader/bin/gi_sample_spec.frag.spv
-
-vert_shader:gi_spec_blur = shader/bin/gi_spec_blur.vert.spv
-frag_shader:gi_spec_blur = shader/bin/gi_spec_blur.frag.spv
-
-vert_shader:gi_reproject = shader/bin/fullscreen.vert.spv
-frag_shader:gi_reproject = shader/bin/gi_reproject.frag.spv
-
-vert_shader:gi_reprojection_weights = shader/bin/fullscreen.vert.spv
-frag_shader:gi_reprojection_weights = shader/bin/gi_reprojection_weights.frag.spv
-
-vert_shader:gi_weight_mipgen = shader/bin/fullscreen.vert.spv
-frag_shader:gi_weight_mipgen = shader/bin/gi_weight_mipgen.frag.spv
-
-vert_shader:median_filter = shader/bin/fullscreen.vert.spv
-frag_shader:median_filter = shader/bin/median_filter.frag.spv
-
-vert_shader:luminance = shader/bin/fullscreen.vert.spv
-frag_shader:luminance = shader/bin/luminance.frag.spv
-
-vert_shader:luminance_adapt = shader/bin/fullscreen.vert.spv
-frag_shader:luminance_adapt = shader/bin/luminance_adapt.frag.spv
-
-vert_shader:bloom_apply = shader/bin/fullscreen.vert.spv
-frag_shader:bloom_apply = shader/bin/bloom_apply.frag.spv
-
-vert_shader:bloom_blur = shader/bin/bloom_blur.vert.spv
-frag_shader:bloom_blur = shader/bin/bloom_blur.frag.spv
-
-comp_shader:tone_mapping_adjust = shader/bin/tone_mapping_adjust.comp.spv
-comp_shader:tone_mapping_histogram = shader/bin/tone_mapping_histogram.comp.spv
-
-vert_shader:tone_mapping_apply = shader/bin/fullscreen.vert.spv
-frag_shader:tone_mapping_apply = shader/bin/tone_mapping_apply.frag.spv
diff --git a/assets/core_assets/fonts/droid_sans.ttf b/assets/core_assets/fonts/droid_sans.ttf
deleted file mode 100644
index 767c63ad000e3eea20f3cb7a43ba9f4154ed7a5d..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/fonts/droid_sans.ttf and /dev/null differ
diff --git a/assets/core_assets/fonts/immortal.ttf b/assets/core_assets/fonts/immortal.ttf
deleted file mode 100644
index 146ad3c0b5c78e563b160cdad758c6c321fb9244..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/fonts/immortal.ttf and /dev/null differ
diff --git a/assets/core_assets/settings/gui.json b/assets/core_assets/settings/gui.json
deleted file mode 100644
index c05e4705b82b0afe8f814391711adeabd9401b69..0000000000000000000000000000000000000000
--- a/assets/core_assets/settings/gui.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "fonts": [
- {"aid":"font:test_font", "size":12, "default_font":true}
- ]
-}
diff --git a/assets/core_assets/settings/languages.json b/assets/core_assets/settings/languages.json
deleted file mode 100644
index 5468c194da2ff1c603314d5bcded3cd880341425..0000000000000000000000000000000000000000
--- a/assets/core_assets/settings/languages.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "default_language": "en",
- "supported_languages": ["en"]
-}
diff --git a/assets/core_assets/shader/bin/blit.frag.spv b/assets/core_assets/shader/bin/blit.frag.spv
deleted file mode 100644
index e5d14c35be8724d1339556c3453fbc0208e6fbbd..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/blit.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/bloom_apply.frag.spv b/assets/core_assets/shader/bin/bloom_apply.frag.spv
deleted file mode 100644
index b6750038968e5bdb329c69b267741d9d9ead938d..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/bloom_apply.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/bloom_blur.frag.spv b/assets/core_assets/shader/bin/bloom_blur.frag.spv
deleted file mode 100644
index 5fece56e262252d4eac5d82c5fb95577961b35c4..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/bloom_blur.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/bloom_blur.vert.spv b/assets/core_assets/shader/bin/bloom_blur.vert.spv
deleted file mode 100644
index b673973c9408b6ae3a6a8aab66adbafffc6520ee..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/bloom_blur.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/debug_draw.frag.spv b/assets/core_assets/shader/bin/debug_draw.frag.spv
deleted file mode 100644
index 4391bf2ad91de036d81e633cd523ac1d4fde7a35..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/debug_draw.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/debug_draw.vert.spv b/assets/core_assets/shader/bin/debug_draw.vert.spv
deleted file mode 100644
index 6812cb11a7eac2ddd9f4e7d71d154b4363963032..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/debug_draw.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/fullscreen.vert.spv b/assets/core_assets/shader/bin/fullscreen.vert.spv
deleted file mode 100644
index f83bf62e19e626d359612477fd493930c1b8f23e..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/fullscreen.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_blend.frag.spv b/assets/core_assets/shader/bin/gi_blend.frag.spv
deleted file mode 100644
index 0c670efd0810f63b19cc5c8a101af2fc222ae412..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_blend.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_diffuse_reproject.frag.spv b/assets/core_assets/shader/bin/gi_diffuse_reproject.frag.spv
deleted file mode 100644
index e35d3c4bd1add66b1f9ab8e5a5bf78bce77f0c78..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_diffuse_reproject.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_integrate_brdf.frag.spv b/assets/core_assets/shader/bin/gi_integrate_brdf.frag.spv
deleted file mode 100644
index c96ed1a60429a87e4a4dbedc26f10ca37c27cf52..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_integrate_brdf.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_integrate_brdf.vert.spv b/assets/core_assets/shader/bin/gi_integrate_brdf.vert.spv
deleted file mode 100644
index f83bf62e19e626d359612477fd493930c1b8f23e..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_integrate_brdf.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_mipgen.frag.spv b/assets/core_assets/shader/bin/gi_mipgen.frag.spv
deleted file mode 100644
index 2610a473034a518b9bfb5ad0e4ecfd8d87a9ba76..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_mipgen.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_reproject.frag.spv b/assets/core_assets/shader/bin/gi_reproject.frag.spv
deleted file mode 100644
index c433cb9fea41972eaf447041187838f239a51805..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_reproject.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_reprojection_weights.frag.spv b/assets/core_assets/shader/bin/gi_reprojection_weights.frag.spv
deleted file mode 100644
index f66256dbe80b10e78054ea90772ec9876e0bd564..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_reprojection_weights.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_sample.frag.spv b/assets/core_assets/shader/bin/gi_sample.frag.spv
deleted file mode 100644
index a1c12b04e3e9c1a74bb0d6d47e99ca78d00694eb..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_sample.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_sample_blend.frag.spv b/assets/core_assets/shader/bin/gi_sample_blend.frag.spv
deleted file mode 100644
index 8e62f73bdddffd16d65656f5b19261911ba4bb01..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_sample_blend.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_sample_spec.frag.spv b/assets/core_assets/shader/bin/gi_sample_spec.frag.spv
deleted file mode 100644
index 61972ac947ab41574bda440432259bb3c5b6fc0f..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_sample_spec.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_sample_upsample.frag.spv b/assets/core_assets/shader/bin/gi_sample_upsample.frag.spv
deleted file mode 100644
index eb3c24b6e398cb96a637d56f22cafc7c6f33a84b..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_sample_upsample.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_spec_blur.frag.spv b/assets/core_assets/shader/bin/gi_spec_blur.frag.spv
deleted file mode 100644
index 2a9d4ecb0fc245943f8352327af29cc0722b550b..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_spec_blur.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_spec_blur.vert.spv b/assets/core_assets/shader/bin/gi_spec_blur.vert.spv
deleted file mode 100644
index 4f88b747efdd562669ea958f6b736a54215d22a6..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_spec_blur.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/gi_weight_mipgen.frag.spv b/assets/core_assets/shader/bin/gi_weight_mipgen.frag.spv
deleted file mode 100644
index bec60a5fa9d3fc0d8211a53089aad3d49e576510..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/gi_weight_mipgen.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/light_directional.frag.spv b/assets/core_assets/shader/bin/light_directional.frag.spv
deleted file mode 100644
index 243f1c8c5ec6439202dc55206754b9be5946076b..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/light_directional.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/light_point.frag.spv b/assets/core_assets/shader/bin/light_point.frag.spv
deleted file mode 100644
index cc6d236b816f554a5801f1c8619c90b7ef20de38..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/light_point.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/light_point.vert.spv b/assets/core_assets/shader/bin/light_point.vert.spv
deleted file mode 100644
index 16dce111a5325e185390136bad5ff9d673acc6cf..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/light_point.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/luminance.frag.spv b/assets/core_assets/shader/bin/luminance.frag.spv
deleted file mode 100644
index 5b54bc9bdfc517f8ecada9054101d8e9e5bb1c8d..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/luminance.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/luminance_adapt.frag.spv b/assets/core_assets/shader/bin/luminance_adapt.frag.spv
deleted file mode 100644
index 372ef6a345af3316046acd0263ba6f71615db100..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/luminance_adapt.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/median_filter.frag.spv b/assets/core_assets/shader/bin/median_filter.frag.spv
deleted file mode 100644
index c493073870257f19a8dd4be0e71e60af765fc521..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/median_filter.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/model.frag.spv b/assets/core_assets/shader/bin/model.frag.spv
deleted file mode 100644
index 80de975f8301f64ad3931e81694a99bcba0e6528..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/model.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/model.vert.spv b/assets/core_assets/shader/bin/model.vert.spv
deleted file mode 100644
index e8bc2f0429c90d5b2ad0123e365cef508ba3e993..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/model.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/model_alphatest.frag.spv b/assets/core_assets/shader/bin/model_alphatest.frag.spv
deleted file mode 100644
index d1df2efceb84899f5d3a894479fa90fcdf1e9a9b..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/model_alphatest.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/model_animated.vert.spv b/assets/core_assets/shader/bin/model_animated.vert.spv
deleted file mode 100644
index 3627aabf87ce121b13515c7b87ab260514d27a03..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/model_animated.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/model_animated_dqs.vert.spv b/assets/core_assets/shader/bin/model_animated_dqs.vert.spv
deleted file mode 100644
index 7302d0e9943ddf5061f716c18c9c5be740461253..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/model_animated_dqs.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/model_emissive.frag.spv b/assets/core_assets/shader/bin/model_emissive.frag.spv
deleted file mode 100644
index 89e3dc61ef35a6d89f9eb9ccf00b8ba8a21c3671..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/model_emissive.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/shadow_model.frag.spv b/assets/core_assets/shader/bin/shadow_model.frag.spv
deleted file mode 100644
index fb22bd0b06863905699c00c5c9932dd31d4deca0..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/shadow_model.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/shadow_model.vert.spv b/assets/core_assets/shader/bin/shadow_model.vert.spv
deleted file mode 100644
index c8096e10e990bce899cc5317f6d6936ba0943f3c..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/shadow_model.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/shadow_model_animated.vert.spv b/assets/core_assets/shader/bin/shadow_model_animated.vert.spv
deleted file mode 100644
index 94028ed6dd711902575aeb1deaa09a84549dbe16..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/shadow_model_animated.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/shadow_model_animated_dqs.vert.spv b/assets/core_assets/shader/bin/shadow_model_animated_dqs.vert.spv
deleted file mode 100644
index 25552e85469b2bcc02443c5e3f73abf689200101..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/shadow_model_animated_dqs.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/ssao.frag.spv b/assets/core_assets/shader/bin/ssao.frag.spv
deleted file mode 100644
index 444009b9ac26ec74b7cf3f691276d86081c804fc..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/ssao.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/ssao_blur.frag.spv b/assets/core_assets/shader/bin/ssao_blur.frag.spv
deleted file mode 100644
index 9bf4e2eca956c8e1cc6ce1ec61904309e200d2e7..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/ssao_blur.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/ssao_blur.vert.spv b/assets/core_assets/shader/bin/ssao_blur.vert.spv
deleted file mode 100644
index bb65988e648a68beac9e9178395414ccf7186c8b..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/ssao_blur.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/taa.frag.spv b/assets/core_assets/shader/bin/taa.frag.spv
deleted file mode 100644
index 4a6002d6b56bb8fb03540758c7273e9dec2831f1..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/taa.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/tone_mapping_adjust.comp.spv b/assets/core_assets/shader/bin/tone_mapping_adjust.comp.spv
deleted file mode 100644
index 85ea6a8bab5bd89ea044336a4120bf5d51783dfa..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/tone_mapping_adjust.comp.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/tone_mapping_apply.frag.spv b/assets/core_assets/shader/bin/tone_mapping_apply.frag.spv
deleted file mode 100644
index d2bf5ba2cd8439be304865daea749af3ed46eb7e..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/tone_mapping_apply.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/tone_mapping_histogram.comp.spv b/assets/core_assets/shader/bin/tone_mapping_histogram.comp.spv
deleted file mode 100644
index ddd63f03e08babc3af00f05cd5050ee2172605e4..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/tone_mapping_histogram.comp.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/ui.frag.spv b/assets/core_assets/shader/bin/ui.frag.spv
deleted file mode 100644
index dcaac90105c6b1be93cc05aeee92f3feb77791c6..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/ui.frag.spv and /dev/null differ
diff --git a/assets/core_assets/shader/bin/ui.vert.spv b/assets/core_assets/shader/bin/ui.vert.spv
deleted file mode 100644
index f008a4eb7699c069bec0de58eed13f6b46b435e4..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/shader/bin/ui.vert.spv and /dev/null differ
diff --git a/assets/core_assets/shader/median_filter.frag b/assets/core_assets/shader/median_filter.frag
deleted file mode 100644
index 2d08803d1670863ed6e4a2c323448e0cee8b7bb8..0000000000000000000000000000000000000000
--- a/assets/core_assets/shader/median_filter.frag
+++ /dev/null
@@ -1,60 +0,0 @@
-#version 450
-#extension GL_ARB_separate_shader_objects : enable
-#extension GL_ARB_shading_language_420pack : enable
-
-
-layout(location = 0) in Vertex_data {
- vec2 tex_coords;
-} vertex_out;
-
-layout(location = 0) out vec4 out_color;
-
-layout(set=1, binding = 0) uniform sampler2D color_sampler;
-
-// A Fast, Small-Radius GPU Median Filter by Morgan McGuire: http://casual-effects.com/research/McGuire2008Median/index.html
-#define s2(a, b) temp = a; a = min(a, b); b = max(temp, b);
-#define mn3(a, b, c) s2(a, b); s2(a, c);
-#define mx3(a, b, c) s2(b, c); s2(a, c);
-
-#define mnmx3(a, b, c) mx3(a, b, c); s2(a, b); // 3 exchanges
-#define mnmx4(a, b, c, d) s2(a, b); s2(c, d); s2(a, c); s2(b, d); // 4 exchanges
-#define mnmx5(a, b, c, d, e) s2(a, b); s2(c, d); mn3(a, c, e); mx3(b, d, e); // 6 exchanges
-#define mnmx6(a, b, c, d, e, f) s2(a, d); s2(b, e); s2(c, f); mn3(a, b, c); mx3(d, e, f); // 7 exchanges
-
-void main() {
- ivec2 result_sampler_size = textureSize(color_sampler, 0).xy;
- ivec2 uv = ivec2(textureSize(color_sampler, 0).xy * vertex_out.tex_coords);
- vec3 colors[9];
- for(int x=-1; x<=1; x++) {
- for(int y=-1; y<=1; y++) {
- ivec2 c_uv = uv+ivec2(x,y);
- c_uv = clamp(c_uv, ivec2(0,0), result_sampler_size-ivec2(1,1));
- colors[(x+1)*3+(y+1)] = texelFetch(color_sampler, c_uv, 0).rgb;
- }
- }
-
- float min_c = dot(colors[0], colors[0]);
- float max_c = min_c;
-
- for(int i=1; i<9; i++) {
- float intensity = dot(colors[i], colors[i]);
- min_c = min(min_c, intensity);
- max_c = max(max_c, intensity);
- }
-
- vec3 org = colors[4];
- float org_intensity = dot(org, org);
- if(min_corg_intensity) {
- out_color = vec4(org, 1.0);
-
- } else {
- // Starting with a subset of size 6, remove the min and max each time
- vec3 temp;
- mnmx6(colors[0], colors[1], colors[2], colors[3], colors[4], colors[5]);
- mnmx5(colors[1], colors[2], colors[3], colors[4], colors[6]);
- mnmx4(colors[2], colors[3], colors[4], colors[7]);
- mnmx3(colors[3], colors[4], colors[8]);
- out_color = vec4(colors[4], 1.0);
- }
- //out_color = vec4(org, 1.0);
-}
diff --git a/assets/core_assets/textures/blue_noise.ktx b/assets/core_assets/textures/blue_noise.ktx
deleted file mode 100644
index debd72ce42703028d22954402cd1329b8d9b0a9c..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/textures/blue_noise.ktx and /dev/null differ
diff --git a/assets/core_assets/textures/default_black.png b/assets/core_assets/textures/default_black.png
deleted file mode 100644
index bba5c08abd7297b58f5ed7ee7c5e3eabc1a2c1ee..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/textures/default_black.png and /dev/null differ
diff --git a/assets/core_assets/textures/default_normal.png b/assets/core_assets/textures/default_normal.png
deleted file mode 100644
index cdaf0a41b55de317a21b00fa201ed77cfebd7054..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/textures/default_normal.png and /dev/null differ
diff --git a/assets/core_assets/textures/default_placeholder.ktx b/assets/core_assets/textures/default_placeholder.ktx
deleted file mode 100644
index c63c95b3c5ee651750c3c006e9d4bcdcebfff12e..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/textures/default_placeholder.ktx and /dev/null differ
diff --git a/assets/core_assets/textures/default_placeholder.png b/assets/core_assets/textures/default_placeholder.png
deleted file mode 100644
index 91802e1c089f2a0802943cccaf56edb71c8c2598..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/textures/default_placeholder.png and /dev/null differ
diff --git a/assets/core_assets/textures/default_white.ktx b/assets/core_assets/textures/default_white.ktx
deleted file mode 100644
index 171d8d97109b08bd92322d08aff4094ff7e2c7ec..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/textures/default_white.ktx and /dev/null differ
diff --git a/assets/core_assets/textures/default_white.png b/assets/core_assets/textures/default_white.png
deleted file mode 100644
index 2a2f75c8b6300d174a4d8dc72455c3e06c60eaf8..0000000000000000000000000000000000000000
Binary files a/assets/core_assets/textures/default_white.png and /dev/null differ
diff --git a/assets/demo_assets/assets_blueprints.map b/assets/demo_assets/assets_blueprints.map
index a116788d94991ca188c05074c02bca9adfbdf35a..60a17a3d33bf16c97b9ac67eb31b75c9fc82e22d 100644
--- a/assets/demo_assets/assets_blueprints.map
+++ b/assets/demo_assets/assets_blueprints.map
@@ -1,6 +1 @@
-blueprint:camera = blueprints/camera.json
-blueprint:sponza = blueprints/sponza.json
-blueprint:cornell = blueprints/cornell.json
-blueprint:sun = blueprints/sun.json
-blueprint:cube = blueprints/cube.json
-
+blueprint: = blueprints/*.json
diff --git a/assets/demo_assets/assets_model.map b/assets/demo_assets/assets_model.map
index a01887e28cbcd3501266596030206e527e5be7cc..c4155c08c6826be9c84ac2ac170b44694d4cb7f8 100644
--- a/assets/demo_assets/assets_model.map
+++ b/assets/demo_assets/assets_model.map
@@ -1,5 +1,2 @@
-model: = models/
-mat: = materials/
-
-model:cube = models/cube.mmf
-
+model: = models/*.mmf
+mat: = materials/*.msf
diff --git a/assets/demo_assets/assets_particles.map b/assets/demo_assets/assets_particles.map
new file mode 100644
index 0000000000000000000000000000000000000000..12b099cc95d62793b977fb73a4aa75f1d7c08bea
--- /dev/null
+++ b/assets/demo_assets/assets_particles.map
@@ -0,0 +1,8 @@
+particle: = particles/
+
+particle_def:test_particles = particles/test_particles.json
+particle_sys:test_particles = particles/test_particle_system.json
+
+particle_def:test_smoke_particles = particles/test_smoke_particles.json
+particle_sys:test_smoke_particles = particles/test_smoke_system.json
+
diff --git a/assets/demo_assets/blueprints/billboard.json b/assets/demo_assets/blueprints/billboard.json
new file mode 100644
index 0000000000000000000000000000000000000000..33e210c2dd1d47d302a848f241b02fc462d8ef2a
--- /dev/null
+++ b/assets/demo_assets/blueprints/billboard.json
@@ -0,0 +1,14 @@
+{
+ "Transform":{
+ },
+ "Billboard": {
+ "billboards": [
+ {
+ "size": {"w":1, "h":1},
+ "material_aid": "mat:billboard_material.msf",
+ "clip_rect": {"x":0, "y":0, "z":1, "w":1},
+ "dynamic_lighting": true
+ }
+ ]
+ }
+}
diff --git a/assets/demo_assets/blueprints/decal.json b/assets/demo_assets/blueprints/decal.json
new file mode 100644
index 0000000000000000000000000000000000000000..295bf3080b1e72cb035a5c5d3255ab4bd96c317b
--- /dev/null
+++ b/assets/demo_assets/blueprints/decal.json
@@ -0,0 +1,15 @@
+{
+ "Transform":{
+ },
+ "Decal": {
+ "decals": [
+ {
+ "size": {"w":1, "h":1},
+ "material_aid": "mat:decal_material.msf",
+ "clip_rect": {"x":0, "y":0, "z":1, "w":1},
+ "thickness": 0.2,
+ "color": {"a":0.25}
+ }
+ ]
+ }
+}
diff --git a/assets/demo_assets/blueprints/sun.json b/assets/demo_assets/blueprints/sun.json
index 8431ca9e010ff1c33805ef7053ec79c739c2b3ab..9cba8b67b55cea5adb82d24d016f77b7c4dec2be 100644
--- a/assets/demo_assets/blueprints/sun.json
+++ b/assets/demo_assets/blueprints/sun.json
@@ -3,12 +3,15 @@
},
"Directional_light": {
"source_radius": 0.8,
- "intensity": 140000.0,
+ "intensity": 130000.0,
"temperature": 4500,
+ "shadow_intensity": 2.0,
+ "shadow_temperature": 4000,
"shadow_size": 24,
"near_plane": 1.0,
"far_plane": 80,
- "update_frequency": 1
+ "update_frequency": 1,
+ "light_particles": true
},
"Shadowcaster": {
},
diff --git a/assets/demo_assets/blueprints/test_particle_emitter.json b/assets/demo_assets/blueprints/test_particle_emitter.json
new file mode 100644
index 0000000000000000000000000000000000000000..a6b452f56fe0efeae0a25afc09d9fe39b2b5dcc6
--- /dev/null
+++ b/assets/demo_assets/blueprints/test_particle_emitter.json
@@ -0,0 +1,11 @@
+{
+ "Transform":{
+ "scale": {"x": 0.1, "y": 0.1, "z": 0.1}
+ },
+ "Model": {
+ "aid": "model:cube"
+ },
+ "Particle_system": {
+ "cfg": "particle_sys:test_particles"
+ }
+}
diff --git a/assets/demo_assets/blueprints/test_smoke_emitter.json b/assets/demo_assets/blueprints/test_smoke_emitter.json
new file mode 100644
index 0000000000000000000000000000000000000000..6f978e034e062fcf821576e4c1e246402c7a6f23
--- /dev/null
+++ b/assets/demo_assets/blueprints/test_smoke_emitter.json
@@ -0,0 +1,11 @@
+{
+ "Transform":{
+ "scale": {"x": 0.1, "y": 0.1, "z": 0.1}
+ },
+ "Model": {
+ "aid": "model:cube"
+ },
+ "Particle_system": {
+ "cfg": "particle_sys:test_smoke_particles"
+ }
+}
diff --git a/assets/demo_assets/materials/billboard_material.msf b/assets/demo_assets/materials/billboard_material.msf
new file mode 100644
index 0000000000000000000000000000000000000000..f27950ba42134e921b89021d125c1b353701f503
--- /dev/null
+++ b/assets/demo_assets/materials/billboard_material.msf
@@ -0,0 +1,4 @@
+{
+ "albedo_aid": "billboard.ktx",
+ "emission_aid": "white"
+}
diff --git a/assets/demo_assets/materials/cube_Material.msf b/assets/demo_assets/materials/cube_Material.msf
index 9504a0a2a86797715850125d40c1a0f50eeca966..a0dd972a92aaf5af13926b295219b2bb6c02a002 100644
--- a/assets/demo_assets/materials/cube_Material.msf
+++ b/assets/demo_assets/materials/cube_Material.msf
@@ -1,4 +1,5 @@
{
- "substance_id": "emissive",
- "albedo_aid": "cube_light.ktx"
+ "substance_id": "default",
+ "albedo_aid": "cube_light.ktx",
+ "emission_aid": "default_white.ktx"
}
diff --git a/assets/demo_assets/materials/decal_material.msf b/assets/demo_assets/materials/decal_material.msf
new file mode 100644
index 0000000000000000000000000000000000000000..34402e2aaa6a1bd3f5e11a61df78a8477d2c086e
--- /dev/null
+++ b/assets/demo_assets/materials/decal_material.msf
@@ -0,0 +1,4 @@
+{
+ "albedo_aid": "billboard.ktx",
+ "normal_aid": "sponza_bricks_normal.ktx"
+}
diff --git a/assets/demo_assets/models/cube.mmf b/assets/demo_assets/models/cube.mmf
index 672ea6a41b0b992676fb844d85e319c8fe74e597..cf28fcde7a5269c15e62bf0e1c244a50ebb11429 100644
Binary files a/assets/demo_assets/models/cube.mmf and b/assets/demo_assets/models/cube.mmf differ
diff --git a/assets/demo_assets/particles/test_particle_system.json b/assets/demo_assets/particles/test_particle_system.json
new file mode 100644
index 0000000000000000000000000000000000000000..fd8e1fcc3dcd858da0d44c144738e853a7b6a784
--- /dev/null
+++ b/assets/demo_assets/particles/test_particle_system.json
@@ -0,0 +1,29 @@
+{
+ "emitters": [{
+ "spawn": [
+ {"particles_per_second": 20000, "stddev":0, "time": 1},
+ {"particles_per_second": 0, "stddev":0, "time": 20}
+ ],
+ "spawn_loop": true,
+
+ "size": {"x":0, "y":0},
+ "direction": {"mean":{"elevation":0.85, "azimuth":-0.25}, "stddev":{"elevation":0.1, "azimuth":0.1}},
+
+ "ttl": {"mean": 4, "stddev": 0.5},
+
+ "velocity": {"mean": 32, "stddev": 8.0},
+
+ "emit_script_id": "comp_shader:particle_spawn_sphere",
+
+ "type_id": "particle_def:test_particles"
+ }],
+
+ "effectors": [
+ {
+ "force": 10,
+ "force_dir": {"y":-1},
+ "distance_decay": 0,
+ "scale_with_mass": false
+ }
+ ]
+}
diff --git a/assets/demo_assets/particles/test_particles.json b/assets/demo_assets/particles/test_particles.json
new file mode 100644
index 0000000000000000000000000000000000000000..07a7a15e7ee3c19e6a0e983fd7ed5542a9bbdc0a
--- /dev/null
+++ b/assets/demo_assets/particles/test_particles.json
@@ -0,0 +1,30 @@
+{
+ "keyframes": [
+ {
+ "time": 0,
+ "color": {"mean":{"hue":0, "saturation":1}, "stddev":{"hue":0.5}},
+ "size": {"mean": {"x": 0.05, "y":0.15, "z":0.04}, "stddev":{"x": 0.04, "y":0.02, "z":0.02}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"elevation":1, "azimuth":1, "angle": 1}},
+ "drag": 0.1
+ },
+ {
+ "time": 4,
+ "color": {"mean":{"hue":0, "saturation":1}, "stddev":{"hue":1}},
+ "size": {"mean": {"x": 0.01, "y":0.1, "z":0.01}},
+ "rotation": {"mean":{"angle":1}, "stddev":{"elevation":1, "azimuth":1, "angle": 1}},
+ "drag": 1.0
+ }
+ ],
+
+ "symmetric_scaling": true,
+ "rotate_with_velocity": false,
+ "blend": "solid",
+/*
+ "geometry": "billboard",
+ "material_id": "mat:billboard_material.msf",
+*/
+ "geometry": "mesh",
+ "model_id": "model:cube",
+
+ "update_script_id": "comp_shader:particle_update_simple"
+}
diff --git a/assets/demo_assets/particles/test_smoke_particles.json b/assets/demo_assets/particles/test_smoke_particles.json
new file mode 100644
index 0000000000000000000000000000000000000000..c324d1e36c0edbc98fe9f8079d0dce542abd2e73
--- /dev/null
+++ b/assets/demo_assets/particles/test_smoke_particles.json
@@ -0,0 +1,135 @@
+{
+ "keyframes": [
+ {
+ "time": 0.1,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0, "y":0, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 0.2,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.2, "y":0, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 0.3,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.4, "y":0, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 0.4,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.6, "y":0, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 0.5,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.8, "y":0, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 0.6,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0, "y":0.333, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 0.7,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.2, "y":0.333, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 0.8,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.4, "y":0.333, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 0.9,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.6, "y":0.333, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 1,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.8, "y":0.333, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 1.1,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0, "y":0.666, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 1.2,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.2, "y":0.666, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 1.3,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.4, "y":0.666, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 1.4,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.6, "y":0.666, "z":0.2, "w":0.333},
+ "drag": 0.1
+ },
+ {
+ "time": 1.5,
+ "color": {"mean":{"value":0.8, "alpha":0.5}, "stddev":{"value":0.2}},
+ "size": {"mean": {"x": 0.5}, "stddev":{"x": 0.1}},
+ "rotation": {"mean":{"angle":0}, "stddev":{"angle": 1}},
+ "clip_rect": {"x":0.8, "y":0.666, "z":0.2, "w":0.333},
+ "drag": 0.1
+ }
+ ],
+
+ "loop_keyframe_time": 1.5,
+
+ "symmetric_scaling": true,
+ "rotate_with_velocity": false,
+ "blend": "transparent",
+
+ "geometry": "billboard",
+ "material_id": "tex:smoke_particle.ktx",
+
+ "update_script_id": "comp_shader:particle_update_simple"
+}
diff --git a/assets/demo_assets/particles/test_smoke_system.json b/assets/demo_assets/particles/test_smoke_system.json
new file mode 100644
index 0000000000000000000000000000000000000000..67ee433132b1b829cb82aae7fd26209c48f98283
--- /dev/null
+++ b/assets/demo_assets/particles/test_smoke_system.json
@@ -0,0 +1,19 @@
+{
+ "emitters": [{
+ "spawn": [
+ {"particles_per_second": 200, "stddev":5, "time": 1}
+ ],
+ "spawn_loop": true,
+
+ "size": {"x":0, "y":0},
+ "direction": {"mean":{"elevation":-1, "azimuth":0}, "stddev":{"elevation":0.4, "azimuth":0.4}},
+
+ "ttl": {"mean": 30, "stddev": 0},
+
+ "velocity": {"mean": 0.01, "stddev": 0.008},
+
+ "emit_script_id": "comp_shader:particle_spawn_sphere",
+
+ "type_id": "particle_def:test_smoke_particles"
+ }]
+}
diff --git a/assets/demo_assets/settings/input_mapping.json b/assets/demo_assets/settings/input_mapping.json
index 7a3cd8c80edc5d2553684ba565557ac840dd6bf5..3ade562b4e16e3a02bb7b2f7ad3cb02692d36b10 100644
--- a/assets/demo_assets/settings/input_mapping.json
+++ b/assets/demo_assets/settings/input_mapping.json
@@ -32,7 +32,9 @@
"F3": {"type":"once", "action":"playback"},
"Space": {"type":"once", "action":"pause"},
- "F11": {"type":"once", "action":"toggle_ui"}
+ "F11": {"type":"once", "action":"toggle_ui"},
+
+ "Caret": {"type":"once", "action":"console"}
},
"pad_sticks": {
diff --git a/assets/demo_assets/textures/billboard.ktx b/assets/demo_assets/textures/billboard.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..e0a3f20c35376511768a9c2fd198cb7874356f00
--- /dev/null
+++ b/assets/demo_assets/textures/billboard.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:10073647350e106a963edb860925fb1e6f8a3cf94592454dbf376044ac88181a
+size 349616
diff --git a/assets/demo_assets/textures/cube_light.ktx b/assets/demo_assets/textures/cube_light.ktx
index 42f590502fa8115fda9ba2edd44d69d5e2471def..2af99ae57bdb2a49211970e8981544e650a28c1a 100644
Binary files a/assets/demo_assets/textures/cube_light.ktx and b/assets/demo_assets/textures/cube_light.ktx differ
diff --git a/assets/demo_assets/textures/smoke_particle.ktx b/assets/demo_assets/textures/smoke_particle.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..d2dd86dede9a3506d45622ea3bf22074c96c182c
--- /dev/null
+++ b/assets/demo_assets/textures/smoke_particle.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6465cf49910624c557674465baa2f4360af9537142de46705e378302eca48356
+size 1310832
diff --git a/assets/extensions/cornell/materials/cornell_floor.msf b/assets/extensions/cornell/materials/cornell_floor.msf
new file mode 100644
index 0000000000000000000000000000000000000000..782a09bd846d39a25710fe4386b4454a894f251d
--- /dev/null
+++ b/assets/extensions/cornell/materials/cornell_floor.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "cornell_floor_albedo.ktx",
+ "normal_aid": "cornell_floor_normal.ktx",
+ "brdf_aid": "cornell_floor_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/cornell/materials/cornell_leftwall.msf b/assets/extensions/cornell/materials/cornell_leftwall.msf
new file mode 100644
index 0000000000000000000000000000000000000000..a19e317d1ace56050a543d41a4761ea90aa3d674
--- /dev/null
+++ b/assets/extensions/cornell/materials/cornell_leftwall.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "cornell_leftwall_albedo.ktx",
+ "normal_aid": "cornell_leftwall_normal.ktx",
+ "brdf_aid": "cornell_leftwall_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/cornell/materials/cornell_light.msf b/assets/extensions/cornell/materials/cornell_light.msf
new file mode 100644
index 0000000000000000000000000000000000000000..19b947a6cad80e1eb7a5e3c7129bac1643e8950a
--- /dev/null
+++ b/assets/extensions/cornell/materials/cornell_light.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "alphatest",
+ "albedo_aid": "cornell_light_albedo.ktx",
+ "normal_aid": "cornell_light_normal.ktx",
+ "brdf_aid": "cornell_light_brdf.ktx",
+ "emission_aid": "cornell_light_emission.ktx"
+}
diff --git a/assets/extensions/cornell/materials/cornell_rightwall.msf b/assets/extensions/cornell/materials/cornell_rightwall.msf
new file mode 100644
index 0000000000000000000000000000000000000000..cc7298daf923ac4bc630d450bc2304a061ef9f0b
--- /dev/null
+++ b/assets/extensions/cornell/materials/cornell_rightwall.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "cornell_rightwall_albedo.ktx",
+ "normal_aid": "cornell_rightwall_normal.ktx",
+ "brdf_aid": "cornell_rightwall_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/cornell/materials/cornell_shortbox.msf b/assets/extensions/cornell/materials/cornell_shortbox.msf
new file mode 100644
index 0000000000000000000000000000000000000000..557cce11713f8e04de0c5beb93cf1b2380cc6a93
--- /dev/null
+++ b/assets/extensions/cornell/materials/cornell_shortbox.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "cornell_shortbox_albedo.ktx",
+ "normal_aid": "cornell_shortbox_normal.ktx",
+ "brdf_aid": "cornell_shortbox_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/cornell/materials/cornell_sphere.msf b/assets/extensions/cornell/materials/cornell_sphere.msf
new file mode 100644
index 0000000000000000000000000000000000000000..21683b47428ed820dbfd02667fec9449d036bc3e
--- /dev/null
+++ b/assets/extensions/cornell/materials/cornell_sphere.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "cornell_sphere_albedo.ktx",
+ "normal_aid": "cornell_sphere_normal.ktx",
+ "brdf_aid": "cornell_sphere_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/cornell/models/cornell.mmf b/assets/extensions/cornell/models/cornell.mmf
new file mode 100644
index 0000000000000000000000000000000000000000..018cb9c28107b638c936c939cbc2b5a16e8ce912
--- /dev/null
+++ b/assets/extensions/cornell/models/cornell.mmf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ca4162a178d93c7b9d52bdbc701ccad9d3ee5cd72966d518227e04d7bada45ed
+size 35297
diff --git a/assets/extensions/cornell/textures/cornell_floor_albedo.ktx b/assets/extensions/cornell/textures/cornell_floor_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5c4da75e58b931afa4ba2642c51f0d2fe376fec8
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_floor_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:24f971711f127f6507f4000779f4b1d9a11851ad26dc4af49a10229fbf96efd7
+size 5592512
diff --git a/assets/extensions/cornell/textures/cornell_floor_brdf.ktx b/assets/extensions/cornell/textures/cornell_floor_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..369d0f9875bfcdc95d9a1a7d05902c636b615249
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_floor_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8e881b227e190bfa3db97fb9d65f85641992309ef7ec762a43f6968852e28769
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_floor_normal.ktx b/assets/extensions/cornell/textures/cornell_floor_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..b140be1972d6ceb8787864b9e8cda528b82af308
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_floor_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91527266078d432988ab9a9d63cb2542e3560b8f2c71f39105c7c48eb802a572
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_leftwall_albedo.ktx b/assets/extensions/cornell/textures/cornell_leftwall_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..7a48cb7ec09190bc3d31f9191d6ecedd56920c00
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_leftwall_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:da3c54f19ca4cca2910cf2beb68c43289bc519d4d4458612280bc4c612c508de
+size 5592512
diff --git a/assets/extensions/cornell/textures/cornell_leftwall_brdf.ktx b/assets/extensions/cornell/textures/cornell_leftwall_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..369d0f9875bfcdc95d9a1a7d05902c636b615249
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_leftwall_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8e881b227e190bfa3db97fb9d65f85641992309ef7ec762a43f6968852e28769
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_leftwall_normal.ktx b/assets/extensions/cornell/textures/cornell_leftwall_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..b140be1972d6ceb8787864b9e8cda528b82af308
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_leftwall_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91527266078d432988ab9a9d63cb2542e3560b8f2c71f39105c7c48eb802a572
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_light_albedo.ktx b/assets/extensions/cornell/textures/cornell_light_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5043db09f618b5b1301b960b41297f2215c3f588
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_light_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dcd9685cf2b5b527ad49a654f3922a53a44124dc4cf34b75e926b6e1abb42ce0
+size 5592512
diff --git a/assets/extensions/cornell/textures/cornell_light_brdf.ktx b/assets/extensions/cornell/textures/cornell_light_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..369d0f9875bfcdc95d9a1a7d05902c636b615249
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_light_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8e881b227e190bfa3db97fb9d65f85641992309ef7ec762a43f6968852e28769
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_light_emission.ktx b/assets/extensions/cornell/textures/cornell_light_emission.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..cbe50f7cebf1ae93cc65b6c2a169d243fb0cede6
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_light_emission.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9fb46dc75c85e13e5846d3fc10a3edf9af169c41c13d13de078ba9a077ccd8fb
+size 4164
diff --git a/assets/extensions/cornell/textures/cornell_light_normal.ktx b/assets/extensions/cornell/textures/cornell_light_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..b140be1972d6ceb8787864b9e8cda528b82af308
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_light_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91527266078d432988ab9a9d63cb2542e3560b8f2c71f39105c7c48eb802a572
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_rightwall_albedo.ktx b/assets/extensions/cornell/textures/cornell_rightwall_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..9196bc6360e83d130e20b6cfe7b04a60c1706a41
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_rightwall_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:37cb5b0d108576b2d9262d20c16d3d4f9a172d0d56438f913146453d9cb8ea44
+size 5592512
diff --git a/assets/extensions/cornell/textures/cornell_rightwall_brdf.ktx b/assets/extensions/cornell/textures/cornell_rightwall_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..369d0f9875bfcdc95d9a1a7d05902c636b615249
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_rightwall_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8e881b227e190bfa3db97fb9d65f85641992309ef7ec762a43f6968852e28769
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_rightwall_normal.ktx b/assets/extensions/cornell/textures/cornell_rightwall_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..b140be1972d6ceb8787864b9e8cda528b82af308
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_rightwall_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91527266078d432988ab9a9d63cb2542e3560b8f2c71f39105c7c48eb802a572
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_shortbox_albedo.ktx b/assets/extensions/cornell/textures/cornell_shortbox_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5c4da75e58b931afa4ba2642c51f0d2fe376fec8
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_shortbox_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:24f971711f127f6507f4000779f4b1d9a11851ad26dc4af49a10229fbf96efd7
+size 5592512
diff --git a/assets/extensions/cornell/textures/cornell_shortbox_brdf.ktx b/assets/extensions/cornell/textures/cornell_shortbox_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..369d0f9875bfcdc95d9a1a7d05902c636b615249
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_shortbox_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8e881b227e190bfa3db97fb9d65f85641992309ef7ec762a43f6968852e28769
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_shortbox_normal.ktx b/assets/extensions/cornell/textures/cornell_shortbox_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..b140be1972d6ceb8787864b9e8cda528b82af308
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_shortbox_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91527266078d432988ab9a9d63cb2542e3560b8f2c71f39105c7c48eb802a572
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_sphere_albedo.ktx b/assets/extensions/cornell/textures/cornell_sphere_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..6986b2695e216e828168f0df0ffd1343333377de
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_sphere_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a40b51716098ae5ef7e2780394c82c421fd9d724fdb8a0863cba1a984cda9777
+size 5592512
diff --git a/assets/extensions/cornell/textures/cornell_sphere_brdf.ktx b/assets/extensions/cornell/textures/cornell_sphere_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5938d8a9c6852321e376b8b2d37f32df59bab343
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_sphere_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:40b38cd42bb613ed6690f07d378e02d35969725ba205795e632ed4fb9dd684e2
+size 2796312
diff --git a/assets/extensions/cornell/textures/cornell_sphere_normal.ktx b/assets/extensions/cornell/textures/cornell_sphere_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..b140be1972d6ceb8787864b9e8cda528b82af308
--- /dev/null
+++ b/assets/extensions/cornell/textures/cornell_sphere_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91527266078d432988ab9a9d63cb2542e3560b8f2c71f39105c7c48eb802a572
+size 2796312
diff --git a/assets/extensions/monk/animations/attack.maf b/assets/extensions/monk/animations/attack.maf
new file mode 100644
index 0000000000000000000000000000000000000000..d2ab3cabc0c63bb1e1ae8407e8f2f6a878c38853
Binary files /dev/null and b/assets/extensions/monk/animations/attack.maf differ
diff --git a/assets/extensions/monk/animations/dance.maf b/assets/extensions/monk/animations/dance.maf
new file mode 100644
index 0000000000000000000000000000000000000000..bb74c289e307c838d853810e331b4f9d46e195c2
Binary files /dev/null and b/assets/extensions/monk/animations/dance.maf differ
diff --git a/assets/extensions/monk/animations/die.maf b/assets/extensions/monk/animations/die.maf
new file mode 100644
index 0000000000000000000000000000000000000000..b3a4ee33d1439b5b9596e4a970c18ac647bb8bc8
Binary files /dev/null and b/assets/extensions/monk/animations/die.maf differ
diff --git a/assets/extensions/monk/animations/flee.maf b/assets/extensions/monk/animations/flee.maf
new file mode 100644
index 0000000000000000000000000000000000000000..07abac030d6f2270cc228e3f7c309b40eacb12a0
Binary files /dev/null and b/assets/extensions/monk/animations/flee.maf differ
diff --git a/assets/extensions/monk/animations/idle.maf b/assets/extensions/monk/animations/idle.maf
new file mode 100644
index 0000000000000000000000000000000000000000..7fbc3f912061770702c55e40aa4deade1a2a4553
Binary files /dev/null and b/assets/extensions/monk/animations/idle.maf differ
diff --git a/assets/extensions/monk/animations/sad.maf b/assets/extensions/monk/animations/sad.maf
new file mode 100644
index 0000000000000000000000000000000000000000..f9d43a2a6300c20c0d13646b35a259ac0ca7635b
Binary files /dev/null and b/assets/extensions/monk/animations/sad.maf differ
diff --git a/assets/extensions/monk/animations/sleep.maf b/assets/extensions/monk/animations/sleep.maf
new file mode 100644
index 0000000000000000000000000000000000000000..ec9e974a5c344fb701dc9bebfd79e1621f54f231
Binary files /dev/null and b/assets/extensions/monk/animations/sleep.maf differ
diff --git a/assets/extensions/monk/animations/torturefire.maf b/assets/extensions/monk/animations/torturefire.maf
new file mode 100644
index 0000000000000000000000000000000000000000..477f339405ea325e95171757d1cfddc13aff95bb
Binary files /dev/null and b/assets/extensions/monk/animations/torturefire.maf differ
diff --git a/assets/extensions/monk/animations/walk.maf b/assets/extensions/monk/animations/walk.maf
new file mode 100644
index 0000000000000000000000000000000000000000..c2abf9ffa2079c85ee3333934ee3dcb463163c93
Binary files /dev/null and b/assets/extensions/monk/animations/walk.maf differ
diff --git a/assets/extensions/monk/assets_monk.map b/assets/extensions/monk/assets_monk.map
new file mode 100644
index 0000000000000000000000000000000000000000..286586b2b0038ba85e78e002bbb37c114fa7daa3
--- /dev/null
+++ b/assets/extensions/monk/assets_monk.map
@@ -0,0 +1,14 @@
+blueprint:monk = blueprints/monk.json
+skel:monk = models/monk.mbf
+
+blueprint:monk_lbs = blueprints/monk_lbs.json
+skel:monk_lbs = models/monk_lbs.mbf
+
+anim:monk_attack = animations/attack.maf
+anim:monk_dance = animations/dance.maf
+anim:monk_die = animations/die.maf
+anim:monk_flee = animations/flee.maf
+anim:monk_idle = animations/idle.maf
+anim:monk_sad = animations/sad.maf
+anim:monk_sleep = animations/sleep.maf
+anim:monk_walk = animations/walk.maf
diff --git a/assets/extensions/monk/blueprints/monk.json b/assets/extensions/monk/blueprints/monk.json
new file mode 100644
index 0000000000000000000000000000000000000000..cdde2ced96e61085385d1af2c7cb08ef67c0953a
--- /dev/null
+++ b/assets/extensions/monk/blueprints/monk.json
@@ -0,0 +1,26 @@
+{
+ "Transform":{
+ "scale": {"x": 0.018, "y": 0.018, "z": 0.018}
+ },
+ "Model": {
+ "aid": "model:monk.mmf"
+ },
+ "Pose": {"skeleton": "skel:monk"},
+ "Animation": {},
+ "Simple_animation_controller": {
+ "animations": {
+ "attack": "anim:monk_attack",
+ "dance": "anim:monk_dance",
+ "die": "anim:monk_die",
+ "flee": "anim:monk_flee",
+ "idle": "anim:monk_idle",
+ "sad": "anim:monk_sad",
+ "sleep": "anim:monk_sleep",
+ "walk": "anim:monk_walk"
+ },
+ "current_animation": {
+ "id": "dance"
+ }
+ },
+ "Shadowcaster": {}
+}
diff --git a/assets/extensions/monk/blueprints/monk_lbs.json b/assets/extensions/monk/blueprints/monk_lbs.json
new file mode 100644
index 0000000000000000000000000000000000000000..cf21ae5b9e3d079ed498e423b5ce1835a2cfb212
--- /dev/null
+++ b/assets/extensions/monk/blueprints/monk_lbs.json
@@ -0,0 +1,26 @@
+{
+ "Transform":{
+ "scale": {"x": 0.018, "y": 0.018, "z": 0.018}
+ },
+ "Model": {
+ "aid": "model:monk.mmf"
+ },
+ "Pose": {"skeleton": "skel:monk_lbs"},
+ "Animation": {},
+ "Simple_animation_controller": {
+ "animations": {
+ "attack": "anim:monk_attack",
+ "dance": "anim:monk_dance",
+ "die": "anim:monk_die",
+ "flee": "anim:monk_flee",
+ "idle": "anim:monk_idle",
+ "sad": "anim:monk_sad",
+ "sleep": "anim:monk_sleep",
+ "walk": "anim:monk_walk"
+ },
+ "current_animation": {
+ "id": "dance"
+ }
+ },
+ "Shadowcaster": {}
+}
diff --git a/assets/extensions/monk/materials/monk_monkbody.msf b/assets/extensions/monk/materials/monk_monkbody.msf
new file mode 100644
index 0000000000000000000000000000000000000000..b3be9c26f0107633b11e49e2e733b85c74f10464
--- /dev/null
+++ b/assets/extensions/monk/materials/monk_monkbody.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "alphatest",
+ "albedo_aid": "monk_monkbody_albedo.ktx",
+ "normal_aid": "monk_monkbody_normal.ktx",
+ "brdf_aid": "monk_monkbody_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/monk/materials/monk_monkhair.msf b/assets/extensions/monk/materials/monk_monkhair.msf
new file mode 100644
index 0000000000000000000000000000000000000000..5d365167240d3c12ebc5bef1499c290271801b1a
--- /dev/null
+++ b/assets/extensions/monk/materials/monk_monkhair.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "alphatest",
+ "albedo_aid": "monk_monkhair_albedo.ktx",
+ "normal_aid": "monk_monkhair_normal.ktx",
+ "brdf_aid": "monk_monkhair_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/monk/materials/monk_monkhead.msf b/assets/extensions/monk/materials/monk_monkhead.msf
new file mode 100644
index 0000000000000000000000000000000000000000..a11aa25c9c23b2038336e9b104abbfbb59d55d79
--- /dev/null
+++ b/assets/extensions/monk/materials/monk_monkhead.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "monk_monkhead_albedo.ktx",
+ "normal_aid": "monk_monkhead_normal.ktx",
+ "brdf_aid": "monk_monkhead_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/monk/models/monk.mbf b/assets/extensions/monk/models/monk.mbf
new file mode 100644
index 0000000000000000000000000000000000000000..900d1c9550634f0ba9efe6ff39bf8deaeff17c88
Binary files /dev/null and b/assets/extensions/monk/models/monk.mbf differ
diff --git a/assets/extensions/monk/models/monk.mmf b/assets/extensions/monk/models/monk.mmf
new file mode 100644
index 0000000000000000000000000000000000000000..bf6ad780694b9cf4f40acb20a671ef97ea8ccedd
--- /dev/null
+++ b/assets/extensions/monk/models/monk.mmf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:af3df7070ab6ef7d8635a5cd9c99c112d18856858d37871383c67e5071ac91b3
+size 208763
diff --git a/assets/extensions/monk/models/monk_lbs.mbf b/assets/extensions/monk/models/monk_lbs.mbf
new file mode 100644
index 0000000000000000000000000000000000000000..2607f1d2178be114291a6e6438275c0354122895
Binary files /dev/null and b/assets/extensions/monk/models/monk_lbs.mbf differ
diff --git a/assets/extensions/monk/textures/monk_monkbody_albedo.ktx b/assets/extensions/monk/textures/monk_monkbody_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..ec7d68b3827982747cca9733c2cb6e8db059b23a
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkbody_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:16bd81aa40853d09d643502a6943b9417a0c0811d18cc218c53bc78da3f2303e
+size 1398196
diff --git a/assets/extensions/monk/textures/monk_monkbody_brdf.ktx b/assets/extensions/monk/textures/monk_monkbody_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5d3e40c20835afd973caacee0dd65af2f6f8fca7
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkbody_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3372ae0de96408d7c29303eb91efb4e16cc9106692dc64d1bc77f06c1ac258cd
+size 349616
diff --git a/assets/extensions/monk/textures/monk_monkbody_normal.ktx b/assets/extensions/monk/textures/monk_monkbody_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..2b7cfb1324c2be00400957253b32147b963bce35
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkbody_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0e07ac6f7d35bb36d65d404cd33deae5a978b3696e5ae8c0c44b6da7eab78898
+size 349616
diff --git a/assets/extensions/monk/textures/monk_monkhair_albedo.ktx b/assets/extensions/monk/textures/monk_monkhair_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..d4ca532dd0692f7d8727375630ade8af9b2158c3
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkhair_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dee1de2ea58a8eff907234ec330ca76c440706d9e16c2c3d028c54887cab2846
+size 349616
diff --git a/assets/extensions/monk/textures/monk_monkhair_brdf.ktx b/assets/extensions/monk/textures/monk_monkhair_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..166f0497d95b972d9fcba9ab99ff506599136d5c
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkhair_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6d7a3f89bdf3f17ad5f820e506d3f7022642a0f4bf4e3944eaf4a75de71a3eaa
+size 349616
diff --git a/assets/extensions/monk/textures/monk_monkhair_normal.ktx b/assets/extensions/monk/textures/monk_monkhair_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..019c632ec5dfeea4ea43a4124fa8b6bd7657c5cb
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkhair_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5fd8297a123bbf6e1317eaa7e1769ec3afd5467d36cac2c6546309df86ead7a7
+size 349616
diff --git a/assets/extensions/monk/textures/monk_monkhead_albedo.ktx b/assets/extensions/monk/textures/monk_monkhead_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..7fd4aca719db5b0b0317e4c32d03a18718b24f77
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkhead_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:39ab61334e33af13053dd3cf9a61ba8577d336541e6729e0a95f4079e6d6042b
+size 1398196
diff --git a/assets/extensions/monk/textures/monk_monkhead_brdf.ktx b/assets/extensions/monk/textures/monk_monkhead_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..6ffff0d50468df07535657da6e67a79bd1933d82
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkhead_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ba3e977e61f605381651b9c8a5ef147ea7c8b3156b8d90dce08575e53db35541
+size 349616
diff --git a/assets/extensions/monk/textures/monk_monkhead_normal.ktx b/assets/extensions/monk/textures/monk_monkhead_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..f44ebd69f4342997f49ff5bbdef99df6c994c712
--- /dev/null
+++ b/assets/extensions/monk/textures/monk_monkhead_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9a60057dc21507966e8ea89a0263e60179f71517e0ded183be0b5d55eaf22c35
+size 349616
diff --git a/assets/extensions/rotation_test/animations/armaturearmatureaction.maf b/assets/extensions/rotation_test/animations/armaturearmatureaction.maf
new file mode 100644
index 0000000000000000000000000000000000000000..28ba675da1575dcba6cead5a232bcea7af9165bc
Binary files /dev/null and b/assets/extensions/rotation_test/animations/armaturearmatureaction.maf differ
diff --git a/assets/extensions/rotation_test/animations/armaturecylinderaction.maf b/assets/extensions/rotation_test/animations/armaturecylinderaction.maf
new file mode 100644
index 0000000000000000000000000000000000000000..1e9fabb6f8cc80ecfda96715283c1bd1b2ce8029
Binary files /dev/null and b/assets/extensions/rotation_test/animations/armaturecylinderaction.maf differ
diff --git a/assets/extensions/rotation_test/assets_rotation_test.map b/assets/extensions/rotation_test/assets_rotation_test.map
new file mode 100644
index 0000000000000000000000000000000000000000..b122d772fbc9dae90f7259afc7f9864aff04c90f
--- /dev/null
+++ b/assets/extensions/rotation_test/assets_rotation_test.map
@@ -0,0 +1,8 @@
+blueprint:rotation_test = blueprints/rotation_test.json
+skel:rotation_test = models/rotation.mbf
+
+blueprint:rotation_test_lbs = blueprints/rotation_test_lbs.json
+skel:rotation_test_lbs = models/rotation_lbs.mbf
+
+anim:rotation_test = animations/armaturearmatureaction.maf
+
diff --git a/assets/extensions/rotation_test/blueprints/rotation_test.json b/assets/extensions/rotation_test/blueprints/rotation_test.json
new file mode 100644
index 0000000000000000000000000000000000000000..142f9ab0e458aa16e60741f6294338c3a072b3d1
--- /dev/null
+++ b/assets/extensions/rotation_test/blueprints/rotation_test.json
@@ -0,0 +1,21 @@
+{
+ "Transform":{
+ "scale": {"x": 0.003, "y": 0.003, "z": 0.003}
+ },
+ "Model": {
+ "aid": "model:rotation.mmf"
+ },
+ "Pose": {"skeleton": "skel:rotation_test"},
+
+ "Animation": {},
+ "Simple_animation_controller": {
+ "animations": {
+ "test": "anim:rotation_test"
+ },
+ "current_animation": {
+ "id": "test",
+ "speed": 0.2
+ }
+ },
+ "Shadowcaster": {}
+}
diff --git a/assets/extensions/rotation_test/blueprints/rotation_test_lbs.json b/assets/extensions/rotation_test/blueprints/rotation_test_lbs.json
new file mode 100644
index 0000000000000000000000000000000000000000..4e94fde02efc153150bc0bd29d9283f68f39c264
--- /dev/null
+++ b/assets/extensions/rotation_test/blueprints/rotation_test_lbs.json
@@ -0,0 +1,22 @@
+{
+ "Transform":{
+ "scale": {"x": 0.003, "y": 0.003, "z": 0.003}
+ },
+ "Model": {
+ "aid": "model:rotation.mmf"
+ },
+ "Pose": {"skeleton": "skel:rotation_test_lbs"},
+
+ "Animation": {},
+ "Simple_animation_controller": {
+ "animations": {
+ "test": "anim:rotation_test"
+ },
+ "current_animation": {
+ "id": "test",
+ "speed": 0.2
+ }
+ },
+ "Shadowcaster": {},
+ "Point_light": {"source_radius":1.0, "intensity":620, "temperature":1900}
+}
diff --git a/assets/extensions/rotation_test/materials/rotation_material.003.msf b/assets/extensions/rotation_test/materials/rotation_material.003.msf
new file mode 100644
index 0000000000000000000000000000000000000000..44940d6e99d3e2b702ecf6066d954f21aa639a11
--- /dev/null
+++ b/assets/extensions/rotation_test/materials/rotation_material.003.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "rotation_material.003_albedo.ktx",
+ "normal_aid": "rotation_material.003_normal.ktx",
+ "brdf_aid": "rotation_material.003_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/rotation_test/models/rotation.mbf b/assets/extensions/rotation_test/models/rotation.mbf
new file mode 100644
index 0000000000000000000000000000000000000000..48d08d203fd35e497c87e8a862377ed73609381c
Binary files /dev/null and b/assets/extensions/rotation_test/models/rotation.mbf differ
diff --git a/assets/extensions/rotation_test/models/rotation.mmf b/assets/extensions/rotation_test/models/rotation.mmf
new file mode 100644
index 0000000000000000000000000000000000000000..fe1149e6cf74d36b0c879775decd70f02470c82a
--- /dev/null
+++ b/assets/extensions/rotation_test/models/rotation.mmf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d06711b1985c183d20ad2c7f3e00f0d7db7a17bc91ada0231e640873932256c2
+size 91697
diff --git a/assets/extensions/rotation_test/models/rotation_lbs.mbf b/assets/extensions/rotation_test/models/rotation_lbs.mbf
new file mode 100644
index 0000000000000000000000000000000000000000..40cc3aec602c653afe4200483440258dfafdf609
Binary files /dev/null and b/assets/extensions/rotation_test/models/rotation_lbs.mbf differ
diff --git a/assets/extensions/rotation_test/textures/rotation_material.003_albedo.ktx b/assets/extensions/rotation_test/textures/rotation_material.003_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..13ddb4f84162f55bb15994800cb69db613875628
--- /dev/null
+++ b/assets/extensions/rotation_test/textures/rotation_material.003_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f2d31719f597eb5452a6f666ca1506de4179d59e19341c22863b532834bd07ab
+size 5592512
diff --git a/assets/extensions/rotation_test/textures/rotation_material.003_brdf.ktx b/assets/extensions/rotation_test/textures/rotation_material.003_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..de501cc2436e2683f64e5abf48864979cdb2ee04
--- /dev/null
+++ b/assets/extensions/rotation_test/textures/rotation_material.003_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7d59823be8e3f0eb31d64b310cb1f4fc7d3080b2b5f4805579285eae4d225456
+size 699156
diff --git a/assets/extensions/rotation_test/textures/rotation_material.003_normal.ktx b/assets/extensions/rotation_test/textures/rotation_material.003_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..dd141369e9b12f5ce06bdc8a136e06266bd45745
--- /dev/null
+++ b/assets/extensions/rotation_test/textures/rotation_material.003_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:470b69a039ffa03ec17c3b20a4e2e65239bb582742f5c7698db0c383d4d41c98
+size 699156
diff --git a/assets/extensions/sponza/materials/sponza_16___default.msf b/assets/extensions/sponza/materials/sponza_16___default.msf
new file mode 100644
index 0000000000000000000000000000000000000000..ed2e852f632cb58bba534787e147a686d4621f72
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_16___default.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_16___default_albedo.ktx",
+ "normal_aid": "sponza_16___default_normal.ktx",
+ "brdf_aid": "sponza_16___default_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_arch.msf b/assets/extensions/sponza/materials/sponza_arch.msf
new file mode 100644
index 0000000000000000000000000000000000000000..e646a42ebcc0207ea2a5bc867d112c915c691101
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_arch.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_arch_albedo.ktx",
+ "normal_aid": "sponza_arch_normal.ktx",
+ "brdf_aid": "sponza_arch_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_bricks.msf b/assets/extensions/sponza/materials/sponza_bricks.msf
new file mode 100644
index 0000000000000000000000000000000000000000..d3bbd3b9647c9071617ef679b93e54b9a48b18ef
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_bricks.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_bricks_albedo.ktx",
+ "normal_aid": "sponza_bricks_normal.ktx",
+ "brdf_aid": "sponza_bricks_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_ceiling.msf b/assets/extensions/sponza/materials/sponza_ceiling.msf
new file mode 100644
index 0000000000000000000000000000000000000000..addd148c0b1a2a65a8dcf25a669334294e0af5af
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_ceiling.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_ceiling_albedo.ktx",
+ "normal_aid": "sponza_ceiling_normal.ktx",
+ "brdf_aid": "sponza_ceiling_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_chain.msf b/assets/extensions/sponza/materials/sponza_chain.msf
new file mode 100644
index 0000000000000000000000000000000000000000..53c7e7e6eef88042d365e0d2757260bd6fe7584b
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_chain.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "alphatest",
+ "albedo_aid": "sponza_chain_albedo.ktx",
+ "normal_aid": "sponza_chain_normal.ktx",
+ "brdf_aid": "sponza_chain_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_column_a.msf b/assets/extensions/sponza/materials/sponza_column_a.msf
new file mode 100644
index 0000000000000000000000000000000000000000..cf6e94061ce3cce397611c9816e3873a59bc4526
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_column_a.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_column_a_albedo.ktx",
+ "normal_aid": "sponza_column_a_normal.ktx",
+ "brdf_aid": "sponza_column_a_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_column_b.msf b/assets/extensions/sponza/materials/sponza_column_b.msf
new file mode 100644
index 0000000000000000000000000000000000000000..b1349dfc285af10e0bf5064eb2f8eb8fd51bec4d
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_column_b.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_column_b_albedo.ktx",
+ "normal_aid": "sponza_column_b_normal.ktx",
+ "brdf_aid": "sponza_column_b_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_column_c.msf b/assets/extensions/sponza/materials/sponza_column_c.msf
new file mode 100644
index 0000000000000000000000000000000000000000..3d4331daecebb93df3acf72c737f272f40a02c04
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_column_c.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_column_c_albedo.ktx",
+ "normal_aid": "sponza_column_c_normal.ktx",
+ "brdf_aid": "sponza_column_c_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_details.msf b/assets/extensions/sponza/materials/sponza_details.msf
new file mode 100644
index 0000000000000000000000000000000000000000..d9a709e4643f111420edc0990a8df57033ee4951
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_details.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_details_albedo.ktx",
+ "normal_aid": "sponza_details_normal.ktx",
+ "brdf_aid": "sponza_details_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_fabric_c.msf b/assets/extensions/sponza/materials/sponza_fabric_c.msf
new file mode 100644
index 0000000000000000000000000000000000000000..b7da8b3734dad5e4490d6b9aa2caf30e486bbe91
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_fabric_c.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_fabric_c_albedo.ktx",
+ "normal_aid": "sponza_fabric_c_normal.ktx",
+ "brdf_aid": "sponza_fabric_c_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_fabric_d.msf b/assets/extensions/sponza/materials/sponza_fabric_d.msf
new file mode 100644
index 0000000000000000000000000000000000000000..8e5e8420a2ae4053fb3132c82c8b38d82f523c06
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_fabric_d.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_fabric_d_albedo.ktx",
+ "normal_aid": "sponza_fabric_d_normal.ktx",
+ "brdf_aid": "sponza_fabric_d_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_fabric_e.msf b/assets/extensions/sponza/materials/sponza_fabric_e.msf
new file mode 100644
index 0000000000000000000000000000000000000000..423b746af4cc03fe8993dbcd86c9e97841d77ecb
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_fabric_e.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_fabric_e_albedo.ktx",
+ "normal_aid": "sponza_fabric_e_normal.ktx",
+ "brdf_aid": "sponza_fabric_e_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_fabric_f.msf b/assets/extensions/sponza/materials/sponza_fabric_f.msf
new file mode 100644
index 0000000000000000000000000000000000000000..2f8ff4dd15d148395c15f95d79e5dad574a55fa1
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_fabric_f.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_fabric_f_albedo.ktx",
+ "normal_aid": "sponza_fabric_f_normal.ktx",
+ "brdf_aid": "sponza_fabric_f_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_fabric_g.msf b/assets/extensions/sponza/materials/sponza_fabric_g.msf
new file mode 100644
index 0000000000000000000000000000000000000000..bff06f0e669e876b1ef2ba871cb528685dc68c40
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_fabric_g.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_fabric_g_albedo.ktx",
+ "normal_aid": "sponza_fabric_g_normal.ktx",
+ "brdf_aid": "sponza_fabric_g_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_flagpole.msf b/assets/extensions/sponza/materials/sponza_flagpole.msf
new file mode 100644
index 0000000000000000000000000000000000000000..6cbbc3d7d5cbd58e91207a803a90c805331fab0b
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_flagpole.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_flagpole_albedo.ktx",
+ "normal_aid": "sponza_flagpole_normal.ktx",
+ "brdf_aid": "sponza_flagpole_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_floor.msf b/assets/extensions/sponza/materials/sponza_floor.msf
new file mode 100644
index 0000000000000000000000000000000000000000..9517f48e47df693a932450fe8308ddf4cbd6ffa6
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_floor.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_floor_albedo.ktx",
+ "normal_aid": "sponza_floor_normal.ktx",
+ "brdf_aid": "sponza_floor_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_leaf.msf b/assets/extensions/sponza/materials/sponza_leaf.msf
new file mode 100644
index 0000000000000000000000000000000000000000..1cc177df0f08a3acbc2b91e27f3e5038a77c481b
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_leaf.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "alphatest",
+ "albedo_aid": "sponza_leaf_albedo.ktx",
+ "normal_aid": "sponza_leaf_normal.ktx",
+ "brdf_aid": "sponza_leaf_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_material__25.msf b/assets/extensions/sponza/materials/sponza_material__25.msf
new file mode 100644
index 0000000000000000000000000000000000000000..4e97573143c546ae033f664184dc8c5c945df7d2
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_material__25.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_material__25_albedo.ktx",
+ "normal_aid": "sponza_material__25_normal.ktx",
+ "brdf_aid": "sponza_material__25_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_material__298.msf b/assets/extensions/sponza/materials/sponza_material__298.msf
new file mode 100644
index 0000000000000000000000000000000000000000..a0e95c7e75c2049a59798d5cad9d07fe0f9b9436
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_material__298.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_material__298_albedo.ktx",
+ "normal_aid": "sponza_material__298_normal.ktx",
+ "brdf_aid": "sponza_material__298_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_material__47.msf b/assets/extensions/sponza/materials/sponza_material__47.msf
new file mode 100644
index 0000000000000000000000000000000000000000..3b74c1fa72f8f69b91250b45175241ab6c4efa43
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_material__47.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_material__47_albedo.ktx",
+ "normal_aid": "sponza_material__47_normal.ktx",
+ "brdf_aid": "sponza_material__47_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_material__57.msf b/assets/extensions/sponza/materials/sponza_material__57.msf
new file mode 100644
index 0000000000000000000000000000000000000000..f19277b094fe92e7beaaca6dff22f5d1ebb8cedc
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_material__57.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "alphatest",
+ "albedo_aid": "sponza_material__57_albedo.ktx",
+ "normal_aid": "sponza_material__57_normal.ktx",
+ "brdf_aid": "sponza_material__57_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_roof.msf b/assets/extensions/sponza/materials/sponza_roof.msf
new file mode 100644
index 0000000000000000000000000000000000000000..6258f02196b185fde3237b58cf3a101025ffc1bd
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_roof.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_roof_albedo.ktx",
+ "normal_aid": "sponza_roof_normal.ktx",
+ "brdf_aid": "sponza_roof_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_vase.msf b/assets/extensions/sponza/materials/sponza_vase.msf
new file mode 100644
index 0000000000000000000000000000000000000000..c44e56499c6d753ab7848f254ab1f0518cac1980
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_vase.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_vase_albedo.ktx",
+ "normal_aid": "sponza_vase_normal.ktx",
+ "brdf_aid": "sponza_vase_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_vase_hanging.msf b/assets/extensions/sponza/materials/sponza_vase_hanging.msf
new file mode 100644
index 0000000000000000000000000000000000000000..f56fb68dbf05ae9c61af95c00573c36624ad53fd
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_vase_hanging.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_vase_hanging_albedo.ktx",
+ "normal_aid": "sponza_vase_hanging_normal.ktx",
+ "brdf_aid": "sponza_vase_hanging_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/materials/sponza_vase_round.msf b/assets/extensions/sponza/materials/sponza_vase_round.msf
new file mode 100644
index 0000000000000000000000000000000000000000..80e507b44e1782ca6a82d64880c664fb3bd25731
--- /dev/null
+++ b/assets/extensions/sponza/materials/sponza_vase_round.msf
@@ -0,0 +1,7 @@
+{
+ "substance_id": "default",
+ "albedo_aid": "sponza_vase_round_albedo.ktx",
+ "normal_aid": "sponza_vase_round_normal.ktx",
+ "brdf_aid": "sponza_vase_round_brdf.ktx",
+ "emission_aid": ""
+}
diff --git a/assets/extensions/sponza/models/sponza.mmf b/assets/extensions/sponza/models/sponza.mmf
new file mode 100644
index 0000000000000000000000000000000000000000..9899a415f8645362efd3b451dbdc70455370b160
--- /dev/null
+++ b/assets/extensions/sponza/models/sponza.mmf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5c87d9119872f529b454416ffb95cc0474f55eebdf5bdc21106947a1170c4c75
+size 9539076
diff --git a/assets/extensions/sponza/textures/sponza_16___default_albedo.ktx b/assets/extensions/sponza/textures/sponza_16___default_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..a37d47e4b44cdc3bb64acd31a93e1d7ddde98431
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_16___default_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fb9420efd5e0a18b09dfb5762e849e6ab8ab28c85f54e528f0ab1f3aa67c7946
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_16___default_brdf.ktx b/assets/extensions/sponza/textures/sponza_16___default_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..947a378ed83ad2cb96168515344985ffa746cfff
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_16___default_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1bbd6227ad160aa52de52130ed5373e1db756e0a7753999f04f12d69846ee703
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_16___default_normal.ktx b/assets/extensions/sponza/textures/sponza_16___default_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..edaccff1722d2d7f7aeb08b841b82b1f994fcd78
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_16___default_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2edc6fbef2cee30f862c59c2f57955595fc617e327ee5115a3a19f1768f2ac8e
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_arch_albedo.ktx b/assets/extensions/sponza/textures/sponza_arch_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..4690eb7e7c75fe36228cec814db21158dda59a90
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_arch_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85aae7ac331b404fc7c6293cb65d84986b3ca16a5a882ca60a62d891860fff8a
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_arch_brdf.ktx b/assets/extensions/sponza/textures/sponza_arch_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..7b8b565a57b9531d545c140bcdca84e64e230ffc
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_arch_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:82f3ba291fda67f48edbccdd67777a0c183575b7b60e845dd3323dcbd4797dfe
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_arch_normal.ktx b/assets/extensions/sponza/textures/sponza_arch_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..4a5a0631f0db2ade80d5c02092490785f9ac456d
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_arch_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bef3a6773d2983785384d699d06f8e99eb130c4e70ea17382855339b4c6b782b
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_bricks_albedo.ktx b/assets/extensions/sponza/textures/sponza_bricks_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..84ca6b921fcae39ac50f372a41827d472d860ed9
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_bricks_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6fb8e16c12ae05e1e58f32d59dc81916004b4c53fd45fec0b07a01489d245756
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_bricks_brdf.ktx b/assets/extensions/sponza/textures/sponza_bricks_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5c02de0440c9c5ab9a95408cb336a1bfeca3bd66
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_bricks_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6b8d1dc0b027c63d3381d5c90321f215072662201688b71eaa56aacb3cc670a3
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_bricks_normal.ktx b/assets/extensions/sponza/textures/sponza_bricks_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..09f85527f083f9bc98643e81aed2a261c84c1318
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_bricks_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:874361242e4d2a0ca6cb89996bdbe129606ccbb36306055b448ca3b66af22b37
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_ceiling_albedo.ktx b/assets/extensions/sponza/textures/sponza_ceiling_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..efcfcb4beb623dd6a8741462e24d620e1113d8fb
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_ceiling_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4ce717672711222c7a4b0f5130b0bf27b8622ea61f01ede8c99dd35dab09abd6
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_ceiling_brdf.ktx b/assets/extensions/sponza/textures/sponza_ceiling_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..a56a3f3e0442c72c626d13d0dbba7efeaac9822c
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_ceiling_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6553ff559f2304775b1c2cccab9972aa22637676370caaf89adf5be9e4dbfbe8
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_ceiling_normal.ktx b/assets/extensions/sponza/textures/sponza_ceiling_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..8183a48139a1572a7f44cfb026a50b24e5c6cdb2
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_ceiling_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1cf54ee821c42f9dd6f48977d1f16a4782b0b3f01dd754507b99e9f082e05e0c
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_chain_albedo.ktx b/assets/extensions/sponza/textures/sponza_chain_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..548d6a867a14e4b3c1b7cfb1f0adbab05f6682db
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_chain_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5aa8a655902063ed1c8b52b7765d9cc3165d88ded08693b6840241e7477b0eff
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_chain_brdf.ktx b/assets/extensions/sponza/textures/sponza_chain_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..2ba7b48dc5b3122fe12f33892e42145a66dda326
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_chain_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:272bf43c27dfecdfb0284608c49757dc4e3d87f2cb994504fa606735feb738c6
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_chain_normal.ktx b/assets/extensions/sponza/textures/sponza_chain_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..4250e1d63dcfdf170a00c6bb3babf4cb0682c129
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_chain_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:08cc92c73dce36ed2466edbca88da6c18aa0337382155fe52c821bf1952253d6
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_a_albedo.ktx b/assets/extensions/sponza/textures/sponza_column_a_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..da54c49a579c43b7694c81f68af48284e1c2bd96
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_a_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c372220ce7707defd5eff652d216bfc23be7ef7c68b35a8912d6df3c23da5528
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_a_brdf.ktx b/assets/extensions/sponza/textures/sponza_column_a_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..6241359107ab3c1f33fccda24606e2396840f200
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_a_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f382ced121b215716de65f521be6ec4e3483fc40d32af2da073eb71fa566789a
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_a_normal.ktx b/assets/extensions/sponza/textures/sponza_column_a_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..efe1ee159b503cd4f2892d694e7bae1dfac3dbd5
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_a_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f157ef0b60b832fd8ee4608a22687df7a32a3072f917ec7aaf7609d21a2a8461
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_b_albedo.ktx b/assets/extensions/sponza/textures/sponza_column_b_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..db2af2d63fd2dd2e9fed428e94a89f75eb3f8bb2
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_b_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:131d968a2bf96ca0c43ec0c300f54bf6be801f43f394900d43d1f80183c632a7
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_b_brdf.ktx b/assets/extensions/sponza/textures/sponza_column_b_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..091c4f4ccf24f2d5478b56b342ec7d555e9a0856
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_b_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:75ff1d51c9f1d7a9fd930a55f8efae78a95a40d0fda2f6ad3e186de2b9ef919e
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_b_normal.ktx b/assets/extensions/sponza/textures/sponza_column_b_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..412d8d814e4da520b4a403bf01c25a22af22f951
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_b_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4ba7cb912331bfc76c91be2099fb5ae9fa3b23c862aa5511c1a4f82fbcf681f8
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_c_albedo.ktx b/assets/extensions/sponza/textures/sponza_column_c_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..0f4242282ea8ffd6e7e7f6db3487660b1821208c
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_c_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4ad1e50ec408ef6f71e8c77dc750d4a5a7f9b55fbf14c71c885f9989d23ef599
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_c_brdf.ktx b/assets/extensions/sponza/textures/sponza_column_c_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..4bd2c80480c3561e285f05327741c7f4344983bc
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_c_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:560919384791bb622982d1b6f0c6e881d9d5962d3f4dcd8801d5cc451c1cb72b
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_column_c_normal.ktx b/assets/extensions/sponza/textures/sponza_column_c_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..c95329e6aafa2971d79943662ce701a629f252bf
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_column_c_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c319e89fde4c7e200041e982cd2f5164a2f9467b15d8953e4e7e2cc8d1bfa3f9
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_details_albedo.ktx b/assets/extensions/sponza/textures/sponza_details_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..be545bbfb8978a7419355fad68285cc3858a410b
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_details_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce61e4039477154bf6a1c2199fe42eeb6ed87821182226bf4cec9e83f550ca2a
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_details_brdf.ktx b/assets/extensions/sponza/textures/sponza_details_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..72b6ec889c657b45247829edbf2806bc59dd5af0
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_details_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a9071e744605dfd04c12732730abb41cc160f8ba9a1dea7dd6b8dd2a9359e52f
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_details_normal.ktx b/assets/extensions/sponza/textures/sponza_details_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..a24574ec93d29d048b8f27380d2e33209701a6e6
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_details_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce87b7b4118879b6fb6e056fda069978b17d64d62971935e8cf9fbc9f0c46292
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_c_albedo.ktx b/assets/extensions/sponza/textures/sponza_fabric_c_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5c91cab828e01aa356898b17475a486f2f91c74e
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_c_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9f93996446257cdf5db43bd9e99445221a64ba65cdd308e999241a83c117909e
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_c_brdf.ktx b/assets/extensions/sponza/textures/sponza_fabric_c_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..41c18ce73ce85016b02cb48046df4cc9776f3527
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_c_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:55d81c3007a8577234aac95fb947ce6a509b40fc0988262af74f1536700dcf80
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_c_normal.ktx b/assets/extensions/sponza/textures/sponza_fabric_c_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5be2878749f0e4ab9c5fc0db79f6f5d5afcaca6a
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_c_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:74cb3cb214e283e1051532d3b5a2c94f4506dd229314e61abac76655fc59264c
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_d_albedo.ktx b/assets/extensions/sponza/textures/sponza_fabric_d_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5cc38126155df5d9a988239d3dfb3f3462153f24
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_d_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:525e69ec0e93fc075456cb67b963d97101cbf428604ae5d45bb01c2522220490
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_d_brdf.ktx b/assets/extensions/sponza/textures/sponza_fabric_d_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..947a378ed83ad2cb96168515344985ffa746cfff
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_d_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1bbd6227ad160aa52de52130ed5373e1db756e0a7753999f04f12d69846ee703
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_d_normal.ktx b/assets/extensions/sponza/textures/sponza_fabric_d_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..edaccff1722d2d7f7aeb08b841b82b1f994fcd78
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_d_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2edc6fbef2cee30f862c59c2f57955595fc617e327ee5115a3a19f1768f2ac8e
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_e_albedo.ktx b/assets/extensions/sponza/textures/sponza_fabric_e_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..3f1b38ec6997bb80f1c094286c399c0e61b42e95
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_e_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c6152050ed59a026225a7059d960749585dbfefdacacf062b379c90b27310e04
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_e_brdf.ktx b/assets/extensions/sponza/textures/sponza_fabric_e_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..947a378ed83ad2cb96168515344985ffa746cfff
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_e_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1bbd6227ad160aa52de52130ed5373e1db756e0a7753999f04f12d69846ee703
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_e_normal.ktx b/assets/extensions/sponza/textures/sponza_fabric_e_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..edaccff1722d2d7f7aeb08b841b82b1f994fcd78
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_e_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2edc6fbef2cee30f862c59c2f57955595fc617e327ee5115a3a19f1768f2ac8e
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_f_albedo.ktx b/assets/extensions/sponza/textures/sponza_fabric_f_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..1df7b0ac290b5e345948c722d913852343c60780
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_f_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fd3b438dc8eacf1785fd545af42203559f31082525cbcaaa0fbe1534fb9cf1df
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_f_brdf.ktx b/assets/extensions/sponza/textures/sponza_fabric_f_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..41c18ce73ce85016b02cb48046df4cc9776f3527
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_f_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:55d81c3007a8577234aac95fb947ce6a509b40fc0988262af74f1536700dcf80
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_f_normal.ktx b/assets/extensions/sponza/textures/sponza_fabric_f_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5be2878749f0e4ab9c5fc0db79f6f5d5afcaca6a
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_f_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:74cb3cb214e283e1051532d3b5a2c94f4506dd229314e61abac76655fc59264c
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_g_albedo.ktx b/assets/extensions/sponza/textures/sponza_fabric_g_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..25fb82b01d62b1f9b972f792862e23e58b229ccd
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_g_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:78a365286b628eee852aba91913bc3a836c2d1ee7fab55f91665c76f41eebcfd
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_g_brdf.ktx b/assets/extensions/sponza/textures/sponza_fabric_g_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..41c18ce73ce85016b02cb48046df4cc9776f3527
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_g_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:55d81c3007a8577234aac95fb947ce6a509b40fc0988262af74f1536700dcf80
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_fabric_g_normal.ktx b/assets/extensions/sponza/textures/sponza_fabric_g_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..5be2878749f0e4ab9c5fc0db79f6f5d5afcaca6a
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_fabric_g_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:74cb3cb214e283e1051532d3b5a2c94f4506dd229314e61abac76655fc59264c
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_flagpole_albedo.ktx b/assets/extensions/sponza/textures/sponza_flagpole_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..4ac25f41eb2d907a75a6e50f687fa917fca053a9
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_flagpole_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:655174aa4961a1a20dfb54f603f83453d77f00dc3d50b33655b120345f1184d4
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_flagpole_brdf.ktx b/assets/extensions/sponza/textures/sponza_flagpole_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..e62cbbc3ba03ff40eb936ce1041a7b2b65a5c041
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_flagpole_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:db1e64c061ed1378ef2df0cb69dc0c8da1a6c644e552cded8e9415f7ee0bfb06
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_flagpole_normal.ktx b/assets/extensions/sponza/textures/sponza_flagpole_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..6ac2cf1891922d88bd016b8f1f140c70d6ad39a3
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_flagpole_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7a15bbc9cbf0b7e51039eb8643dd1717ea6cb3bc1bf316ec5d25bec66ff5779b
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_floor_albedo.ktx b/assets/extensions/sponza/textures/sponza_floor_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..241726940318101edc69c5b7d1a6c81f54f8071d
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_floor_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4260ebda6cf61556ef8c8793398da312c89f45dc235a95f8bfbbef94f9125e9c
+size 5592504
diff --git a/assets/extensions/sponza/textures/sponza_floor_brdf.ktx b/assets/extensions/sponza/textures/sponza_floor_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..074a5928e405d7728a6c788b6227b4d48563e470
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_floor_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44ef13238c11dd18e1d969dbf0a2dbc4a1e85068f28846ee640e386635adf500
+size 5592504
diff --git a/assets/extensions/sponza/textures/sponza_floor_normal.ktx b/assets/extensions/sponza/textures/sponza_floor_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..6712da91a3f29c67b58955f70fdad29654514fd8
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_floor_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8b685f702654e0a312f7f666beade3277b5eeb5f6a3c41036c7701927d8e032e
+size 5592504
diff --git a/assets/extensions/sponza/textures/sponza_leaf_albedo.ktx b/assets/extensions/sponza/textures/sponza_leaf_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..85de3b94c5eb719f032f93957188bd8709c431be
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_leaf_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:282d799d74c1c568e95ff1b4fcbb2968b15503a1b68bcdfd8b8a8f6e81f05756
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_leaf_brdf.ktx b/assets/extensions/sponza/textures/sponza_leaf_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..0ce772af7c34083c065b0120317487ea02091826
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_leaf_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:999c84e5ad0f2dd923e1662b53725c2be8815aeed74ce6f104baa546fce3dd42
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_leaf_normal.ktx b/assets/extensions/sponza/textures/sponza_leaf_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..c74abcb51d38e29ff11ac95f04e138ddca9db4cb
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_leaf_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:534b0f658d65db5eb390ddb8eb5e9ba2bb52bb32b1c0c8c2a08898845b36f9fb
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__25_albedo.ktx b/assets/extensions/sponza/textures/sponza_material__25_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..9640d5fe9731384d5a9170ff1f408a75969a2161
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__25_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f0482e168fb3f902ba99f0200ee76a593e07369b5d06fa920abd5310c4943e2c
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__25_brdf.ktx b/assets/extensions/sponza/textures/sponza_material__25_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..09b7d4e89ad5b28ebdc891cee3bc9da3878f571f
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__25_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2f1fabe9a48eee5c0c71437a6edad053622af15345c436fce8281244d4a5c3f8
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__25_normal.ktx b/assets/extensions/sponza/textures/sponza_material__25_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..30af18f5a244cbccadacbb0db0a940d800e616b6
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__25_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:83872e72c9fc53534b7782ef94e0fa9c67d057415207b200f0b622a7a60ccfdd
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__298_albedo.ktx b/assets/extensions/sponza/textures/sponza_material__298_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..92d0463b93aa0e254ab53748611801fe627d74b2
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__298_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:300c99cc290f7e2f74b9bafd88da2665190399386e85225e854c561035e02670
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__298_brdf.ktx b/assets/extensions/sponza/textures/sponza_material__298_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..09b7d4e89ad5b28ebdc891cee3bc9da3878f571f
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__298_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2f1fabe9a48eee5c0c71437a6edad053622af15345c436fce8281244d4a5c3f8
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__298_normal.ktx b/assets/extensions/sponza/textures/sponza_material__298_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..c20abeb9fd2b5193f5361bd2f176724356e23f8b
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__298_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e39560b6438f4475a6ae290f33fbb6cc459cfd9f7669ae926c6a86fa92f9d84e
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__47_albedo.ktx b/assets/extensions/sponza/textures/sponza_material__47_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..71e86bb633d45fdf3b4de4df0df551127aeff4b4
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__47_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:258295ec7dfec951defcf1a1e39a96f1fae87fafcb40002486c35b892ffae8a6
+size 1440
diff --git a/assets/extensions/sponza/textures/sponza_material__47_brdf.ktx b/assets/extensions/sponza/textures/sponza_material__47_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..ef1d9446fe45adf6796bed796c9c7ffe4dbe2cdb
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__47_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6ee4817d7ba8c78aea221901ace7db587bc61eb9634e3061472e304bf1963557
+size 349616
diff --git a/assets/extensions/sponza/textures/sponza_material__47_normal.ktx b/assets/extensions/sponza/textures/sponza_material__47_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..019c632ec5dfeea4ea43a4124fa8b6bd7657c5cb
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__47_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5fd8297a123bbf6e1317eaa7e1769ec3afd5467d36cac2c6546309df86ead7a7
+size 349616
diff --git a/assets/extensions/sponza/textures/sponza_material__57_albedo.ktx b/assets/extensions/sponza/textures/sponza_material__57_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..7fcb5ebde9549d500ef62fcde67decec72f5069b
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__57_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3e4dbdfe09bdd1a76f82fa0a7c84772e50a0ea03e61a46aba1c49162edf04ddc
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__57_brdf.ktx b/assets/extensions/sponza/textures/sponza_material__57_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..a8ca59a374e27aeb2c8d66265a47437c256ffdeb
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__57_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6110cfa34cc2521376cfe06d6eee5e78cf8b71cc422eab4b447b097c745d836c
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_material__57_normal.ktx b/assets/extensions/sponza/textures/sponza_material__57_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..cfafae694b96e4158ab87bd7e1182a6a7cd45b11
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_material__57_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6df881e1e347128baff1e07ccdce66d72270168a30144fed86316b52e5fac233
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_roof_albedo.ktx b/assets/extensions/sponza/textures/sponza_roof_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..948000115ee6f0e9d486c22b42a9e1b5131457ee
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_roof_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a8c7340f5b37c67048db4c8cb9a64629f4cb19934de5bd20ac3bb99e65edc0fb
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_roof_brdf.ktx b/assets/extensions/sponza/textures/sponza_roof_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..d43339366f653e06f10162776ad93bc2a713f2de
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_roof_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:170e221ab3144369b7f1b7f27e3667ec8d6c4a43c3b6cb6ffd396fcbb5d82148
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_roof_normal.ktx b/assets/extensions/sponza/textures/sponza_roof_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..e2635838d376dbdceb4753d1cdb91be8eba67149
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_roof_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:04cc6619968018421bd45e099ddf4300b9b045a67a509f722be1a24f77a4dba8
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_albedo.ktx b/assets/extensions/sponza/textures/sponza_vase_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..85139951e3faaf19135419e27e408a063d77a3bd
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:28b6231a99b3e7a2c492de35262a8d040cff0bca7f4daa27713258b299372f5b
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_brdf.ktx b/assets/extensions/sponza/textures/sponza_vase_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..e2a5ed274fb13727c50e6f4166562dfe728adab0
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8783cda81301b0978c1d6feefc27a347e0fbd8ba598bf433bf245db97f97a716
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_hanging_albedo.ktx b/assets/extensions/sponza/textures/sponza_vase_hanging_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..29ec9268ad32063989b9638cc25868bc98608735
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_hanging_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fbacd57921c0efd8218dbd92bf3ea709b4a0c949597db97d2bd9d251b39efa8e
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_hanging_brdf.ktx b/assets/extensions/sponza/textures/sponza_vase_hanging_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..a8bcb5c617dfd242c755f2e228d30770aa4117d0
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_hanging_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e630186097c231adb94b5868701a5edddfbf420d480a38dfe7a4604693b890a
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_hanging_normal.ktx b/assets/extensions/sponza/textures/sponza_vase_hanging_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..4bde866e4f90eaec7f442d6b50bb5309fd268596
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_hanging_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:09db7278ccb4ac31576880a8d32970f97f243576ce0cdd95b9e2ea3c40c39e37
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_normal.ktx b/assets/extensions/sponza/textures/sponza_vase_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..27090e83ebe98cbde1e518972b14b5f7c3260eef
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fd742086cad72e09461b30afec04fdf47b1a39324bb47ec6540a8c492a1bb061
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_round_albedo.ktx b/assets/extensions/sponza/textures/sponza_vase_round_albedo.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..310a6441698dbec52d8e5b6d5d3867da0796b38e
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_round_albedo.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b3cf02152b2fdf525e79aa01e65c8cfd5ee8668af8d5cd1a8dcabc028d40d6fe
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_round_brdf.ktx b/assets/extensions/sponza/textures/sponza_vase_round_brdf.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..bbe74ac133d58997d5513b220882c7b1ab394337
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_round_brdf.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5828a4b3c4cec99dcd7c957997324885287599d3f57098947515a5141b2a77ea
+size 1398196
diff --git a/assets/extensions/sponza/textures/sponza_vase_round_normal.ktx b/assets/extensions/sponza/textures/sponza_vase_round_normal.ktx
new file mode 100644
index 0000000000000000000000000000000000000000..9eb256d43bbc0534081a36cbad51314ef1ae7f8d
--- /dev/null
+++ b/assets/extensions/sponza/textures/sponza_vase_round_normal.ktx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dcd6675cd8aa82852f44c1712b9ea37e6dedaebb89649708c2105e5f36e32413
+size 1398196
diff --git a/clang-format.cmake b/clang-format.cmake
index 30b02f0ce3982cd0c59ec50953f313f13ceb5df9..e5b78033a735e1c8838c5f24e822c5b7d09476de 100644
--- a/clang-format.cmake
+++ b/clang-format.cmake
@@ -1,7 +1,7 @@
# additional target to perform clang-format run, requires clang-format
# get all project files
-file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.h*)
+file(GLOB_RECURSE ALL_SOURCE_FILES "${MIRRAGE_ROOT_DIR}/src/*.cpp" "${MIRRAGE_ROOT_DIR}/src/*.h*")
add_custom_target(
clangformat
diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt
index f1e7b60c9af42364cb98c341d9b1422dfe5f856b..073ac42abbb2b375ae6c695fda844fe5ef4ce083 100644
--- a/dependencies/CMakeLists.txt
+++ b/dependencies/CMakeLists.txt
@@ -1,15 +1,21 @@
-cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
SET(BUILD_SHARED_LIBS FALSE CACHE BOOL "" FORCE)
add_subdirectory(asyncplusplus)
-add_subdirectory(backward-cpp)
+
+if(${MIRRAGE_ENABLE_BACKWARD})
+ add_subdirectory(backward-cpp)
+endif()
+
add_subdirectory(enet)
include(glm_interface.cmake)
include(gsl_interface.cmake)
include(moodycamel_interface.cmake)
-include(nuklear_interface.cmake)
+include(imgui_interface.cmake)
-include(magic_get_interface.cmake)
+if(NOT TARGET boost::pfr)
+ include(magic_get_interface.cmake)
+endif()
SET(PHYSFS_ARCHIVE_7Z FALSE CACHE BOOL "" FORCE)
SET(PHYSFS_BUILD_SHARED FALSE CACHE BOOL "" FORCE)
@@ -20,6 +26,50 @@ include(plog_interface.cmake)
include(robin-map_interface.cmake)
include(doctest_interface.cmake)
+if (WIN32)
+ option(MIRRAGE_PREFER_SYSTEM_SDL "Try to find an already installed SDL2 on the system before building our own" OFF)
+else()
+ option(MIRRAGE_PREFER_SYSTEM_SDL "Try to find an already installed SDL2 on the system before building our own" ON)
+endif()
+if(MIRRAGE_PREFER_SYSTEM_SDL)
+ find_package(SDL2)
+ if(SDL2_FOUND)
+ if(TARGET SDL2::SDL2)
+ set_target_properties(SDL2::SDL2 PROPERTIES IMPORTED_GLOBAL TRUE)
+ set_target_properties(SDL2::SDL2main PROPERTIES IMPORTED_GLOBAL TRUE)
+ add_library(mirrage::deps::SDL2 ALIAS SDL2::SDL2)
+ add_library(mirrage::deps::SDL2main ALIAS SDL2::SDL2main)
+ else()
+ if(NOT EXISTS ${SDL2_INCLUDE_DIR}/SDL.h)
+ if(EXISTS ${SDL2_INCLUDE_DIR}/SDL2/SDL.h)
+ set(SDL2_INCLUDE_DIR "${SDL2_INCLUDE_DIR}/SDL2")
+ else()
+ find_path(SDL2_INCLUDE_DIR NAMES SDL_vulkan.h PATH_SUFFIXES SDL2)
+ message("Found SDL2 include directory: ${SDL2_INCLUDE_DIR}")
+ endif()
+ endif()
+
+ if(EXISTS ${SDL2_INCLUDE_DIR}/SDL.h)
+ add_library(mirrage::deps::SDL2 INTERFACE IMPORTED GLOBAL)
+ set_property(TARGET mirrage::deps::SDL2 PROPERTY INTERFACE_LINK_LIBRARIES ${SDL2_LIBRARIES})
+ set_property(TARGET mirrage::deps::SDL2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR})
+ message("Generated SDL2 target: ${SDL2_LIBRARIES}; ${SDL2_INCLUDE_DIR}")
+ endif()
+ endif()
+ endif()
+endif()
+
+if(NOT TARGET mirrage::deps::SDL2)
+ message("Building SDL2 from source")
+ add_subdirectory(SDL)
+ if(MSVC)
+ target_compile_options(SDL2 PRIVATE /wd4267 /wd4018)
+ target_compile_options(SDL2-static PRIVATE /wd4267 /wd4018)
+ endif()
+ add_library(mirrage::deps::SDL2 ALIAS SDL2-static)
+ add_library(mirrage::deps::SDL2main ALIAS SDL2main)
+endif()
+
add_subdirectory(sf2)
@@ -31,4 +81,5 @@ if(MIRRAGE_BUILD_MESH_CONVERTER)
endif()
add_subdirectory(stb_image)
+ include(crunch_interface.cmake)
endif()
diff --git a/dependencies/SDL b/dependencies/SDL
new file mode 160000
index 0000000000000000000000000000000000000000..279eb4402b59c15eee566d98bbe4d2b9c22604cd
--- /dev/null
+++ b/dependencies/SDL
@@ -0,0 +1 @@
+Subproject commit 279eb4402b59c15eee566d98bbe4d2b9c22604cd
diff --git a/dependencies/asyncplusplus b/dependencies/asyncplusplus
index df0df2d889a78cc594aad8bbbdeb6240e7605b88..a22315d5bda54f802a0c94ecd71e4b33fbfa2796 160000
--- a/dependencies/asyncplusplus
+++ b/dependencies/asyncplusplus
@@ -1 +1 @@
-Subproject commit df0df2d889a78cc594aad8bbbdeb6240e7605b88
+Subproject commit a22315d5bda54f802a0c94ecd71e4b33fbfa2796
diff --git a/dependencies/crunch b/dependencies/crunch
new file mode 160000
index 0000000000000000000000000000000000000000..b9b8066a84a2c19769a8200cd114b8e3f00b540a
--- /dev/null
+++ b/dependencies/crunch
@@ -0,0 +1 @@
+Subproject commit b9b8066a84a2c19769a8200cd114b8e3f00b540a
diff --git a/dependencies/crunch_interface.cmake b/dependencies/crunch_interface.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..a54b827265b50508c478d505ec821a3bbc033dc6
--- /dev/null
+++ b/dependencies/crunch_interface.cmake
@@ -0,0 +1,117 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+project(crunch)
+
+if(MSVC)
+ set(CRUNCH_PLATFORM_SOURCES crunch/crnlib/crn_threading_win32.cpp)
+else()
+ set(CRUNCH_PLATFORM_SOURCES crunch/crnlib/crn_threading_pthreads.cpp)
+endif()
+
+
+file(GLOB_RECURSE CRUNCH_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/crunch/crnlib/*.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/crunch/crunch/*.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/crunch/inc/*.h
+)
+add_library(crunch STATIC ${CRUNCH_SOURCES} ${CRUNCH_PLATFORM_SOURCES}
+ crunch/crnlib/crn_arealist.cpp
+ crunch/crnlib/crn_assert.cpp
+ crunch/crnlib/crn_checksum.cpp
+ crunch/crnlib/crn_colorized_console.cpp
+ crunch/crnlib/crn_command_line_params.cpp
+ crunch/crnlib/crn_comp.cpp
+ crunch/crnlib/crn_console.cpp
+ crunch/crnlib/crn_core.cpp
+ crunch/crnlib/crn_data_stream.cpp
+ crunch/crnlib/crn_dds_comp.cpp
+ crunch/crnlib/crn_decomp.cpp
+ crunch/crnlib/crn_dxt1.cpp
+ crunch/crnlib/crn_dxt5a.cpp
+ crunch/crnlib/crn_dxt.cpp
+ crunch/crnlib/crn_dxt_endpoint_refiner.cpp
+ crunch/crnlib/crn_dxt_fast.cpp
+ crunch/crnlib/crn_dxt_hc_common.cpp
+ crunch/crnlib/crn_dxt_hc.cpp
+ crunch/crnlib/crn_dxt_image.cpp
+ crunch/crnlib/crn_dynamic_string.cpp
+ crunch/crnlib/crn_etc.cpp
+ crunch/crnlib/crn_file_utils.cpp
+ crunch/crnlib/crn_find_files.cpp
+ crunch/crnlib/crn_hash.cpp
+ crunch/crnlib/crn_hash_map.cpp
+ crunch/crnlib/crn_huffman_codes.cpp
+ crunch/crnlib/crn_image_utils.cpp
+ crunch/crnlib/crn_jpgd.cpp
+ crunch/crnlib/crn_jpge.cpp
+ crunch/crnlib/crn_ktx_texture.cpp
+ crunch/crnlib/crnlib.cpp
+ crunch/crnlib/crn_lzma_codec.cpp
+ crunch/crnlib/crn_math.cpp
+ crunch/crnlib/crn_mem.cpp
+ crunch/crnlib/crn_miniz.cpp
+ crunch/crnlib/crn_mipmapped_texture.cpp
+ crunch/crnlib/crn_pixel_format.cpp
+ crunch/crnlib/crn_platform.cpp
+ crunch/crnlib/crn_prefix_coding.cpp
+ crunch/crnlib/crn_qdxt1.cpp
+ crunch/crnlib/crn_qdxt5.cpp
+ crunch/crnlib/crn_rand.cpp
+ crunch/crnlib/crn_resample_filters.cpp
+ crunch/crnlib/crn_resampler.cpp
+ crunch/crnlib/crn_rg_etc1.cpp
+ crunch/crnlib/crn_ryg_dxt.cpp
+ crunch/crnlib/crn_sparse_bit_array.cpp
+ crunch/crnlib/crn_stb_image.cpp
+ crunch/crnlib/crn_strutils.cpp
+ crunch/crnlib/crn_symbol_codec.cpp
+ crunch/crnlib/crn_texture_comp.cpp
+ crunch/crnlib/crn_texture_conversion.cpp
+ crunch/crnlib/crn_texture_file_types.cpp
+ crunch/crnlib/crn_threaded_resampler.cpp
+ crunch/crnlib/crn_timer.cpp
+ crunch/crnlib/crn_utils.cpp
+ crunch/crnlib/crn_value.cpp
+ crunch/crnlib/crn_vector.cpp
+ crunch/crnlib/crn_zeng.cpp
+ crunch/crnlib/lzma_7zBuf2.cpp
+ crunch/crnlib/lzma_7zBuf.cpp
+ crunch/crnlib/lzma_7zCrc.cpp
+ crunch/crnlib/lzma_7zFile.cpp
+ crunch/crnlib/lzma_7zStream.cpp
+ crunch/crnlib/lzma_Alloc.cpp
+ crunch/crnlib/lzma_Bcj2.cpp
+ crunch/crnlib/lzma_Bra86.cpp
+ crunch/crnlib/lzma_Bra.cpp
+ crunch/crnlib/lzma_BraIA64.cpp
+ crunch/crnlib/lzma_LzFind.cpp
+ crunch/crnlib/lzma_LzmaDec.cpp
+ crunch/crnlib/lzma_LzmaEnc.cpp
+ crunch/crnlib/lzma_LzmaLib.cpp
+)
+add_library(crunch::crunch ALIAS crunch)
+
+if(NOT MSVC)
+ target_compile_options(crunch PRIVATE -fno-strict-aliasing -lpthread -w)
+endif()
+
+target_include_directories(crunch PUBLIC
+ $
+ $)
+
+install(TARGETS crunch EXPORT crunchTargets
+ INCLUDES DESTINATION include
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+)
+install(DIRECTORY crunch/inc/ DESTINATION include)
+
+export(
+ EXPORT crunchTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/crunchTargets.cmake"
+)
+
+install(
+ EXPORT crunchTargets FILE crunchTargets.cmake
+ DESTINATION lib/cmake
+)
diff --git a/dependencies/enet/CMakeLists.txt b/dependencies/enet/CMakeLists.txt
index 27f932183227a624d74e1ae9b977fee0fa9ba8d4..30a6bf8746e5d48f1abfa2d3a981ec064512f301 100644
--- a/dependencies/enet/CMakeLists.txt
+++ b/dependencies/enet/CMakeLists.txt
@@ -71,8 +71,12 @@ target_include_directories(enet PUBLIC
$
$)
-if (MINGW)
- target_link_libraries(enet winmm ws2_32)
+if(WIN32)
+ target_link_libraries(enet PUBLIC winmm ws2_32)
+endif()
+
+if(MSVC)
+ target_compile_definitions(enet PRIVATE _WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
install(TARGETS enet EXPORT enetTargets
diff --git a/dependencies/imgui b/dependencies/imgui
new file mode 160000
index 0000000000000000000000000000000000000000..a53c57152b83491a4bcd7fceca9d6cbc887c0c54
--- /dev/null
+++ b/dependencies/imgui
@@ -0,0 +1 @@
+Subproject commit a53c57152b83491a4bcd7fceca9d6cbc887c0c54
diff --git a/dependencies/imgui_interface.cmake b/dependencies/imgui_interface.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..b99e5247476485d94fee10d68fa2b98905680562
--- /dev/null
+++ b/dependencies/imgui_interface.cmake
@@ -0,0 +1,36 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+project(imgui)
+
+add_library(imgui STATIC
+ imgui/imgui.cpp
+ imgui/imgui.h
+ imgui/imgui_demo.cpp
+ imgui/imgui_draw.cpp
+ imgui/imgui_internal.h
+ imgui/imgui_widgets.cpp
+ imgui/imstb_rectpack.h
+ imgui/imstb_textedit.h
+ imgui/imstb_truetype.h
+)
+add_library(imgui::imgui ALIAS imgui)
+target_include_directories(imgui SYSTEM INTERFACE
+ $
+ $
+)
+install(TARGETS imgui EXPORT imguiTargets
+ INCLUDES DESTINATION include
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+)
+
+export(
+ EXPORT imguiTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/imguiTargets.cmake"
+)
+
+install(
+ EXPORT imguiTargets FILE imguiTargets.cmake
+ NAMESPACE imgui::
+ DESTINATION lib/cmake
+)
diff --git a/dependencies/magic_get_interface.cmake b/dependencies/magic_get_interface.cmake
index cb58d2288368cb8b43140205fa85e82c7b6e0551..e19539e44d0828a739610e43080a34ce40d7fb1d 100644
--- a/dependencies/magic_get_interface.cmake
+++ b/dependencies/magic_get_interface.cmake
@@ -1,21 +1,14 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
-project(magic_get)
+include_guard()
-add_library(magic_get INTERFACE)
-add_library(boost::magic_get ALIAS magic_get)
-target_include_directories(magic_get INTERFACE
+add_library(pfr INTERFACE)
+add_library(boost::pfr ALIAS pfr)
+target_include_directories(pfr INTERFACE
$
$)
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- # GCC broke their structured binding implementation in 7.2.0.
- # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81888
- # TODO: Remove when fixed.
- target_compile_options(magic_get INTERFACE -DBOOST_PFR_USE_CPP17=0)
-endif()
-
-install(TARGETS magic_get EXPORT magic_get_targets INCLUDES DESTINATION include)
+install(TARGETS pfr EXPORT magic_get_targets INCLUDES DESTINATION include)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/magic_get/include/
DESTINATION include
diff --git a/dependencies/nuklear b/dependencies/nuklear
deleted file mode 160000
index aeb18269131ab2c8d579aab935e15a8f4b040e38..0000000000000000000000000000000000000000
--- a/dependencies/nuklear
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit aeb18269131ab2c8d579aab935e15a8f4b040e38
diff --git a/dependencies/physfs b/dependencies/physfs
index 7c693a1ce4d2b82ebcb62674365863224543f5bd..53684f1d003058836f67e4f28e5d22e7d7fde597 160000
--- a/dependencies/physfs
+++ b/dependencies/physfs
@@ -1 +1 @@
-Subproject commit 7c693a1ce4d2b82ebcb62674365863224543f5bd
+Subproject commit 53684f1d003058836f67e4f28e5d22e7d7fde597
diff --git a/dependencies/plog b/dependencies/plog
index b56969ec12dacc40b08daa211e336feead538e94..7c54ae4110f2d4e37f083eb76ed069aa87d6697c 160000
--- a/dependencies/plog
+++ b/dependencies/plog
@@ -1 +1 @@
-Subproject commit b56969ec12dacc40b08daa211e336feead538e94
+Subproject commit 7c54ae4110f2d4e37f083eb76ed069aa87d6697c
diff --git a/dependencies/sf2 b/dependencies/sf2
index 26cc9aa8881064c6f43caac653d809d8717f4c4e..8a8c6a170fc05fbea5a75aeea8da20307ff26b08 160000
--- a/dependencies/sf2
+++ b/dependencies/sf2
@@ -1 +1 @@
-Subproject commit 26cc9aa8881064c6f43caac653d809d8717f4c4e
+Subproject commit 8a8c6a170fc05fbea5a75aeea8da20307ff26b08
diff --git a/embed_assets.cmake b/embed_assets.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..5b104f2685d84c4a02921d9610cadfa173aa38e4
--- /dev/null
+++ b/embed_assets.cmake
@@ -0,0 +1,94 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+macro(mirrage_embed_asset)
+ set(options)
+ set(oneValueArgs TARGET EXPORT)
+ set(multiValueArgs SOURCES DEPENDS)
+ cmake_parse_arguments(EMBED_ASSET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ set(target ${EMBED_ASSET_TARGET})
+
+ string (REPLACE ";" "$" src_files_str "${EMBED_ASSET_SOURCES}")
+
+ set(ID "mirrage_embedded_asset_${target}")
+ if(MSVC)
+ set(EMBED_SRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/embedded_assets_${target}.rc")
+ set(EMBED_MODE "MSVC")
+ elseif(APPLE)
+ set(EMBED_SRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.s")
+ set(EMBED_MODE "APPLE")
+ else()
+ set(EMBED_SRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.s")
+ set(EMBED_MODE "ASM")
+ endif()
+
+ add_custom_command(OUTPUT ${EMBED_SRC_FILE}
+ COMMAND ${CMAKE_COMMAND} -DMIRRAGE_ROOT_DIR=${MIRRAGE_ROOT_DIR} -DEMBED_MODE=${EMBED_MODE} -DID=${ID} -DSRC_FILES=${src_files_str} -DDST_DIR=${CMAKE_CURRENT_BINARY_DIR} -DEMBED_SRC_FILE=${EMBED_SRC_FILE} -P ${MIRRAGE_ROOT_DIR}/embed_recursive_into_asm.cmake
+ DEPENDS ${EMBED_ASSET_DEPENDS}
+ VERBATIM
+ )
+
+ set(PLATFORM_EMBED_SRC "")
+
+ if(MSVC)
+ string(TOUPPER "${ID}" RES_ID)
+ set(PLATFORM_EMBED_SRC
+"#include
+#include
+
+static auto create_asset() -> mirrage::asset::Embedded_asset {
+ auto handle = GetModuleHandle(NULL);
+ auto res = FindResource(handle, \"${RES_ID}\", RT_RCDATA);
+
+ if(!res){
+ throw std::runtime_error(\"Couldn't find ressource ${RES_ID}.\");
+ }
+
+ return mirrage::asset::Embedded_asset(\"${target}\",
+ gsl::span{reinterpret_cast(LockResource(LoadResource(handle, res))),
+ static_cast(SizeofResource(handle, res))});
+}
+
+static auto mirrage_asset_reg = create_asset();
+")
+
+ else()
+ set(PLATFORM_EMBED_SRC
+"extern \"C\" const char ${ID}[];
+extern \"C\" const int ${ID}_size;
+
+static auto mirrage_asset_reg = mirrage::asset::Embedded_asset(\"${target}\",
+ gsl::span{reinterpret_cast(&*${ID}), ${ID}_size});
+")
+ endif()
+
+ file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.cpp" CONTENT
+"#include
+
+${PLATFORM_EMBED_SRC}
+
+void ref_embedded_assets_${target}() {
+ volatile mirrage::asset::Embedded_asset* x = &mirrage_asset_reg;
+#ifndef _MSC_VER
+ asm volatile(\"\" : \"+r\" (x));
+#endif
+}
+")
+
+ if(NOT MSVC)
+ target_sources(${target} PRIVATE ${EMBED_SRC_FILE})
+ endif()
+ target_sources(${target} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.cpp")
+ add_custom_target(mirrage_embedded_assets_${target} DEPENDS ${EMBED_SRC_FILE})
+ add_dependencies(${target} mirrage_embedded_assets_${target})
+ if(MSVC)
+ add_library(mirrage_embedded_assets_obj_${target} OBJECT "${EMBED_SRC_FILE}")
+ target_link_libraries(${target} INTERFACE $)
+ add_dependencies(mirrage_embedded_assets_obj_${target} mirrage_embedded_assets_${target})
+ if(EMBED_ASSET_EXPORT)
+ install(TARGETS mirrage_embedded_assets_obj_${target}
+ EXPORT ${EMBED_ASSET_EXPORT}
+ OBJECTS DESTINATION lib)
+ endif()
+ endif()
+endmacro()
+
diff --git a/embed_recursive_into_asm.cmake b/embed_recursive_into_asm.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..d999e6dd90e2fa533ec6fb4b2532c6bc02dc27db
--- /dev/null
+++ b/embed_recursive_into_asm.cmake
@@ -0,0 +1,46 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+
+function(mirrage_copy_recursive src dst)
+ foreach(path ${src})
+ get_filename_component(file ${path} NAME)
+ if(IS_DIRECTORY ${path})
+ set(files "")
+ file(GLOB files ${path}/*)
+ mirrage_copy_recursive("${files}" "${dst}/${file}")
+ set(local_copied_files ${local_copied_files} ${copied_files})
+ else()
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}"
+ OUTPUT_QUIET
+ )
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different "${path}" "${dst}/"
+ OUTPUT_QUIET
+ )
+ list(APPEND local_copied_files "${dst}/${file}")
+ endif()
+ endforeach(path)
+
+ set(copied_files "${local_copied_files}" PARENT_SCOPE)
+endfunction()
+
+mirrage_copy_recursive("${SRC_FILES}" "${DST_DIR}/embed")
+
+execute_process(COMMAND ${CMAKE_COMMAND} -E tar "cfv" "${DST_DIR}/embedded_assets.zip" --format=zip ${copied_files}
+ WORKING_DIRECTORY "${DST_DIR}/embed"
+ OUTPUT_QUIET
+)
+
+if("${EMBED_MODE} " STREQUAL "MSVC ")
+ string(TOUPPER "${ID}" RES_ID)
+ configure_file(${MIRRAGE_ROOT_DIR}/embedded_assets.rc.in "${EMBED_SRC_FILE}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${EMBED_SRC_FILE}" OUTPUT_QUIET)
+else()
+ if("${EMBED_MODE} " STREQUAL "APPLE ")
+ set(SECTION ".const_data, no_dead_strip")
+ else()
+ set(SECTION ".section .rodata")
+ endif()
+ configure_file(${MIRRAGE_ROOT_DIR}/embedded_assets.s.in "${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.s")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/embedded_assets.s" OUTPUT_QUIET)
+endif()
diff --git a/embedded_assets.rc.in b/embedded_assets.rc.in
new file mode 100644
index 0000000000000000000000000000000000000000..fc61522bea5d43486062122ab5bde2154ddb5360
--- /dev/null
+++ b/embedded_assets.rc.in
@@ -0,0 +1 @@
+${RES_ID} RCDATA "${DST_DIR}/embedded_assets.zip"
diff --git a/embedded_assets.s.in b/embedded_assets.s.in
new file mode 100644
index 0000000000000000000000000000000000000000..1f908f5b15afb3f0dcffba20e2880db8723149b1
--- /dev/null
+++ b/embedded_assets.s.in
@@ -0,0 +1,9 @@
+ ${SECTION}
+ .global ${ID}
+ .global ${ID}_size
+${ID}:
+ .incbin "${DST_DIR}/embedded_assets.zip"
+1:
+${ID}_size:
+ .int 1b - ${ID}
+
diff --git a/globals.cmake b/globals.cmake
index f3af22636cdf410ac36ddec66b24373a39606e62..c6d3eae619d5eab54f92faa32c22fd53cecea21d 100644
--- a/globals.cmake
+++ b/globals.cmake
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -5,11 +6,19 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# required at top-level
set(MIRRAGE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})
+set(MIRRAGE_ROOT_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${MIRRAGE_ROOT_DIR}/modules")
-# add_definitions(-DHPC_HISTOGRAM_DEBUG_VIEW)
+enable_language(C CXX ASM)
+
add_definitions(-DGSL_TERMINATE_ON_CONTRACT_VIOLATION)
+if (WIN32)
+ option(MIRRAGE_ENABLE_BACKWARD "Enable stacktraces through backward-cpp" OFF)
+else()
+ option(MIRRAGE_ENABLE_BACKWARD "Enable stacktraces through backward-cpp" ON)
+endif()
+
# LTO
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024 -fno-strict-aliasing")
@@ -39,7 +48,7 @@ endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(MIRRAGE_DEFAULT_COMPILER_ARGS -Wextra -Wall -pedantic -Wextra-semi
-Wzero-as-null-pointer-constant -Wold-style-cast -Werror
- -Wno-unused-parameter -Wno-unused-private-field -Wno-missing-braces)
+ -Wno-unused-parameter -Wno-unused-private-field -Wno-missing-braces -Wno-error-unused-command-line-argument)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(MIRRAGE_DEFAULT_COMPILER_ARGS -Wextra -Wall -pedantic
@@ -47,7 +56,9 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-Wno-missing-braces)
elseif(MSVC)
- set(MIRRAGE_DEFAULT_COMPILER_ARGS /Za)
+ set(MIRRAGE_DEFAULT_COMPILER_ARGS /DWIN32_LEAN_AND_MEAN /DNOMINMAX /MP /W3 /WX)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4221")
+ set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
endif()
# Select optimal linker
@@ -80,13 +91,20 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR MIRRAGE_FORCE_LIBCPP)
endif()
endif()
+option(MIRRAGE_OPTIMIZE_NATIVE "Enable -march=native" OFF)
+if(${MIRRAGE_OPTIMIZE_NATIVE})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
+endif()
+
option(MIRRAGE_ENABLE_COTIRE "Enable cotire" ON)
if(MIRRAGE_ENABLE_COTIRE)
include(cotire OPTIONAL)
if(COMMAND cotire)
add_definitions(-DGLM_FORCE_RADIANS -DGLM_FORCE_DEPTH_ZERO_TO_ON -DGLM_ENABLE_EXPERIMENTAL -DGLM_FORCE_CXX14)
- add_compile_options(-pthread)
+ if(NOT MSVC)
+ add_compile_options(-pthread)
+ endif()
set_property(GLOBAL PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PATH "${MIRRAGE_ROOT_DIR}/dependencies")
set_property(GLOBAL PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH "${MIRRAGE_ROOT_DIR}/dependencies/nuklear;${MIRRAGE_ROOT_DIR}/src;${MIRRAGE_ROOT_DIR}/dependencies/moodycamel/concurrentqueue.h")
set_property(GLOBAL PROPERTY COTIRE_ADD_UNITY_BUILD FALSE)
@@ -101,6 +119,8 @@ endif()
option(MIRRAGE_ENABLE_CLANG_FORMAT "Includes a clangformat target, that automatically formats the source files." OFF)
if(MIRRAGE_ENABLE_CLANG_FORMAT)
- include(clang-format.cmake)
+ include(${MIRRAGE_ROOT_DIR}/clang-format.cmake)
endif()
+include(${MIRRAGE_ROOT_DIR}/embed_assets.cmake)
+
diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake
deleted file mode 100644
index f24af555a2529dde1cd4450b04eee6e03fe8779e..0000000000000000000000000000000000000000
--- a/modules/FindSDL2.cmake
+++ /dev/null
@@ -1,249 +0,0 @@
-# Locate SDL2 library
-# This module defines
-# SDL2_LIBRARY, the name of the library to link against
-# SDL2_FOUND, if false, do not try to link to SDL2
-# SDL2_INCLUDE_DIR, where to find SDL.h
-#
-# This module responds to the the flag:
-# SDL2_BUILDING_LIBRARY
-# If this is defined, then no SDL2_main will be linked in because
-# only applications need main().
-# Otherwise, it is assumed you are building an application and this
-# module will attempt to locate and set the the proper link flags
-# as part of the returned SDL2_LIBRARY variable.
-#
-# Don't forget to include SDL2main.h and SDL2main.m your project for the
-# OS X framework based version. (Other versions link to -lSDL2main which
-# this module will try to find on your behalf.) Also for OS X, this
-# module will automatically add the -framework Cocoa on your behalf.
-#
-#
-# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
-# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
-# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
-# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
-# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
-# as appropriate. These values are used to generate the final SDL2_LIBRARY
-# variable, but when these values are unset, SDL2_LIBRARY does not get created.
-#
-#
-# $SDL2 is an environment variable that would
-# correspond to the ./configure --prefix=$SDL2
-# used in building SDL2.
-# l.e.galup 9-20-02
-#
-# Modified by Eric Wing.
-# Added code to assist with automated building by using environmental variables
-# and providing a more controlled/consistent search behavior.
-# Added new modifications to recognize OS X frameworks and
-# additional Unix paths (FreeBSD, etc).
-# Also corrected the header search path to follow "proper" SDL2 guidelines.
-# Added a search for SDL2main which is needed by some platforms.
-# Added a search for threads which is needed by some platforms.
-# Added needed compile switches for MinGW.
-#
-# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
-# SDL2_LIBRARY to override this selection or set the CMake environment
-# CMAKE_INCLUDE_PATH to modify the search paths.
-#
-# Note that the header path has changed from SDL2/SDL.h to just SDL.h
-# This needed to change because "proper" SDL2 convention
-# is #include "SDL.h", not . This is done for portability
-# reasons because not all systems place things in SDL2/ (see FreeBSD).
-#
-# Ported by Johnny Patterson. This is a literal port for SDL2 of the FindSDL.cmake
-# module with the minor edit of changing "SDL" to "SDL2" where necessary. This
-# was not created for redistribution, and exists temporarily pending official
-# SDL2 CMake modules.
-#
-# Note that on windows this will only search for the 32bit libraries, to search
-# for 64bit change x86/i686-w64 to x64/x86_64-w64
-
-#=============================================================================
-# Copyright 2003-2009 Kitware, Inc.
-#
-# CMake - Cross Platform Makefile Generator
-# Copyright 2000-2014 Kitware, Inc.
-# Copyright 2000-2011 Insight Software Consortium
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# * Neither the names of Kitware, Inc., the Insight Software Consortium,
-# nor the names of their contributors may be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-FIND_PATH(SDL2_INCLUDE_DIR SDL.h
- HINTS
- $ENV{SDL2}
- PATH_SUFFIXES include/SDL2 include SDL2
- i686-w64-mingw32/include/SDL2
- x86_64-w64-mingw32/include/SDL2
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL2
- /usr/include/SDL2
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
-)
-
-# Lookup the 64 bit libs on x64
-IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- FIND_LIBRARY(SDL2_LIBRARY_TEMP SDL2
- HINTS
- $ENV{SDL2}
- PATH_SUFFIXES lib64 lib
- lib/x64
- x86_64-w64-mingw32/lib
- PATHS
- /sw
- /opt/local
- /opt/csw
- /opt
- )
-# On 32bit build find the 32bit libs
-ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
- FIND_LIBRARY(SDL2_LIBRARY_TEMP SDL2
- HINTS
- $ENV{SDL2}
- PATH_SUFFIXES lib
- lib/x86
- i686-w64-mingw32/lib
- PATHS
- /sw
- /opt/local
- /opt/csw
- /opt
- )
-ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
-
-IF(NOT SDL2_BUILDING_LIBRARY)
- IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
- # Non-OS X framework versions expect you to also dynamically link to
- # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
- # seem to provide SDL2main for compatibility even though they don't
- # necessarily need it.
- # Lookup the 64 bit libs on x64
- IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- FIND_LIBRARY(SDL2MAIN_LIBRARY
- NAMES SDL2main
- HINTS
- $ENV{SDL2}
- PATH_SUFFIXES lib64 lib
- lib/x64
- x86_64-w64-mingw32/lib
- PATHS
- /sw
- /opt/local
- /opt/csw
- /opt
- )
- # On 32bit build find the 32bit libs
- ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
- FIND_LIBRARY(SDL2MAIN_LIBRARY
- NAMES SDL2main
- HINTS
- $ENV{SDL2}
- PATH_SUFFIXES lib
- lib/x86
- i686-w64-mingw32/lib
- PATHS
- /sw
- /opt/local
- /opt/csw
- /opt
- )
- ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
-ENDIF(NOT SDL2_BUILDING_LIBRARY)
-
-# SDL2 may require threads on your system.
-# The Apple build may not need an explicit flag because one of the
-# frameworks may already provide it.
-# But for non-OSX systems, I will use the CMake Threads package.
-IF(NOT APPLE)
- FIND_PACKAGE(Threads)
-ENDIF(NOT APPLE)
-
-# MinGW needs an additional library, mwindows
-# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
-# (Actually on second look, I think it only needs one of the m* libraries.)
-IF(MINGW)
- SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
-ENDIF(MINGW)
-
-SET(SDL2_FOUND "NO")
- IF(SDL2_LIBRARY_TEMP)
- # For SDL2main
- IF(NOT SDL2_BUILDING_LIBRARY)
- IF(SDL2MAIN_LIBRARY)
- SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
- ENDIF(SDL2MAIN_LIBRARY)
- ENDIF(NOT SDL2_BUILDING_LIBRARY)
-
- # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
- # CMake doesn't display the -framework Cocoa string in the UI even
- # though it actually is there if I modify a pre-used variable.
- # I think it has something to do with the CACHE STRING.
- # So I use a temporary variable until the end so I can set the
- # "real" variable in one-shot.
- IF(APPLE)
- SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
- ENDIF(APPLE)
-
- # For threads, as mentioned Apple doesn't need this.
- # In fact, there seems to be a problem if I used the Threads package
- # and try using this line, so I'm just skipping it entirely for OS X.
- IF(NOT APPLE)
- SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
- ENDIF(NOT APPLE)
-
- # For MinGW library
- IF(MINGW)
- SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
- ENDIF(MINGW)
-
- # Set the final string here so the GUI reflects the final state.
- SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
- # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
- SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
-
- SET(SDL2_FOUND "YES")
-ENDIF(SDL2_LIBRARY_TEMP)
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
diff --git a/modules/android_toolchain.cmake b/modules/android_toolchain.cmake
deleted file mode 100644
index d97d625b127f1b4028a98652b66e1f35f2470dc4..0000000000000000000000000000000000000000
--- a/modules/android_toolchain.cmake
+++ /dev/null
@@ -1,1709 +0,0 @@
-# Copyright (c) 2010-2011, Ethan Rublee
-# Copyright (c) 2011-2014, Andrey Kamaev
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice,
-# this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following disclaimer in the documentation
-# and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the copyright holder nor the names of its
-# contributors may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-# ------------------------------------------------------------------------------
-# Android CMake toolchain file, for use with the Android NDK r5-r10d
-# Requires cmake 2.6.3 or newer (2.8.9 or newer is recommended).
-# See home page: https://github.com/taka-no-me/android-cmake
-#
-# Usage Linux:
-# $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
-# $ mkdir build && cd build
-# $ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.toolchain.cmake ..
-# $ make -j8
-#
-# Usage Windows:
-# You need native port of make to build your project.
-# Android NDK r7 (and newer) already has make.exe on board.
-# For older NDK you have to install it separately.
-# For example, this one: http://gnuwin32.sourceforge.net/packages/make.htm
-#
-# $ SET ANDROID_NDK=C:\absolute\path\to\the\android-ndk
-# $ mkdir build && cd build
-# $ cmake.exe -G"MinGW Makefiles"
-# -DCMAKE_TOOLCHAIN_FILE=path\to\the\android.toolchain.cmake
-# -DCMAKE_MAKE_PROGRAM="%ANDROID_NDK%\prebuilt\windows\bin\make.exe" ..
-# $ cmake.exe --build .
-#
-#
-# Options (can be set as cmake parameters: -D=):
-# ANDROID_NDK=/opt/android-ndk - path to the NDK root.
-# Can be set as environment variable. Can be set only at first cmake run.
-#
-# ANDROID_ABI=armeabi-v7a - specifies the target Application Binary
-# Interface (ABI). This option nearly matches to the APP_ABI variable
-# used by ndk-build tool from Android NDK.
-#
-# Possible targets are:
-# "armeabi" - ARMv5TE based CPU with software floating point operations
-# "armeabi-v7a" - ARMv7 based devices with hardware FPU instructions
-# this ABI target is used by default
-# "armeabi-v7a with NEON" - same as armeabi-v7a, but
-# sets NEON as floating-point unit
-# "armeabi-v7a with VFPV3" - same as armeabi-v7a, but
-# sets VFPV3 as floating-point unit (has 32 registers instead of 16)
-# "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP
-# "x86" - IA-32 instruction set
-# "mips" - MIPS32 instruction set
-#
-# 64-bit ABIs for NDK r10 and newer:
-# "arm64-v8a" - ARMv8 AArch64 instruction set
-# "x86_64" - Intel64 instruction set (r1)
-# "mips64" - MIPS64 instruction set (r6)
-#
-# ANDROID_NATIVE_API_LEVEL=android-8 - level of Android API compile for.
-# Option is read-only when standalone toolchain is used.
-# Note: building for "android-L" requires explicit configuration.
-#
-# ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 - the name of compiler
-# toolchain to be used. The list of possible values depends on the NDK
-# version. For NDK r10c the possible values are:
-#
-# * aarch64-linux-android-4.9
-# * aarch64-linux-android-clang3.4
-# * aarch64-linux-android-clang3.5
-# * arm-linux-androideabi-4.6
-# * arm-linux-androideabi-4.8
-# * arm-linux-androideabi-4.9 (default)
-# * arm-linux-androideabi-clang3.4
-# * arm-linux-androideabi-clang3.5
-# * mips64el-linux-android-4.9
-# * mips64el-linux-android-clang3.4
-# * mips64el-linux-android-clang3.5
-# * mipsel-linux-android-4.6
-# * mipsel-linux-android-4.8
-# * mipsel-linux-android-4.9
-# * mipsel-linux-android-clang3.4
-# * mipsel-linux-android-clang3.5
-# * x86-4.6
-# * x86-4.8
-# * x86-4.9
-# * x86-clang3.4
-# * x86-clang3.5
-# * x86_64-4.9
-# * x86_64-clang3.4
-# * x86_64-clang3.5
-#
-# ANDROID_FORCE_ARM_BUILD=OFF - set ON to generate 32-bit ARM instructions
-# instead of Thumb. Is not available for "armeabi-v6 with VFP"
-# (is forced to be ON) ABI.
-#
-# ANDROID_NO_UNDEFINED=ON - set ON to show all undefined symbols as linker
-# errors even if they are not used.
-#
-# ANDROID_SO_UNDEFINED=OFF - set ON to allow undefined symbols in shared
-# libraries. Automatically turned for NDK r5x and r6x due to GLESv2
-# problems.
-#
-# ANDROID_STL=gnustl_static - specify the runtime to use.
-#
-# Possible values are:
-# none -> Do not configure the runtime.
-# system -> Use the default minimal system C++ runtime library.
-# Implies -fno-rtti -fno-exceptions.
-# Is not available for standalone toolchain.
-# system_re -> Use the default minimal system C++ runtime library.
-# Implies -frtti -fexceptions.
-# Is not available for standalone toolchain.
-# gabi++_static -> Use the GAbi++ runtime as a static library.
-# Implies -frtti -fno-exceptions.
-# Available for NDK r7 and newer.
-# Is not available for standalone toolchain.
-# gabi++_shared -> Use the GAbi++ runtime as a shared library.
-# Implies -frtti -fno-exceptions.
-# Available for NDK r7 and newer.
-# Is not available for standalone toolchain.
-# stlport_static -> Use the STLport runtime as a static library.
-# Implies -fno-rtti -fno-exceptions for NDK before r7.
-# Implies -frtti -fno-exceptions for NDK r7 and newer.
-# Is not available for standalone toolchain.
-# stlport_shared -> Use the STLport runtime as a shared library.
-# Implies -fno-rtti -fno-exceptions for NDK before r7.
-# Implies -frtti -fno-exceptions for NDK r7 and newer.
-# Is not available for standalone toolchain.
-# gnustl_static -> Use the GNU STL as a static library.
-# Implies -frtti -fexceptions.
-# gnustl_shared -> Use the GNU STL as a shared library.
-# Implies -frtti -fno-exceptions.
-# Available for NDK r7b and newer.
-# Silently degrades to gnustl_static if not available.
-#
-# ANDROID_STL_FORCE_FEATURES=ON - turn rtti and exceptions support based on
-# chosen runtime. If disabled, then the user is responsible for settings
-# these options.
-#
-# What?:
-# android-cmake toolchain searches for NDK/toolchain in the following order:
-# ANDROID_NDK - cmake parameter
-# ANDROID_NDK - environment variable
-# ANDROID_STANDALONE_TOOLCHAIN - cmake parameter
-# ANDROID_STANDALONE_TOOLCHAIN - environment variable
-# ANDROID_NDK - default locations
-# ANDROID_STANDALONE_TOOLCHAIN - default locations
-#
-# Make sure to do the following in your scripts:
-# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}" )
-# SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}" )
-# The flags will be prepopulated with critical flags, so don't loose them.
-# Also be aware that toolchain also sets configuration-specific compiler
-# flags and linker flags.
-#
-# ANDROID and BUILD_ANDROID will be set to true, you may test any of these
-# variables to make necessary Android-specific configuration changes.
-#
-# Also ARMEABI or ARMEABI_V7A or X86 or MIPS or ARM64_V8A or X86_64 or MIPS64
-# will be set true, mutually exclusive. NEON option will be set true
-# if VFP is set to NEON.
-#
-# ------------------------------------------------------------------------------
-
-cmake_minimum_required( VERSION 2.6.3 )
-
-if( DEFINED CMAKE_CROSSCOMPILING )
- # subsequent toolchain loading is not really needed
- return()
-endif()
-
-if( CMAKE_TOOLCHAIN_FILE )
- # touch toolchain variable to suppress "unused variable" warning
-endif()
-
-# inherit settings in recursive loads
-get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
-if( _CMAKE_IN_TRY_COMPILE )
- include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL )
-endif()
-
-# this one is important
-if( CMAKE_VERSION VERSION_GREATER "3.0.99" )
- set( CMAKE_SYSTEM_NAME Android )
-else()
- set( CMAKE_SYSTEM_NAME Linux )
-endif()
-
-# this one not so much
-set( CMAKE_SYSTEM_VERSION 1 )
-
-# rpath makes low sense for Android
-set( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "" )
-set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )
-
-# NDK search paths
-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
-if( NOT DEFINED ANDROID_NDK_SEARCH_PATHS )
- if( CMAKE_HOST_WIN32 )
- file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
- set( ANDROID_NDK_SEARCH_PATHS "${ANDROID_NDK_SEARCH_PATHS}" "$ENV{SystemDrive}/NVPACK" )
- else()
- file( TO_CMAKE_PATH "$ENV{HOME}" ANDROID_NDK_SEARCH_PATHS )
- set( ANDROID_NDK_SEARCH_PATHS /opt "${ANDROID_NDK_SEARCH_PATHS}/NVPACK" )
- endif()
-endif()
-if( NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH )
- set( ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH /opt/android-toolchain )
-endif()
-
-# known ABIs
-set( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" )
-set( ANDROID_SUPPORTED_ABIS_arm64 "arm64-v8a" )
-set( ANDROID_SUPPORTED_ABIS_x86 "x86" )
-set( ANDROID_SUPPORTED_ABIS_x86_64 "x86_64" )
-set( ANDROID_SUPPORTED_ABIS_mips "mips" )
-set( ANDROID_SUPPORTED_ABIS_mips64 "mips64" )
-
-# API level defaults
-set( ANDROID_DEFAULT_NDK_API_LEVEL 8 )
-set( ANDROID_DEFAULT_NDK_API_LEVEL_arm64 21 )
-set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 )
-set( ANDROID_DEFAULT_NDK_API_LEVEL_x86_64 21 )
-set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 9 )
-set( ANDROID_DEFAULT_NDK_API_LEVEL_mips64 21 )
-
-
-macro( __LIST_FILTER listvar regex )
- if( ${listvar} )
- foreach( __val ${${listvar}} )
- if( __val MATCHES "${regex}" )
- list( REMOVE_ITEM ${listvar} "${__val}" )
- endif()
- endforeach()
- endif()
-endmacro()
-
-macro( __INIT_VARIABLE var_name )
- set( __test_path 0 )
- foreach( __var ${ARGN} )
- if( __var STREQUAL "PATH" )
- set( __test_path 1 )
- break()
- endif()
- endforeach()
-
- if( __test_path AND NOT EXISTS "${${var_name}}" )
- unset( ${var_name} CACHE )
- endif()
-
- if( " ${${var_name}}" STREQUAL " " )
- set( __values 0 )
- foreach( __var ${ARGN} )
- if( __var STREQUAL "VALUES" )
- set( __values 1 )
- elseif( NOT __var STREQUAL "PATH" )
- if( __var MATCHES "^ENV_.*$" )
- string( REPLACE "ENV_" "" __var "${__var}" )
- set( __value "$ENV{${__var}}" )
- elseif( DEFINED ${__var} )
- set( __value "${${__var}}" )
- elseif( __values )
- set( __value "${__var}" )
- else()
- set( __value "" )
- endif()
-
- if( NOT " ${__value}" STREQUAL " " AND (NOT __test_path OR EXISTS "${__value}") )
- set( ${var_name} "${__value}" )
- break()
- endif()
- endif()
- endforeach()
- unset( __value )
- unset( __values )
- endif()
-
- if( __test_path )
- file( TO_CMAKE_PATH "${${var_name}}" ${var_name} )
- endif()
- unset( __test_path )
-endmacro()
-
-macro( __DETECT_NATIVE_API_LEVEL _var _path )
- set( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*.*$" )
- file( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" )
- if( NOT __apiFileContent )
- message( SEND_ERROR "Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." )
- endif()
- string( REGEX REPLACE "${__ndkApiLevelRegex}" "\\1" ${_var} "${__apiFileContent}" )
- unset( __apiFileContent )
- unset( __ndkApiLevelRegex )
-endmacro()
-
-macro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )
- if( EXISTS "${_root}" )
- file( GLOB __gccExePath RELATIVE "${_root}/bin/" "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
- __LIST_FILTER( __gccExePath "^[.].*" )
- list( LENGTH __gccExePath __gccExePathsCount )
- if( NOT __gccExePathsCount EQUAL 1 AND NOT _CMAKE_IN_TRY_COMPILE )
- message( WARNING "Could not determine machine name for compiler from ${_root}" )
- set( ${_var} "" )
- else()
- get_filename_component( __gccExeName "${__gccExePath}" NAME_WE )
- string( REPLACE "-gcc" "" ${_var} "${__gccExeName}" )
- endif()
- unset( __gccExePath )
- unset( __gccExePathsCount )
- unset( __gccExeName )
- else()
- set( ${_var} "" )
- endif()
-endmacro()
-
-
-# fight against cygwin
-set( ANDROID_FORBID_SYGWIN TRUE CACHE BOOL "Prevent cmake from working under cygwin and using cygwin tools")
-mark_as_advanced( ANDROID_FORBID_SYGWIN )
-if( ANDROID_FORBID_SYGWIN )
- if( CYGWIN )
- message( FATAL_ERROR "Android NDK and android-cmake toolchain are not welcome Cygwin. It is unlikely that this cmake toolchain will work under cygwin. But if you want to try then you can set cmake variable ANDROID_FORBID_SYGWIN to FALSE and rerun cmake." )
- endif()
-
- if( CMAKE_HOST_WIN32 )
- # remove cygwin from PATH
- set( __new_path "$ENV{PATH}")
- __LIST_FILTER( __new_path "cygwin" )
- set(ENV{PATH} "${__new_path}")
- unset(__new_path)
- endif()
-endif()
-
-
-# detect current host platform
-if( NOT DEFINED ANDROID_NDK_HOST_X64 AND (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64" OR CMAKE_HOST_APPLE) )
- set( ANDROID_NDK_HOST_X64 1 CACHE BOOL "Try to use 64-bit compiler toolchain" )
- mark_as_advanced( ANDROID_NDK_HOST_X64 )
-endif()
-
-set( TOOL_OS_SUFFIX "" )
-if( CMAKE_HOST_APPLE )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86_64" )
- set( ANDROID_NDK_HOST_SYSTEM_NAME2 "darwin-x86" )
-elseif( CMAKE_HOST_WIN32 )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "windows-x86_64" )
- set( ANDROID_NDK_HOST_SYSTEM_NAME2 "windows" )
- set( TOOL_OS_SUFFIX ".exe" )
-elseif( CMAKE_HOST_UNIX )
- set( ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86_64" )
- set( ANDROID_NDK_HOST_SYSTEM_NAME2 "linux-x86" )
-else()
- message( FATAL_ERROR "Cross-compilation on your platform is not supported by this cmake toolchain" )
-endif()
-
-if( NOT ANDROID_NDK_HOST_X64 )
- set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
-endif()
-
-# see if we have path to Android NDK
-if( NOT ANDROID_NDK AND NOT ANDROID_STANDALONE_TOOLCHAIN )
- __INIT_VARIABLE( ANDROID_NDK PATH ENV_ANDROID_NDK )
-endif()
-if( NOT ANDROID_NDK )
- # see if we have path to Android standalone toolchain
- __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN )
-
- if( NOT ANDROID_STANDALONE_TOOLCHAIN )
- #try to find Android NDK in one of the the default locations
- set( __ndkSearchPaths )
- foreach( __ndkSearchPath ${ANDROID_NDK_SEARCH_PATHS} )
- foreach( suffix ${ANDROID_SUPPORTED_NDK_VERSIONS} )
- list( APPEND __ndkSearchPaths "${__ndkSearchPath}/android-ndk${suffix}" )
- endforeach()
- endforeach()
- __INIT_VARIABLE( ANDROID_NDK PATH VALUES ${__ndkSearchPaths} )
- unset( __ndkSearchPaths )
-
- if( ANDROID_NDK )
- message( STATUS "Using default path for Android NDK: ${ANDROID_NDK}" )
- message( STATUS " If you prefer to use a different location, please define a cmake or environment variable: ANDROID_NDK" )
- else()
- #try to find Android standalone toolchain in one of the the default locations
- __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH )
-
- if( ANDROID_STANDALONE_TOOLCHAIN )
- message( STATUS "Using default path for standalone toolchain ${ANDROID_STANDALONE_TOOLCHAIN}" )
- message( STATUS " If you prefer to use a different location, please define the variable: ANDROID_STANDALONE_TOOLCHAIN" )
- endif( ANDROID_STANDALONE_TOOLCHAIN )
- endif( ANDROID_NDK )
- endif( NOT ANDROID_STANDALONE_TOOLCHAIN )
-endif( NOT ANDROID_NDK )
-
-# remember found paths
-if( ANDROID_NDK )
- get_filename_component( ANDROID_NDK "${ANDROID_NDK}" ABSOLUTE )
- set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" FORCE )
- set( BUILD_WITH_ANDROID_NDK True )
- if( EXISTS "${ANDROID_NDK}/RELEASE.TXT" )
- file( STRINGS "${ANDROID_NDK}/RELEASE.TXT" ANDROID_NDK_RELEASE_FULL LIMIT_COUNT 1 REGEX "r[0-9]+[a-z]?" )
- string( REGEX MATCH "r([0-9]+)([a-z]?)" ANDROID_NDK_RELEASE "${ANDROID_NDK_RELEASE_FULL}" )
- else()
- set( ANDROID_NDK_RELEASE "r1x" )
- set( ANDROID_NDK_RELEASE_FULL "unreleased" )
- endif()
- string( REGEX REPLACE "r([0-9]+)([a-z]?)" "\\1*1000" ANDROID_NDK_RELEASE_NUM "${ANDROID_NDK_RELEASE}" )
- string( FIND " abcdefghijklmnopqastuvwxyz" "${CMAKE_MATCH_2}" __ndkReleaseLetterNum )
- math( EXPR ANDROID_NDK_RELEASE_NUM "${ANDROID_NDK_RELEASE_NUM}+${__ndkReleaseLetterNum}" )
-elseif( ANDROID_STANDALONE_TOOLCHAIN )
- get_filename_component( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" ABSOLUTE )
- # try to detect change
- if( CMAKE_AR )
- string( LENGTH "${ANDROID_STANDALONE_TOOLCHAIN}" __length )
- string( SUBSTRING "${CMAKE_AR}" 0 ${__length} __androidStandaloneToolchainPreviousPath )
- if( NOT __androidStandaloneToolchainPreviousPath STREQUAL ANDROID_STANDALONE_TOOLCHAIN )
- message( FATAL_ERROR "It is not possible to change path to the Android standalone toolchain on subsequent run." )
- endif()
- unset( __androidStandaloneToolchainPreviousPath )
- unset( __length )
- endif()
- set( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" CACHE INTERNAL "Path of the Android standalone toolchain" FORCE )
- set( BUILD_WITH_STANDALONE_TOOLCHAIN True )
-else()
- list(GET ANDROID_NDK_SEARCH_PATHS 0 ANDROID_NDK_SEARCH_PATH)
- message( FATAL_ERROR "Could not find neither Android NDK nor Android standalone toolchain.
- You should either set an environment variable:
- export ANDROID_NDK=~/my-android-ndk
- or
- export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain
- or put the toolchain or NDK in the default path:
- sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}/android-ndk
- sudo ln -s ~/my-android-toolchain ${ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH}" )
-endif()
-
-# android NDK layout
-if( BUILD_WITH_ANDROID_NDK )
- if( NOT DEFINED ANDROID_NDK_LAYOUT )
- # try to automatically detect the layout
- if( EXISTS "${ANDROID_NDK}/RELEASE.TXT")
- set( ANDROID_NDK_LAYOUT "RELEASE" )
- elseif( EXISTS "${ANDROID_NDK}/../../linux-x86/toolchain/" )
- set( ANDROID_NDK_LAYOUT "LINARO" )
- elseif( EXISTS "${ANDROID_NDK}/../../gcc/" )
- set( ANDROID_NDK_LAYOUT "ANDROID" )
- endif()
- endif()
- set( ANDROID_NDK_LAYOUT "${ANDROID_NDK_LAYOUT}" CACHE STRING "The inner layout of NDK" )
- mark_as_advanced( ANDROID_NDK_LAYOUT )
- if( ANDROID_NDK_LAYOUT STREQUAL "LINARO" )
- set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) # only 32-bit at the moment
- set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/../../${ANDROID_NDK_HOST_SYSTEM_NAME}/toolchain" )
- set( ANDROID_NDK_TOOLCHAINS_SUBPATH "" )
- set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "" )
- elseif( ANDROID_NDK_LAYOUT STREQUAL "ANDROID" )
- set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) # only 32-bit at the moment
- set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/../../gcc/${ANDROID_NDK_HOST_SYSTEM_NAME}/arm" )
- set( ANDROID_NDK_TOOLCHAINS_SUBPATH "" )
- set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "" )
- else() # ANDROID_NDK_LAYOUT STREQUAL "RELEASE"
- set( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK}/toolchains" )
- set( ANDROID_NDK_TOOLCHAINS_SUBPATH "/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
- set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 "/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME2}" )
- endif()
- get_filename_component( ANDROID_NDK_TOOLCHAINS_PATH "${ANDROID_NDK_TOOLCHAINS_PATH}" ABSOLUTE )
-
- # try to detect change of NDK
- if( CMAKE_AR )
- string( LENGTH "${ANDROID_NDK_TOOLCHAINS_PATH}" __length )
- string( SUBSTRING "${CMAKE_AR}" 0 ${__length} __androidNdkPreviousPath )
- if( NOT __androidNdkPreviousPath STREQUAL ANDROID_NDK_TOOLCHAINS_PATH )
- message( FATAL_ERROR "It is not possible to change the path to the NDK on subsequent CMake run. You must remove all generated files from your build folder first.
- " )
- endif()
- unset( __androidNdkPreviousPath )
- unset( __length )
- endif()
-endif()
-
-
-# get all the details about standalone toolchain
-if( BUILD_WITH_STANDALONE_TOOLCHAIN )
- __DETECT_NATIVE_API_LEVEL( ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot/usr/include/android/api-level.h" )
- set( ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
- set( __availableToolchains "standalone" )
- __DETECT_TOOLCHAIN_MACHINE_NAME( __availableToolchainMachines "${ANDROID_STANDALONE_TOOLCHAIN}" )
- if( NOT __availableToolchainMachines )
- message( FATAL_ERROR "Could not determine machine name of your toolchain. Probably your Android standalone toolchain is broken." )
- endif()
- if( __availableToolchainMachines MATCHES x86_64 )
- set( __availableToolchainArchs "x86_64" )
- elseif( __availableToolchainMachines MATCHES i686 )
- set( __availableToolchainArchs "x86" )
- elseif( __availableToolchainMachines MATCHES aarch64 )
- set( __availableToolchainArchs "arm64" )
- elseif( __availableToolchainMachines MATCHES arm )
- set( __availableToolchainArchs "arm" )
- elseif( __availableToolchainMachines MATCHES mips64el )
- set( __availableToolchainArchs "mips64" )
- elseif( __availableToolchainMachines MATCHES mipsel )
- set( __availableToolchainArchs "mips" )
- endif()
- execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" -dumpversion
- OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )
- string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
- if( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/bin/clang${TOOL_OS_SUFFIX}" )
- list( APPEND __availableToolchains "standalone-clang" )
- list( APPEND __availableToolchainMachines ${__availableToolchainMachines} )
- list( APPEND __availableToolchainArchs ${__availableToolchainArchs} )
- list( APPEND __availableToolchainCompilerVersions ${__availableToolchainCompilerVersions} )
- endif()
-endif()
-
-macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __toolchain_subpath )
- foreach( __toolchain ${${__availableToolchainsLst}} )
- if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" )
- SET( __toolchainVersionRegex "^TOOLCHAIN_VERSION[\t ]+:=[\t ]+(.*)$" )
- FILE( STRINGS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}/setup.mk" __toolchainVersionStr REGEX "${__toolchainVersionRegex}" )
- if( __toolchainVersionStr )
- string( REGEX REPLACE "${__toolchainVersionRegex}" "\\1" __toolchainVersionStr "${__toolchainVersionStr}" )
- string( REGEX REPLACE "-clang3[.][0-9]$" "-${__toolchainVersionStr}" __gcc_toolchain "${__toolchain}" )
- else()
- string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
- endif()
- unset( __toolchainVersionStr )
- unset( __toolchainVersionRegex )
- else()
- set( __gcc_toolchain "${__toolchain}" )
- endif()
- __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK_TOOLCHAINS_PATH}/${__gcc_toolchain}${__toolchain_subpath}" )
- if( __machine )
- string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9x]+)?$" __version "${__gcc_toolchain}" )
- if( __machine MATCHES x86_64 )
- set( __arch "x86_64" )
- elseif( __machine MATCHES i686 )
- set( __arch "x86" )
- elseif( __machine MATCHES aarch64 )
- set( __arch "arm64" )
- elseif( __machine MATCHES arm )
- set( __arch "arm" )
- elseif( __machine MATCHES mips64el )
- set( __arch "mips64" )
- elseif( __machine MATCHES mipsel )
- set( __arch "mips" )
- else()
- set( __arch "" )
- endif()
- #message("machine: !${__machine}!\narch: !${__arch}!\nversion: !${__version}!\ntoolchain: !${__toolchain}!\n")
- if (__arch)
- list( APPEND __availableToolchainMachines "${__machine}" )
- list( APPEND __availableToolchainArchs "${__arch}" )
- list( APPEND __availableToolchainCompilerVersions "${__version}" )
- list( APPEND ${__availableToolchainsVar} "${__toolchain}" )
- endif()
- endif()
- unset( __gcc_toolchain )
- endforeach()
-endmacro()
-
-# get all the details about NDK
-if( BUILD_WITH_ANDROID_NDK )
- file( GLOB ANDROID_SUPPORTED_NATIVE_API_LEVELS RELATIVE "${ANDROID_NDK}/platforms" "${ANDROID_NDK}/platforms/android-*" )
- string( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
- set( __availableToolchains "" )
- set( __availableToolchainMachines "" )
- set( __availableToolchainArchs "" )
- set( __availableToolchainCompilerVersions "" )
- if( ANDROID_TOOLCHAIN_NAME AND EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_TOOLCHAIN_NAME}/" )
- # do not go through all toolchains if we know the name
- set( __availableToolchainsLst "${ANDROID_TOOLCHAIN_NAME}" )
- __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
- if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 )
- __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH2}" )
- if( __availableToolchains )
- set( ANDROID_NDK_TOOLCHAINS_SUBPATH ${ANDROID_NDK_TOOLCHAINS_SUBPATH2} )
- endif()
- endif()
- endif()
- if( NOT __availableToolchains )
- file( GLOB __availableToolchainsLst RELATIVE "${ANDROID_NDK_TOOLCHAINS_PATH}" "${ANDROID_NDK_TOOLCHAINS_PATH}/*" )
- if( __availableToolchainsLst )
- list(SORT __availableToolchainsLst) # we need clang to go after gcc
- endif()
- __LIST_FILTER( __availableToolchainsLst "^[.]" )
- __LIST_FILTER( __availableToolchainsLst "llvm" )
- __LIST_FILTER( __availableToolchainsLst "renderscript" )
- __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
- if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 )
- __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH2}" )
- if( __availableToolchains )
- set( ANDROID_NDK_TOOLCHAINS_SUBPATH ${ANDROID_NDK_TOOLCHAINS_SUBPATH2} )
- endif()
- endif()
- endif()
- if( NOT __availableToolchains )
- message( FATAL_ERROR "Could not find any working toolchain in the NDK. Probably your Android NDK is broken." )
- endif()
-endif()
-
-# build list of available ABIs
-set( ANDROID_SUPPORTED_ABIS "" )
-set( __uniqToolchainArchNames ${__availableToolchainArchs} )
-list( REMOVE_DUPLICATES __uniqToolchainArchNames )
-list( SORT __uniqToolchainArchNames )
-foreach( __arch ${__uniqToolchainArchNames} )
- list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} )
-endforeach()
-unset( __uniqToolchainArchNames )
-if( NOT ANDROID_SUPPORTED_ABIS )
- message( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
-endif()
-
-# choose target ABI
-__INIT_VARIABLE( ANDROID_ABI VALUES ${ANDROID_SUPPORTED_ABIS} )
-# verify that target ABI is supported
-list( FIND ANDROID_SUPPORTED_ABIS "${ANDROID_ABI}" __androidAbiIdx )
-if( __androidAbiIdx EQUAL -1 )
- string( REPLACE ";" "\", \"" PRINTABLE_ANDROID_SUPPORTED_ABIS "${ANDROID_SUPPORTED_ABIS}" )
- message( FATAL_ERROR "Specified ANDROID_ABI = \"${ANDROID_ABI}\" is not supported by this cmake toolchain or your NDK/toolchain.
- Supported values are: \"${PRINTABLE_ANDROID_SUPPORTED_ABIS}\"
- " )
-endif()
-unset( __androidAbiIdx )
-
-# set target ABI options
-if( ANDROID_ABI STREQUAL "x86" )
- set( X86 true )
- set( ANDROID_NDK_ABI_NAME "x86" )
- set( ANDROID_ARCH_NAME "x86" )
- set( ANDROID_LLVM_TRIPLE "i686-none-linux-android" )
- set( CMAKE_SYSTEM_PROCESSOR "i686" )
-elseif( ANDROID_ABI STREQUAL "x86_64" )
- set( X86 true )
- set( X86_64 true )
- set( ANDROID_NDK_ABI_NAME "x86_64" )
- set( ANDROID_ARCH_NAME "x86_64" )
- set( CMAKE_SYSTEM_PROCESSOR "x86_64" )
- set( ANDROID_LLVM_TRIPLE "x86_64-none-linux-android" )
-elseif( ANDROID_ABI STREQUAL "mips64" )
- set( MIPS64 true )
- set( ANDROID_NDK_ABI_NAME "mips64" )
- set( ANDROID_ARCH_NAME "mips64" )
- set( ANDROID_LLVM_TRIPLE "mips64el-none-linux-android" )
- set( CMAKE_SYSTEM_PROCESSOR "mips64" )
-elseif( ANDROID_ABI STREQUAL "mips" )
- set( MIPS true )
- set( ANDROID_NDK_ABI_NAME "mips" )
- set( ANDROID_ARCH_NAME "mips" )
- set( ANDROID_LLVM_TRIPLE "mipsel-none-linux-android" )
- set( CMAKE_SYSTEM_PROCESSOR "mips" )
-elseif( ANDROID_ABI STREQUAL "arm64-v8a" )
- set( ARM64_V8A true )
- set( ANDROID_NDK_ABI_NAME "arm64-v8a" )
- set( ANDROID_ARCH_NAME "arm64" )
- set( ANDROID_LLVM_TRIPLE "aarch64-none-linux-android" )
- set( CMAKE_SYSTEM_PROCESSOR "aarch64" )
- set( VFPV3 true )
- set( NEON true )
-elseif( ANDROID_ABI STREQUAL "armeabi" )
- set( ARMEABI true )
- set( ANDROID_NDK_ABI_NAME "armeabi" )
- set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
- set( CMAKE_SYSTEM_PROCESSOR "armv5te" )
-elseif( ANDROID_ABI STREQUAL "armeabi-v6 with VFP" )
- set( ARMEABI_V6 true )
- set( ANDROID_NDK_ABI_NAME "armeabi" )
- set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
- set( CMAKE_SYSTEM_PROCESSOR "armv6" )
- # need always fallback to older platform
- set( ARMEABI true )
-elseif( ANDROID_ABI STREQUAL "armeabi-v7a")
- set( ARMEABI_V7A true )
- set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
- set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
- set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
-elseif( ANDROID_ABI STREQUAL "armeabi-v7a with VFPV3" )
- set( ARMEABI_V7A true )
- set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
- set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
- set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
- set( VFPV3 true )
-elseif( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" )
- set( ARMEABI_V7A true )
- set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
- set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
- set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
- set( VFPV3 true )
- set( NEON true )
-else()
- message( SEND_ERROR "Unknown ANDROID_ABI=\"${ANDROID_ABI}\" is specified." )
-endif()
-
-if( CMAKE_BINARY_DIR AND EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" )
- # really dirty hack
- # it is not possible to change CMAKE_SYSTEM_PROCESSOR after the first run...
- file( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")\n" )
-endif()
-
-if( ANDROID_ARCH_NAME STREQUAL "arm" AND NOT ARMEABI_V6 )
- __INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD VALUES OFF )
- set( ANDROID_FORCE_ARM_BUILD ${ANDROID_FORCE_ARM_BUILD} CACHE BOOL "Use 32-bit ARM instructions instead of Thumb-1" FORCE )
- mark_as_advanced( ANDROID_FORCE_ARM_BUILD )
-else()
- unset( ANDROID_FORCE_ARM_BUILD CACHE )
-endif()
-
-# choose toolchain
-if( ANDROID_TOOLCHAIN_NAME )
- list( FIND __availableToolchains "${ANDROID_TOOLCHAIN_NAME}" __toolchainIdx )
- if( __toolchainIdx EQUAL -1 )
- list( SORT __availableToolchains )
- string( REPLACE ";" "\n * " toolchains_list "${__availableToolchains}" )
- set( toolchains_list " * ${toolchains_list}")
- message( FATAL_ERROR "Specified toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is missing in your NDK or broken. Please verify that your NDK is working or select another compiler toolchain.
-To configure the toolchain set CMake variable ANDROID_TOOLCHAIN_NAME to one of the following values:\n${toolchains_list}\n" )
- endif()
- list( GET __availableToolchainArchs ${__toolchainIdx} __toolchainArch )
- if( NOT __toolchainArch STREQUAL ANDROID_ARCH_NAME )
- message( SEND_ERROR "Selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform." )
- endif()
-else()
- set( __toolchainIdx -1 )
- set( __applicableToolchains "" )
- set( __toolchainMaxVersion "0.0.0" )
- list( LENGTH __availableToolchains __availableToolchainsCount )
- math( EXPR __availableToolchainsCount "${__availableToolchainsCount}-1" )
- foreach( __idx RANGE ${__availableToolchainsCount} )
- list( GET __availableToolchainArchs ${__idx} __toolchainArch )
- if( __toolchainArch STREQUAL ANDROID_ARCH_NAME )
- list( GET __availableToolchainCompilerVersions ${__idx} __toolchainVersion )
- string( REPLACE "x" "99" __toolchainVersion "${__toolchainVersion}")
- if( __toolchainVersion VERSION_GREATER __toolchainMaxVersion )
- set( __toolchainMaxVersion "${__toolchainVersion}" )
- set( __toolchainIdx ${__idx} )
- endif()
- endif()
- endforeach()
- unset( __availableToolchainsCount )
- unset( __toolchainMaxVersion )
- unset( __toolchainVersion )
-endif()
-unset( __toolchainArch )
-if( __toolchainIdx EQUAL -1 )
- message( FATAL_ERROR "No one of available compiler toolchains is able to compile for ${ANDROID_ARCH_NAME} platform." )
-endif()
-list( GET __availableToolchains ${__toolchainIdx} ANDROID_TOOLCHAIN_NAME )
-list( GET __availableToolchainMachines ${__toolchainIdx} ANDROID_TOOLCHAIN_MACHINE_NAME )
-list( GET __availableToolchainCompilerVersions ${__toolchainIdx} ANDROID_COMPILER_VERSION )
-
-unset( __toolchainIdx )
-unset( __availableToolchains )
-unset( __availableToolchainMachines )
-unset( __availableToolchainArchs )
-unset( __availableToolchainCompilerVersions )
-
-# choose native API level
-__INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL )
-string( REPLACE "android-" "" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
-string( STRIP "${ANDROID_NATIVE_API_LEVEL}" ANDROID_NATIVE_API_LEVEL )
-# adjust API level
-set( __real_api_level ${ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME}} )
-foreach( __level ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
- if( (__level LESS ANDROID_NATIVE_API_LEVEL OR __level STREQUAL ANDROID_NATIVE_API_LEVEL) AND NOT __level LESS __real_api_level )
- set( __real_api_level ${__level} )
- endif()
-endforeach()
-if( __real_api_level AND NOT ANDROID_NATIVE_API_LEVEL STREQUAL __real_api_level )
- message( STATUS "Adjusting Android API level 'android-${ANDROID_NATIVE_API_LEVEL}' to 'android-${__real_api_level}'")
- set( ANDROID_NATIVE_API_LEVEL ${__real_api_level} )
-endif()
-unset(__real_api_level)
-# validate
-list( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_NATIVE_API_LEVEL}" __levelIdx )
-if( __levelIdx EQUAL -1 )
- message( SEND_ERROR "Specified Android native API level 'android-${ANDROID_NATIVE_API_LEVEL}' is not supported by your NDK/toolchain." )
-else()
- if( BUILD_WITH_ANDROID_NDK )
- __DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
- if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL AND NOT __realApiLevel GREATER 9000 )
- message( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
- endif()
- unset( __realApiLevel )
- endif()
- set( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE )
- set( CMAKE_ANDROID_API ${ANDROID_NATIVE_API_LEVEL} )
- if( CMAKE_VERSION VERSION_GREATER "2.8" )
- list( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )
- set_property( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
- endif()
-endif()
-unset( __levelIdx )
-
-
-# remember target ABI
-set( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE )
-if( CMAKE_VERSION VERSION_GREATER "2.8" )
- list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME} )
- set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME}} )
-endif()
-
-
-# runtime choice (STL, rtti, exceptions)
-if( NOT ANDROID_STL )
- set( ANDROID_STL gnustl_static )
-endif()
-set( ANDROID_STL "${ANDROID_STL}" CACHE STRING "C++ runtime" )
-set( ANDROID_STL_FORCE_FEATURES ON CACHE BOOL "automatically configure rtti and exceptions support based on C++ runtime" )
-mark_as_advanced( ANDROID_STL ANDROID_STL_FORCE_FEATURES )
-
-if( BUILD_WITH_ANDROID_NDK )
- if( NOT "${ANDROID_STL}" MATCHES "^(none|system|system_re|(gabi\\+\\+|stlport|gnustl|libc\\+\\+)_(static|shared))$")
- message( FATAL_ERROR "ANDROID_STL is set to invalid value \"${ANDROID_STL}\".
-The possible values are:
- none -> Do not configure the runtime.
- system -> Use the default minimal system C++ runtime library.
- system_re -> Same as system but with rtti and exceptions.
- gabi++_static -> Use the GAbi++ runtime as a static library.
- gabi++_shared -> Use the GAbi++ runtime as a shared library.
- stlport_static -> Use the STLport runtime as a static library.
- stlport_shared -> Use the STLport runtime as a shared library.
- gnustl_static -> (default) Use the GNU STL as a static library.
- gnustl_shared -> Use the GNU STL as a shared library.
- libc++_static -> Use the LLVM C++ Standard Library as a static library.
- libc++_shared -> Use the LLVM C++ Standard Library as a shared library.
-" )
- endif()
-elseif( BUILD_WITH_STANDALONE_TOOLCHAIN )
- if( NOT "${ANDROID_STL}" MATCHES "^(none|gnustl_static|gnustl_shared)$")
- message( FATAL_ERROR "ANDROID_STL is set to invalid value \"${ANDROID_STL}\".
-The possible values are:
- none -> Do not configure the runtime.
- gnustl_static -> (default) Use the GNU STL as a static library.
- gnustl_shared -> Use the GNU STL as a shared library.
-" )
- endif()
-endif()
-
-unset( ANDROID_RTTI )
-unset( ANDROID_EXCEPTIONS )
-unset( ANDROID_STL_INCLUDE_DIRS )
-unset( __libstl )
-unset( __libsupcxx )
-
-if( NOT _CMAKE_IN_TRY_COMPILE AND ANDROID_NDK_RELEASE STREQUAL "r7b" AND ARMEABI_V7A AND NOT VFPV3 AND ANDROID_STL MATCHES "gnustl" )
- message( WARNING "The GNU STL armeabi-v7a binaries from NDK r7b can crash non-NEON devices. The files provided with NDK r7b were not configured properly, resulting in crashes on Tegra2-based devices and others when trying to use certain floating-point functions (e.g., cosf, sinf, expf).
-You are strongly recommended to switch to another NDK release.
-" )
-endif()
-
-if( NOT _CMAKE_IN_TRY_COMPILE AND X86 AND ANDROID_STL MATCHES "gnustl" AND ANDROID_NDK_RELEASE STREQUAL "r6" )
- message( WARNING "The x86 system header file from NDK r6 has incorrect definition for ptrdiff_t. You are recommended to upgrade to a newer NDK release or manually patch the header:
-See https://android.googlesource.com/platform/development.git f907f4f9d4e56ccc8093df6fee54454b8bcab6c2
- diff --git a/ndk/platforms/android-9/arch-x86/include/machine/_types.h b/ndk/platforms/android-9/arch-x86/include/machine/_types.h
- index 5e28c64..65892a1 100644
- --- a/ndk/platforms/android-9/arch-x86/include/machine/_types.h
- +++ b/ndk/platforms/android-9/arch-x86/include/machine/_types.h
- @@ -51,7 +51,11 @@ typedef long int ssize_t;
- #endif
- #ifndef _PTRDIFF_T
- #define _PTRDIFF_T
- -typedef long ptrdiff_t;
- +# ifdef __ANDROID__
- + typedef int ptrdiff_t;
- +# else
- + typedef long ptrdiff_t;
- +# endif
- #endif
-" )
-endif()
-
-
-# setup paths and STL for standalone toolchain
-if( BUILD_WITH_STANDALONE_TOOLCHAIN )
- set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
- set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
- set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )
-
- if( NOT ANDROID_STL STREQUAL "none" )
- set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/include/c++/${ANDROID_COMPILER_VERSION}" )
- if( NOT EXISTS "${ANDROID_STL_INCLUDE_DIRS}" )
- # old location ( pre r8c )
- set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
- endif()
- if( ARMEABI_V7A AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" )
- list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}" )
- elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits" )
- list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb" )
- else()
- list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" )
- endif()
- # always search static GNU STL to get the location of libsupc++.a
- if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb" )
- elseif( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}" )
- elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libstdc++.a" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb" )
- elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libstdc++.a" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )
- endif()
- if( __libstl )
- set( __libsupcxx "${__libstl}/libsupc++.a" )
- set( __libstl "${__libstl}/libstdc++.a" )
- endif()
- if( NOT EXISTS "${__libsupcxx}" )
- message( FATAL_ERROR "The required libstdsupc++.a is missing in your standalone toolchain.
- Usually it happens because of bug in make-standalone-toolchain.sh script from NDK r7, r7b and r7c.
- You need to either upgrade to newer NDK or manually copy
- $ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a
- to
- ${__libsupcxx}
- " )
- endif()
- if( ANDROID_STL STREQUAL "gnustl_shared" )
- if( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
- elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
- elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
- endif()
- endif()
- if( ANDROID_STL STREQUAL "c++_shared" )
- if( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libc++_shared.so" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libc++_shared.so" )
- elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libc++_shared.so" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libc++_shared.so" )
- elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libc++_shared.so" )
- set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libc++_shared.so" )
- endif()
- endif()
- endif()
-endif()
-
-# clang
-if( "${ANDROID_TOOLCHAIN_NAME}" STREQUAL "standalone-clang" )
- set( ANDROID_COMPILER_IS_CLANG 1 )
- execute_process( COMMAND "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/clang${TOOL_OS_SUFFIX}" --version OUTPUT_VARIABLE ANDROID_CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )
- string( REGEX MATCH "[0-9]+[.][0-9]+" ANDROID_CLANG_VERSION "${ANDROID_CLANG_VERSION}")
-elseif( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang3[.][0-9]?$" )
- string( REGEX MATCH "3[.][0-9]$" ANDROID_CLANG_VERSION "${ANDROID_TOOLCHAIN_NAME}")
- string( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-${ANDROID_COMPILER_VERSION}" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
- if( NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}/bin/clang${TOOL_OS_SUFFIX}" )
- message( FATAL_ERROR "Could not find the Clang compiler driver" )
- endif()
- set( ANDROID_COMPILER_IS_CLANG 1 )
- set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
-else()
- set( ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
- unset( ANDROID_COMPILER_IS_CLANG CACHE )
-endif()
-
-string( REPLACE "." "" _clang_name "clang${ANDROID_CLANG_VERSION}" )
-if( NOT EXISTS "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" )
- set( _clang_name "clang" )
-endif()
-
-
-# setup paths and STL for NDK
-if( BUILD_WITH_ANDROID_NDK )
- set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
- set( ANDROID_SYSROOT "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}" )
-
- if( ANDROID_STL STREQUAL "none" )
- # do nothing
- elseif( ANDROID_STL STREQUAL "system" )
- set( ANDROID_RTTI OFF )
- set( ANDROID_EXCEPTIONS OFF )
- set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" )
- elseif( ANDROID_STL STREQUAL "system_re" )
- set( ANDROID_RTTI ON )
- set( ANDROID_EXCEPTIONS ON )
- set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" )
- elseif( ANDROID_STL MATCHES "gabi" )
- if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
- message( FATAL_ERROR "gabi++ is not available in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.")
- endif()
- set( ANDROID_RTTI ON )
- set( ANDROID_EXCEPTIONS OFF )
- set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/gabi++/include" )
- set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gabi++/libs/${ANDROID_NDK_ABI_NAME}/libgabi++_static.a" )
- elseif( ANDROID_STL MATCHES "stlport" )
- if( NOT ANDROID_NDK_RELEASE_NUM LESS 8004 ) # before r8d
- set( ANDROID_EXCEPTIONS ON )
- else()
- set( ANDROID_EXCEPTIONS OFF )
- endif()
- if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
- set( ANDROID_RTTI OFF )
- else()
- set( ANDROID_RTTI ON )
- endif()
- set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/stlport/stlport" )
- set( __libstl "${ANDROID_NDK}/sources/cxx-stl/stlport/libs/${ANDROID_NDK_ABI_NAME}/libstlport_static.a" )
- elseif( ANDROID_STL MATCHES "gnustl" )
- set( ANDROID_EXCEPTIONS ON )
- set( ANDROID_RTTI ON )
- if( EXISTS "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}" )
- if( ARMEABI_V7A AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.7" AND ANDROID_NDK_RELEASE STREQUAL "r8d" )
- # gnustl binary for 4.7 compiler is buggy :(
- # TODO: look for right fix
- set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.6" )
- else()
- set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}" )
- endif()
- else()
- set( __libstl "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++" )
- endif()
- set( ANDROID_STL_INCLUDE_DIRS "${__libstl}/include" "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/include" "${__libstl}/include/backward" )
- if( EXISTS "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a" )
- set( __libstl "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a" )
- else()
- set( __libstl "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libstdc++.a" )
- endif()
- elseif( ANDROID_STL MATCHES "libc\\+\\+" )
- set( ANDROID_EXCEPTIONS ON )
- set( ANDROID_RTTI ON )
- set( __libstl "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_NDK_ABI_NAME}/libc++_static.a" )
- set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include/" "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++abi/libcxxabi/include" )
- else()
- message( FATAL_ERROR "Unknown runtime: ${ANDROID_STL}" )
- endif()
- # find libsupc++.a - rtti & exceptions
- if( ANDROID_STL STREQUAL "system_re" OR ANDROID_STL MATCHES "gnustl" )
- set( __libsupcxx "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a" ) # r8b or newer
- if( NOT EXISTS "${__libsupcxx}" )
- set( __libsupcxx "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a" ) # r7-r8
- endif()
- if( NOT EXISTS "${__libsupcxx}" ) # before r7
- if( ARMEABI_V7A )
- if( ANDROID_FORCE_ARM_BUILD )
- set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libsupc++.a" )
- else()
- set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libsupc++.a" )
- endif()
- elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD )
- set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libsupc++.a" )
- else()
- set( __libsupcxx "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libsupc++.a" )
- endif()
- endif()
- if( NOT EXISTS "${__libsupcxx}")
- message( ERROR "Could not find libsupc++.a for a chosen platform. Either your NDK is not supported or is broken.")
- endif()
- endif()
-endif()
-
-
-# case of shared STL linkage
-if( ANDROID_STL MATCHES "shared" AND DEFINED __libstl )
- string( REPLACE "_static.a" "_shared.so" __libstl "${__libstl}" )
- # TODO: check if .so file exists before the renaming
-endif()
-
-
-# ccache support
-__INIT_VARIABLE( _ndk_ccache NDK_CCACHE ENV_NDK_CCACHE )
-if( _ndk_ccache )
- if( DEFINED NDK_CCACHE AND NOT EXISTS NDK_CCACHE )
- unset( NDK_CCACHE CACHE )
- endif()
- find_program( NDK_CCACHE "${_ndk_ccache}" DOC "The path to ccache binary")
-else()
- unset( NDK_CCACHE CACHE )
-endif()
-unset( _ndk_ccache )
-
-
-# setup the cross-compiler
-if( NOT CMAKE_C_COMPILER )
- if( NDK_CCACHE AND NOT ANDROID_SYSROOT MATCHES "[ ;\"]" )
- set( CMAKE_C_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C compiler" )
- set( CMAKE_CXX_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C++ compiler" )
- if( ANDROID_COMPILER_IS_CLANG )
- set( CMAKE_C_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
- set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
- else()
- set( CMAKE_C_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
- set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
- endif()
- else()
- if( ANDROID_COMPILER_IS_CLANG )
- set( CMAKE_C_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
- set( CMAKE_CXX_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
- else()
- set( CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler" )
- set( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler" )
- endif()
- endif()
- set( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "assembler" )
- set( CMAKE_STRIP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}" CACHE PATH "strip" )
- if( EXISTS "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc-ar${TOOL_OS_SUFFIX}" )
- # Use gcc-ar if we have it for better LTO support.
- set( CMAKE_AR "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc-ar${TOOL_OS_SUFFIX}" CACHE PATH "archive" )
- else()
- set( CMAKE_AR "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}" CACHE PATH "archive" )
- endif()
- set( CMAKE_LINKER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ld${TOOL_OS_SUFFIX}" CACHE PATH "linker" )
- set( CMAKE_NM "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-nm${TOOL_OS_SUFFIX}" CACHE PATH "nm" )
- set( CMAKE_OBJCOPY "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}" CACHE PATH "objcopy" )
- set( CMAKE_OBJDUMP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objdump${TOOL_OS_SUFFIX}" CACHE PATH "objdump" )
- set( CMAKE_RANLIB "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ranlib${TOOL_OS_SUFFIX}" CACHE PATH "ranlib" )
-endif()
-
-set( _CMAKE_TOOLCHAIN_PREFIX "${ANDROID_TOOLCHAIN_MACHINE_NAME}-" )
-if( CMAKE_VERSION VERSION_LESS 2.8.5 )
- set( CMAKE_ASM_COMPILER_ARG1 "-c" )
-endif()
-if( APPLE )
- find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool )
- if( NOT CMAKE_INSTALL_NAME_TOOL )
- message( FATAL_ERROR "Could not find install_name_tool, please check your installation." )
- endif()
- mark_as_advanced( CMAKE_INSTALL_NAME_TOOL )
-endif()
-
-# Force set compilers because standard identification works badly for us
-include( CMakeForceCompiler )
-CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU )
-if( ANDROID_COMPILER_IS_CLANG )
- set( CMAKE_C_COMPILER_ID Clang )
-endif()
-set( CMAKE_C_PLATFORM_ID Linux )
-if( X86_64 OR MIPS64 OR ARM64_V8A )
- set( CMAKE_C_SIZEOF_DATA_PTR 8 )
-else()
- set( CMAKE_C_SIZEOF_DATA_PTR 4 )
-endif()
-set( CMAKE_C_HAS_ISYSROOT 1 )
-set( CMAKE_C_COMPILER_ABI ELF )
-CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU )
-if( ANDROID_COMPILER_IS_CLANG )
- set( CMAKE_CXX_COMPILER_ID Clang)
-endif()
-set( CMAKE_CXX_PLATFORM_ID Linux )
-set( CMAKE_CXX_SIZEOF_DATA_PTR ${CMAKE_C_SIZEOF_DATA_PTR} )
-set( CMAKE_CXX_HAS_ISYSROOT 1 )
-set( CMAKE_CXX_COMPILER_ABI ELF )
-set( CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc cp cxx cpp CPP c++ C )
-# force ASM compiler (required for CMake < 2.8.5)
-set( CMAKE_ASM_COMPILER_ID_RUN TRUE )
-set( CMAKE_ASM_COMPILER_ID GNU )
-set( CMAKE_ASM_COMPILER_WORKS TRUE )
-set( CMAKE_ASM_COMPILER_FORCED TRUE )
-set( CMAKE_COMPILER_IS_GNUASM 1)
-set( CMAKE_ASM_SOURCE_FILE_EXTENSIONS s S asm )
-
-foreach( lang C CXX ASM )
- if( ANDROID_COMPILER_IS_CLANG )
- set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_CLANG_VERSION} )
- else()
- set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_COMPILER_VERSION} )
- endif()
-endforeach()
-
-# flags and definitions
-remove_definitions( -DANDROID )
-add_definitions( -DANDROID )
-
-if( ANDROID_SYSROOT MATCHES "[ ;\"]" )
- if( CMAKE_HOST_WIN32 )
- # try to convert path to 8.3 form
- file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd" "@echo %~s1" )
- execute_process( COMMAND "$ENV{ComSpec}" /c "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd" "${ANDROID_SYSROOT}"
- OUTPUT_VARIABLE __path OUTPUT_STRIP_TRAILING_WHITESPACE
- RESULT_VARIABLE __result ERROR_QUIET )
- if( __result EQUAL 0 )
- file( TO_CMAKE_PATH "${__path}" ANDROID_SYSROOT )
- set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT}" )
- else()
- set( ANDROID_CXX_FLAGS "--sysroot=\"${ANDROID_SYSROOT}\"" )
- endif()
- else()
- set( ANDROID_CXX_FLAGS "'--sysroot=${ANDROID_SYSROOT}'" )
- endif()
- if( NOT _CMAKE_IN_TRY_COMPILE )
- # quotes can break try_compile and compiler identification
- message(WARNING "Path to your Android NDK (or toolchain) has non-alphanumeric symbols.\nThe build might be broken.\n")
- endif()
-else()
- set( ANDROID_CXX_FLAGS "--sysroot=${ANDROID_SYSROOT}" )
-endif()
-
-# NDK flags
-if (ARM64_V8A )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
- set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
- set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer -fno-strict-aliasing" )
- if( NOT ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" )
- endif()
-elseif( ARMEABI OR ARMEABI_V7A)
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
- if( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 )
- set( ANDROID_CXX_FLAGS_RELEASE "-mthumb -fomit-frame-pointer -fno-strict-aliasing" )
- set( ANDROID_CXX_FLAGS_DEBUG "-marm -fno-omit-frame-pointer -fno-strict-aliasing" )
- if( NOT ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -finline-limit=64" )
- endif()
- else()
- # always compile ARMEABI_V6 in arm mode; otherwise there is no difference from ARMEABI
- set( ANDROID_CXX_FLAGS_RELEASE "-marm -fomit-frame-pointer -fstrict-aliasing" )
- set( ANDROID_CXX_FLAGS_DEBUG "-marm -fno-omit-frame-pointer -fno-strict-aliasing" )
- if( NOT ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
- endif()
- endif()
-elseif( X86 OR X86_64 )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
- if( NOT ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
- endif()
- set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
- set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer -fno-strict-aliasing" )
-elseif( MIPS OR MIPS64 )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fno-strict-aliasing -finline-functions -funwind-tables -fmessage-length=0" )
- set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer" )
- set( ANDROID_CXX_FLAGS_DEBUG "-fno-omit-frame-pointer" )
- if( NOT ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" )
- set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" )
- endif()
-elseif()
- set( ANDROID_CXX_FLAGS_RELEASE "" )
- set( ANDROID_CXX_FLAGS_DEBUG "" )
-endif()
-
-set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char" ) # good/necessary when porting desktop libraries
-
-if( NOT X86 AND NOT ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS "-Wno-psabi ${ANDROID_CXX_FLAGS}" )
-endif()
-
-if( NOT ANDROID_COMPILER_VERSION VERSION_LESS "4.6" )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -no-canonical-prefixes" ) # see https://android-review.googlesource.com/#/c/47564/
-endif()
-
-# ABI-specific flags
-if( ARMEABI_V7A )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv7-a -mfloat-abi=softfp" )
- if( NEON )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=neon" )
- elseif( VFPV3 )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3" )
- else()
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3-d16" )
- endif()
-elseif( ARMEABI_V6 )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp" ) # vfp == vfpv2
-elseif( ARMEABI )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv5te -mtune=xscale -msoft-float" )
-endif()
-
-if( ANDROID_STL MATCHES "gnustl" AND (EXISTS "${__libstl}" OR EXISTS "${__libsupcxx}") )
- set( CMAKE_CXX_CREATE_SHARED_LIBRARY " -o " )
- set( CMAKE_CXX_CREATE_SHARED_MODULE " -o " )
- set( CMAKE_CXX_LINK_EXECUTABLE " -o " )
-else()
- set( CMAKE_CXX_CREATE_SHARED_LIBRARY " -o " )
- set( CMAKE_CXX_CREATE_SHARED_MODULE " -o " )
- set( CMAKE_CXX_LINK_EXECUTABLE " -o " )
-endif()
-
-# STL
-if( EXISTS "${__libstl}" OR EXISTS "${__libsupcxx}" )
- if( EXISTS "${__libstl}" )
- set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${__libstl}\"" )
- set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${__libstl}\"" )
- set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} \"${__libstl}\"" )
- endif()
- if( EXISTS "${__libsupcxx}" )
- set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${__libsupcxx}\"" )
- set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${__libsupcxx}\"" )
- set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} \"${__libsupcxx}\"" )
- # C objects:
- set( CMAKE_C_CREATE_SHARED_LIBRARY " -o " )
- set( CMAKE_C_CREATE_SHARED_MODULE " -o " )
- set( CMAKE_C_LINK_EXECUTABLE " -o " )
- set( CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY} \"${__libsupcxx}\"" )
- set( CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE} \"${__libsupcxx}\"" )
- set( CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} \"${__libsupcxx}\"" )
- endif()
- if( ANDROID_STL MATCHES "gnustl" )
- if( NOT EXISTS "${ANDROID_LIBM_PATH}" )
- set( ANDROID_LIBM_PATH -lm )
- endif()
- set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} ${ANDROID_LIBM_PATH}" )
- set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} ${ANDROID_LIBM_PATH}" )
- set( CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${ANDROID_LIBM_PATH}" )
- endif()
-endif()
-
-# variables controlling optional build flags
-if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
- # libGLESv2.so in NDK's prior to r7 refers to missing external symbols.
- # So this flag option is required for all projects using OpenGL from native.
- __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES ON )
-else()
- __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES OFF )
-endif()
-__INIT_VARIABLE( ANDROID_NO_UNDEFINED VALUES ON )
-__INIT_VARIABLE( ANDROID_FUNCTION_LEVEL_LINKING VALUES ON )
-__INIT_VARIABLE( ANDROID_GOLD_LINKER VALUES ON )
-__INIT_VARIABLE( ANDROID_NOEXECSTACK VALUES ON )
-__INIT_VARIABLE( ANDROID_RELRO VALUES ON )
-
-set( ANDROID_NO_UNDEFINED ${ANDROID_NO_UNDEFINED} CACHE BOOL "Show all undefined symbols as linker errors" )
-set( ANDROID_SO_UNDEFINED ${ANDROID_SO_UNDEFINED} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
-set( ANDROID_FUNCTION_LEVEL_LINKING ${ANDROID_FUNCTION_LEVEL_LINKING} CACHE BOOL "Put each function in separate section and enable garbage collection of unused input sections at link time" )
-set( ANDROID_GOLD_LINKER ${ANDROID_GOLD_LINKER} CACHE BOOL "Enables gold linker" )
-set( ANDROID_NOEXECSTACK ${ANDROID_NOEXECSTACK} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
-set( ANDROID_RELRO ${ANDROID_RELRO} CACHE BOOL "Enables RELRO - a memory corruption mitigation technique" )
-mark_as_advanced( ANDROID_NO_UNDEFINED ANDROID_SO_UNDEFINED ANDROID_FUNCTION_LEVEL_LINKING ANDROID_GOLD_LINKER ANDROID_NOEXECSTACK ANDROID_RELRO )
-
-# linker flags
-set( ANDROID_LINKER_FLAGS "" )
-
-if( ARMEABI_V7A )
- # this is *required* to use the following linker flags that routes around
- # a CPU bug in some Cortex-A8 implementations:
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--fix-cortex-a8" )
-endif()
-
-if( ANDROID_NO_UNDEFINED )
- if( MIPS )
- # there is some sysroot-related problem in mips linker...
- if( NOT ANDROID_SYSROOT MATCHES "[ ;\"]" )
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--no-undefined -Wl,-rpath-link,${ANDROID_SYSROOT}/usr/lib" )
- endif()
- else()
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--no-undefined" )
- endif()
-endif()
-
-if( ANDROID_SO_UNDEFINED )
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-allow-shlib-undefined" )
-endif()
-
-if( ANDROID_FUNCTION_LEVEL_LINKING )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections" )
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" )
-endif()
-
-if( ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
- if( ANDROID_GOLD_LINKER AND (CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE_NUM GREATER 8002) AND (ARMEABI OR ARMEABI_V7A OR X86) )
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
- elseif( ANDROID_NDK_RELEASE_NUM GREATER 8002 ) # after r8b
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=bfd" )
- elseif( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND NOT _CMAKE_IN_TRY_COMPILE )
- message( WARNING "The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342
- On Linux and OS X host platform you can workaround this problem using gold linker (default).
- Rerun cmake with -DANDROID_GOLD_LINKER=ON option in case of problems.
-" )
- endif()
-endif() # version 4.6
-
-if( ANDROID_NOEXECSTACK )
- if( ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Xclang -mnoexecstack" )
- else()
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Wa,--noexecstack" )
- endif()
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,noexecstack" )
-endif()
-
-if( ANDROID_RELRO )
- set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now" )
-endif()
-
-if( ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS "-target ${ANDROID_LLVM_TRIPLE} -Qunused-arguments ${ANDROID_CXX_FLAGS}" )
- if( BUILD_WITH_ANDROID_NDK )
- set( ANDROID_CXX_FLAGS "-gcc-toolchain ${ANDROID_TOOLCHAIN_ROOT} ${ANDROID_CXX_FLAGS}" )
- endif()
-endif()
-
-# cache flags
-set( CMAKE_CXX_FLAGS "" CACHE STRING "c++ flags" )
-set( CMAKE_C_FLAGS "" CACHE STRING "c flags" )
-set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "c++ Release flags" )
-set( CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "c Release flags" )
-set( CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c++ Debug flags" )
-set( CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c Debug flags" )
-set( CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "shared linker flags" )
-set( CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "module linker flags" )
-set( CMAKE_EXE_LINKER_FLAGS "-Wl,-z,nocopyreloc" CACHE STRING "executable linker flags" )
-
-# put flags to cache (for debug purpose only)
-set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS}" CACHE INTERNAL "Android specific c/c++ flags" )
-set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE}" CACHE INTERNAL "Android specific c/c++ Release flags" )
-set( ANDROID_CXX_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG}" CACHE INTERNAL "Android specific c/c++ Debug flags" )
-set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Android specific c/c++ linker flags" )
-
-# finish flags
-set( CMAKE_CXX_FLAGS "${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" )
-set( CMAKE_C_FLAGS "${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}" )
-set( CMAKE_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}" )
-set( CMAKE_C_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELEASE}" )
-set( CMAKE_CXX_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG}" )
-set( CMAKE_C_FLAGS_DEBUG "${ANDROID_CXX_FLAGS_DEBUG} ${CMAKE_C_FLAGS_DEBUG}" )
-set( CMAKE_SHARED_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
-set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
-set( CMAKE_EXE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
-
-if( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK_RELEASE STREQUAL "r8" )
- set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}" )
- set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}" )
- set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}" )
-endif()
-
-# pie/pic
-if( NOT (ANDROID_NATIVE_API_LEVEL LESS 16) AND (NOT DEFINED ANDROID_APP_PIE OR ANDROID_APP_PIE) AND (CMAKE_VERSION VERSION_GREATER 2.8.8) )
- set( CMAKE_POSITION_INDEPENDENT_CODE TRUE )
- set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie")
-else()
- set( CMAKE_POSITION_INDEPENDENT_CODE FALSE )
- set( CMAKE_CXX_FLAGS "-fpic ${CMAKE_CXX_FLAGS}" )
- set( CMAKE_C_FLAGS "-fpic ${CMAKE_C_FLAGS}" )
-endif()
-
-# configure rtti
-if( DEFINED ANDROID_RTTI AND ANDROID_STL_FORCE_FEATURES )
- if( ANDROID_RTTI )
- set( CMAKE_CXX_FLAGS "-frtti ${CMAKE_CXX_FLAGS}" )
- else()
- set( CMAKE_CXX_FLAGS "-fno-rtti ${CMAKE_CXX_FLAGS}" )
- endif()
-endif()
-
-# configure exceptios
-if( DEFINED ANDROID_EXCEPTIONS AND ANDROID_STL_FORCE_FEATURES )
- if( ANDROID_EXCEPTIONS )
- set( CMAKE_CXX_FLAGS "-fexceptions ${CMAKE_CXX_FLAGS}" )
- set( CMAKE_C_FLAGS "-fexceptions ${CMAKE_C_FLAGS}" )
- else()
- set( CMAKE_CXX_FLAGS "-fno-exceptions ${CMAKE_CXX_FLAGS}" )
- set( CMAKE_C_FLAGS "-fno-exceptions ${CMAKE_C_FLAGS}" )
- endif()
-endif()
-
-# global includes and link directories
-include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_STL_INCLUDE_DIRS} )
-get_filename_component(__android_install_path "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" ABSOLUTE) # avoid CMP0015 policy warning
-link_directories( "${__android_install_path}" )
-
-# detect if need link crtbegin_so.o explicitly
-if( NOT DEFINED ANDROID_EXPLICIT_CRT_LINK )
- set( __cmd "${CMAKE_CXX_CREATE_SHARED_LIBRARY}" )
- string( REPLACE "" "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" __cmd "${__cmd}" )
- string( REPLACE "" "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" __cmd "${__cmd}" )
- string( REPLACE "" "${CMAKE_CXX_FLAGS}" __cmd "${__cmd}" )
- string( REPLACE "" "" __cmd "${__cmd}" )
- string( REPLACE "" "${CMAKE_SHARED_LINKER_FLAGS}" __cmd "${__cmd}" )
- string( REPLACE "" "-shared" __cmd "${__cmd}" )
- string( REPLACE "" "" __cmd "${__cmd}" )
- string( REPLACE "" "" __cmd "${__cmd}" )
- string( REPLACE "" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toolchain_crtlink_test.so" __cmd "${__cmd}" )
- string( REPLACE "" "\"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" __cmd "${__cmd}" )
- string( REPLACE "" "" __cmd "${__cmd}" )
- separate_arguments( __cmd )
- foreach( __var ANDROID_NDK ANDROID_NDK_TOOLCHAINS_PATH ANDROID_STANDALONE_TOOLCHAIN )
- if( ${__var} )
- set( __tmp "${${__var}}" )
- separate_arguments( __tmp )
- string( REPLACE "${__tmp}" "${${__var}}" __cmd "${__cmd}")
- endif()
- endforeach()
- string( REPLACE "'" "" __cmd "${__cmd}" )
- string( REPLACE "\"" "" __cmd "${__cmd}" )
- execute_process( COMMAND ${__cmd} RESULT_VARIABLE __cmd_result OUTPUT_QUIET ERROR_QUIET )
- if( __cmd_result EQUAL 0 )
- set( ANDROID_EXPLICIT_CRT_LINK ON )
- else()
- set( ANDROID_EXPLICIT_CRT_LINK OFF )
- endif()
-endif()
-
-if( ANDROID_EXPLICIT_CRT_LINK )
- set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" )
- set( CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" )
-endif()
-
-# setup output directories
-set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
-
-if( DEFINED LIBRARY_OUTPUT_PATH_ROOT
- OR EXISTS "${CMAKE_SOURCE_DIR}/AndroidManifest.xml"
- OR (EXISTS "${CMAKE_SOURCE_DIR}/../AndroidManifest.xml" AND EXISTS "${CMAKE_SOURCE_DIR}/../jni/") )
- set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "Root for binaries output, set this to change where Android libs are installed to" )
- if( NOT _CMAKE_IN_TRY_COMPILE )
- if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
- set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
- else()
- set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
- endif()
- set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for Android libs" )
- endif()
-endif()
-
-# copy shaed stl library to build directory
-if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" AND DEFINED LIBRARY_OUTPUT_PATH )
- get_filename_component( __libstlname "${__libstl}" NAME )
- execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__libstl}" "${LIBRARY_OUTPUT_PATH}/${__libstlname}" RESULT_VARIABLE __fileCopyProcess )
- if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS "${LIBRARY_OUTPUT_PATH}/${__libstlname}")
- message( SEND_ERROR "Failed copying of ${__libstl} to the ${LIBRARY_OUTPUT_PATH}/${__libstlname}" )
- endif()
- unset( __fileCopyProcess )
- unset( __libstlname )
-endif()
-
-
-# set these global flags for cmake client scripts to change behavior
-set( ANDROID True )
-set( BUILD_ANDROID True )
-
-# where is the target environment
-set( CMAKE_FIND_ROOT_PATH "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )
-
-# only search for libraries and includes in the ndk toolchain
-set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
-set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
-set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
-
-
-# macro to find packages on the host OS
-macro( find_host_package )
- set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
- set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )
- set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )
- if( CMAKE_HOST_WIN32 )
- SET( WIN32 1 )
- SET( UNIX )
- elseif( CMAKE_HOST_APPLE )
- SET( APPLE 1 )
- SET( UNIX )
- endif()
- find_package( ${ARGN} )
- SET( WIN32 )
- SET( APPLE )
- SET( UNIX 1 )
- set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
- set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
- set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
-endmacro()
-
-
-# macro to find programs on the host OS
-macro( find_host_program )
- set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
- set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )
- set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )
- if( CMAKE_HOST_WIN32 )
- SET( WIN32 1 )
- SET( UNIX )
- elseif( CMAKE_HOST_APPLE )
- SET( APPLE 1 )
- SET( UNIX )
- endif()
- find_program( ${ARGN} )
- SET( WIN32 )
- SET( APPLE )
- SET( UNIX 1 )
- set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
- set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
- set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
-endmacro()
-
-
-# export toolchain settings for the try_compile() command
-if( NOT _CMAKE_IN_TRY_COMPILE )
- set( __toolchain_config "")
- foreach( __var NDK_CCACHE LIBRARY_OUTPUT_PATH_ROOT ANDROID_FORBID_SYGWIN
- ANDROID_NDK_HOST_X64
- ANDROID_NDK
- ANDROID_NDK_LAYOUT
- ANDROID_STANDALONE_TOOLCHAIN
- ANDROID_TOOLCHAIN_NAME
- ANDROID_ABI
- ANDROID_NATIVE_API_LEVEL
- ANDROID_STL
- ANDROID_STL_FORCE_FEATURES
- ANDROID_FORCE_ARM_BUILD
- ANDROID_NO_UNDEFINED
- ANDROID_SO_UNDEFINED
- ANDROID_FUNCTION_LEVEL_LINKING
- ANDROID_GOLD_LINKER
- ANDROID_NOEXECSTACK
- ANDROID_RELRO
- ANDROID_LIBM_PATH
- ANDROID_EXPLICIT_CRT_LINK
- ANDROID_APP_PIE
- )
- if( DEFINED ${__var} )
- if( ${__var} MATCHES " ")
- set( __toolchain_config "${__toolchain_config}set( ${__var} \"${${__var}}\" CACHE INTERNAL \"\" )\n" )
- else()
- set( __toolchain_config "${__toolchain_config}set( ${__var} ${${__var}} CACHE INTERNAL \"\" )\n" )
- endif()
- endif()
- endforeach()
- file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android.toolchain.config.cmake" "${__toolchain_config}" )
- unset( __toolchain_config )
-endif()
-
-
-# force cmake to produce / instead of \ in build commands for Ninja generator
-if( CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_HOST_WIN32 )
- # it is a bad hack after all
- # CMake generates Ninja makefiles with UNIX paths only if it thinks that we are going to build with MinGW
- set( CMAKE_COMPILER_IS_MINGW TRUE ) # tell CMake that we are MinGW
- set( CMAKE_CROSSCOMPILING TRUE ) # stop recursion
- enable_language( C )
- enable_language( CXX )
- # unset( CMAKE_COMPILER_IS_MINGW ) # can't unset because CMake does not convert back-slashes in response files without it
- unset( MINGW )
-endif()
-
-
-# Variables controlling behavior or set by cmake toolchain:
-# ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86", "mips", "arm64-v8a", "x86_64", "mips64"
-# ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14,15,16,17,18,19,21 (depends on NDK version)
-# ANDROID_STL : gnustl_static/gnustl_shared/stlport_static/stlport_shared/gabi++_static/gabi++_shared/system_re/system/none
-# ANDROID_FORBID_SYGWIN : ON/OFF
-# ANDROID_NO_UNDEFINED : ON/OFF
-# ANDROID_SO_UNDEFINED : OFF/ON (default depends on NDK version)
-# ANDROID_FUNCTION_LEVEL_LINKING : ON/OFF
-# ANDROID_GOLD_LINKER : ON/OFF
-# ANDROID_NOEXECSTACK : ON/OFF
-# ANDROID_RELRO : ON/OFF
-# ANDROID_FORCE_ARM_BUILD : ON/OFF
-# ANDROID_STL_FORCE_FEATURES : ON/OFF
-# ANDROID_LIBM_PATH : path to libm.so (set to something like $(TOP)/out/target/product//obj/lib/libm.so) to workaround unresolved `sincos`
-# Can be set only at the first run:
-# ANDROID_NDK : path to your NDK install
-# NDK_CCACHE : path to your ccache executable
-# ANDROID_TOOLCHAIN_NAME : the NDK name of compiler toolchain
-# ANDROID_NDK_HOST_X64 : try to use x86_64 toolchain (default for x64 host systems)
-# ANDROID_NDK_LAYOUT : the inner NDK structure (RELEASE, LINARO, ANDROID)
-# LIBRARY_OUTPUT_PATH_ROOT :
-# ANDROID_STANDALONE_TOOLCHAIN
-#
-# Primary read-only variables:
-# ANDROID : always TRUE
-# ARMEABI : TRUE for arm v6 and older devices
-# ARMEABI_V6 : TRUE for arm v6
-# ARMEABI_V7A : TRUE for arm v7a
-# ARM64_V8A : TRUE for arm64-v8a
-# NEON : TRUE if NEON unit is enabled
-# VFPV3 : TRUE if VFP version 3 is enabled
-# X86 : TRUE if configured for x86
-# X86_64 : TRUE if configured for x86_64
-# MIPS : TRUE if configured for mips
-# MIPS64 : TRUE if configured for mips64
-# BUILD_WITH_ANDROID_NDK : TRUE if NDK is used
-# BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
-# ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
-# ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86", "mips", "arm64-v8a", "x86_64", "mips64" depending on ANDROID_ABI
-# ANDROID_NDK_RELEASE : from r5 to r10d; set only for NDK
-# ANDROID_NDK_RELEASE_NUM : numeric ANDROID_NDK_RELEASE version (1000*major+minor)
-# ANDROID_ARCH_NAME : "arm", "x86", "mips", "arm64", "x86_64", "mips64" depending on ANDROID_ABI
-# ANDROID_SYSROOT : path to the compiler sysroot
-# TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
-# ANDROID_COMPILER_IS_CLANG : TRUE if clang compiler is used
-#
-# Secondary (less stable) read-only variables:
-# ANDROID_COMPILER_VERSION : GCC version used (not Clang version)
-# ANDROID_CLANG_VERSION : version of clang compiler if clang is used
-# ANDROID_CXX_FLAGS : C/C++ compiler flags required by Android platform
-# ANDROID_SUPPORTED_ABIS : list of currently allowed values for ANDROID_ABI
-# ANDROID_TOOLCHAIN_MACHINE_NAME : "arm-linux-androideabi", "arm-eabi" or "i686-android-linux"
-# ANDROID_TOOLCHAIN_ROOT : path to the top level of toolchain (standalone or placed inside NDK)
-# ANDROID_CLANG_TOOLCHAIN_ROOT : path to clang tools
-# ANDROID_SUPPORTED_NATIVE_API_LEVELS : list of native API levels found inside NDK
-# ANDROID_STL_INCLUDE_DIRS : stl include paths
-# ANDROID_RTTI : if rtti is enabled by the runtime
-# ANDROID_EXCEPTIONS : if exceptions are enabled by the runtime
-# ANDROID_GCC_TOOLCHAIN_NAME : read-only, differs from ANDROID_TOOLCHAIN_NAME only if clang is used
-#
-# Defaults:
-# ANDROID_DEFAULT_NDK_API_LEVEL
-# ANDROID_DEFAULT_NDK_API_LEVEL_${ARCH}
-# ANDROID_NDK_SEARCH_PATHS
-# ANDROID_SUPPORTED_ABIS_${ARCH}
-# ANDROID_SUPPORTED_NDK_VERSIONS
diff --git a/modules/cotire.cmake b/modules/cotire.cmake
index ced265c105940123785990c9259fc87b5d62cbd1..371ab8bc4fcfa2b38f30218fc5274a2f2cfb46fd 100644
--- a/modules/cotire.cmake
+++ b/modules/cotire.cmake
@@ -43,7 +43,7 @@ if (NOT CMAKE_SCRIPT_MODE_FILE)
endif()
set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.8.0")
+set (COTIRE_CMAKE_MODULE_VERSION "1.8.1")
# activate select policies
if (POLICY CMP0025)
@@ -931,9 +931,9 @@ function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemInclu
list (FIND ${_systemIncludesVar} "${_include}" _index)
endif()
if (_index GREATER -1)
+ # Pass -isystem as a separated flag, not as "-isystem ".
string(STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _include_system_flag)
list (APPEND ${_cmdVar} "${_include_system_flag}" "${_include}")
-
else()
list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
endif()
@@ -1070,10 +1070,10 @@ macro (cotire_check_ignore_header_file_path _headerFile _headerIsIgnoredVar)
set (${_headerIsIgnoredVar} TRUE)
elseif (IS_DIRECTORY "${_headerFile}")
set (${_headerIsIgnoredVar} TRUE)
- elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed" AND "${_headerFile}" MATCHES "\\.h$")
- # heuristic: ignore C headers with embedded parent directory references or "-fixed" or "_fixed" in path
+ elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed")
+ # heuristic: ignore headers with embedded parent directory references or "-fixed" or "_fixed" in path
# these often stem from using GCC #include_next tricks, which may break the precompiled header compilation
- # with the error message "error: no include path in which to search for header.h"
+ # with the error message "error: no include path in which to search for header"
set (${_headerIsIgnoredVar} TRUE)
else()
set (${_headerIsIgnoredVar} FALSE)
@@ -1632,7 +1632,6 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
- string (REGEX REPLACE "\\.[^.]*$" ".obj" _objFileNative "${_hostFileNative}")
# cl.exe options used
# /Yc creates a precompiled header file
# /Fp specifies precompiled header binary file name
@@ -1640,16 +1639,13 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
# /TC treat all files named on the command line as C source files
# /TP treat all files named on the command line as C++ source files
# /Zs syntax check only
- # /c stop compilation after creating an object file
- # /Fo specifies object file name
# /Zm precompiled header memory allocation scaling factor
set (_sourceFileTypeC "/TC")
set (_sourceFileTypeCXX "/TP")
if (_flags)
# append to list
list (APPEND _flags /nologo "${_sourceFileType${_language}}"
- "/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /c "/Fo${_objFileNative}"
- "${_hostFileNative}")
+ "/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
list (APPEND _flags "/Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
endif()
@@ -2387,8 +2383,8 @@ endfunction()
function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
set (_sourceFiles ${ARGN})
- if ((CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
- (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang")) AND NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+ (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
if (_sourceFiles)
@@ -2420,16 +2416,9 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
if (COTIRE_DEBUG)
message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} ${_realCompilerExe} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
endif()
- set (_outputFiles "")
- list (APPEND _outputFiles "${_pchFile}")
set_property (SOURCE "${_pchFile}" PROPERTY GENERATED TRUE)
- if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
- string (REGEX REPLACE "\\.[^.]*$" ".obj" _hostObjFile "${_hostFile}")
- list (APPEND _outputFiles "${_hostObjFile}")
- set_property (SOURCE "${_hostObjFile}" PROPERTY GENERATED TRUE)
- endif()
add_custom_command(
- OUTPUT ${_outputFiles}
+ OUTPUT "${_pchFile}"
COMMAND ${_cmds}
DEPENDS "${_prefixFile}" "${_realCompilerExe}"
IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
@@ -2441,8 +2430,8 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre
endfunction()
function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
- if ((CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
- (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang")) AND NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+ if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+ (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
set (_sourceFiles ${ARGN})
@@ -2589,9 +2578,9 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget)
# if this is a single-language target without any excluded files
if (_wholeTarget)
set (_language "${_languages}")
- # for Intel and clang-cl, precompiled header inclusion is always done on the source file level
+ # for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
# see cotire_setup_pch_file_inclusion
- if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "Intel" AND NOT
+ if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
if (_prefixFile)
@@ -3041,16 +3030,6 @@ function (cotire_process_target_language _language _configurations _target _whol
if (_targetUsePCH)
cotire_make_pch_file_path(${_language} ${_target} _pchFile)
if (_pchFile)
- if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC" AND "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
- # use stub file to link in precompiled header
- string (REGEX REPLACE "\\.[^.]*$" "_stub.cxx" _stubFile "${_prefixFile}")
- file (WRITE "${_stubFile}" "#include \"${_prefixFile}\"")
- list (INSERT _sourceFiles 0 "${_stubFile}")
- string (REGEX REPLACE "\\.[^.]*$" ".obj" _stubObjFile "${_stubFile}")
- set_property (SOURCE "${_stubObjFile}" PROPERTY GENERATED TRUE)
- target_sources (${_target} PRIVATE "${_stubObjFile}")
- set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_STUB_OBJECT "${_stubObjFile}")
- endif()
# first file in _sourceFiles is passed as the host file
cotire_setup_pch_file_compilation(
${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
@@ -3140,11 +3119,6 @@ function (cotire_collect_unity_target_sources _target _languages _unityTargetSou
if (_sourceFiles OR _cotiredSources)
list (REMOVE_ITEM _unityTargetSources ${_sourceFiles} ${_cotiredSources})
endif()
- if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC" AND "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
- # remove pch stub object file
- get_property(_stubObjFile TARGET ${_target} PROPERTY COTIRE_${_language}_STUB_OBJECT)
- list (REMOVE_ITEM _unityTargetSources "${_stubObjFile}")
- endif()
# add unity source files instead
list (APPEND _unityTargetSources ${_unityFiles})
endif()
diff --git a/screenshots/cornell.jpeg b/screenshots/cornell.jpeg
index 8eaead5adea63aabd208072902d4d48e8c2cf486..30b6a61d5b0448819c3fc4b953d5271bd4f967a2 100644
Binary files a/screenshots/cornell.jpeg and b/screenshots/cornell.jpeg differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cb812173dc53a4903548e23db28fdc559b0c3459..7da0eac09213d6f44dcb14d43fbe20ba226c7586 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+add_subdirectory(mirrage)
+
if(MIRRAGE_BUILD_DEMO)
add_subdirectory(demo)
endif()
@@ -8,5 +10,3 @@ if(MIRRAGE_BUILD_MESH_CONVERTER)
add_subdirectory(mesh_converter)
endif()
-add_subdirectory(mirrage)
-
diff --git a/src/demo/CMakeLists.txt b/src/demo/CMakeLists.txt
index 5fd3264bbcb28c2dca49a4cf4587394825a5ad3e..d6b6342f42c5668bf979373d7baa674a44bb0ede 100644
--- a/src/demo/CMakeLists.txt
+++ b/src/demo/CMakeLists.txt
@@ -1,6 +1,6 @@
-cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
-project(mirrage_demo LANGUAGES CXX)
+project(mirrage_demo LANGUAGES CXX ASM)
file(GLOB_RECURSE HEADER_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
@@ -13,9 +13,13 @@ add_executable(demo ${HEADER_FILES}
src/main.cpp
src/meta_system.cpp
src/test_screen.cpp
+ src/test_animation_screen.cpp
${BACKWARD_ENABLE}
)
-add_backward(demo)
+if(${MIRRAGE_ENABLE_BACKWARD})
+ add_backward(demo)
+endif()
+target_compile_features(demo PUBLIC cxx_std_17)
set(MIRRAGE_DEFAULT_COMPILER_ARGS ${MIRRAGE_DEFAULT_COMPILER_ARGS})
target_compile_options(demo PRIVATE ${MIRRAGE_DEFAULT_COMPILER_ARGS})
@@ -29,6 +33,18 @@ target_link_libraries(demo
sf2
doctest
)
+if (WIN32)
+ if(MINGW)
+ target_link_libraries(demo
+ PRIVATE
+ mingw32
+ )
+ endif()
+ target_link_libraries(demo
+ PRIVATE
+ mirrage::deps::SDL2main
+ )
+endif()
option(MIRRAGE_EXPORT_EXECUTABLE "Export executable" OFF)
if(MIRRAGE_EXPORT_EXECUTABLE)
@@ -39,3 +55,7 @@ endif()
if(COMMAND cotire)
cotire(demo)
endif()
+
+if(MSVC_IDE)
+ set_property(TARGET demo PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${MIRRAGE_ROOT_DIR}/assets")
+endif()
diff --git a/src/demo/src/game_engine.cpp b/src/demo/src/game_engine.cpp
index 5281c1dbed1e2f495b9f54fadc5d123b2db2bb42..d3300e5e8a7cfed99d37adaad14c80fbcb053aaa 100644
--- a/src/demo/src/game_engine.cpp
+++ b/src/demo/src/game_engine.cpp
@@ -2,48 +2,61 @@
#include
#include
+#include
#include
#include
#include
#include
+#include
#include
#include
#include
#include
+#include
#include
#include
#include
#include
+#include
namespace mirrage {
- Game_engine::Game_engine(const std::string& org,
- const std::string& title,
- std::uint32_t version_major,
- std::uint32_t version_minor,
- bool debug,
- int argc,
- char** argv,
- char** env)
- : Engine(org, title, version_major, version_minor, debug, false, argc, argv, env)
+ Game_engine::Game_engine(const std::string& org,
+ const std::string& title,
+ util::maybe base_dir,
+ std::uint32_t version_major,
+ std::uint32_t version_minor,
+ bool debug,
+ int argc,
+ char** argv,
+ char** env)
+ : Engine(org, title, std::move(base_dir), version_major, version_minor, debug, false, argc, argv, env)
+ , _debug_ui(assets(), gui(), bus())
, _renderer_factory(std::make_unique(
*this,
window(),
util::make_vector(renderer::make_pass_factory(),
+ renderer::make_pass_factory(),
renderer::make_pass_factory(),
renderer::make_pass_factory(),
renderer::make_pass_factory(),
renderer::make_pass_factory(),
renderer::make_pass_factory(),
renderer::make_pass_factory(),
+ renderer::make_pass_factory(),
renderer::make_pass_factory(),
+ renderer::make_pass_factory(),
renderer::make_pass_factory(),
renderer::make_pass_factory(),
+ renderer::make_pass_factory(),
renderer::make_pass_factory(),
renderer::make_pass_factory(),
renderer::make_pass_factory())))
+ , _global_render(_renderer_factory->create_renderer())
+ , _render_pass_mask(_renderer_factory->all_passes_mask())
{
+ util::erase_fast(_render_pass_mask, renderer::render_pass_id_of());
}
Game_engine::~Game_engine()
@@ -51,6 +64,13 @@ namespace mirrage {
screens().clear(); // destroy all screens before the engine
}
- void Game_engine::_on_post_frame(util::Time) { _renderer_factory->finish_frame(); }
+ void Game_engine::_on_post_frame(util::Time dt)
+ {
+ _debug_ui.draw();
+
+ _global_render->update(dt);
+ _global_render->draw();
+ _renderer_factory->finish_frame();
+ }
} // namespace mirrage
diff --git a/src/demo/src/game_engine.hpp b/src/demo/src/game_engine.hpp
index c5d5a39b2ab42deac486d4532030aae92dae7d8a..0e7b0e08fccebf5a52be5736e369a626fa490dd9 100644
--- a/src/demo/src/game_engine.hpp
+++ b/src/demo/src/game_engine.hpp
@@ -11,6 +11,7 @@
#include
#include
+#include
#include
@@ -21,22 +22,28 @@ namespace mirrage {
class Game_engine : public Engine {
public:
- Game_engine(const std::string& org,
- const std::string& title,
- std::uint32_t version_major,
- std::uint32_t version_minor,
- bool debug,
- int argc,
- char** argv,
- char** env);
- ~Game_engine();
+ Game_engine(const std::string& org,
+ const std::string& title,
+ util::maybe base_dir,
+ std::uint32_t version_major,
+ std::uint32_t version_minor,
+ bool debug,
+ int argc,
+ char** argv,
+ char** env);
+ ~Game_engine() override;
auto renderer_factory() noexcept -> auto& { return *_renderer_factory; }
+ auto global_render() noexcept -> auto& { return *_global_render; }
+ auto render_pass_mask() noexcept -> auto& { return _render_pass_mask; }
protected:
void _on_post_frame(util::Time) override;
private:
+ gui::Debug_ui _debug_ui;
std::unique_ptr _renderer_factory;
+ std::unique_ptr _global_render;
+ renderer::Render_pass_mask _render_pass_mask;
};
} // namespace mirrage
diff --git a/src/demo/src/main.cpp b/src/demo/src/main.cpp
index aca1fba2d28df1f1db84f89587dcf4e56dd5f7d5..69b8eff7ef37f474b5c8190705d7efae19571463 100644
--- a/src/demo/src/main.cpp
+++ b/src/demo/src/main.cpp
@@ -8,13 +8,16 @@
#define DOCTEST_CONFIG_IMPLEMENT
#include "game_engine.hpp"
+#include "test_animation_screen.hpp"
#include "test_screen.hpp"
#include
#include
+#include
+#include
-#include
+#include
#include
#include
#include
@@ -28,7 +31,8 @@ using namespace std::string_literals;
namespace {
- std::unique_ptr engine;
+ std::unique_ptr engine;
+ std::unique_ptr global_commands;
void init_env(int argc, char** argv, char** env);
void init_engine();
@@ -69,19 +73,30 @@ int main(int argc, char** argv, char** env)
namespace {
constexpr auto org_name = "secondsystem";
constexpr auto app_name = "Mirrage";
- int argc;
- char** argv;
- char** env;
+ auto base_dir() -> util::maybe
+ {
+#ifndef NDEBUG
+ return mirrage::version_info::engine_root + "/assets";
+#else
+ return util::nothing;
+#endif
+ }
+
+ int argc;
+ char** argv;
+ char** env;
void init_env(int argc, char** argv, char** env)
{
- auto write_dir = asset::write_dir(argv[0], org_name, app_name);
+ auto write_dir = asset::write_dir(argv[0], org_name, app_name, base_dir());
static auto fileAppender = plog::RollingFileAppender(
(write_dir + "/mirrage.log").c_str(), 1024L * 1024L, 4);
static auto consoleAppender = plog::ColorConsoleAppender();
- plog::init(plog::debug, &fileAppender).addAppender(&consoleAppender);
+ plog::init(plog::debug, &fileAppender)
+ .addAppender(&consoleAppender)
+ .addAppender(&gui::debug_console_appender());
::argc = argc;
@@ -89,6 +104,7 @@ namespace {
::env = env;
LOG(plog::debug) << "Game started from: " << argv[0] << "\n"
+ << "Base dir: " << base_dir().get_ref_or("") << "\n"
<< "Working dir: " << asset::pwd() << "\n"
<< "Write dir: " << write_dir << "\n"
<< "Version: " << version_info::name << "\n"
@@ -114,15 +130,37 @@ namespace {
}
- engine = std::make_unique(org_name, app_name, 0, 1, debug, argc, argv, env);
+ engine = std::make_unique(org_name, app_name, base_dir(), 0, 1, debug, argc, argv, env);
+
+ global_commands = std::make_unique();
+ global_commands->add("screen.leave | Pops the top screens",
+ [&](std::uint8_t depth) { engine->screens().leave(depth); });
+ global_commands->add(
+ "screen.print | Prints the currently open screens (=> update+draw next, D> only draw, S> "
+ "don't update+draw)",
+ [&]() {
+ auto screen_list = engine->screens().print_stack();
+ LOG(plog::info) << "Open Screens: " << screen_list;
+ });
+
+ global_commands->add("screen.enter.test | Enters the test screen",
+ [&]() { engine->screens().enter(); });
+ global_commands->add("screen.enter.animation_test | Enters the animation test screen",
+ [&]() { engine->screens().enter(); });
if(argc > 1 && argv[1] == "test"s)
engine->screens().enter();
+ else if(argc > 1 && argv[1] == "animation_test"s)
+ engine->screens().enter();
else
engine->screens().enter();
}
void onFrame() { engine->on_frame(); }
- void shutdown() { engine.reset(); }
+ void shutdown()
+ {
+ global_commands.reset();
+ engine.reset();
+ }
} // namespace
diff --git a/src/demo/src/meta_system.cpp b/src/demo/src/meta_system.cpp
index f6b8278827236750ed8718b51aef89c5ec75cca2..5889d925dd0a0c461435c3d6923e5998318d772e 100644
--- a/src/demo/src/meta_system.cpp
+++ b/src/demo/src/meta_system.cpp
@@ -8,14 +8,37 @@
namespace mirrage {
+ using namespace ecs::components;
Meta_system::Meta_system(Game_engine& engine)
: _entities(engine.assets(), this)
- , _renderer(engine.renderer_factory().create_renderer(_entities))
+ , _renderer(engine.renderer_factory().create_renderer(_entities, engine.render_pass_mask()))
, _model_loading(std::make_unique(_entities, engine.assets()))
, _nims(std::make_unique(_entities))
{
_entities.register_component_type();
+
+ _commands.add("reload | Reloads most assets", [&] { engine.assets().reload(); });
+
+ _commands.add("ecs.emplace | Creates a new entity in front of the current camera",
+ [&](std::string blueprint) {
+ auto pos = glm::vec3(0, 0, 0);
+ float prio = -1.f;
+ for(auto&& [transform, cam] :
+ _entities.list()) {
+ if(cam.priority() > prio) {
+ prio = cam.priority();
+ pos = transform.position + transform.direction() * 2.f;
+ }
+ }
+ _entities.entity_builder(blueprint).position(pos).create();
+ });
+
+ _commands.add("mem.renderer | Prints memory usage of renderer", [&] {
+ auto msg = std::stringstream();
+ _renderer->device().print_memory_usage(msg);
+ LOG(plog::info) << "Renderer Memory usage: " << msg.str();
+ });
}
Meta_system::~Meta_system()
diff --git a/src/demo/src/meta_system.hpp b/src/demo/src/meta_system.hpp
index 698197c692da4e4e93f2b4825194602d0decb75b..8671299f15136ef33f9c4b93dc328b04166020bc 100644
--- a/src/demo/src/meta_system.hpp
+++ b/src/demo/src/meta_system.hpp
@@ -3,6 +3,7 @@
#include "game_engine.hpp"
#include
+#include
namespace mirrage {
@@ -36,5 +37,6 @@ namespace mirrage {
std::unique_ptr _renderer;
std::unique_ptr _model_loading;
std::unique_ptr _nims;
+ util::Console_command_container _commands;
};
} // namespace mirrage
diff --git a/src/demo/src/systems/nim_system.cpp b/src/demo/src/systems/nim_system.cpp
index ee32af163befb4efed3fa1c4a405fdbbde4435a3..9bb8ec2b50aa9bcaa3c7c544373c4f665c2f6d95 100644
--- a/src/demo/src/systems/nim_system.cpp
+++ b/src/demo/src/systems/nim_system.cpp
@@ -80,9 +80,9 @@ namespace mirrage::systems {
state.orientations.emplace_back(iter->second.orientation);
state.light_colors.emplace_back(iter->second.light_color);
} else if(state.positions.empty()) {
- state.positions.emplace_back(0, 0, 0);
- state.orientations.emplace_back(1, 0, 0, 0);
- state.light_colors.emplace_back(1, 0.938374f, 0.88349f, 100.f);
+ state.positions.emplace_back(0.0f, 0.0f, 0.0f);
+ state.orientations.emplace_back(1.0f, 0.0f, 0.0f, 0.0f);
+ state.light_colors.emplace_back(1.0f, 0.938374f, 0.88349f, 100.f);
} else {
state.positions.emplace_back(glm::vec3(state.positions.back()));
state.orientations.emplace_back(glm::quat(state.orientations.back()));
diff --git a/src/demo/src/test_animation_screen.cpp b/src/demo/src/test_animation_screen.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..106629546e57f0e9af42081b456e3bd4236a0397
--- /dev/null
+++ b/src/demo/src/test_animation_screen.cpp
@@ -0,0 +1,160 @@
+#include "test_animation_screen.hpp"
+
+#include
+#include
+
+
+namespace mirrage {
+ using namespace ecs::components;
+ using namespace util::unit_literals;
+ using namespace graphic;
+
+ Test_animation_screen::Test_animation_screen(Engine& engine) : Test_screen(engine)
+ {
+ _animation_test_dqs = _meta_system.entities()
+ .entity_builder("monk")
+ .position({-8, 0, -0.5f - 1.f})
+ .direction(glm::vec3{-1, 0, 0})
+ .create();
+
+ _animation_test_lbs = _meta_system.entities()
+ .entity_builder("monk_lbs")
+ .position({-8, 0, -0.5f + 1.f})
+ .direction(glm::vec3{-1, 0, 0})
+ .create();
+
+
+ _animation_test2_dqs = _meta_system.entities()
+ .entity_builder("rotation_test")
+ .position({-4, 0, -0.5f - 1.f})
+ .create();
+
+ _animation_test2_lbs = _meta_system.entities()
+ .entity_builder("rotation_test_lbs")
+ .position({-4, 0, -0.5f + 1.f})
+ .create();
+ }
+
+ void Test_animation_screen::_draw()
+ {
+ auto anim_mb = _animation_test_dqs.get();
+ auto anim_lbs_mb = _animation_test_lbs.get();
+ if(anim_mb.is_nothing())
+ return;
+
+ auto& anim = anim_mb.get_or_throw();
+
+ ImGui::PositionNextWindow(
+ {300, 500}, ImGui::WindowPosition_X::right, ImGui::WindowPosition_Y::center);
+ if(ImGui::Begin("Animation")) {
+ ImGui::TextUnformatted("Animation");
+
+ auto animations_strs = std::array{
+ {"[None]", "Attack", "Dance", "Die", "Flee", "Idle", "Sad", "Sleep", "Walk"}};
+ auto animations_ids = std::array{{""_strid,
+ "attack"_strid,
+ "dance"_strid,
+ "die"_strid,
+ "flee"_strid,
+ "idle"_strid,
+ "sad"_strid,
+ "sleep"_strid,
+ "walk"_strid}};
+ (void) animations_ids;
+
+ auto curr_animation_id = anim.animation_id().get_or(""_strid);
+ auto curr_idx = int(std::distance(
+ animations_ids.begin(),
+ std::find(animations_ids.begin(), animations_ids.end(), curr_animation_id)));
+
+ if(ImGui::Combo("Animation", &curr_idx, animations_strs.data(), int(animations_strs.size()))) {
+ anim.play(animations_ids.at(std::size_t(curr_idx)));
+ anim_lbs_mb.process([&](auto& anim) { anim.play(animations_ids.at(std::size_t(curr_idx))); });
+ }
+
+ anim.animation().process([&](auto& curr_animation) {
+ auto& dqs_anim = _animation_test_dqs.get().get_or_throw();
+ auto& dqs_states = dqs_anim.states();
+ auto& lbs_anim = _animation_test_lbs.get().get_or_throw();
+ auto& lbs_states = lbs_anim.states();
+
+ auto time = 0.f;
+ auto curr_dqs_state = std::find_if(dqs_states.begin(), dqs_states.end(), [&](auto& s) {
+ return &*s.animation == &*curr_animation;
+ });
+ auto curr_lbs_state = std::find_if(lbs_states.begin(), lbs_states.end(), [&](auto& s) {
+ return &*s.animation == &*curr_animation;
+ });
+
+ if(curr_dqs_state != dqs_states.end()) {
+ time = curr_dqs_state->time;
+ } else if(curr_lbs_state != lbs_states.end()) {
+ time = curr_dqs_state->time;
+ }
+
+ auto duration = curr_animation->duration();
+
+ auto new_time = ImGui::ValueSliderFloat("Time", time, 0.f, duration);
+ if(std::abs(new_time - time) > 0.00001f) {
+ dqs_anim.mark_dirty();
+ lbs_anim.mark_dirty();
+
+ if(curr_dqs_state != dqs_states.end())
+ curr_dqs_state->time = new_time;
+
+ if(curr_lbs_state != lbs_states.end())
+ curr_lbs_state->time = new_time;
+ }
+
+ ImGui::TextUnformatted(
+ (util::to_string(new_time) + " / " + util::to_string(duration)).c_str());
+
+ anim.speed(ImGui::ValueSliderFloat("Speed", anim.speed(), 0.f, 5.f));
+
+
+ if(anim.paused())
+ anim.pause(!ImGui::Button("Continue"));
+ else
+ anim.pause(ImGui::Button("Pause"));
+
+ ImGui::SameLine();
+
+ if(anim.reversed())
+ anim.reverse(!ImGui::Button("Reverse (->)"));
+ else
+ anim.reverse(ImGui::Button("Reverse (<-)"));
+
+ ImGui::SameLine();
+
+ if(anim.looped())
+ anim.loop(!ImGui::Button("Once"));
+ else
+ anim.loop(ImGui::Button("Repeat"));
+
+
+ anim_lbs_mb.process([&](auto& anim_lbs) {
+ anim_lbs.speed(anim.speed());
+ anim_lbs.pause(anim.paused());
+ anim_lbs.reverse(anim.reversed());
+ anim_lbs.loop(anim.looped());
+ });
+ });
+ }
+
+ ImGui::TextUnformatted("Rotation Test");
+ _animation_test2_dqs.get().process([&](auto& anim) {
+ if(anim.paused())
+ anim.pause(!ImGui::Button("Continue"));
+ else
+ anim.pause(ImGui::Button("Pause"));
+
+ _animation_test2_lbs.get().process(
+ [&](auto& anim_lbs) { anim_lbs.pause(anim.paused()); });
+ });
+
+ ImGui::End();
+
+ Test_screen::_draw();
+ }
+
+} // namespace mirrage
diff --git a/src/demo/src/test_animation_screen.hpp b/src/demo/src/test_animation_screen.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..ce132119a0101c1f3b57d996396fc27b6acbbb44
--- /dev/null
+++ b/src/demo/src/test_animation_screen.hpp
@@ -0,0 +1,40 @@
+/** The main menu ************************************************************
+ * *
+ * Copyright (c) 2016 Florian Oetke *
+ * This file is distributed under the MIT License *
+ * See LICENSE file for details. *
+\*****************************************************************************/
+
+#pragma once
+
+#include "test_screen.hpp"
+
+#include
+#include
+#include
+#include
+
+
+namespace mirrage {
+
+ class Test_animation_screen : public Test_screen {
+ public:
+ Test_animation_screen(Engine& engine);
+
+ auto name() const -> std::string override { return "Test_animation"; }
+
+ protected:
+ void _draw() override;
+
+ auto _prev_screen_policy() const noexcept -> Prev_screen_policy override
+ {
+ return Prev_screen_policy::discard;
+ }
+
+ private:
+ ecs::Entity_facet _animation_test_dqs;
+ ecs::Entity_facet _animation_test_lbs;
+ ecs::Entity_facet _animation_test2_dqs;
+ ecs::Entity_facet _animation_test2_lbs;
+ };
+} // namespace mirrage
diff --git a/src/demo/src/test_screen.cpp b/src/demo/src/test_screen.cpp
index e7ea2144f655936404edf1d0165ff448393b0d75..79ce146427a7bef972cf703c6e8b5fcfc75bffcb 100644
--- a/src/demo/src/test_screen.cpp
+++ b/src/demo/src/test_screen.cpp
@@ -9,10 +9,6 @@
#include
#include
-#ifdef HPC_HISTOGRAM_DEBUG_VIEW
-#include
-#endif
-
#include
#include
#include
@@ -30,20 +26,6 @@
#include
-
-template
-void quick_exit(int) noexcept
-{
- std::abort();
-}
-void mirrage_quick_exit() noexcept
-{
- using namespace std;
- // calls std::quick_exit if it exists or the template-fallback defined above, if not
- // needs to be at global scope for this workaround to work correctly
- quick_exit(0);
-}
-
namespace mirrage {
using namespace ecs::components;
using namespace util::unit_literals;
@@ -82,46 +64,39 @@ namespace mirrage {
, _meta_system(static_cast(engine))
, _gui(engine.gui())
, _performance_log(util::nothing)
- , _window_width(engine.window().width())
- , _window_height(engine.window().height())
- , _window_fullscreen(engine.window().fullscreen() != graphic::Fullscreen::no)
{
+ _meta_system.entities().entity_builder("cornell").position({1000, 0, 0}).create();
- _animation_test_dqs = _meta_system.entities().emplace("monk");
- _animation_test_dqs.get().process([](auto& transform) {
- transform.position = {-8, 0, -0.5f - 1.f};
- transform.orientation = glm::quatLookAt(glm::vec3{-1, 0, 0}, glm::vec3{0, 1, 0});
- });
-
- _animation_test_lbs = _meta_system.entities().emplace("monk_lbs");
- _animation_test_lbs.get().process([](auto& transform) {
- transform.position = {-8, 0, -0.5f + 1.f};
- transform.orientation = glm::quatLookAt(glm::vec3{-1, 0, 0}, glm::vec3{0, 1, 0});
- });
+ _cmd_commands.add_property("pos",
+ [&](glm::vec3 position) {
+ _camera.get().process(
+ [&](auto& transform) { transform.position = position; });
+ },
+ [&]() {
+ return _camera.get().process(
+ glm::vec3(0, 0, 0),
+ [&](auto& transform) { return transform.position; });
+ });
+ _meta_system.entities().entity_builder("sponza").create();
- _animation_test2_dqs = _meta_system.entities().emplace("rotation_test");
- _animation_test2_dqs.get().process([](auto& transform) {
- transform.position = {-4, 0, -0.5f - 1.f};
- });
+ _meta_system.entities().entity_builder("test_particle_emitter").position({-6, 2, 1}).create();
+ _meta_system.entities().entity_builder("test_smoke_emitter").position({-6, 1, -1}).create();
- _animation_test2_lbs = _meta_system.entities().emplace("rotation_test_lbs");
- _animation_test2_lbs.get().process([](auto& transform) {
- transform.position = {-4, 0, -0.5f + 1.f};
- });
+ _meta_system.entities()
+ .entity_builder("billboard")
+ .position({-8, 1, 0.5f})
+ .direction({-1, 0, 0})
+ .create();
+ _meta_system.entities().entity_builder("decal").position({-8, 0, -0.5f}).create();
+ _sun = _meta_system.entities().entity_builder("sun").create();
- _camera = _meta_system.entities().emplace("camera");
-
- auto cornell = _meta_system.entities().emplace("cornell");
- cornell.get().process([&](auto& transform) { transform.position = {1000, 0, 0}; });
-
- _meta_system.entities().emplace("sponza");
-
- _sun = _meta_system.entities().emplace("sun");
-
- _set_preset(1);
+ _camera = _meta_system.entities()
+ .entity_builder("camera")
+ .post_create([&](auto&&) { _set_preset(1); })
+ .create();
_mailbox.subscribe_to([&](input::Once_action& e) {
switch(e.id) {
@@ -133,20 +108,15 @@ namespace mirrage {
_engine.screens().leave();
}
break;
- case "fast_quit"_strid:
- _meta_system.renderer().device().wait_idle();
- std::this_thread::sleep_for(std::chrono::milliseconds(250));
- mirrage_quick_exit();
- break;
-
- case "create"_strid:
- _meta_system.entities().emplace("cube").get().process(
- [&](auto& transform) {
- auto& cam = _camera.get().get_or_throw();
- transform.position = cam.position + cam.direction();
- });
+ case "create"_strid: {
+ auto& cam = _camera.get().get_or_throw();
+ _meta_system.entities()
+ .entity_builder("cube")
+ .position(cam.position + cam.direction())
+ .create();
break;
+ }
case "print"_strid: {
auto cam = _camera.get().get_or_throw().position;
@@ -182,6 +152,7 @@ namespace mirrage {
case "pause"_strid:
LOG(plog::debug) << "Pause/Unpause playback";
_meta_system.nims().toggle_pause();
+ _paused = !_paused;
break;
case "toggle_ui"_strid: _show_ui = !_show_ui; break;
@@ -304,7 +275,7 @@ namespace mirrage {
});
_look = {0.f, 0.f};
- _meta_system.update(dt);
+ _meta_system.update(_paused ? util::Time(0.001f) : dt);
_performance_log.process([&](auto& log) {
_performance_log_delay_left -= dt;
@@ -348,15 +319,6 @@ namespace mirrage {
{
if(_show_ui) {
_draw_settings_window();
- _draw_histogram_window();
- _draw_animation_window();
-
- if(_show_profiler) {
- _meta_system.renderer().profiler().enable();
- _draw_profiler_window();
- } else {
- _meta_system.renderer().profiler().disable();
- }
}
_meta_system.renderer().debug_draw({renderer::Debug_geometry{{0, 1, 0}, {0, 5, 0}, {1, 0, 0}},
@@ -366,16 +328,10 @@ namespace mirrage {
}
void Test_screen::_draw_settings_window()
{
- auto ctx = _gui.ctx();
- if(nk_begin_titled(ctx,
- "debug_controls",
- "Debug Controls",
- _gui.centered_left(250, 720),
- NK_WINDOW_BORDER | NK_WINDOW_MOVABLE | NK_WINDOW_TITLE | NK_WINDOW_MINIMIZABLE)) {
+ ImGui::PositionNextWindow({250, 400}, ImGui::WindowPosition_X::left, ImGui::WindowPosition_Y::center);
+ if(ImGui::Begin("Debug Controls")) {
- nk_layout_row_dynamic(ctx, 20, 2);
-
- nk_label(ctx, "Preset", NK_TEXT_LEFT);
+ ImGui::TextUnformatted("Preset");
auto preset_options = std::array{{"Free Motion",
"Center",
"Top-Down",
@@ -383,34 +339,26 @@ namespace mirrage {
"Hallway",
"Hallway2",
"Cornell Box"}};
- _set_preset(nk_combo(ctx,
- preset_options.data(),
- preset_options.size(),
- _selected_preset,
- 14,
- nk_vec2(100.f, 200)));
-
-
- nk_layout_row_dynamic(ctx, 20, 1);
- auto show_profiler = _show_profiler ? 1 : 0;
- if(nk_checkbox_label(ctx, "Show Profiler", &show_profiler)) {
- _show_profiler = show_profiler == 1;
- }
+ ImGui::Combo("preset", &_selected_preset, preset_options.data(), int(preset_options.size()));
- if(!_meta_system.nims().is_playing()) {
- nk_layout_row_dynamic(ctx, 20, 1);
- nk_label(ctx, "Directional Light", NK_TEXT_LEFT);
- nk_layout_row_dynamic(ctx, 14, 1);
+ _camera.process([&](auto& cam) {
+ cam.dof_focus(ImGui::ValueSliderFloat("Focus Plane", cam.dof_focus(), 0.1f, 100.f));
+ cam.dof_range(ImGui::ValueSliderFloat("Focus Range", cam.dof_range(), 0.1f, 10.f));
+ cam.dof_power(ImGui::ValueSliderFloat("DOF Power", cam.dof_power(), 0.01f, 1.f));
+ });
+
+ if(!_meta_system.nims().is_playing()) {
+ ImGui::TextUnformatted("Directional Light");
- auto elevation = nk_propertyf(ctx, "Elevation", 0.f, _sun_elevation, 1.f, 0.05f, 0.001f);
+ auto elevation = ImGui::ValueSliderFloat("Elevation", _sun_elevation, 0.f, 1.f);
if(std::abs(elevation - _sun_elevation) > 0.000001f) {
_sun_elevation = elevation;
_set_preset(0);
}
- auto azimuth = nk_propertyf(ctx, "Azimuth", -2.f, _sun_azimuth, 2.f, 0.05f, 0.001f);
+ auto azimuth = ImGui::ValueSliderFloat("Azimuth", _sun_azimuth, -2.f, 2.f);
if(std::abs(azimuth - _sun_azimuth) > 0.000001f) {
_sun_azimuth = azimuth;
_set_preset(0);
@@ -420,445 +368,30 @@ namespace mirrage {
_sun.get().process(
[&](renderer::Directional_light_comp& light) {
- auto new_size = nk_propertyf(
- ctx, "Size", 0.5f, light.source_radius() / 1_m, 20.f, 0.1f, 0.01f);
+ auto new_size =
+ ImGui::ValueSliderFloat("Size", light.source_radius() / 1_m, 0.5f, 20.f);
light.source_radius(new_size * 1_m);
- auto new_temp = nk_propertyf(
- ctx, "Color", 500.f, _sun_color_temperature, 20000.f, 500.f, 50.f);
+ auto new_temp =
+ ImGui::ValueSliderFloat("Color", _sun_color_temperature, 500.f, 20000.f);
if(std::abs(new_temp - _sun_color_temperature) > 0.000001f) {
light.temperature(_sun_color_temperature = new_temp);
_set_preset(0);
}
- auto color = util::Rgba{light.color(), light.intensity() / 50'000.f};
- if(gui::color_picker(ctx, color, 210.f)) {
+ ImGui::Spacing();
+ ImGui::TextUnformatted("Color");
+ auto color = util::Rgba{light.color(), light.intensity() / 50000.f};
+ if(ImGui::ColorPicker4("Color", &color.r)) {
light.color({color.r, color.g, color.b});
- light.intensity(color.a * 50'000.f);
+ light.intensity(color.a * 50000.f);
_set_preset(0);
}
});
}
-
- nk_layout_row_dynamic(ctx, 10, 1);
- nk_label(ctx, "", NK_TEXT_LEFT);
-
- nk_layout_row_dynamic(ctx, 20, 1);
- nk_label(ctx, "Graphic Settings", NK_TEXT_LEFT);
- auto renderer_settings = _meta_system.renderer().settings();
- auto bool_nk_wrapper = 0;
-
- nk_property_int(ctx, "Window Width", 640, &_window_width, 7680, 1, 1);
- nk_property_int(ctx, "Window Height", 360, &_window_height, 4320, 1, 1);
-
- bool_nk_wrapper = _window_fullscreen ? 1 : 0;
- nk_checkbox_label(ctx, "Fullscreen", &bool_nk_wrapper);
- _window_fullscreen = bool_nk_wrapper == 1;
-
- if(nk_button_label(ctx, "Apply")) {
- if(_window_width != _engine.window().width() || _window_height != _engine.window().height()
- || _window_fullscreen != (_engine.window().fullscreen() != graphic::Fullscreen::no)) {
- _engine.window().dimensions(_window_width,
- _window_height,
- _window_fullscreen ? graphic::Fullscreen::yes_borderless
- : graphic::Fullscreen::no);
- }
- }
-
- nk_layout_row_dynamic(ctx, 10, 1);
- nk_label(ctx, "", NK_TEXT_LEFT);
- nk_layout_row_dynamic(ctx, 20, 1);
-
- nk_label(ctx, "Renderer Settings", NK_TEXT_LEFT);
-
- nk_layout_row_dynamic(ctx, 20, 1);
- nk_property_int(ctx, "Debug Layer", -1, &renderer_settings.debug_gi_layer, 5, 1, 1);
-
- bool_nk_wrapper = renderer_settings.gi ? 1 : 0;
- nk_checkbox_label(ctx, "Indirect Illumination", &bool_nk_wrapper);
- renderer_settings.gi = bool_nk_wrapper == 1;
-
- bool_nk_wrapper = renderer_settings.gi_shadows ? 1 : 0;
- nk_checkbox_label(ctx, "Indirect Shadows", &bool_nk_wrapper);
- renderer_settings.gi_shadows = bool_nk_wrapper == 1;
-
- bool_nk_wrapper = renderer_settings.gi_highres ? 1 : 0;
- nk_checkbox_label(ctx, "High-Resolution GI", &bool_nk_wrapper);
- renderer_settings.gi_highres = bool_nk_wrapper == 1;
-
- nk_property_int(ctx, "Minimum GI MIP", 0, &renderer_settings.gi_min_mip_level, 4, 1, 1);
-
- nk_property_int(ctx, "Diffuse GI MIP", 0, &renderer_settings.gi_diffuse_mip_level, 4, 1, 1);
-
- nk_property_int(ctx, "Low-Res Sample Count", 8, &renderer_settings.gi_lowres_samples, 1024, 1, 1);
-
- nk_property_int(ctx, "Sample Count", 8, &renderer_settings.gi_samples, 1024, 1, 1);
-
- nk_property_float(
- ctx, "Exposure", 0.f, &renderer_settings.exposure_override, 50.f, 0.001f, 0.01f);
-
- nk_property_float(
- ctx, "Background Brightness", 0.f, &renderer_settings.background_intensity, 10.f, 1, 0.1f);
-
- bool_nk_wrapper = renderer_settings.ssao ? 1 : 0;
- nk_checkbox_label(ctx, "Ambient Occlusion", &bool_nk_wrapper);
- renderer_settings.ssao = bool_nk_wrapper == 1;
-
- bool_nk_wrapper = renderer_settings.bloom ? 1 : 0;
- nk_checkbox_label(ctx, "Bloom", &bool_nk_wrapper);
- renderer_settings.bloom = bool_nk_wrapper == 1;
-
- bool_nk_wrapper = renderer_settings.tonemapping ? 1 : 0;
- nk_checkbox_label(ctx, "Tonemapping", &bool_nk_wrapper);
- renderer_settings.tonemapping = bool_nk_wrapper == 1;
-
-
- nk_layout_row_dynamic(ctx, 20, 2);
-
- if(nk_button_label(ctx, "Apply")) {
- if(_window_width != _engine.window().width() || _window_height != _engine.window().height()
- || _window_fullscreen != (_engine.window().fullscreen() != graphic::Fullscreen::no)) {
- _engine.window().dimensions(_window_width,
- _window_height,
- _window_fullscreen ? graphic::Fullscreen::yes_borderless
- : graphic::Fullscreen::no);
- }
- _meta_system.renderer().settings(renderer_settings, true);
- } else {
- _meta_system.renderer().settings(renderer_settings, false);
- }
-
- if(nk_button_label(ctx, "Reset")) {
- _meta_system.renderer().settings(renderer::Renderer_settings{}, true);
- }
- }
- nk_end(ctx);
- }
-
- namespace {
- template
- auto to_fixed_str(T num, int digits)
- {
- auto ss = std::stringstream{};
- ss << std::fixed << std::setprecision(digits) << num;
- return ss.str();
- }
-
- auto pad_left(const std::string& str, int padding)
- {
- return std::string(std::size_t(padding), ' ') + str;
- }
-
- template
- auto top_n(const Container& container, Comp&& less)
- {
- auto max_elements = std::array();
- max_elements.fill(container.end());
-
- for(auto iter = container.begin(); iter != container.end(); iter++) {
- // compare with each of the top elements
- for(auto i = std::size_t(0); i < N; i++) {
- if(max_elements[i] == container.end() || less(*max_elements[i], *iter)) {
- // move top elements to make room
- for(auto j = i + 1; j < N; j++) {
- max_elements[j] = max_elements[j - 1];
- }
- max_elements[i] = iter;
- break;
- }
- }
- }
-
- return max_elements;
- }
-
- template
- auto index_of(const Container& container, const T& element) -> int
- {
- auto top_entry = std::find(container.begin(), container.end(), element);
- if(top_entry == container.end())
- return -1;
-
- return gsl::narrow(std::distance(container.begin(), top_entry));
- }
- } // namespace
- void Test_screen::_draw_profiler_window()
- {
- auto ctx = _gui.ctx();
- if(nk_begin_titled(ctx,
- "profiler",
- "Profiler",
- _gui.centered_right(330, 380),
- NK_WINDOW_BORDER | NK_WINDOW_MOVABLE | NK_WINDOW_TITLE | NK_WINDOW_MINIMIZABLE)) {
-
- nk_layout_row_dynamic(ctx, 20, 1);
- if(nk_button_label(ctx, "Reset")) {
- _meta_system.renderer().profiler().reset();
- }
-
-#if 0
- if(_performance_log.is_nothing() && nk_button_label(ctx, "Record")) {
- _performance_log = _engine.assets().save_raw("log:perf.log"_aid);
- }
-#endif
-
- constexpr auto rows = std::array{{0.4f, 0.15f, 0.15f, 0.15f, 0.15f}};
- nk_layout_row(ctx, NK_DYNAMIC, 25, rows.size(), rows.data());
- nk_label(ctx, "RenderPass", NK_TEXT_CENTERED);
- nk_label(ctx, "Curr (ms)", NK_TEXT_CENTERED);
- nk_label(ctx, "Min (ms)", NK_TEXT_CENTERED);
- nk_label(ctx, "Avg (ms)", NK_TEXT_CENTERED);
- nk_label(ctx, "Max (ms)", NK_TEXT_CENTERED);
-
- nk_layout_row(ctx, NK_DYNAMIC, 10, rows.size(), rows.data());
-
-
- auto print_entry =
- [&](auto&& printer, const Profiler_result& result, int depth = 0, int rank = -1) -> void {
- auto color = [&] {
- switch(rank) {
- case 0: return nk_rgb(255, 0, 0);
- case 1: return nk_rgb(255, 220, 128);
- default: return nk_rgb(255, 255, 255);
- }
- }();
-
- nk_label_colored(ctx, pad_left(result.name(), depth * 4).c_str(), NK_TEXT_LEFT, color);
- nk_label_colored(ctx, to_fixed_str(result.time_ms(), 2).c_str(), NK_TEXT_RIGHT, color);
- nk_label_colored(ctx, to_fixed_str(result.time_min_ms(), 2).c_str(), NK_TEXT_RIGHT, color);
- nk_label_colored(ctx, to_fixed_str(result.time_avg_ms(), 2).c_str(), NK_TEXT_RIGHT, color);
- nk_label_colored(ctx, to_fixed_str(result.time_max_ms(), 2).c_str(), NK_TEXT_RIGHT, color);
-
-
- auto worst_timings = top_n<2>(
- result, [](auto&& lhs, auto&& rhs) { return lhs.time_avg_ms() < rhs.time_avg_ms(); });
-
- for(auto iter = result.begin(); iter != result.end(); iter++) {
- auto rank = index_of(worst_timings, iter);
- printer(printer, *iter, depth + 1, rank);
- }
- };
-
- auto& result = _meta_system.renderer().profiler().results();
- print_entry(print_entry, result);
- }
-
- nk_end(ctx);
- }
-
- void Test_screen::_draw_histogram_window()
- {
-#ifdef HPC_HISTOGRAM_DEBUG_VIEW
-
- auto tone_mapping_pass = _meta_system.renderer().find_pass();
- if(tone_mapping_pass) {
- auto&& histogram = tone_mapping_pass->last_histogram();
- auto histogram_sum = std::accumulate(begin(histogram), end(histogram) - 2, 0.0);
- auto max_histogram = std::max_element(begin(histogram), end(histogram) - 2);
-
- auto ctx = _gui.ctx();
- if(nk_begin_titled(
- ctx,
- "Histogram",
- "Histogram",
- _gui.centered_right(400, 600),
- NK_WINDOW_BORDER | NK_WINDOW_MOVABLE | NK_WINDOW_TITLE | NK_WINDOW_MINIMIZABLE)) {
-
- nk_layout_row_dynamic(ctx, 400, 1);
- nk_chart_begin(
- ctx, NK_CHART_COLUMN, static_cast(histogram.size() - 2), 0, *max_histogram);
- for(auto i : util::range(histogram.size() - 1)) {
- auto state = nk_chart_push(ctx, histogram[i]);
- if(state & NK_CHART_HOVERING) {
- _last_selected_histogram = i;
- }
- }
- nk_chart_end(ctx);
-
- nk_layout_row_dynamic(ctx, 25, 2);
- nk_label(ctx, "Luminance", NK_TEXT_CENTERED);
- auto log_lum_range = std::log(_meta_system.renderer().gbuffer().max_luminance)
- - std::log(_meta_system.renderer().gbuffer().min_luminance);
- auto log_lum = float(_last_selected_histogram) / float(histogram.size() - 1) * log_lum_range
- + std::log(_meta_system.renderer().gbuffer().min_luminance);
- auto lum = std::exp(log_lum);
- nk_label(ctx, to_fixed_str(lum, 5).c_str(), NK_TEXT_CENTERED);
-
- auto percentage = static_cast(histogram[_last_selected_histogram])
- / std::max(1.0, histogram_sum);
- nk_label(ctx, "Percentage", NK_TEXT_CENTERED);
- nk_label(ctx, (to_fixed_str(percentage * 100, 4) + " %").c_str(), NK_TEXT_CENTERED);
-
- nk_label(ctx, "La", NK_TEXT_CENTERED);
- nk_label(ctx, (to_fixed_str(histogram[histogram.size() - 2], 4)).c_str(), NK_TEXT_CENTERED);
- nk_label(ctx, "p(La)", NK_TEXT_CENTERED);
- nk_label(ctx,
- (to_fixed_str(1.f - histogram[histogram.size() - 1], 4)).c_str(),
- NK_TEXT_CENTERED);
-
- nk_label(ctx, "Trimmings", NK_TEXT_CENTERED);
- nk_label(ctx,
- std::to_string(
- static_cast(tone_mapping_pass->max_histogram_size() - histogram_sum))
- .c_str(),
- NK_TEXT_CENTERED);
-
- auto renderer_settings = _meta_system.renderer().settings();
-
- nk_property_float(ctx,
- "Min Display Lum.",
- 1.f / 255.f / 4.f,
- &renderer_settings.min_display_luminance,
- 500.f,
- 0.001f,
- 0.01f);
- nk_property_float(ctx,
- "Max Display Lum.",
- 1.f / 255.f / 4.f,
- &renderer_settings.max_display_luminance,
- 500.f,
- 0.001f,
- 0.01f);
-
- _meta_system.renderer().settings(renderer_settings, false);
- }
-
- nk_end(ctx);
}
-#endif
- }
-
- void Test_screen::_draw_animation_window()
- {
- auto anim_mb = _animation_test_dqs.get();
- auto anim_lbs_mb = _animation_test_lbs.get();
- if(anim_mb.is_nothing())
- return;
-
- auto& anim = anim_mb.get_or_throw();
-
- auto ctx = _gui.ctx();
- if(nk_begin_titled(ctx,
- "Animation",
- "Animation",
- _gui.centered_right(300, 500),
- NK_WINDOW_BORDER | NK_WINDOW_MOVABLE | NK_WINDOW_TITLE | NK_WINDOW_MINIMIZABLE)) {
-
- nk_layout_row_dynamic(ctx, 20, 1);
-
- nk_label(ctx, "Animation", NK_TEXT_LEFT);
- auto animations_strs = std::array{
- {"[None]", "Attack", "Dance", "Die", "Flee", "Idle", "Sad", "Sleep", "Walk"}};
- auto animations_ids = std::array{{""_strid,
- "attack"_strid,
- "dance"_strid,
- "die"_strid,
- "flee"_strid,
- "idle"_strid,
- "sad"_strid,
- "sleep"_strid,
- "walk"_strid}};
- (void) animations_ids;
-
- auto curr_animation_id = anim.animation_id().get_or(""_strid);
- auto curr_idx =
- std::distance(animations_ids.begin(),
- std::find(animations_ids.begin(), animations_ids.end(), curr_animation_id));
-
- auto new_idx = nk_combo(ctx,
- animations_strs.data(),
- animations_strs.size(),
- int(curr_idx),
- 14,
- nk_vec2(100.f, 200));
-
- if(new_idx != curr_idx) {
- anim.play(animations_ids.at(std::size_t(new_idx)));
- anim_lbs_mb.process([&](auto& anim) { anim.play(animations_ids.at(std::size_t(new_idx))); });
- }
-
- anim.animation().process([&](auto& curr_animation) {
- auto& dqs_anim = _animation_test_dqs.get().get_or_throw();
- auto& dqs_states = dqs_anim.states();
- auto& lbs_anim = _animation_test_lbs.get().get_or_throw();
- auto& lbs_states = lbs_anim.states();
-
- auto time = 0.f;
- auto curr_dqs_state = std::find_if(dqs_states.begin(), dqs_states.end(), [&](auto& s) {
- return &*s.animation == &*curr_animation;
- });
- auto curr_lbs_state = std::find_if(lbs_states.begin(), lbs_states.end(), [&](auto& s) {
- return &*s.animation == &*curr_animation;
- });
-
- if(curr_dqs_state != dqs_states.end()) {
- time = curr_dqs_state->time;
- } else if(curr_lbs_state != lbs_states.end()) {
- time = curr_dqs_state->time;
- }
-
- auto duration = curr_animation->duration();
-
- nk_label(ctx, "Time", NK_TEXT_LEFT);
- auto new_time = nk_slide_float(ctx, 0.f, time, duration, 0.01f);
- if(std::abs(new_time - time) > 0.00001f) {
- dqs_anim.mark_dirty();
- lbs_anim.mark_dirty();
-
- if(curr_dqs_state != dqs_states.end())
- curr_dqs_state->time = new_time;
-
- if(curr_lbs_state != lbs_states.end())
- curr_lbs_state->time = new_time;
- }
-
- nk_label(ctx,
- (util::to_string(new_time) + " / " + util::to_string(duration)).c_str(),
- NK_TEXT_LEFT);
-
- auto speed = anim.speed();
- nk_property_float(ctx, "Speed", 0.f, &speed, 5.f, 0.1f, 0.05f);
- anim.speed(speed);
-
-
- if(anim.paused())
- anim.pause(!nk_button_label(ctx, "Continue"));
- else
- anim.pause(nk_button_label(ctx, "Pause"));
-
- if(anim.reversed())
- anim.reverse(!nk_button_label(ctx, "Reverse (->)"));
- else
- anim.reverse(nk_button_label(ctx, "Reverse (<-)"));
-
- if(anim.looped())
- anim.loop(!nk_button_label(ctx, "Once"));
- else
- anim.loop(nk_button_label(ctx, "Repeat"));
-
-
- anim_lbs_mb.process([&](auto& anim_lbs) {
- anim_lbs.speed(anim.speed());
- anim_lbs.pause(anim.paused());
- anim_lbs.reverse(anim.reversed());
- anim_lbs.loop(anim.looped());
- });
- });
- }
-
- nk_label(ctx, "Rotation Test", NK_TEXT_LEFT);
- _animation_test2_dqs.get().process([&](auto& anim) {
- if(anim.paused())
- anim.pause(!nk_button_label(ctx, "Continue"));
- else
- anim.pause(nk_button_label(ctx, "Pause"));
-
- _animation_test2_lbs.get