diff --git a/.gitignore b/.gitignore index a2d2f979..a0740c05 100644 --- a/.gitignore +++ b/.gitignore @@ -196,7 +196,7 @@ UpgradeLog*.htm # Microsoft Fakes FakesAssemblies/ -vulkanCapsViewer/vulkanreport.json +.vs/ # Don't ignore 3d models in obj format !data/models/*.obj @@ -213,4 +213,5 @@ android/layers/*/*.so vulkan_asset_pack.* data/textures/hdr/*.* data/readme.txt +data/models/cerberus/*.* !data/textures/hdr/README.md \ No newline at end of file diff --git a/README.md b/README.md index 6635dca3..d7c2abb1 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,25 @@ The final scene compositing pass then samples from the layered depth map to dete Implements ambient occlusion in screen space, adding depth with the help of ambient occlusion to a scene. The example is using a deferred shading setup with the AO pass using the depth information from the deferred G-Buffer to generate the ambient occlusion values. A second pass is then applied to blur the AO results before they're applied to the scene in the final composition pass. +## Physically based rendering + +*Physical based rendering as a lighting technique that achieves a more realistic and dynamic look by applying approximations of bidirectional reflectance distribution functions that rely on measured real-world material parameters and environment lighting.* + +### [Physical shading basics](pbrbasic/) + + +Basic implementation of a metallic-roughness based physical based rendering model using measured material parameters. Implements a specular BRDF based on material parameters for metallic reflectance, surface roughness and color and displays a grid of objects with varying metallic and roughness parameters light by multiple fixed light sources. + +### [Physical shading with image based lighting](pbribl/) + + +Adds ```image based lighting``` to the PBR equation. IBL uses the surrounding environment as a single light source. This adds an even more realistic look the models as the light contribution used by the materials is now controlled by the environment. The sample uses a fixed HDR environment cubemap as for lighting and reflectance. The new textures and cubemaps required for the enhanced lighting (BRDF 2D-LUT, irradiance cube and a filtered cube based on roughness) are generated at run-time based on that cubemap. + +### [Physical shading with textures and image based lighting](pbrtexture/) + + +This example adds a textured model with materials especially created for the metallic-roughness PBR workflow. Where the other examples used fixed material parameters for the PBR equation (metallic, roughness, albedo), this model contains texture maps that store these values (plus a normal and ambient occlusion map) used as input parameters for the BRDF shader. So even though the model uses only one material there are differing roughness and metallic areas and combined with image based lighting based on the environment the model is rendered with a realistic look. + ## Compute *Compute shaders are mandatory in Vulkan and must be supported on all devices* @@ -348,6 +367,7 @@ Please note that (some) models and textures use separate licenses. Please comply - Hidden treasure scene used in pipeline and debug marker examples by [Laurynas Jurgila](http://www.blendswap.com/user/PigArt) - Sibenik Cathedral model by Marko Dabrovic, using updated version by [Kenzie Lamar and Morgan McGuire](http://graphics.cs.williams.edu/data/meshes.xml) - Textures used in some examples by [Hugues Muller](http://www.yughues-folio.com) +- Cerberus gun model used in PBR sample by [Andrew Maximov](http://artisaverb.info/Cerberus.html) - Updated compute particle system shader by [Lukas Bergdoll](https://github.com/Voultapher) - Vulkan scene model (and derived models) by [Dominic Agoro-Ombaka](http://www.agorodesign.com/) and [Sascha Willems](http://www.saschawillems.de) - Vulkan and the Vulkan logo are trademarks of the [Khronos Group Inc.](http://www.khronos.org) diff --git a/android/README.md b/android/README.md index 34b1fe28..e84904f8 100644 --- a/android/README.md +++ b/android/README.md @@ -9,14 +9,14 @@ Since Vulkan is not yet part of the Android OS (like OpenGL ES) the library and - Builds currently only support arm-v7, x86 may follow at a later point - Android TV leanback launcher is supported, so the examples will show up on the launcher - Basic gamepad support is available too (zoom and rotate) -- Touch controls are not yet implemented, same for screen rotations +- Basic touch control support (zoom, move, rotate, look) ## Building ### Requirements - [Android NDK r11b](http://developer.android.com/ndk/downloads/index.html) (or newer) - Somewhere in your search path - Examples are built against API level 23 (requires the SDK Platform installed) -- Batch files for building are provided for windows only, with linux to be added at some point +- Python 3.x ### Building the Examples @@ -27,7 +27,7 @@ Since Vulkan is not yet part of the Android OS (like OpenGL ES) the library and #### Build only ``` -build-all +build-all.py ``` This will build all apks and puts them into the **bin** folder. @@ -35,7 +35,7 @@ This will build all apks and puts them into the **bin** folder. #### Build and deploy ``` -install-all +install-all.py ``` This will build all apks and deploys them to the currently attached android device. @@ -49,7 +49,7 @@ These are for building and/or deploying a single example. Call build(.bat) with the name of the example to build, e.g. : ``` -build triangle +build.py pbrtexture ``` This will build the apk for the triangle example and puts it into the **bin** folder. @@ -57,18 +57,28 @@ This will build the apk for the triangle example and puts it into the **bin** fo #### Build and deploy ``` -build triangle -deploy +build.py pbrtexture -deploy ``` This will build the apk for the triangle example and deploys it to the currently attached android device. +#### Validation layers + +``` +build.py pbrtexture -validation (-deploy) +``` + +Builds the apk, adds the validation layer libraries and enables validation via a compiler define. + +**Note**: You need to manually build the validation layers and put them in the [proper folder](layers/). If the libaries are not present they won't be included with the apk and running the app will fail. + ## Removing -A batch file for removing all installed examples is provided in case you installed all of them and don't want to remove them by hand (which is especially tedious on Android TV). +A single file for removing all installed examples is provided in case you installed all of them and don't want to remove them by hand (which is especially tedious on Android TV). ``` -uninstall-all +uninstall-all.py ``` This will remove any installed Android example from this repository from the attached device. diff --git a/android/bloom/build.py b/android/bloom/build.py deleted file mode 100644 index bbf55142..00000000 --- a/android/bloom/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanBloom" -SHADER_DIR = "bloom" -ASSETS_MODELS = ["retroufo.dae", "retroufo_glow.dae", "cube.obj"] -ASSETS_TEXTURES = ["cubemap_space.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/bloom/example.json b/android/bloom/example.json new file mode 100644 index 00000000..e8bc7770 --- /dev/null +++ b/android/bloom/example.json @@ -0,0 +1,16 @@ +{ + "apkname": "vulkanBloom", + "directories": { + "shaders": "bloom" + }, + "assets": { + "models": [ + "retroufo.dae", + "retroufo_glow.dae", + "cube.obj" + ], + "textures": [ + "cubemap_space.ktx" + ] + } +} \ No newline at end of file diff --git a/android/build.py b/android/build.py index 7942b3ae..2d1f2be0 100644 --- a/android/build.py +++ b/android/build.py @@ -4,6 +4,7 @@ import subprocess import sys import shutil import glob +import json # Android SDK version used SDK_VERSION = "android-23" @@ -17,27 +18,114 @@ if not os.path.exists(PROJECT_FOLDER): print("Please specify a valid project folder to build!") sys.exit(-1) +# Definitions (apk name, folders, etc.) will be taken from a json definition +if not os.path.isfile(os.path.join(PROJECT_FOLDER, "example.json")): + print("Could not find json definition for example %s" % PROJECT_FOLDER) + sys.exit(-1) + # Check if a build file is present, if not create one using the android SDK version specified if not os.path.isfile(os.path.join(PROJECT_FOLDER, "build.xml")): print("Build.xml not present, generating with %s " % SDK_VERSION) - if subprocess.call("android.bat update project -p ./%s -t %s" % (PROJECT_FOLDER, SDK_VERSION)) != 0: + ANDROID_CMD = "android" + if os.name == 'nt': + ANDROID_CMD += ".bat" + if subprocess.call("%s update project -p ./%s -t %s" % (ANDROID_CMD, PROJECT_FOLDER, SDK_VERSION)) != 0: print("Error: Project update failed!") sys.exit(-1) -# Run actual build script from example folder -if not os.path.isfile(os.path.join(PROJECT_FOLDER, "build.py")): - print("Error: No build script present!") - sys.exit(-1) +# Load example definition from json file +with open(os.path.join(PROJECT_FOLDER, "example.json")) as json_file: + EXAMPLE_JSON = json.load(json_file) -BUILD_ARGUMENTS = " ".join(sys.argv[2:]) +APK_NAME = EXAMPLE_JSON["apkname"] +SHADER_DIR = EXAMPLE_JSON["directories"]["shaders"] +# Additional +ADDITIONAL_DIRS = [] +ADDITIONAL_FILES = [] +if "additional" in EXAMPLE_JSON["assets"]: + ADDITIONAL = EXAMPLE_JSON["assets"]["additional"] + if "directories" in ADDITIONAL: + ADDITIONAL_DIRS = ADDITIONAL["directories"] + if "files" in ADDITIONAL: + ADDITIONAL_FILES = ADDITIONAL["files"] + +# Get assets to be copied +ASSETS_MODELS = [] +ASSETS_TEXTURES = [] +if "assets" in EXAMPLE_JSON: + ASSETS = EXAMPLE_JSON["assets"] + if "models" in ASSETS: + ASSETS_MODELS = EXAMPLE_JSON["assets"]["models"] + if "textures" in ASSETS: + ASSETS_TEXTURES = EXAMPLE_JSON["assets"]["textures"] + +# Enable validation +VALIDATION = False +BUILD_ARGS = "" + +for arg in sys.argv[1:]: + if arg == "-validation": + VALIDATION = True + # Use a define to force validation in code + BUILD_ARGS = "APP_CFLAGS=-D_VALIDATION" + break + +# Build os.chdir(PROJECT_FOLDER) -if subprocess.call("python build.py %s" % BUILD_ARGUMENTS) != 0: - print("Error during build process!") + +if subprocess.call("ndk-build %s" %BUILD_ARGS, shell=True) == 0: + print("Build successful") + + if VALIDATION: + # Copy validation layers + # todo: Currently only arm v7 + print("Validation enabled, copying validation layers...") + os.makedirs("./libs/armeabi-v7a", exist_ok=True) + for file in glob.glob("../layers/armeabi-v7a/*.so"): + print("\t" + file) + shutil.copy(file, "./libs/armeabi-v7a") + + # Create folders + os.makedirs("./assets/shaders/base", exist_ok=True) + os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) + os.makedirs("./assets/models", exist_ok=True) + os.makedirs("./assets/textures", exist_ok=True) + for directory in ADDITIONAL_DIRS: + os.makedirs("./assets/%s" % directory, exist_ok=True) + os.makedirs("./res/drawable", exist_ok=True) + + for filename in glob.glob("../../data/shaders/base/*.spv"): + shutil.copy(filename, "./assets/shaders/base") + for filename in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): + shutil.copy(filename, "./assets/shaders/%s" % SHADER_DIR) + for filename in ASSETS_MODELS: + shutil.copy("../../data/models/%s" % filename, "./assets/models") + for filename in ASSETS_TEXTURES: + shutil.copy("../../data/textures/%s" % filename, "./assets/textures") + for filename in ADDITIONAL_FILES: + if "*." in filename: + for fname in glob.glob("../../data/%s" % filename): + locfname = fname.replace("../../data/", "") + shutil.copy(fname, "./assets/%s" % locfname) + else: + shutil.copy("../../data/%s" % filename, "./assets/%s" % filename) + + shutil.copy("../../android/images/icon.png", "./res/drawable") + + if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: + # Deploy to device + for arg in sys.argv[1:]: + if arg == "-deploy": + if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: + print("Could not deploy to device!") + else: + print("Error during build process!") + sys.exit(-1) +else: + print("Error building project!") sys.exit(-1) -# Move apk to bin folder +# Copy apk to bin folder os.makedirs("../bin", exist_ok=True) -for file in glob.glob("vulkan*.apk"): - print(file) - shutil.move(file, "../bin/%s" % file) +shutil.move('%s.apk' % APK_NAME, "../bin/%s.apk" % APK_NAME) diff --git a/android/computecullandlod/build.py b/android/computecullandlod/build.py deleted file mode 100644 index e3ccbc68..00000000 --- a/android/computecullandlod/build.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanComputecullandlod" -SHADER_DIR = "computecullandlod" -ASSETS_MODELS = ["suzanne_lods.dae"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders", exist_ok=True) - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/computecullandlod/example.json b/android/computecullandlod/example.json new file mode 100644 index 00000000..d79c5596 --- /dev/null +++ b/android/computecullandlod/example.json @@ -0,0 +1,11 @@ +{ + "apkname": "vulkanComputecullandlod", + "directories": { + "shaders": "computecullandlod" + }, + "assets": { + "models": [ + "suzanne_lods.dae" + ] + } +} \ No newline at end of file diff --git a/android/computenbody/build.py b/android/computenbody/build.py deleted file mode 100644 index 5d3de2b5..00000000 --- a/android/computenbody/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanComputenbody" -SHADER_DIR = "computenbody" -ASSETS_TEXTURES = ["particle01_rgba.ktx", "particle_gradient_rgba.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Texture - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/computenbody/example.json b/android/computenbody/example.json new file mode 100644 index 00000000..56e31f4b --- /dev/null +++ b/android/computenbody/example.json @@ -0,0 +1,12 @@ +{ + "apkname": "vulkanComputenbody", + "directories": { + "shaders": "computenbody" + }, + "assets": { + "textures": [ + "particle01_rgba.ktx", + "particle_gradient_rgba.ktx" + ] + } +} \ No newline at end of file diff --git a/android/computeparticles/build.py b/android/computeparticles/build.py deleted file mode 100644 index 86d3e27f..00000000 --- a/android/computeparticles/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanComputeparticles" -SHADER_DIR = "computeparticles" -ASSETS_TEXTURES = ["particle01_rgba.ktx", "particle_gradient_rgba.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Texture - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/computeparticles/example.json b/android/computeparticles/example.json new file mode 100644 index 00000000..b1ebea49 --- /dev/null +++ b/android/computeparticles/example.json @@ -0,0 +1,12 @@ +{ + "apkname": "vulkanComputeparticles", + "directories": { + "shaders": "computeparticles" + }, + "assets": { + "textures": [ + "particle01_rgba.ktx", + "particle_gradient_rgba.ktx" + ] + } +} \ No newline at end of file diff --git a/android/computeshader/build.py b/android/computeshader/build.py deleted file mode 100644 index e4b679c7..00000000 --- a/android/computeshader/build.py +++ /dev/null @@ -1,44 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanComputeshader" -SHADER_DIR = "computeshader" -ASSETS_TEXTURES = ["het_kanonschot_rgba8.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/computeshader/example.json b/android/computeshader/example.json new file mode 100644 index 00000000..360a4dc6 --- /dev/null +++ b/android/computeshader/example.json @@ -0,0 +1,11 @@ +{ + "apkname": "vulkanComputeshader", + "directories": { + "shaders": "computeshader" + }, + "assets": { + "textures": [ + "het_kanonschot_rgba8.ktx" + ] + } +} \ No newline at end of file diff --git a/android/debugmarker/build.py b/android/debugmarker/build.py deleted file mode 100644 index f531f1cc..00000000 --- a/android/debugmarker/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanDebugmarker" -SHADER_DIR = "debugmarker" -ASSETS_MODELS = ["treasure_smooth.dae", "treasure_glow.dae"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/debugmarker/example.json b/android/debugmarker/example.json new file mode 100644 index 00000000..09b9df1c --- /dev/null +++ b/android/debugmarker/example.json @@ -0,0 +1,12 @@ +{ + "apkname": "vulkanDebugmarker", + "directories": { + "shaders": "debugmarker" + }, + "assets": { + "models": [ + "treasure_smooth.dae", + "treasure_glow.dae" + ] + } +} \ No newline at end of file diff --git a/android/deferred/build.py b/android/deferred/build.py deleted file mode 100644 index 56ba64b1..00000000 --- a/android/deferred/build.py +++ /dev/null @@ -1,58 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanDeferred" -SHADER_DIR = "deferred" -ASSETS_MODELS = ["plane.obj"] -ASSETS_TEXTURES = ["stonefloor01_color_astc_8x8_unorm.ktx", "stonefloor01_color_bc3_unorm.ktx", "stonefloor01_normal_astc_8x8_unorm.ktx", "stonefloor01_normal_bc3_unorm.ktx", "stonefloor01_color_etc2_unorm.ktx", "stonefloor01_normal_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and model - if not os.path.exists("./assets/models/armor/"): - os.makedirs("./assets/models/armor/") - for file in glob.glob("../../data/models/armor/*.*"): - shutil.copy(file, "./assets/models/armor") - # Textures from base - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/deferred/example.json b/android/deferred/example.json new file mode 100644 index 00000000..f7b80757 --- /dev/null +++ b/android/deferred/example.json @@ -0,0 +1,25 @@ +{ + "apkname": "vulkanDeferred", + "directories": { + "shaders": "deferred" + }, + "assets": { + "models": [ + "plane.obj" + ], + "textures": [ + "stonefloor01_color_astc_8x8_unorm.ktx", + "stonefloor01_color_bc3_unorm.ktx", + "stonefloor01_normal_astc_8x8_unorm.ktx", + "stonefloor01_normal_bc3_unorm.ktx", + "stonefloor01_color_etc2_unorm.ktx", + "stonefloor01_normal_etc2_unorm.ktx" + ], + "additional" : { + "directories": ["models/armor"], + "files": [ + "models/armor/*.*" + ] + } + } +} \ No newline at end of file diff --git a/android/deferredmultisampling/build.py b/android/deferredmultisampling/build.py deleted file mode 100644 index 79397743..00000000 --- a/android/deferredmultisampling/build.py +++ /dev/null @@ -1,58 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanDeferredmulitsampling" -SHADER_DIR = "deferredmultisampling" -ASSETS_MODELS = ["openbox.dae"] -ASSETS_TEXTURES = ["stonefloor02_color_astc_8x8_unorm.ktx", "stonefloor02_color_bc3_unorm.ktx", "stonefloor02_normal_astc_8x8_unorm.ktx", "stonefloor02_normal_bc3_unorm.ktx", "stonefloor02_color_etc2_unorm.ktx", "stonefloor02_normal_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and model - if not os.path.exists("./assets/models/armor/"): - os.makedirs("./assets/models/armor/") - for file in glob.glob("../../data/models/armor/*.*"): - shutil.copy(file, "./assets/models/armor") - # Textures from base - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/deferredmultisampling/example.json b/android/deferredmultisampling/example.json new file mode 100644 index 00000000..7ce1dc65 --- /dev/null +++ b/android/deferredmultisampling/example.json @@ -0,0 +1,25 @@ +{ + "apkname": "vulkanDeferredmulitsampling", + "directories": { + "shaders": "deferredmultisampling" + }, + "assets": { + "models": [ + "openbox.dae" + ], + "textures": [ + "stonefloor02_color_astc_8x8_unorm.ktx", + "stonefloor02_color_bc3_unorm.ktx", + "stonefloor02_normal_astc_8x8_unorm.ktx", + "stonefloor02_normal_bc3_unorm.ktx", + "stonefloor02_color_etc2_unorm.ktx", + "stonefloor02_normal_etc2_unorm.ktx" + ], + "additional" : { + "directories": ["models/armor"], + "files": [ + "models/armor/*.*" + ] + } + } +} \ No newline at end of file diff --git a/android/deferredshadows/build.py b/android/deferredshadows/build.py deleted file mode 100644 index 5821bc35..00000000 --- a/android/deferredshadows/build.py +++ /dev/null @@ -1,58 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanDeferredshadows" -SHADER_DIR = "deferredshadows" -ASSETS_MODELS = ["openbox.dae"] -ASSETS_TEXTURES = ["stonefloor02_color_astc_8x8_unorm.ktx", "stonefloor02_color_bc3_unorm.ktx", "stonefloor02_normal_astc_8x8_unorm.ktx", "stonefloor02_normal_bc3_unorm.ktx", "stonefloor02_color_etc2_unorm.ktx", "stonefloor02_normal_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and model - if not os.path.exists("./assets/models/armor/"): - os.makedirs("./assets/models/armor/") - for file in glob.glob("../../data/models/armor/*.*"): - shutil.copy(file, "./assets/models/armor") - # Textures from base - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/deferredshadows/example.json b/android/deferredshadows/example.json new file mode 100644 index 00000000..64fda99a --- /dev/null +++ b/android/deferredshadows/example.json @@ -0,0 +1,25 @@ +{ + "apkname": "vulkanDeferredshadows", + "directories": { + "shaders": "deferredshadows" + }, + "assets": { + "models": [ + "openbox.dae" + ], + "textures": [ + "stonefloor02_color_astc_8x8_unorm.ktx", + "stonefloor02_color_bc3_unorm.ktx", + "stonefloor02_normal_astc_8x8_unorm.ktx", + "stonefloor02_normal_bc3_unorm.ktx", + "stonefloor02_color_etc2_unorm.ktx", + "stonefloor02_normal_etc2_unorm.ktx" + ], + "additional" : { + "directories": ["models/armor"], + "files": [ + "models/armor/*.*" + ] + } + } +} \ No newline at end of file diff --git a/android/displacement/build.py b/android/displacement/build.py deleted file mode 100644 index 4977a7cf..00000000 --- a/android/displacement/build.py +++ /dev/null @@ -1,53 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanDisplacement" -SHADER_DIR = "displacement" -ASSETS_MODELS = ["plane.obj"] -ASSETS_TEXTURES = ["stonefloor03_color_bc3_unorm.ktx", "stonefloor03_color_astc_8x8_unorm.ktx", "stonefloor03_color_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and models - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/displacement/example.json b/android/displacement/example.json new file mode 100644 index 00000000..91199b88 --- /dev/null +++ b/android/displacement/example.json @@ -0,0 +1,16 @@ +{ + "apkname": "vulkanDisplacement", + "directories": { + "shaders": "displacement" + }, + "assets": { + "models": [ + "plane.obj" + ], + "textures": [ + "stonefloor03_color_bc3_unorm.ktx", + "stonefloor03_color_astc_8x8_unorm.ktx", + "stonefloor03_color_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/distancefieldfonts/build.py b/android/distancefieldfonts/build.py deleted file mode 100644 index 92e8dcf2..00000000 --- a/android/distancefieldfonts/build.py +++ /dev/null @@ -1,44 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanDistancefieldfonts" -SHADER_DIR = "distancefieldfonts" -ASSETS_TEXTURES = ["font_sdf_rgba.ktx", "font_bitmap_rgba.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Font file - shutil.copy("../../data/font.fnt", "./assets") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/distancefieldfonts/example.json b/android/distancefieldfonts/example.json new file mode 100644 index 00000000..4809371c --- /dev/null +++ b/android/distancefieldfonts/example.json @@ -0,0 +1,17 @@ +{ + "apkname": "vulkanDistancefieldfonts", + "directories": { + "shaders": "distancefieldfonts" + }, + "assets": { + "textures": [ + "font_sdf_rgba.ktx", + "font_bitmap_rgba.ktx" + ], + "additional": { + "files": [ + "/font.fnt" + ] + } + } +} \ No newline at end of file diff --git a/android/dynamicuniformbuffer/build.py b/android/dynamicuniformbuffer/build.py deleted file mode 100644 index f74713ca..00000000 --- a/android/dynamicuniformbuffer/build.py +++ /dev/null @@ -1,35 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanDynamicuniformbuffer" -SHADER_DIR = "dynamicuniformbuffer" - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" % SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/dynamicuniformbuffer/example.json b/android/dynamicuniformbuffer/example.json new file mode 100644 index 00000000..cdee2177 --- /dev/null +++ b/android/dynamicuniformbuffer/example.json @@ -0,0 +1,7 @@ +{ + "apkname": "vulkanDynamicuniformbuffer", + "directories": { + "shaders": "dynamicuniformbuffer" + }, + "assets": {} +} \ No newline at end of file diff --git a/android/gears/build.py b/android/gears/build.py deleted file mode 100644 index 00eecba1..00000000 --- a/android/gears/build.py +++ /dev/null @@ -1,35 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanGears" -SHADER_DIR = "gears" - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" % SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/gears/example.json b/android/gears/example.json new file mode 100644 index 00000000..2abf6a15 --- /dev/null +++ b/android/gears/example.json @@ -0,0 +1,7 @@ +{ + "apkname": "vulkanGears", + "directories": { + "shaders": "gears" + }, + "assets": {} +} \ No newline at end of file diff --git a/android/geometryshader/build.py b/android/geometryshader/build.py deleted file mode 100644 index 42cbbdee..00000000 --- a/android/geometryshader/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanGeometryshader" -SHADER_DIR = "geometryshader" -ASSETS_MODELS = ["suzanne.obj"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/geometryshader/example.json b/android/geometryshader/example.json new file mode 100644 index 00000000..dca01d7e --- /dev/null +++ b/android/geometryshader/example.json @@ -0,0 +1,11 @@ +{ + "apkname": "vulkanGeometryshader", + "directories": { + "shaders": "geometryshader" + }, + "assets": { + "models": [ + "suzanne.obj" + ] + } +} \ No newline at end of file diff --git a/android/hdr/build.py b/android/hdr/build.py deleted file mode 100644 index cef8718b..00000000 --- a/android/hdr/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanHDR" -SHADER_DIR = "hdr" -ASSETS_MODELS = ["cube.obj", "sphere.obj", "teapot.dae", "torusknot.obj", "venus.fbx"] -ASSETS_TEXTURES = ["hdr/uffizi_cube.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures/hdr", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures/hdr") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - for arg in sys.argv[1:]: - if arg == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/hdr/example.json b/android/hdr/example.json new file mode 100644 index 00000000..595df0ca --- /dev/null +++ b/android/hdr/example.json @@ -0,0 +1,23 @@ +{ + "apkname": "vulkanHDR", + "directories": { + "shaders": "hdr" + }, + "assets": { + "models": [ + "cube.obj", + "geosphere.obj", + "teapot.dae", + "torusknot.obj", + "venus.fbx" + ], + "additional" : { + "directories": [ + "textures/hdr" + ], + "files": [ + "textures/hdr/uffizi_cube.ktx" + ] + } + } +} \ No newline at end of file diff --git a/android/imgui/build.py b/android/imgui/build.py deleted file mode 100644 index b794dda0..00000000 --- a/android/imgui/build.py +++ /dev/null @@ -1,56 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanImGui" -SHADER_DIR = "imgui" -ASSETS_MODELS = ["vulkanscenemodels.dae", "vulkanscenebackground.dae", "vulkanscenelogos.dae"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Validation - VALIDATION = False - for arg in sys.argv[1:]: - print(arg) - if arg == "-validation": - VALIDATION = True - break - if VALIDATION: - print("Validation enabled, copying validation layers...") - os.makedirs("./libs/armeabi-v7a", exist_ok=True) - for file in glob.glob("../layers/armeabi-v7a/*.so"): - print(file + "\n") - shutil.copy(file, "./libs/armeabi-v7a") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - for arg in sys.argv[1:]: - if arg == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/imgui/example.json b/android/imgui/example.json new file mode 100644 index 00000000..1341f23e --- /dev/null +++ b/android/imgui/example.json @@ -0,0 +1,13 @@ +{ + "apkname": "vulkanImGui", + "directories": { + "shaders": "imgui" + }, + "assets": { + "models": [ + "vulkanscenemodels.dae", + "vulkanscenebackground.dae", + "vulkanscenelogos.dae" + ] + } +} \ No newline at end of file diff --git a/android/indirectdraw/build.py b/android/indirectdraw/build.py deleted file mode 100644 index 92d5e5f3..00000000 --- a/android/indirectdraw/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanIndirectdraw" -SHADER_DIR = "indirectdraw" -ASSETS_MODELS = ["plants.dae", "plane_circle.dae", "skysphere.dae"] -ASSETS_TEXTURES = ["texturearray_plants_bc3_unorm.ktx", "texturearray_plants_astc_8x8_unorm.ktx", "texturearray_plants_etc2_unorm.ktx", "ground_dry_bc3_unorm.ktx", "ground_dry_astc_8x8_unorm.ktx", "ground_dry_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/indirectdraw/example.json b/android/indirectdraw/example.json new file mode 100644 index 00000000..83135e1a --- /dev/null +++ b/android/indirectdraw/example.json @@ -0,0 +1,21 @@ +{ + "apkname": "vulkanIndirectdraw", + "directories": { + "shaders": "indirectdraw" + }, + "assets": { + "models": [ + "plants.dae", + "plane_circle.dae", + "skysphere.dae" + ], + "textures": [ + "texturearray_plants_bc3_unorm.ktx", + "texturearray_plants_astc_8x8_unorm.ktx", + "texturearray_plants_etc2_unorm.ktx", + "ground_dry_bc3_unorm.ktx", + "ground_dry_astc_8x8_unorm.ktx", + "ground_dry_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/instancing/build.py b/android/instancing/build.py deleted file mode 100644 index c24fdba6..00000000 --- a/android/instancing/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanInstancing" -SHADER_DIR = "instancing" -ASSETS_MODELS = ["rock01.dae", "sphere.obj", ] -ASSETS_TEXTURES = ["texturearray_rocks_bc3_unorm.ktx", "texturearray_rocks_astc_8x8_unorm.ktx", "texturearray_rocks_etc2_unorm.ktx", "lavaplanet_bc3_unorm.ktx", "lavaplanet_astc_8x8_unorm.ktx", "lavaplanet_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/instancing/example.json b/android/instancing/example.json new file mode 100644 index 00000000..76bf7d50 --- /dev/null +++ b/android/instancing/example.json @@ -0,0 +1,20 @@ +{ + "apkname": "vulkanInstancing", + "directories": { + "shaders": "instancing" + }, + "assets": { + "models": [ + "rock01.dae", + "sphere.obj" + ], + "textures": [ + "texturearray_rocks_bc3_unorm.ktx", + "texturearray_rocks_astc_8x8_unorm.ktx", + "texturearray_rocks_etc2_unorm.ktx", + "lavaplanet_bc3_unorm.ktx", + "lavaplanet_astc_8x8_unorm.ktx", + "lavaplanet_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/layers/README.md b/android/layers/README.md index 45efa239..94d8bcea 100644 --- a/android/layers/README.md +++ b/android/layers/README.md @@ -4,6 +4,12 @@ Put the pre-built validation layers into the folder for the architecture you're E.g. for armeabi-v7a: -./armeabi-v7a/libVkLayer_core_validation.so -./armeabi-v7a/libVkLayer_object_tracker.so -... \ No newline at end of file +- ./armeabi-v7a/libVkLayer_core_validation.so +- ./armeabi-v7a/libVkLayer_object_tracker.so +- ... + +After this, build the example you want validation to be enabled for with the "-validation" flag, e.g.: + +``` +build pbrtexture -validation +``` \ No newline at end of file diff --git a/android/mesh/build.py b/android/mesh/build.py deleted file mode 100644 index 38b43e45..00000000 --- a/android/mesh/build.py +++ /dev/null @@ -1,52 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanMesh" -SHADER_DIR = "mesh" -ASSETS_MODELS = ["voyager.dae"] -ASSETS_TEXTURES = ["voyager_astc_8x8_unorm.ktx", "voyager_bc3_unorm.ktx", "voyager_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - if not os.path.exists("./assets/models/voyager"): - os.makedirs("./assets/models/voyager") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/models/voyager/%s" % file, "./assets/models/voyager") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/voyager/%s" % file, "./assets/models/voyager") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/mesh/example.json b/android/mesh/example.json new file mode 100644 index 00000000..734e36f3 --- /dev/null +++ b/android/mesh/example.json @@ -0,0 +1,16 @@ +{ + "apkname": "vulkanMesh", + "directories": { + "shaders": "mesh" + }, + "assets": { + "additional": { + "directories": [ + "models/voyager" + ], + "files": [ + "models/voyager/*.*" + ] + } + } +} \ No newline at end of file diff --git a/android/multisampling/build.py b/android/multisampling/build.py deleted file mode 100644 index 06b6fe2a..00000000 --- a/android/multisampling/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanMultisampling" -SHADER_DIR = "mesh" -ASSETS_MODELS = ["voyager.dae"] -ASSETS_TEXTURES = ["voyager_astc_8x8_unorm.ktx", "voyager_bc3_unorm.ktx", "voyager_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders", exist_ok=True) - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models/voyager", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/models/voyager/%s" % file, "./assets/models/voyager") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/voyager/%s" % file, "./assets/models/voyager") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/multisampling/example.json b/android/multisampling/example.json new file mode 100644 index 00000000..2150538a --- /dev/null +++ b/android/multisampling/example.json @@ -0,0 +1,16 @@ +{ + "apkname": "vulkanMultisampling", + "directories": { + "shaders": "mesh" + }, + "assets": { + "additional": { + "directories": [ + "models/voyager" + ], + "files": [ + "models/voyager/*.*" + ] + } + } +} \ No newline at end of file diff --git a/android/multithreading/build.py b/android/multithreading/build.py deleted file mode 100644 index 632075f0..00000000 --- a/android/multithreading/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanMultithreading" -SHADER_DIR = "multithreading" -ASSETS_MODELS = ["retroufo_red_lowpoly.dae", "sphere.obj", ] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/multithreading/example.json b/android/multithreading/example.json new file mode 100644 index 00000000..888d24e0 --- /dev/null +++ b/android/multithreading/example.json @@ -0,0 +1,12 @@ +{ + "apkname": "vulkanMultithreading", + "directories": { + "shaders": "multithreading" + }, + "assets": { + "models": [ + "retroufo_red_lowpoly.dae", + "sphere.obj" + ] + } +} \ No newline at end of file diff --git a/android/occlusionquery/build.py b/android/occlusionquery/build.py deleted file mode 100644 index 56770ae2..00000000 --- a/android/occlusionquery/build.py +++ /dev/null @@ -1,44 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanOcclusionquery" -APP_TITLE = "Occlusion queries" -SHADER_DIR = "occlusionquery" -ASSETS_MODELS = ["plane_z.3ds", "teapot.3ds", "sphere.3ds"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders", exist_ok=True) - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/occlusionquery/example.json b/android/occlusionquery/example.json new file mode 100644 index 00000000..f7f4b5d7 --- /dev/null +++ b/android/occlusionquery/example.json @@ -0,0 +1,13 @@ +{ + "apkname": "vulkanOcclusionquery", + "directories": { + "shaders": "occlusionquery" + }, + "assets": { + "models": [ + "plane_z.3ds", + "teapot.3ds", + "sphere.3ds" + ] + } +} \ No newline at end of file diff --git a/android/offscreen/build.py b/android/offscreen/build.py deleted file mode 100644 index 759008b6..00000000 --- a/android/offscreen/build.py +++ /dev/null @@ -1,53 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanOffscreen" -SHADER_DIR = "offscreen" -ASSETS_MODELS = ["plane.obj", "chinesedragon.dae"] -ASSETS_TEXTURES = ["darkmetal_bc3_unorm.ktx", "stonefloor01_color_bc3_unorm.ktx", "darkmetal_astc_8x8_unorm.ktx", "darkmetal_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and models - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/offscreen/example.json b/android/offscreen/example.json new file mode 100644 index 00000000..db98376e --- /dev/null +++ b/android/offscreen/example.json @@ -0,0 +1,17 @@ +{ + "apkname": "vulkanOffscreen", + "directories": { + "shaders": "offscreen" + }, + "assets": { + "models": [ + "plane.obj", + "chinesedragon.dae" + ], + "textures": [ + "darkmetal_bc3_unorm.ktx", + "darkmetal_astc_8x8_unorm.ktx", + "darkmetal_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/parallaxmapping/build.py b/android/parallaxmapping/build.py deleted file mode 100644 index 6098e4db..00000000 --- a/android/parallaxmapping/build.py +++ /dev/null @@ -1,53 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanParallaxmapping" -SHADER_DIR = "parallax" -ASSETS_MODELS = ["plane_z.obj"] -ASSETS_TEXTURES = ["rocks_normal_height_rgba.dds", "rocks_color_bc3_unorm.dds", "rocks_color_astc_8x8_unorm.ktx", "rocks_color_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and models - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/parallaxmapping/example.json b/android/parallaxmapping/example.json new file mode 100644 index 00000000..365487ea --- /dev/null +++ b/android/parallaxmapping/example.json @@ -0,0 +1,17 @@ +{ + "apkname": "vulkanParallaxmapping", + "directories": { + "shaders": "parallax" + }, + "assets": { + "models": [ + "plane_z.obj" + ], + "textures": [ + "rocks_normal_height_rgba.dds", + "rocks_color_bc3_unorm.dds", + "rocks_color_astc_8x8_unorm.ktx", + "rocks_color_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/particlefire/build.py b/android/particlefire/build.py deleted file mode 100644 index 47cb3a6d..00000000 --- a/android/particlefire/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanParticlefire" -SHADER_DIR = "particlefire" -ASSETS_MODELS = ["fireplace.obj"] -ASSETS_TEXTURES = ["particle_fire.ktx", "particle_smoke.ktx", "fireplace_normalmap_bc3_unorm.ktx", "fireplace_normalmap_astc_8x8_unorm.ktx", "fireplace_normalmap_etc2_unorm.ktx", "fireplace_colormap_bc3_unorm.ktx", "fireplace_colormap_astc_8x8_unorm.ktx", "fireplace_colormap_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models/lowpoly", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - for arg in sys.argv[1:]: - if arg == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/particlefire/example.json b/android/particlefire/example.json new file mode 100644 index 00000000..30f12040 --- /dev/null +++ b/android/particlefire/example.json @@ -0,0 +1,21 @@ +{ + "apkname": "vulkanParticlefire", + "directories": { + "shaders": "particlefire" + }, + "assets": { + "models": [ + "fireplace.obj" + ], + "textures": [ + "particle_fire.ktx", + "particle_smoke.ktx", + "fireplace_normalmap_bc3_unorm.ktx", + "fireplace_normalmap_astc_8x8_unorm.ktx", + "fireplace_normalmap_etc2_unorm.ktx", + "fireplace_colormap_bc3_unorm.ktx", + "fireplace_colormap_astc_8x8_unorm.ktx", + "fireplace_colormap_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/pbrbasic/build.py b/android/pbrbasic/build.py deleted file mode 100644 index 5a8bde6a..00000000 --- a/android/pbrbasic/build.py +++ /dev/null @@ -1,49 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanPBRBasic" -SHADER_DIR = "pbrbasic" -ASSETS_MODELS = ["cube.obj", "geosphere.obj", "teapot.dae", "torusknot.obj", "venus.fbx"] -ASSETS_TEXTURES = [""] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/pbrbasic/example.json b/android/pbrbasic/example.json new file mode 100644 index 00000000..7fdd463c --- /dev/null +++ b/android/pbrbasic/example.json @@ -0,0 +1,15 @@ +{ + "apkname": "vulkanPBRBasic", + "directories": { + "shaders": "pbrbasic" + }, + "assets": { + "models": [ + "cube.obj", + "geosphere.obj", + "teapot.dae", + "torusknot.obj", + "venus.fbx" + ] + } +} \ No newline at end of file diff --git a/android/pbribl/build.py b/android/pbribl/build.py deleted file mode 100644 index d6ea9772..00000000 --- a/android/pbribl/build.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanPBRIBL" -SHADER_DIR = "pbribl" -ASSETS_MODELS = ["cube.obj", "geosphere.obj", "teapot.dae", "torusknot.obj", "venus.fbx"] -ASSETS_TEXTURES = ["hdr/pisa_cube.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures/hdr", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures/hdr") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - for arg in sys.argv[1:]: - if arg == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") - \ No newline at end of file diff --git a/android/pbribl/example.json b/android/pbribl/example.json new file mode 100644 index 00000000..f2620b81 --- /dev/null +++ b/android/pbribl/example.json @@ -0,0 +1,23 @@ +{ + "apkname": "vulkanPBRIBL", + "directories": { + "shaders": "pbribl" + }, + "assets": { + "models": [ + "cube.obj", + "geosphere.obj", + "teapot.dae", + "torusknot.obj", + "venus.fbx" + ], + "additional" : { + "directories": [ + "textures/hdr" + ], + "files": [ + "textures/hdr/pisa_cube.ktx" + ] + } + } +} \ No newline at end of file diff --git a/android/pbrtexture/build.py b/android/pbrtexture/build.py deleted file mode 100644 index dfd43750..00000000 --- a/android/pbrtexture/build.py +++ /dev/null @@ -1,51 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanPBRTexture" -SHADER_DIR = "pbrtexture" -ASSETS_MODELS = ["cube.obj"] -ASSETS_TEXTURES = ["hdr/gcanyon_cube.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - os.makedirs("./assets/textures/hdr", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./assets/models/cerberus/", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures/hdr") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - for file in glob.glob("../../data/models/cerberus/*.*"): - shutil.copy(file, "./assets/models/cerberus") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - for arg in sys.argv[1:]: - if arg == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") - \ No newline at end of file diff --git a/android/pbrtexture/example.json b/android/pbrtexture/example.json new file mode 100644 index 00000000..32584555 --- /dev/null +++ b/android/pbrtexture/example.json @@ -0,0 +1,18 @@ +{ + "apkname": "vulkanPBRTexture", + "directories": { + "shaders": "pbrtexture" + }, + "assets": { + "models": [ + "cube.obj" + ], + "additional" : { + "directories": ["textures/hdr", "models/cerberus"], + "files": [ + "textures/hdr/gcanyon_cube.ktx", + "models/cerberus/*.*" + ] + } + } +} \ No newline at end of file diff --git a/android/pipelines/build.py b/android/pipelines/build.py deleted file mode 100644 index fe18640c..00000000 --- a/android/pipelines/build.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanPipelines" -SHADER_DIR = "pipelines" -ASSETS_MODELS = ["treasure_smooth.dae"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/pipelines/example.json b/android/pipelines/example.json new file mode 100644 index 00000000..49856b43 --- /dev/null +++ b/android/pipelines/example.json @@ -0,0 +1,11 @@ +{ + "apkname": "vulkanPipelines", + "directories": { + "shaders": "pipelines" + }, + "assets": { + "models": [ + "treasure_smooth.dae" + ] + } +} \ No newline at end of file diff --git a/android/pushconstants/build.py b/android/pushconstants/build.py deleted file mode 100644 index 8d3138c0..00000000 --- a/android/pushconstants/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanPushconstants" -SHADER_DIR = "pushconstants" -ASSETS_MODELS = ["samplescene.dae"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - for arg in sys.argv[1:]: - if arg == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/pushconstants/example.json b/android/pushconstants/example.json new file mode 100644 index 00000000..ab370ffc --- /dev/null +++ b/android/pushconstants/example.json @@ -0,0 +1,11 @@ +{ + "apkname": "vulkanPushconstants", + "directories": { + "shaders": "pushconstants" + }, + "assets": { + "models": [ + "samplescene.dae" + ] + } +} \ No newline at end of file diff --git a/android/radialblur/build.py b/android/radialblur/build.py deleted file mode 100644 index 10a49af3..00000000 --- a/android/radialblur/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanRadialblur" -SHADER_DIR = "radialblur" -ASSETS_MODELS = ["glowsphere.dae"] -ASSETS_TEXTURES = ["particle_gradient_rgba.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/radialblur/example.json b/android/radialblur/example.json new file mode 100644 index 00000000..871a206f --- /dev/null +++ b/android/radialblur/example.json @@ -0,0 +1,14 @@ +{ + "apkname": "vulkanRadialblur", + "directories": { + "shaders": "radialblur" + }, + "assets": { + "models": [ + "glowsphere.dae" + ], + "textures": [ + "particle_gradient_rgba.ktx" + ] + } +} \ No newline at end of file diff --git a/android/raytracing/build.py b/android/raytracing/build.py deleted file mode 100644 index d61726cd..00000000 --- a/android/raytracing/build.py +++ /dev/null @@ -1,51 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanRaytracing" -SHADER_DIR = "raytracing" - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Copy validation layers - if len(sys.argv) > 1: - if sys.argv[1] == "-validation": - print("copying validation layers") - for file in glob.glob("../layers/armeabi-v7a/*.so"): - print(file) - shutil.copy(file, "./libs/armeabi-v7a") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/raytracing/example.json b/android/raytracing/example.json new file mode 100644 index 00000000..daa22f46 --- /dev/null +++ b/android/raytracing/example.json @@ -0,0 +1,7 @@ +{ + "apkname": "vulkanRaytracing", + "directories": { + "shaders": "raytracing" + }, + "assets": {} +} \ No newline at end of file diff --git a/android/scenerendering/build.py b/android/scenerendering/build.py deleted file mode 100644 index f87bfe39..00000000 --- a/android/scenerendering/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanScenerendering" -SHADER_DIR = "scenerendering" - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and model - if not os.path.exists("./assets/models/sibenik/"): - os.makedirs("./assets/models/sibenik/") - for file in glob.glob("../../data/models/sibenik/*.*"): - shutil.copy(file, "./assets/models/sibenik") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/scenerendering/example.json b/android/scenerendering/example.json new file mode 100644 index 00000000..bdc959ef --- /dev/null +++ b/android/scenerendering/example.json @@ -0,0 +1,16 @@ +{ + "apkname": "vulkanScenerendering", + "directories": { + "shaders": "scenerendering" + }, + "assets": { + "additional" : { + "directories" : [ + "models/sibenik" + ], + "files" : [ + "models/sibenik/*.*" + ] + } + } +} \ No newline at end of file diff --git a/android/shadowmapping/build.py b/android/shadowmapping/build.py deleted file mode 100644 index f168ba87..00000000 --- a/android/shadowmapping/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanShadowmapping" -SHADER_DIR = "shadowmapping" -ASSETS_MODELS = ["vulkanscene_shadow.dae"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/shadowmapping/example.json b/android/shadowmapping/example.json new file mode 100644 index 00000000..edbd65ce --- /dev/null +++ b/android/shadowmapping/example.json @@ -0,0 +1,11 @@ +{ + "apkname": "vulkanShadowmapping", + "directories": { + "shaders": "shadowmapping" + }, + "assets": { + "models": [ + "vulkanscene_shadow.dae" + ] + } +} \ No newline at end of file diff --git a/android/shadowmappingomni/build.py b/android/shadowmappingomni/build.py deleted file mode 100644 index 96e6f205..00000000 --- a/android/shadowmappingomni/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanShadowmappingomni" -SHADER_DIR = "shadowmapomni" -ASSETS_MODELS = ["shadowscene_fire.dae", "cube.obj"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/shadowmappingomni/example.json b/android/shadowmappingomni/example.json new file mode 100644 index 00000000..907f1421 --- /dev/null +++ b/android/shadowmappingomni/example.json @@ -0,0 +1,12 @@ +{ + "apkname": "vulkanShadowmappingomni", + "directories": { + "shaders": "shadowmapomni" + }, + "assets": { + "models": [ + "shadowscene_fire.dae", + "cube.obj" + ] + } +} \ No newline at end of file diff --git a/android/skeletalanimation/build.py b/android/skeletalanimation/build.py deleted file mode 100644 index e9878fa2..00000000 --- a/android/skeletalanimation/build.py +++ /dev/null @@ -1,53 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanSkeletalanimation" -SHADER_DIR = "skeletalanimation" -ASSETS_MODELS = ["goblin.dae", "plane_z.obj"] -ASSETS_TEXTURES = ["trail_bc3_unorm.ktx", "goblin_bc3_unorm.ktx", "trail_astc_8x8_unorm.ktx", "goblin_astc_8x8_unorm.ktx", "trail_etc2_unorm.ktx", "goblin_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and models - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - if not os.path.exists("./assets/models"): - os.makedirs("./assets/models") - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/skeletalanimation/example.json b/android/skeletalanimation/example.json new file mode 100644 index 00000000..992ce5cc --- /dev/null +++ b/android/skeletalanimation/example.json @@ -0,0 +1,20 @@ +{ + "apkname": "vulkanSkeletalanimation", + "directories": { + "shaders": "skeletalanimation" + }, + "assets": { + "models": [ + "goblin.dae", + "plane_z.obj" + ], + "textures": [ + "trail_bc3_unorm.ktx", + "goblin_bc3_unorm.ktx", + "trail_astc_8x8_unorm.ktx", + "goblin_astc_8x8_unorm.ktx", + "trail_etc2_unorm.ktx", + "goblin_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/specializationconstants/build.py b/android/specializationconstants/build.py deleted file mode 100644 index 5782178a..00000000 --- a/android/specializationconstants/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanSpecializationconstants" -SHADER_DIR = "specializationconstants" -ASSETS_MODELS = ["color_teapot_spheres.dae"] -ASSETS_TEXTURES = ["metalplate_nomips_rgba.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/specializationconstants/example.json b/android/specializationconstants/example.json new file mode 100644 index 00000000..e0d87e78 --- /dev/null +++ b/android/specializationconstants/example.json @@ -0,0 +1,14 @@ +{ + "apkname": "vulkanSpecializationconstants", + "directories": { + "shaders": "specializationconstants" + }, + "assets": { + "models": [ + "color_teapot_spheres.dae" + ], + "textures" : [ + "metalplate_nomips_rgba.ktx" + ] + } +} \ No newline at end of file diff --git a/android/sphericalenvmapping/build.py b/android/sphericalenvmapping/build.py deleted file mode 100644 index 7318895c..00000000 --- a/android/sphericalenvmapping/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanSphericalenvmapping" -SHADER_DIR = "sphericalenvmapping" -ASSETS_MODELS = ["chinesedragon.dae"] -ASSETS_TEXTURES = ["matcap_array_rgba.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/sphericalenvmapping/example.json b/android/sphericalenvmapping/example.json new file mode 100644 index 00000000..0db9c325 --- /dev/null +++ b/android/sphericalenvmapping/example.json @@ -0,0 +1,14 @@ +{ + "apkname": "vulkanSphericalenvmapping", + "directories": { + "shaders": "sphericalenvmapping" + }, + "assets": { + "models": [ + "chinesedragon.dae" + ], + "textures": [ + "matcap_array_rgba.ktx" + ] + } +} \ No newline at end of file diff --git a/android/ssao/build.py b/android/ssao/build.py deleted file mode 100644 index 50a1c418..00000000 --- a/android/ssao/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanSSAO" -SHADER_DIR = "ssao" - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures and model - if not os.path.exists("./assets/models/sibenik/"): - os.makedirs("./assets/models/sibenik/") - for file in glob.glob("../../data/models/sibenik/*.*"): - shutil.copy(file, "./assets/models/sibenik") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/ssao/example.json b/android/ssao/example.json new file mode 100644 index 00000000..085ad64c --- /dev/null +++ b/android/ssao/example.json @@ -0,0 +1,16 @@ +{ + "apkname": "vulkanSSAO", + "directories": { + "shaders": "ssao" + }, + "assets": { + "additional" : { + "directories" : [ + "models/sibenik" + ], + "files" : [ + "models/sibenik/*.*" + ] + } + } +} \ No newline at end of file diff --git a/android/subpasses/build.py b/android/subpasses/build.py deleted file mode 100644 index 1e5198cc..00000000 --- a/android/subpasses/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanSubpasses" -SHADER_DIR = "subpasses" -ASSETS_MODELS = ["samplebuilding.dae", "samplebuilding_glass.dae"] -ASSETS_TEXTURES = ["colored_glass_bc3_unorm.ktx", "colored_glass_etc2_unorm.ktx", "colored_glass_astc_8x8_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - for arg in sys.argv[1:]: - if arg == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/subpasses/example.json b/android/subpasses/example.json new file mode 100644 index 00000000..4ae16f32 --- /dev/null +++ b/android/subpasses/example.json @@ -0,0 +1,17 @@ +{ + "apkname": "vulkanSubpasses", + "directories": { + "shaders": "subpasses" + }, + "assets": { + "models": [ + "samplebuilding.dae", + "samplebuilding_glass.dae" + ], + "textures": [ + "colored_glass_bc3_unorm.ktx", + "colored_glass_etc2_unorm.ktx", + "colored_glass_astc_8x8_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/terraintessellation/build.py b/android/terraintessellation/build.py deleted file mode 100644 index cf164514..00000000 --- a/android/terraintessellation/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTerraintessellation" -SHADER_DIR = "terraintessellation" -ASSETS_MODELS = ["geosphere.obj"] -ASSETS_TEXTURES = ["skysphere_bc3_unorm.ktx", "terrain_texturearray_bc3_unorm.ktx", "skysphere_astc_8x8_unorm.ktx", "terrain_texturearray_astc_8x8_unorm.ktx", "skysphere_etc2_unorm.ktx", "terrain_texturearray_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/terraintessellation/example.json b/android/terraintessellation/example.json new file mode 100644 index 00000000..02e031a6 --- /dev/null +++ b/android/terraintessellation/example.json @@ -0,0 +1,19 @@ +{ + "apkname": "vulkanTerraintessellation", + "directories": { + "shaders": "terraintessellation" + }, + "assets": { + "models": [ + "geosphere.obj" + ], + "textures": [ + "skysphere_bc3_unorm.ktx", + "skysphere_astc_8x8_unorm.ktx", + "skysphere_etc2_unorm.ktx", + "terrain_texturearray_bc3_unorm.ktx", + "terrain_texturearray_astc_8x8_unorm.ktx", + "terrain_texturearray_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/tessellation/build.py b/android/tessellation/build.py deleted file mode 100644 index 5ac1297d..00000000 --- a/android/tessellation/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTessellation" -SHADER_DIR = "tessellation" -ASSETS_MODELS = ["deer.dae"] -ASSETS_TEXTURES = ["deer_bc3_unorm.ktx", "deer_astc_8x8_unorm.ktx", "deer_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models/lowpoly", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/lowpoly/%s" % file, "./assets/models/lowpoly") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - for arg in sys.argv[1:]: - if arg == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") \ No newline at end of file diff --git a/android/tessellation/example.json b/android/tessellation/example.json new file mode 100644 index 00000000..54d5edeb --- /dev/null +++ b/android/tessellation/example.json @@ -0,0 +1,21 @@ +{ + "apkname": "vulkanTessellation", + "directories": { + "shaders": "tessellation" + }, + "assets": { + "textures": [ + "deer_bc3_unorm.ktx", + "deer_astc_8x8_unorm.ktx", + "deer_etc2_unorm.ktx" + ], + "additional": { + "directories": [ + "models/lowpoly" + ], + "files" : [ + "models/lowpoly/deer.dae" + ] + } + } +} \ No newline at end of file diff --git a/android/textoverlay/build.py b/android/textoverlay/build.py deleted file mode 100644 index 4ef3030f..00000000 --- a/android/textoverlay/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTextoverlay" -SHADER_DIR = "textoverlay" -ASSETS_MODELS = ["cube.dae"] -ASSETS_TEXTURES = ["skysphere_bc3_unorm.ktx", "round_window_bc3_unorm.ktx", "skysphere_astc_8x8_unorm.ktx", "round_window_astc_8x8_unorm.ktx", "skysphere_etc2_unorm.ktx", "round_window_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/textoverlay/example.json b/android/textoverlay/example.json new file mode 100644 index 00000000..6e413622 --- /dev/null +++ b/android/textoverlay/example.json @@ -0,0 +1,19 @@ +{ + "apkname": "vulkanTextoverlay", + "directories": { + "shaders": "textoverlay" + }, + "assets": { + "models": [ + "cube.dae" + ], + "textures": [ + "skysphere_bc3_unorm.ktx", + "skysphere_astc_8x8_unorm.ktx", + "skysphere_etc2_unorm.ktx", + "round_window_bc3_unorm.ktx", + "round_window_astc_8x8_unorm.ktx", + "round_window_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/texture/build.py b/android/texture/build.py deleted file mode 100644 index 2a5f326a..00000000 --- a/android/texture/build.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTexture" -SHADER_DIR = "texture" -ASSETS_TEXTURES = ["metalplate01_rgba.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/texture/example.json b/android/texture/example.json new file mode 100644 index 00000000..24ec5bb7 --- /dev/null +++ b/android/texture/example.json @@ -0,0 +1,11 @@ +{ + "apkname": "vulkanTexture", + "directories": { + "shaders": "texture" + }, + "assets": { + "textures": [ + "metalplate01_rgba.ktx" + ] + } +} \ No newline at end of file diff --git a/android/texture3d/build.py b/android/texture3d/build.py deleted file mode 100644 index 8662c1a5..00000000 --- a/android/texture3d/build.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTexture3d" -SHADER_DIR = "texture3d" - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/texture3d/example.json b/android/texture3d/example.json new file mode 100644 index 00000000..470e6e74 --- /dev/null +++ b/android/texture3d/example.json @@ -0,0 +1,7 @@ +{ + "apkname": "vulkanTexture3d", + "directories": { + "shaders": "texture3d" + }, + "assets": {} +} \ No newline at end of file diff --git a/android/texturearray/build.py b/android/texturearray/build.py deleted file mode 100644 index f712c10d..00000000 --- a/android/texturearray/build.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTexturearray" -SHADER_DIR = "texturearray" -ASSETS_TEXTURES = ["texturearray_bc3_unorm.ktx", "texturearray_astc_8x8_unorm.ktx", "texturearray_etc2_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - if not os.path.exists("./assets"): - os.makedirs("./assets") - - # Shaders - # Base - if not os.path.exists("./assets/shaders/base"): - os.makedirs("./assets/shaders/base") - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - if not os.path.exists("./assets/shaders/%s" % SHADER_DIR): - os.makedirs("./assets/shaders/%s" % SHADER_DIR) - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - if not os.path.exists("./assets/textures"): - os.makedirs("./assets/textures") - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - - # Icon - if not os.path.exists("./res/drawable"): - os.makedirs("./res/drawable") - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/texturearray/example.json b/android/texturearray/example.json new file mode 100644 index 00000000..8bffb1a9 --- /dev/null +++ b/android/texturearray/example.json @@ -0,0 +1,13 @@ +{ + "apkname": "vulkanTexturearray", + "directories": { + "shaders": "texturearray" + }, + "assets": { + "textures": [ + "texturearray_bc3_unorm.ktx", + "texturearray_astc_8x8_unorm.ktx", + "texturearray_etc2_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/texturecubemap/build.py b/android/texturecubemap/build.py deleted file mode 100644 index 4f30992f..00000000 --- a/android/texturecubemap/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTexturecubemap" -SHADER_DIR = "cubemap" -ASSETS_MODELS = ["sphere.obj", "teapot.dae", "torusknot.obj", "cube.obj"] -ASSETS_TEXTURES = ["cubemap_yokohama_bc3_unorm.ktx", "cubemap_yokohama_etc2_unorm.ktx", "cubemap_yokohama_astc_8x8_unorm.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/texturecubemap/example.json b/android/texturecubemap/example.json new file mode 100644 index 00000000..8654d620 --- /dev/null +++ b/android/texturecubemap/example.json @@ -0,0 +1,19 @@ +{ + "apkname": "vulkanTexturecubemap", + "directories": { + "shaders": "cubemap" + }, + "assets": { + "models": [ + "sphere.obj", + "teapot.dae", + "torusknot.obj", + "cube.obj" + ], + "textures": [ + "cubemap_yokohama_bc3_unorm.ktx", + "cubemap_yokohama_etc2_unorm.ktx", + "cubemap_yokohama_astc_8x8_unorm.ktx" + ] + } +} \ No newline at end of file diff --git a/android/texturemipmapgen/build.py b/android/texturemipmapgen/build.py deleted file mode 100644 index a9f1e96e..00000000 --- a/android/texturemipmapgen/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTexturemipmapgen" -SHADER_DIR = "texturemipmapgen" -ASSETS_MODELS = ["tunnel_cylinder.dae"] -ASSETS_TEXTURES = ["metalplate_nomips_rgba.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/texturemipmapgen/example.json b/android/texturemipmapgen/example.json new file mode 100644 index 00000000..b54f2dd0 --- /dev/null +++ b/android/texturemipmapgen/example.json @@ -0,0 +1,14 @@ +{ + "apkname": "vulkanTexturemipmapgen", + "directories": { + "shaders": "texturemipmapgen" + }, + "assets": { + "models": [ + "tunnel_cylinder.dae" + ], + "textures": [ + "metalplate_nomips_rgba.ktx" + ] + } +} \ No newline at end of file diff --git a/android/triangle/build.py b/android/triangle/build.py deleted file mode 100644 index e5e933ab..00000000 --- a/android/triangle/build.py +++ /dev/null @@ -1,36 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanTriangle" -ASSETS_SHADERS = ["triangle.vert.spv", "triangle.frag.spv"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - os.makedirs("./assets/shaders", exist_ok=True) - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in ASSETS_SHADERS: - shutil.copy("../../data/shaders/%s" % file, "./assets/shaders") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/triangle/example.json b/android/triangle/example.json new file mode 100644 index 00000000..081ad343 --- /dev/null +++ b/android/triangle/example.json @@ -0,0 +1,6 @@ +{ + "apkname": "vulkanTriangle", + "directories": { + "shaders": "triangle" + } +} \ No newline at end of file diff --git a/android/vulkanscene/build.py b/android/vulkanscene/build.py deleted file mode 100644 index 477f05c4..00000000 --- a/android/vulkanscene/build.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import shutil -import subprocess -import sys -import glob - -APK_NAME = "vulkanVulkanscene" -SHADER_DIR = "vulkanscene" -ASSETS_MODELS = ["vulkanscenelogos.dae", "vulkanscenebackground.dae", "vulkanscenemodels.dae", "cube.obj"] -ASSETS_TEXTURES = ["cubemap_vulkan.ktx"] - -if subprocess.call("ndk-build", shell=True) == 0: - print("Build successful") - - # Assets - os.makedirs("./assets/shaders/base", exist_ok=True) - os.makedirs("./assets/shaders/%s" % SHADER_DIR, exist_ok=True) - os.makedirs("./assets/textures", exist_ok=True) - os.makedirs("./assets/models", exist_ok=True) - os.makedirs("./res/drawable", exist_ok=True) - - # Shaders - # Base - for file in glob.glob("../../data/shaders/base/*.spv"): - shutil.copy(file, "./assets/shaders/base") - # Sample - for file in glob.glob("../../data/shaders/%s/*.spv" %SHADER_DIR): - shutil.copy(file, "./assets/shaders/%s" % SHADER_DIR) - # Textures - for file in ASSETS_TEXTURES: - shutil.copy("../../data/textures/%s" % file, "./assets/textures") - # Models - for file in ASSETS_MODELS: - shutil.copy("../../data/models/%s" % file, "./assets/models") - - # Icon - shutil.copy("../../android/images/icon.png", "./res/drawable") - - if subprocess.call("ant debug -Dout.final.file=%s.apk" % APK_NAME, shell=True) == 0: - if len(sys.argv) > 1: - if sys.argv[1] == "-deploy": - if subprocess.call("adb install -r %s.apk" % APK_NAME, shell=True) != 0: - print("Could not deploy to device!") - else: - print("Error during build process!") -else: - print("Error building project!") diff --git a/android/vulkanscene/example.json b/android/vulkanscene/example.json new file mode 100644 index 00000000..7820ea2e --- /dev/null +++ b/android/vulkanscene/example.json @@ -0,0 +1,17 @@ +{ + "apkname": "vulkanVulkanscene", + "directories": { + "shaders": "vulkanscene" + }, + "assets": { + "models": [ + "vulkanscenelogos.dae", + "vulkanscenebackground.dae", + "vulkanscenemodels.dae", + "cube.obj" + ], + "textures": [ + "cubemap_vulkan.ktx" + ] + } +} \ No newline at end of file diff --git a/base/VulkanDevice.hpp b/base/VulkanDevice.hpp index 52d1f27f..a6d3b205 100644 --- a/base/VulkanDevice.hpp +++ b/base/VulkanDevice.hpp @@ -3,7 +3,7 @@ * * Encapsulates a physical Vulkan device and it's logical representation * -* Copyright (C) 2016 by Sascha Willems - www.saschawillems.de +* Copyright (C) 2016-2017 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ @@ -29,6 +29,8 @@ namespace vks VkPhysicalDeviceProperties properties; /** @brief Features of the physical device that an application can use to check if a feature is supported */ VkPhysicalDeviceFeatures features; + /** @brief Features that have been enabled for use on the physical device */ + VkPhysicalDeviceFeatures enabledFeatures; /** @brief Memory types and heaps of the physical device */ VkPhysicalDeviceMemoryProperties memoryProperties; /** @brief Queue family properties of the physical device */ @@ -331,6 +333,8 @@ namespace vks commandPool = createCommandPool(queueFamilyIndices.graphics); } + this->enabledFeatures = enabledFeatures; + return result; } diff --git a/base/VulkanFrameBuffer.hpp b/base/VulkanFrameBuffer.hpp index 66714a46..a3941b6c 100644 --- a/base/VulkanFrameBuffer.hpp +++ b/base/VulkanFrameBuffer.hpp @@ -244,7 +244,7 @@ namespace vks samplerInfo.addressModeV = adressMode; samplerInfo.addressModeW = adressMode; samplerInfo.mipLodBias = 0.0f; - samplerInfo.maxAnisotropy = 0; + samplerInfo.maxAnisotropy = 1.0f; samplerInfo.minLod = 0.0f; samplerInfo.maxLod = 1.0f; samplerInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; diff --git a/base/VulkanTexture.hpp b/base/VulkanTexture.hpp index 129fedd8..b9311862 100644 --- a/base/VulkanTexture.hpp +++ b/base/VulkanTexture.hpp @@ -340,8 +340,8 @@ namespace vks samplerCreateInfo.minLod = 0.0f; // Max level-of-detail should match mip level count samplerCreateInfo.maxLod = (useStaging) ? (float)mipLevels : 0.0f; - // Enable anisotropic filtering - samplerCreateInfo.maxAnisotropy = 8; + // Only enable anisotropic filtering if enabled on the devicec + samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f; samplerCreateInfo.anisotropyEnable = VK_TRUE; samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; VK_CHECK_RESULT(vkCreateSampler(device->logicalDevice, &samplerCreateInfo, nullptr, &sampler)); @@ -726,7 +726,7 @@ namespace vks samplerCreateInfo.addressModeV = samplerCreateInfo.addressModeU; samplerCreateInfo.addressModeW = samplerCreateInfo.addressModeU; samplerCreateInfo.mipLodBias = 0.0f; - samplerCreateInfo.maxAnisotropy = 8; + samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f; samplerCreateInfo.compareOp = VK_COMPARE_OP_NEVER; samplerCreateInfo.minLod = 0.0f; samplerCreateInfo.maxLod = (float)mipLevels; @@ -938,7 +938,7 @@ namespace vks samplerCreateInfo.addressModeV = samplerCreateInfo.addressModeU; samplerCreateInfo.addressModeW = samplerCreateInfo.addressModeU; samplerCreateInfo.mipLodBias = 0.0f; - samplerCreateInfo.maxAnisotropy = 8; + samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f; samplerCreateInfo.compareOp = VK_COMPARE_OP_NEVER; samplerCreateInfo.minLod = 0.0f; samplerCreateInfo.maxLod = (float)mipLevels; diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index c91c1a14..aa381b0e 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -14,6 +14,11 @@ VkResult VulkanExampleBase::createInstance(bool enableValidation) { this->settings.validation = enableValidation; + // Validation can also be forced via a define +#if defined(_VALIDATION) + this->settings.validation = true; +#endif + VkApplicationInfo appInfo = {}; appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; appInfo.pApplicationName = name.c_str(); diff --git a/bloom/bloom.cpp b/bloom/bloom.cpp index 6675cf19..ad0df5b8 100644 --- a/bloom/bloom.cpp +++ b/bloom/bloom.cpp @@ -356,7 +356,7 @@ public: sampler.addressModeV = sampler.addressModeU; sampler.addressModeW = sampler.addressModeU; sampler.mipLodBias = 0.0f; - sampler.maxAnisotropy = 0; + sampler.maxAnisotropy = 1.0f; sampler.minLod = 0.0f; sampler.maxLod = 1.0f; sampler.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; diff --git a/computecullandlod/computecullandlod.cpp b/computecullandlod/computecullandlod.cpp index 387cbe39..92e3f12e 100644 --- a/computecullandlod/computecullandlod.cpp +++ b/computecullandlod/computecullandlod.cpp @@ -150,14 +150,12 @@ public: vkDestroySemaphore(device, compute.semaphore, nullptr); } - void reBuildCommandBuffers() + virtual void getEnabledFeatures() { - if (!checkCommandBuffers()) - { - destroyCommandBuffers(); - createCommandBuffers(); + // Enable multi draw indirect if supported + if (deviceFeatures.multiDrawIndirect) { + enabledFeatures.multiDrawIndirect = VK_TRUE; } - buildCommandBuffers(); } void buildCommandBuffers() diff --git a/computeshader/computeshader.cpp b/computeshader/computeshader.cpp index 714053ea..9c757e9e 100644 --- a/computeshader/computeshader.cpp +++ b/computeshader/computeshader.cpp @@ -173,7 +173,7 @@ public: sampler.addressModeV = sampler.addressModeU; sampler.addressModeW = sampler.addressModeU; sampler.mipLodBias = 0.0f; - sampler.maxAnisotropy = 0; + sampler.maxAnisotropy = 1.0f; sampler.compareOp = VK_COMPARE_OP_NEVER; sampler.minLod = 0.0f; sampler.maxLod = 0.0f; diff --git a/data/shaders/spirv-triangle.bat b/data/shaders/spirv-triangle.bat deleted file mode 100644 index 0459876d..00000000 --- a/data/shaders/spirv-triangle.bat +++ /dev/null @@ -1,3 +0,0 @@ -glslangvalidator -V triangle.vert -o triangle.vert.spv -glslangvalidator -V triangle.frag -o triangle.frag.spv - diff --git a/data/shaders/subpasses/composition.frag b/data/shaders/subpasses/composition.frag index 0984b0ec..e8451826 100644 --- a/data/shaders/subpasses/composition.frag +++ b/data/shaders/subpasses/composition.frag @@ -9,10 +9,7 @@ layout (input_attachment_index = 2, binding = 2) uniform subpassInput samplerAlb layout (location = 0) in vec2 inUV; -layout (location = 0) out vec4 outFragcolor; -layout (location = 1) out vec4 outPosition; -layout (location = 2) out vec4 outNormal; -layout (location = 3) out vec4 outAlbedo; +layout (location = 0) out vec4 outColor; layout (constant_id = 0) const int NUM_LIGHTS = 64; @@ -72,10 +69,5 @@ void main() fragcolor += diff;// + spec; } - outFragcolor = vec4(fragcolor, 1.0); - - // Write G-Buffer attachments to avoid undefined behaviour (validation error) - outPosition = vec4(0.0); - outNormal = vec4(0.0); - outAlbedo = vec4(0.0); + outColor = vec4(fragcolor, 1.0); } \ No newline at end of file diff --git a/data/shaders/subpasses/composition.frag.spv b/data/shaders/subpasses/composition.frag.spv index 6dacd638..9c568e1a 100644 Binary files a/data/shaders/subpasses/composition.frag.spv and b/data/shaders/subpasses/composition.frag.spv differ diff --git a/data/shaders/triangle.frag b/data/shaders/triangle/triangle.frag similarity index 100% rename from data/shaders/triangle.frag rename to data/shaders/triangle/triangle.frag diff --git a/data/shaders/triangle.frag.spv b/data/shaders/triangle/triangle.frag.spv similarity index 100% rename from data/shaders/triangle.frag.spv rename to data/shaders/triangle/triangle.frag.spv diff --git a/data/shaders/triangle.vert b/data/shaders/triangle/triangle.vert similarity index 100% rename from data/shaders/triangle.vert rename to data/shaders/triangle/triangle.vert diff --git a/data/shaders/triangle.vert.spv b/data/shaders/triangle/triangle.vert.spv similarity index 100% rename from data/shaders/triangle.vert.spv rename to data/shaders/triangle/triangle.vert.spv diff --git a/data/shaders/viewportarray/multiview.geom b/data/shaders/viewportarray/multiview.geom index 12d21b82..c517d069 100644 --- a/data/shaders/viewportarray/multiview.geom +++ b/data/shaders/viewportarray/multiview.geom @@ -38,7 +38,7 @@ void main(void) // Set the viewport index that the vertex will be emitted to gl_ViewportIndex = gl_InvocationID; - + gl_PrimitiveID = gl_PrimitiveIDIn; EmitVertex(); } EndPrimitive(); diff --git a/data/shaders/viewportarray/multiview.geom.spv b/data/shaders/viewportarray/multiview.geom.spv index f50cb326..a40c84ca 100644 Binary files a/data/shaders/viewportarray/multiview.geom.spv and b/data/shaders/viewportarray/multiview.geom.spv differ diff --git a/debugmarker/debugmarker.cpp b/debugmarker/debugmarker.cpp index c06ba59a..31ec70ba 100644 --- a/debugmarker/debugmarker.cpp +++ b/debugmarker/debugmarker.cpp @@ -350,7 +350,7 @@ public: samplerInfo.addressModeV = samplerInfo.addressModeU; samplerInfo.addressModeW = samplerInfo.addressModeU; samplerInfo.mipLodBias = 0.0f; - samplerInfo.maxAnisotropy = 0; + samplerInfo.maxAnisotropy = 1.0f; samplerInfo.minLod = 0.0f; samplerInfo.maxLod = 1.0f; samplerInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; diff --git a/deferred/deferred.cpp b/deferred/deferred.cpp index 3e00e2ff..35c5d61e 100644 --- a/deferred/deferred.cpp +++ b/deferred/deferred.cpp @@ -210,6 +210,25 @@ public: vkDestroySemaphore(device, offscreenSemaphore, nullptr); } + // Enable physical device features required for this example + virtual void getEnabledFeatures() + { + // Enable anisotropic filtering if supported + if (deviceFeatures.samplerAnisotropy) { + enabledFeatures.samplerAnisotropy = VK_TRUE; + } + // Enable texture compression + if (deviceFeatures.textureCompressionBC) { + enabledFeatures.textureCompressionBC = VK_TRUE; + } + else if (deviceFeatures.textureCompressionASTC_LDR) { + enabledFeatures.textureCompressionASTC_LDR = VK_TRUE; + } + else if (deviceFeatures.textureCompressionETC2) { + enabledFeatures.textureCompressionETC2 = VK_TRUE; + } + }; + // Create a frame buffer attachment void createAttachment( VkFormat format, @@ -407,7 +426,7 @@ public: sampler.addressModeV = sampler.addressModeU; sampler.addressModeW = sampler.addressModeU; sampler.mipLodBias = 0.0f; - sampler.maxAnisotropy = 0; + sampler.maxAnisotropy = 1.0f; sampler.minLod = 0.0f; sampler.maxLod = 1.0f; sampler.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; diff --git a/deferredmultisampling/deferredmultisampling.cpp b/deferredmultisampling/deferredmultisampling.cpp index ee0db6a9..7b5cf169 100644 --- a/deferredmultisampling/deferredmultisampling.cpp +++ b/deferredmultisampling/deferredmultisampling.cpp @@ -214,6 +214,25 @@ public: vkDestroySemaphore(device, offscreenSemaphore, nullptr); } + // Enable physical device features required for this example + virtual void getEnabledFeatures() + { + // Enable anisotropic filtering if supported + if (deviceFeatures.samplerAnisotropy) { + enabledFeatures.samplerAnisotropy = VK_TRUE; + } + // Enable texture compression + if (deviceFeatures.textureCompressionBC) { + enabledFeatures.textureCompressionBC = VK_TRUE; + } + else if (deviceFeatures.textureCompressionASTC_LDR) { + enabledFeatures.textureCompressionASTC_LDR = VK_TRUE; + } + else if (deviceFeatures.textureCompressionETC2) { + enabledFeatures.textureCompressionETC2 = VK_TRUE; + } + }; + // Create a frame buffer attachment void createAttachment( VkFormat format, @@ -427,7 +446,7 @@ public: sampler.addressModeV = sampler.addressModeU; sampler.addressModeW = sampler.addressModeU; sampler.mipLodBias = 0.0f; - sampler.maxAnisotropy = 0; + sampler.maxAnisotropy = 1.0f; sampler.minLod = 0.0f; sampler.maxLod = 1.0f; sampler.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; diff --git a/deferredshadows/deferredshadows.cpp b/deferredshadows/deferredshadows.cpp index 6e3a63fb..ebc77881 100644 --- a/deferredshadows/deferredshadows.cpp +++ b/deferredshadows/deferredshadows.cpp @@ -240,6 +240,20 @@ public: else { vks::tools::exitFatal("Selected GPU does not support geometry shaders!", "Feature not supported"); } + // Enable anisotropic filtering if supported + if (deviceFeatures.samplerAnisotropy) { + enabledFeatures.samplerAnisotropy = VK_TRUE; + } + // Enable texture compression + if (deviceFeatures.textureCompressionBC) { + enabledFeatures.textureCompressionBC = VK_TRUE; + } + else if (deviceFeatures.textureCompressionASTC_LDR) { + enabledFeatures.textureCompressionASTC_LDR = VK_TRUE; + } + else if (deviceFeatures.textureCompressionETC2) { + enabledFeatures.textureCompressionETC2 = VK_TRUE; + } } // Prepare a layered shadow map with each layer containing depth from a light's point of view diff --git a/hdr/hdr.cpp b/hdr/hdr.cpp index 3ad6f538..1ce7ad22 100644 --- a/hdr/hdr.cpp +++ b/hdr/hdr.cpp @@ -435,7 +435,7 @@ public: sampler.addressModeV = sampler.addressModeU; sampler.addressModeW = sampler.addressModeU; sampler.mipLodBias = 0.0f; - sampler.maxAnisotropy = 0; + sampler.maxAnisotropy = 1.0f; sampler.minLod = 0.0f; sampler.maxLod = 1.0f; sampler.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; @@ -526,7 +526,7 @@ public: sampler.addressModeV = sampler.addressModeU; sampler.addressModeW = sampler.addressModeU; sampler.mipLodBias = 0.0f; - sampler.maxAnisotropy = 0; + sampler.maxAnisotropy = 1.0f; sampler.minLod = 0.0f; sampler.maxLod = 1.0f; sampler.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; diff --git a/indirectdraw/indirectdraw.cpp b/indirectdraw/indirectdraw.cpp index 9460e401..77bede2b 100644 --- a/indirectdraw/indirectdraw.cpp +++ b/indirectdraw/indirectdraw.cpp @@ -152,14 +152,25 @@ public: // Enable physical device features required for this example virtual void getEnabledFeatures() { - // Example uses multi draw indirect (if available) + // Example uses multi draw indirect if available if (deviceFeatures.multiDrawIndirect) { enabledFeatures.multiDrawIndirect = VK_TRUE; } - else { - std::cout << "MultiDrawIndirect not supported" << std::endl; + // Enable anisotropic filtering if supported + if (deviceFeatures.samplerAnisotropy) { + enabledFeatures.samplerAnisotropy = VK_TRUE; } - } + // Enable texture compression + if (deviceFeatures.textureCompressionBC) { + enabledFeatures.textureCompressionBC = VK_TRUE; + } + else if (deviceFeatures.textureCompressionASTC_LDR) { + enabledFeatures.textureCompressionASTC_LDR = VK_TRUE; + } + else if (deviceFeatures.textureCompressionETC2) { + enabledFeatures.textureCompressionETC2 = VK_TRUE; + } + }; void buildCommandBuffers() { diff --git a/instancing/instancing.cpp b/instancing/instancing.cpp index bab00335..76df86cf 100644 --- a/instancing/instancing.cpp +++ b/instancing/instancing.cpp @@ -118,6 +118,25 @@ public: uniformBuffers.scene.destroy(); } + // Enable physical device features required for this example + virtual void getEnabledFeatures() + { + // Enable anisotropic filtering if supported + if (deviceFeatures.samplerAnisotropy) { + enabledFeatures.samplerAnisotropy = VK_TRUE; + } + // Enable texture compression + if (deviceFeatures.textureCompressionBC) { + enabledFeatures.textureCompressionBC = VK_TRUE; + } + else if (deviceFeatures.textureCompressionASTC_LDR) { + enabledFeatures.textureCompressionASTC_LDR = VK_TRUE; + } + else if (deviceFeatures.textureCompressionETC2) { + enabledFeatures.textureCompressionETC2 = VK_TRUE; + } + }; + void buildCommandBuffers() { VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo(); diff --git a/offscreen/offscreen.cpp b/offscreen/offscreen.cpp index 7098dee8..f3668153 100644 --- a/offscreen/offscreen.cpp +++ b/offscreen/offscreen.cpp @@ -235,7 +235,7 @@ public: samplerInfo.addressModeV = samplerInfo.addressModeU; samplerInfo.addressModeW = samplerInfo.addressModeU; samplerInfo.mipLodBias = 0.0f; - samplerInfo.maxAnisotropy = 0; + samplerInfo.maxAnisotropy = 1.0f; samplerInfo.minLod = 0.0f; samplerInfo.maxLod = 1.0f; samplerInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; diff --git a/particlefire/particlefire.cpp b/particlefire/particlefire.cpp index e463e560..b09b7bd6 100644 --- a/particlefire/particlefire.cpp +++ b/particlefire/particlefire.cpp @@ -370,7 +370,7 @@ public: // Both particle textures have the same number of mip maps samplerCreateInfo.maxLod = float(textures.particles.fire.mipLevels); // Enable anisotropic filtering - samplerCreateInfo.maxAnisotropy = 8; + samplerCreateInfo.maxAnisotropy = 8.0f; samplerCreateInfo.anisotropyEnable = VK_TRUE; // Use a different border color (than the normal texture loader) for additive blending samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; diff --git a/pbrbasic/pbrbasic.cpp b/pbrbasic/pbrbasic.cpp index 8d009d48..f851b4e6 100644 --- a/pbrbasic/pbrbasic.cpp +++ b/pbrbasic/pbrbasic.cpp @@ -96,8 +96,8 @@ public: title = "Vulkan Example - Physical based shading basics"; enableTextOverlay = true; camera.type = Camera::CameraType::firstperson; - camera.setPosition(glm::vec3(13.0f, 8.0f, -10.0f)); - camera.setRotation(glm::vec3(-31.75f, 45.0f, 0.0f)); + camera.setPosition(glm::vec3(10.0f, 13.0f, 1.8f)); + camera.setRotation(glm::vec3(-62.5f, 90.0f, 0.0f)); camera.movementSpeed = 4.0f; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); camera.rotationSpeed = 0.25f; @@ -118,7 +118,7 @@ public: materials.push_back(Material("Blue", glm::vec3(0.0f, 0.0f, 1.0f), 0.1f, 1.0f)); materials.push_back(Material("Black", glm::vec3(0.0f), 0.1f, 1.0f)); - materialIndex = 8; + materialIndex = 0; } ~VulkanExample() @@ -138,22 +138,12 @@ public: uniformBuffers.params.destroy(); } - void reBuildCommandBuffers() - { - if (!checkCommandBuffers()) - { - destroyCommandBuffers(); - createCommandBuffers(); - } - buildCommandBuffers(); - } - void buildCommandBuffers() { VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo(); VkClearValue clearValues[2]; - clearValues[0].color = { { 0.1f, 0.1f, 0.1f, 1.0f } }; + clearValues[0].color = defaultClearColor; clearValues[1].depthStencil = { 1.0f, 0 }; VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo(); @@ -207,7 +197,7 @@ public: for (uint32_t x = 0; x < GRID_DIM; x++) { glm::vec3 pos = glm::vec3(float(x - (GRID_DIM / 2.0f)) * 2.5f, 0.0f, float(y - (GRID_DIM / 2.0f)) * 2.5f); vkCmdPushConstants(drawCmdBuffers[i], pipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(glm::vec3), &pos); - mat.params.metallic = (float)x / (float)(GRID_DIM - 1); + mat.params.metallic = glm::clamp((float)x / (float)(GRID_DIM - 1), 0.1f, 1.0f); mat.params.roughness = glm::clamp((float)y / (float)(GRID_DIM - 1), 0.05f, 1.0f); vkCmdPushConstants(drawCmdBuffers[i], pipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, sizeof(glm::vec3), sizeof(Material::PushBlock), &mat); vkCmdDrawIndexed(drawCmdBuffers[i], models.objects[models.objectIndex].indexCount, 1, 0, 0, 0); @@ -475,7 +465,7 @@ public: models.objectIndex = 0; } updateUniformBuffers(); - reBuildCommandBuffers(); + buildCommandBuffers(); } void toggleMaterial(int32_t dir) @@ -487,7 +477,7 @@ public: if (materialIndex > static_cast(materials.size()) - 1) { materialIndex = 0; } - reBuildCommandBuffers(); + buildCommandBuffers(); updateTextOverlay(); } diff --git a/pbribl/pbribl.cpp b/pbribl/pbribl.cpp index 59cb3717..14f76467 100644 --- a/pbribl/pbribl.cpp +++ b/pbribl/pbribl.cpp @@ -91,7 +91,7 @@ public: struct UBOParams { glm::vec4 lights[4]; - float exposure = 2.0f; + float exposure = 4.5f; float gamma = 2.2f; } uboParams; @@ -114,7 +114,7 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { - title = "VK PBR IBL"; + title = "Vulkan Example - PBR with image based lighting"; enableTextOverlay = true; camera.type = Camera::CameraType::firstperson; @@ -227,13 +227,11 @@ public: #define SINGLE_ROW 1 #ifdef SINGLE_ROW - mat.params.metallic = 1.0; - uint32_t objcount = 10; for (uint32_t x = 0; x < objcount; x++) { glm::vec3 pos = glm::vec3(float(x - (objcount / 2.0f)) * 2.15f, 0.0f, 0.0f); - mat.params.roughness = glm::clamp((float)x / (float)objcount, 0.005f, 1.0f); - mat.params.metallic = 1.0f - glm::clamp((float)x / (float)objcount, 0.005f, 1.0f); + mat.params.roughness = 1.0f-glm::clamp((float)x / (float)objcount, 0.005f, 1.0f); + mat.params.metallic = glm::clamp((float)x / (float)objcount, 0.005f, 1.0f); vkCmdPushConstants(drawCmdBuffers[i], pipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(glm::vec3), &pos); vkCmdPushConstants(drawCmdBuffers[i], pipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, sizeof(glm::vec3), sizeof(Material::PushBlock), &mat); vkCmdDrawIndexed(drawCmdBuffers[i], models.objects[models.objectIndex].indexCount, 1, 0, 0, 0); @@ -1438,7 +1436,7 @@ public: // 3D object uboMatrices.projection = camera.matrices.perspective; uboMatrices.view = camera.matrices.view; - uboMatrices.model = glm::rotate(glm::mat4(), glm::radians(90.0f + (models.objectIndex == 1 ? -45.0f : 0.0f)), glm::vec3(0.0f, 1.0f, 0.0f)); + uboMatrices.model = glm::rotate(glm::mat4(), glm::radians(90.0f + (models.objectIndex == 1 ? 45.0f : 0.0f)), glm::vec3(0.0f, 1.0f, 0.0f)); uboMatrices.camPos = camera.position * -1.0f; memcpy(uniformBuffers.object.mapped, &uboMatrices, sizeof(uboMatrices)); diff --git a/pbrtexture/main.cpp b/pbrtexture/main.cpp index affdb47c..4d6b6870 100644 --- a/pbrtexture/main.cpp +++ b/pbrtexture/main.cpp @@ -97,7 +97,7 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { - title = "Vulkan textured PBR using IBL"; + title = "Vulkan Example - Textured PBR with IBL"; enableTextOverlay = true; camera.type = Camera::CameraType::firstperson; @@ -1385,7 +1385,7 @@ public: // 3D object uboMatrices.projection = camera.matrices.perspective; uboMatrices.view = camera.matrices.view; - uboMatrices.model = glm::rotate(glm::mat4(), glm::radians(90.0f), glm::vec3(0.0f, 1.0f, 0.0f)); + uboMatrices.model = glm::rotate(glm::mat4(), glm::radians(-90.0f), glm::vec3(0.0f, 1.0f, 0.0f)); uboMatrices.camPos = camera.position * -1.0f; memcpy(uniformBuffers.object.mapped, &uboMatrices, sizeof(uboMatrices)); diff --git a/radialblur/radialblur.cpp b/radialblur/radialblur.cpp index 34ee01ad..60282b14 100644 --- a/radialblur/radialblur.cpp +++ b/radialblur/radialblur.cpp @@ -224,7 +224,7 @@ public: samplerInfo.addressModeV = samplerInfo.addressModeU; samplerInfo.addressModeW = samplerInfo.addressModeU; samplerInfo.mipLodBias = 0.0f; - samplerInfo.maxAnisotropy = 0; + samplerInfo.maxAnisotropy = 1.0f; samplerInfo.minLod = 0.0f; samplerInfo.maxLod = 1.0f; samplerInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE; diff --git a/raytracing/raytracing.cpp b/raytracing/raytracing.cpp index 6d652ea5..b63f265f 100644 --- a/raytracing/raytracing.cpp +++ b/raytracing/raytracing.cpp @@ -183,7 +183,7 @@ public: sampler.addressModeV = sampler.addressModeU; sampler.addressModeW = sampler.addressModeU; sampler.mipLodBias = 0.0f; - sampler.maxAnisotropy = 0; + sampler.maxAnisotropy = 1.0f; sampler.compareOp = VK_COMPARE_OP_NEVER; sampler.minLod = 0.0f; sampler.maxLod = 0.0f; diff --git a/screenshots/pbrbasic.jpg b/screenshots/pbrbasic.jpg index 7397c563..2d354a51 100644 Binary files a/screenshots/pbrbasic.jpg and b/screenshots/pbrbasic.jpg differ diff --git a/screenshots/pbribl.jpg b/screenshots/pbribl.jpg index e3f2544b..3c33b345 100644 Binary files a/screenshots/pbribl.jpg and b/screenshots/pbribl.jpg differ diff --git a/screenshots/pbrtexture.jpg b/screenshots/pbrtexture.jpg new file mode 100644 index 00000000..61c4b2b4 Binary files /dev/null and b/screenshots/pbrtexture.jpg differ diff --git a/shadowmappingomni/shadowmappingomni.cpp b/shadowmappingomni/shadowmappingomni.cpp index 6920aa58..ff080939 100644 --- a/shadowmappingomni/shadowmappingomni.cpp +++ b/shadowmappingomni/shadowmappingomni.cpp @@ -242,7 +242,7 @@ public: sampler.addressModeV = sampler.addressModeU; sampler.addressModeW = sampler.addressModeU; sampler.mipLodBias = 0.0f; - sampler.maxAnisotropy = 0; + sampler.maxAnisotropy = 1.0f; sampler.compareOp = VK_COMPARE_OP_NEVER; sampler.minLod = 0.0f; sampler.maxLod = 1.0f; diff --git a/subpasses/subpasses.cpp b/subpasses/subpasses.cpp index 8c18da94..e6e6b904 100644 --- a/subpasses/subpasses.cpp +++ b/subpasses/subpasses.cpp @@ -161,6 +161,25 @@ public: uniformBuffers.lights.destroy(); } + // Enable physical device features required for this example + virtual void getEnabledFeatures() + { + // Enable anisotropic filtering if supported + if (deviceFeatures.samplerAnisotropy) { + enabledFeatures.samplerAnisotropy = VK_TRUE; + } + // Enable texture compression + if (deviceFeatures.textureCompressionBC) { + enabledFeatures.textureCompressionBC = VK_TRUE; + } + else if (deviceFeatures.textureCompressionASTC_LDR) { + enabledFeatures.textureCompressionASTC_LDR = VK_TRUE; + } + else if (deviceFeatures.textureCompressionETC2) { + enabledFeatures.textureCompressionETC2 = VK_TRUE; + } + }; + // Create a frame buffer attachment void createAttachment(VkFormat format, VkImageUsageFlags usage, FrameBufferAttachment *attachment) { @@ -346,9 +365,6 @@ public: // Use the color attachments filled in the first pass as input attachments subpassDescriptions[1].inputAttachmentCount = 3; subpassDescriptions[1].pInputAttachments = inputReferences; - // Preserve attachment 1 (position + depth) for next subpass - subpassDescriptions[1].preserveAttachmentCount = 1; - subpassDescriptions[1].pPreserveAttachments = &preserveAttachmentIndex; // Third subpass: Forward transparency // ---------------------------------------------------------------------------------------- diff --git a/triangle/triangle.cpp b/triangle/triangle.cpp index 4f74b9d3..93c0f6d5 100644 --- a/triangle/triangle.cpp +++ b/triangle/triangle.cpp @@ -966,7 +966,7 @@ public: // Set pipeline stage for this shader shaderStages[0].stage = VK_SHADER_STAGE_VERTEX_BIT; // Load binary SPIR-V shader - shaderStages[0].module = loadSPIRVShader(getAssetPath() + "shaders/triangle.vert.spv"); + shaderStages[0].module = loadSPIRVShader(getAssetPath() + "shaders/triangle/triangle.vert.spv"); // Main entry point for the shader shaderStages[0].pName = "main"; assert(shaderStages[0].module != VK_NULL_HANDLE); @@ -976,7 +976,7 @@ public: // Set pipeline stage for this shader shaderStages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT; // Load binary SPIR-V shader - shaderStages[1].module = loadSPIRVShader(getAssetPath() + "shaders/triangle.frag.spv"); + shaderStages[1].module = loadSPIRVShader(getAssetPath() + "shaders/triangle/triangle.frag.spv"); // Main entry point for the shader shaderStages[1].pName = "main"; assert(shaderStages[1].module != VK_NULL_HANDLE);