From 053a89cda52b828d416649e5e82e41a743876f60 Mon Sep 17 00:00:00 2001 From: Tobias Frisch <tfrisch@uni-koblenz.de> Date: Fri, 21 Oct 2022 23:49:15 +0200 Subject: [PATCH] Add documentation of the projects Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de> --- README.md | 39 ++++++++++++++++--- projects/CMakeLists.txt | 4 +- projects/bindless_textures/README.md | 16 ++++++++ projects/fire_works/README.md | 11 ++++++ projects/first_mesh/README.md | 10 +++++ projects/first_scene/README.md | 10 +++++ projects/first_triangle/README.md | 9 +++++ projects/head_demo/README.md | 11 ++++++ projects/head_demo/src/main.cpp | 3 +- projects/indirect_dispatch/README.md | 10 +++++ projects/indirect_draw/README.md | 17 ++++++++ projects/mesh_shader/README.md | 24 ++++++++++++ projects/{wobble_bobble => mpm}/.gitignore | 0 .../{wobble_bobble => mpm}/CMakeLists.txt | 0 projects/mpm/README.md | 11 ++++++ .../{wobble_bobble => mpm}/shaders/.gitignore | 0 .../{wobble_bobble => mpm}/shaders/grid.frag | 0 .../{wobble_bobble => mpm}/shaders/grid.vert | 0 .../shaders/init_particle_weights.comp | 0 .../{wobble_bobble => mpm}/shaders/lines.frag | 0 .../{wobble_bobble => mpm}/shaders/lines.vert | 0 .../shaders/particle.frag | 0 .../shaders/particle.inc | 0 .../shaders/particle.vert | 0 .../shaders/transform_particles_to_grid.comp | 0 .../shaders/update_particle_velocities.comp | 0 projects/{wobble_bobble => mpm}/src/main.cpp | 2 +- projects/particle_simulation/README.md | 20 ++++++++++ projects/particle_simulation/src/main.cpp | 2 +- projects/path_tracer/README.md | 10 +++++ projects/ray_tracer/.gitignore | 1 + projects/ray_tracer/CMakeLists.txt | 15 +++++++ projects/ray_tracer/README.md | 11 ++++++ .../shaders/raytracing.comp | 0 projects/{saf_r => ray_tracer}/src/main.cpp | 34 ++++++++-------- .../src/scene.hpp} | 2 +- projects/rtx_ambient_occlusion/README.md | 25 ++++++++++++ projects/saf_r/.gitignore | 1 - projects/saf_r/CMakeLists.txt | 15 ------- projects/sph/README.md | 10 +++++ projects/voxelization/README.md | 21 ++++++++++ screenshots/bindless_textures.png | 3 ++ screenshots/fire_works.png | 3 ++ screenshots/first_mesh.png | 3 ++ screenshots/first_scene.png | 3 ++ screenshots/first_triangle.png | 3 ++ screenshots/head_demo.png | 3 ++ screenshots/indirect_dispatch.png | 3 ++ screenshots/indirect_draw.png | 3 ++ screenshots/mesh_shader.png | 3 ++ screenshots/mpm.png | 3 ++ screenshots/particle_simulation_gravity.png | 3 ++ screenshots/particle_simulation_space.png | 3 ++ screenshots/particle_simulation_water.png | 3 ++ screenshots/path_tracer.png | 3 ++ screenshots/ray_tracer.png | 3 ++ screenshots/rtx_ambient_occlusion.png | 3 ++ screenshots/sph.png | 3 ++ screenshots/voxelization.png | 3 ++ 59 files changed, 352 insertions(+), 46 deletions(-) create mode 100644 projects/bindless_textures/README.md create mode 100644 projects/fire_works/README.md create mode 100644 projects/first_mesh/README.md create mode 100644 projects/first_scene/README.md create mode 100644 projects/first_triangle/README.md create mode 100644 projects/head_demo/README.md create mode 100644 projects/indirect_dispatch/README.md create mode 100644 projects/indirect_draw/README.md create mode 100644 projects/mesh_shader/README.md rename projects/{wobble_bobble => mpm}/.gitignore (100%) rename projects/{wobble_bobble => mpm}/CMakeLists.txt (100%) create mode 100644 projects/mpm/README.md rename projects/{wobble_bobble => mpm}/shaders/.gitignore (100%) rename projects/{wobble_bobble => mpm}/shaders/grid.frag (100%) rename projects/{wobble_bobble => mpm}/shaders/grid.vert (100%) rename projects/{wobble_bobble => mpm}/shaders/init_particle_weights.comp (100%) rename projects/{wobble_bobble => mpm}/shaders/lines.frag (100%) rename projects/{wobble_bobble => mpm}/shaders/lines.vert (100%) rename projects/{wobble_bobble => mpm}/shaders/particle.frag (100%) rename projects/{wobble_bobble => mpm}/shaders/particle.inc (100%) rename projects/{wobble_bobble => mpm}/shaders/particle.vert (100%) rename projects/{wobble_bobble => mpm}/shaders/transform_particles_to_grid.comp (100%) rename projects/{wobble_bobble => mpm}/shaders/update_particle_velocities.comp (100%) rename projects/{wobble_bobble => mpm}/src/main.cpp (99%) create mode 100644 projects/particle_simulation/README.md create mode 100644 projects/path_tracer/README.md create mode 100644 projects/ray_tracer/.gitignore create mode 100644 projects/ray_tracer/CMakeLists.txt create mode 100644 projects/ray_tracer/README.md rename projects/{saf_r => ray_tracer}/shaders/raytracing.comp (100%) rename projects/{saf_r => ray_tracer}/src/main.cpp (84%) rename projects/{saf_r/src/safrScene.hpp => ray_tracer/src/scene.hpp} (98%) create mode 100644 projects/rtx_ambient_occlusion/README.md delete mode 100644 projects/saf_r/.gitignore delete mode 100644 projects/saf_r/CMakeLists.txt create mode 100644 projects/sph/README.md create mode 100644 projects/voxelization/README.md create mode 100644 screenshots/bindless_textures.png create mode 100644 screenshots/fire_works.png create mode 100644 screenshots/first_mesh.png create mode 100644 screenshots/first_scene.png create mode 100644 screenshots/first_triangle.png create mode 100644 screenshots/head_demo.png create mode 100644 screenshots/indirect_dispatch.png create mode 100644 screenshots/indirect_draw.png create mode 100644 screenshots/mesh_shader.png create mode 100644 screenshots/mpm.png create mode 100644 screenshots/particle_simulation_gravity.png create mode 100644 screenshots/particle_simulation_space.png create mode 100644 screenshots/particle_simulation_water.png create mode 100644 screenshots/path_tracer.png create mode 100644 screenshots/ray_tracer.png create mode 100644 screenshots/rtx_ambient_occlusion.png create mode 100644 screenshots/sph.png create mode 100644 screenshots/voxelization.png diff --git a/README.md b/README.md index 10af7456..db60c73d 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,16 @@ ## Repository -Git LFS is used for bigger resource files like meshes and textures. So you need to install Git LFS and use `git lfs install` after cloning. +Git LFS is used for bigger resource files like meshes and textures. So you need to install Git LFS +and use `git lfs install` after cloning. More information about Git LFS [here](https://git-lfs.github.com/). ## Build -Git submodules are used for libraries. -To download the submodules either clone using `git clone --recurse-submodules` or after `git clone` use `git submodule init` and `git submodule update`. +Git submodules are used for libraries. To download the submodules either clone using +`git clone --recurse-submodules` or after `git clone` use `git submodule init` and +`git submodule update`. Detailed build process: - [How to build on Windows](doc/BUILD_WINDOWS.md) @@ -21,7 +23,8 @@ Detailed build process: ### Dependencies (required): -Most dependencies will be used via submodules but for example Vulkan needs to be installed correctly depending on your platform. So please setup your environment properly. +Most dependencies are used via submodules but for example Vulkan needs to be installed correctly +depending on your platform. So please setup your environment properly. | Name of dependency | Used as submodule | |-----------------------------------------------------------------------------------|---| @@ -34,7 +37,8 @@ Most dependencies will be used via submodules but for example Vulkan needs to be ### Modules (optional): -The following modules will be provided in this repository and they will automatically be builded together with the framework if used. You can configure/adjust the build using CMake if necessary. +The following modules are provided in this repository and they build automatically together with +the framework if used. You can configure/adjust the build using CMake if necessary. - [Algorithm](modules/algorithm/README.md) - [Asset-Loader](modules/asset_loader/README.md) @@ -48,6 +52,28 @@ The following modules will be provided in this repository and they will automati - [Shader-Compiler](modules/shader_compiler/README.md) - [Upscaling](modules/upscaling/README.md) +### Projects (optional): + +The following projects are provided in this repository and can be build with their own CMake +targets: + + - [bindless_textures](projects/bindless_textures/README.md) + - [fire_works](projects/fire_works/README.md) + - [first_mesh](projects/first_mesh/README.md) + - [first_scene](projects/first_scene/README.md) + - [first_triangle](projects/first_triangle/README.md) + - [head_demo](projects/head_demo/README.md) + - [indirect_dispatch](projects/indirect_dispatch/README.md) + - [indirect_draw](projects/indirect_draw/README.md) + - [mesh_shader](projects/mesh_shader/README.md) + - [mpm](projects/mpm/README.md) + - [particle_simulation](projects/particle_simulation/README.md) + - [path_tracer](projects/path_tracer/README.md) + - [ray_tracer](projects/ray_tracer/README.md) + - [rtx_ambient_occlusion](projects/rtx_ambient_occlusion/README.md) + - [sph](projects/sph/README.md) + - [voxelization](projects/voxelization/README.md) + ## Development See this guide to setup your IDE for most forward development. @@ -58,4 +84,5 @@ See this guide to setup your IDE for most forward development. A pre-built documentation can be found here: https://userpages.uni-koblenz.de/~vkcv/doc/ -But it is recommended to build the documentation with Doxygen locally to get the most recent changes. There is also an optional CMake target to build the documentation via Doxygen. +But it is recommended to build the documentation with Doxygen locally to get the most recent +changes. There is also an optional CMake target to build the documentation via Doxygen. diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt index 1fffd2da..2d2a6b00 100644 --- a/projects/CMakeLists.txt +++ b/projects/CMakeLists.txt @@ -13,8 +13,8 @@ add_subdirectory(indirect_draw) add_subdirectory(mesh_shader) add_subdirectory(particle_simulation) add_subdirectory(path_tracer) +add_subdirectory(ray_tracer) add_subdirectory(rtx_ambient_occlusion) -add_subdirectory(saf_r) add_subdirectory(sph) add_subdirectory(voxelization) -add_subdirectory(wobble_bobble) \ No newline at end of file +add_subdirectory(mpm) \ No newline at end of file diff --git a/projects/bindless_textures/README.md b/projects/bindless_textures/README.md new file mode 100644 index 00000000..0c549855 --- /dev/null +++ b/projects/bindless_textures/README.md @@ -0,0 +1,16 @@ +# Bindless textures +An example project to show usage of bindless descriptor indexing with the VkCV framework + + + +## Details + +The project utilizes a Vulkan extension to access an array of descriptors with arbitrary size. The +size does not need to be known during shader compilation and can be adjusted during runtime when +creating the graphics pipeline. + +## Extensions + +Here is a list of the used extensions: + + - [VK_EXT_descriptor_indexing](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_descriptor_indexing.html) diff --git a/projects/fire_works/README.md b/projects/fire_works/README.md new file mode 100644 index 00000000..0357b60b --- /dev/null +++ b/projects/fire_works/README.md @@ -0,0 +1,11 @@ +# Fire works +An example project to show a particle simulation via compute shader to visualize virtual firework + + + +## Details + +The project uses many different compute shaders to calculate different steps of the particles +lifecycle. Particles can dynamically be spread to different events for explosions on the GPU. The +particles will then be rendered as volumetric smoke and geometric smoke using geometry shader +invocations. diff --git a/projects/first_mesh/README.md b/projects/first_mesh/README.md new file mode 100644 index 00000000..5aec0c29 --- /dev/null +++ b/projects/first_mesh/README.md @@ -0,0 +1,10 @@ +# First mesh +An example project to show a simple mesh can be rendered with the VkCV framework + + + +## Details + +This project is rather a proof of concept to show that rendering a more complex mesh than a single +triangle was indeed possible with the given API. It was used as a benchmark for further API design +changes. diff --git a/projects/first_scene/README.md b/projects/first_scene/README.md new file mode 100644 index 00000000..be333a77 --- /dev/null +++ b/projects/first_scene/README.md @@ -0,0 +1,10 @@ +# First scene +An example project to show a whole scene can be rendered with the VkCV framework + + + +## Details + +Similar to the projects to show rendering a single triangle or a simple mesh was possible. This +project shows that a whole scene can easily be loaded from any GLTF file and be rendered using the +modules from the VkCV framework. diff --git a/projects/first_triangle/README.md b/projects/first_triangle/README.md new file mode 100644 index 00000000..da8cde4e --- /dev/null +++ b/projects/first_triangle/README.md @@ -0,0 +1,9 @@ +# First triangle +An example project to show a triangle can be rendered with the VkCV framework + + + +## Details + +This project was the first step of the development to this framework. It was the proof of concept +the designed API can work to reduce the required overhead code for applications using Vulkan. diff --git a/projects/head_demo/README.md b/projects/head_demo/README.md new file mode 100644 index 00000000..c9b0bebc --- /dev/null +++ b/projects/head_demo/README.md @@ -0,0 +1,11 @@ +# Head demo +An example project to show how the VkCV framework could be used for medical applications + + + +## Details + +This project renders a mesh from a human skull by [HannahNewey](https://sketchfab.com/HannahNewey) +and splits the rendering on three axes into diffusive shading and drawing the vertices as point +cloud. In a similar way you could visualize different layers of a human body to make a specific +part the visual focus without blending the layers above completely away. diff --git a/projects/head_demo/src/main.cpp b/projects/head_demo/src/main.cpp index e96f22eb..b3ed708e 100644 --- a/projects/head_demo/src/main.cpp +++ b/projects/head_demo/src/main.cpp @@ -5,7 +5,6 @@ #include <GLFW/glfw3.h> #include <vkcv/camera/CameraManager.hpp> #include <vkcv/gui/GUI.hpp> -#include <chrono> #include <vkcv/asset/asset_loader.hpp> #include <vkcv/shader/GLSLCompiler.hpp> #include <vkcv/scene/Scene.hpp> @@ -13,7 +12,7 @@ #include <vkcv/upscaling/FSRUpscaling.hpp> int main(int argc, const char** argv) { - const std::string applicationName = "First Scene"; + const std::string applicationName = "Head Demo"; uint32_t windowWidth = 800; uint32_t windowHeight = 600; diff --git a/projects/indirect_dispatch/README.md b/projects/indirect_dispatch/README.md new file mode 100644 index 00000000..675e61d4 --- /dev/null +++ b/projects/indirect_dispatch/README.md @@ -0,0 +1,10 @@ +# Indirect dispatch +An example project to show usage of indirect compute shader dispatching + + + +## Details + +The project shows off indirect dispatching of compute shaders for an implementation of motion +blur. Additionally, the calculated motion vectors for the motion blur can be used for temporal +upscaling techniques such as FSR2. diff --git a/projects/indirect_draw/README.md b/projects/indirect_draw/README.md new file mode 100644 index 00000000..06c74837 --- /dev/null +++ b/projects/indirect_draw/README.md @@ -0,0 +1,17 @@ +# Indirect draw +An example project to show usage of indirect draw calls + + + +## Details + +The project utilizes multiple Vulkan extensions to access to make indirect draw calls which can be +modified on the GPU from within compute shaders. This will be used to cull the rendered scene on +the GPU instead of (potentially) more expensive frustum culling on the CPU. + +## Extensions + +Here is a list of the used extensions: + + - [VK_KHR_shader_draw_parameters](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_shader_draw_parameters.html) + - [VK_EXT_descriptor_indexing](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_descriptor_indexing.html) diff --git a/projects/mesh_shader/README.md b/projects/mesh_shader/README.md new file mode 100644 index 00000000..5d789a63 --- /dev/null +++ b/projects/mesh_shader/README.md @@ -0,0 +1,24 @@ +# Mesh shader +An example project to show usage of mesh shaders with the VkCV framework + + + +## Details + +The project utilizes a Vulkan extension to use hardware accelerated mesh shaders. Those mesh +shaders can replace the usual vertex-, tessellation- and geometry-shader stages in the graphics +pipeline. They also act more similar to compute shaders. + +The application uses those mesh shaders to cull a rendered mesh into individual groups of triangles +which are called meshlets in this context. + +The project currently uses the Nvidia GPU exclusive extension for mesh shading but it could be +adjusted to use the cross compatible extension +"[VK_EXT_mesh_shader](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_mesh_shader.html)" +instead. + +## Extensions + +Here is a list of the used extensions: + +- [VK_NV_mesh_shader](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_mesh_shader.html) diff --git a/projects/wobble_bobble/.gitignore b/projects/mpm/.gitignore similarity index 100% rename from projects/wobble_bobble/.gitignore rename to projects/mpm/.gitignore diff --git a/projects/wobble_bobble/CMakeLists.txt b/projects/mpm/CMakeLists.txt similarity index 100% rename from projects/wobble_bobble/CMakeLists.txt rename to projects/mpm/CMakeLists.txt diff --git a/projects/mpm/README.md b/projects/mpm/README.md new file mode 100644 index 00000000..2b3a8f0c --- /dev/null +++ b/projects/mpm/README.md @@ -0,0 +1,11 @@ +# MPM +An example project to show the implementation of an MPM soft-body simulation with the VkCV framework + + + +## Details + +The project shows off an example implementation of an MPM simulation which are widely used +in computer graphics to simulate the behavior of solids, liquids or gases. It utilizes the discrete +representation of objects as combined particles as well as a discrete grid of data. Together both +representations help to stabilize the result while providing as much detail as possible. diff --git a/projects/wobble_bobble/shaders/.gitignore b/projects/mpm/shaders/.gitignore similarity index 100% rename from projects/wobble_bobble/shaders/.gitignore rename to projects/mpm/shaders/.gitignore diff --git a/projects/wobble_bobble/shaders/grid.frag b/projects/mpm/shaders/grid.frag similarity index 100% rename from projects/wobble_bobble/shaders/grid.frag rename to projects/mpm/shaders/grid.frag diff --git a/projects/wobble_bobble/shaders/grid.vert b/projects/mpm/shaders/grid.vert similarity index 100% rename from projects/wobble_bobble/shaders/grid.vert rename to projects/mpm/shaders/grid.vert diff --git a/projects/wobble_bobble/shaders/init_particle_weights.comp b/projects/mpm/shaders/init_particle_weights.comp similarity index 100% rename from projects/wobble_bobble/shaders/init_particle_weights.comp rename to projects/mpm/shaders/init_particle_weights.comp diff --git a/projects/wobble_bobble/shaders/lines.frag b/projects/mpm/shaders/lines.frag similarity index 100% rename from projects/wobble_bobble/shaders/lines.frag rename to projects/mpm/shaders/lines.frag diff --git a/projects/wobble_bobble/shaders/lines.vert b/projects/mpm/shaders/lines.vert similarity index 100% rename from projects/wobble_bobble/shaders/lines.vert rename to projects/mpm/shaders/lines.vert diff --git a/projects/wobble_bobble/shaders/particle.frag b/projects/mpm/shaders/particle.frag similarity index 100% rename from projects/wobble_bobble/shaders/particle.frag rename to projects/mpm/shaders/particle.frag diff --git a/projects/wobble_bobble/shaders/particle.inc b/projects/mpm/shaders/particle.inc similarity index 100% rename from projects/wobble_bobble/shaders/particle.inc rename to projects/mpm/shaders/particle.inc diff --git a/projects/wobble_bobble/shaders/particle.vert b/projects/mpm/shaders/particle.vert similarity index 100% rename from projects/wobble_bobble/shaders/particle.vert rename to projects/mpm/shaders/particle.vert diff --git a/projects/wobble_bobble/shaders/transform_particles_to_grid.comp b/projects/mpm/shaders/transform_particles_to_grid.comp similarity index 100% rename from projects/wobble_bobble/shaders/transform_particles_to_grid.comp rename to projects/mpm/shaders/transform_particles_to_grid.comp diff --git a/projects/wobble_bobble/shaders/update_particle_velocities.comp b/projects/mpm/shaders/update_particle_velocities.comp similarity index 100% rename from projects/wobble_bobble/shaders/update_particle_velocities.comp rename to projects/mpm/shaders/update_particle_velocities.comp diff --git a/projects/wobble_bobble/src/main.cpp b/projects/mpm/src/main.cpp similarity index 99% rename from projects/wobble_bobble/src/main.cpp rename to projects/mpm/src/main.cpp index da7dbfa4..61f27daa 100644 --- a/projects/wobble_bobble/src/main.cpp +++ b/projects/mpm/src/main.cpp @@ -281,7 +281,7 @@ vkcv::BufferHandle resetParticles(vkcv::Core& core, size_t count, const glm::vec } int main(int argc, const char **argv) { - const std::string applicationName = "Wobble Bobble"; + const std::string applicationName = "MPM"; uint32_t windowWidth = 800; uint32_t windowHeight = 600; diff --git a/projects/particle_simulation/README.md b/projects/particle_simulation/README.md new file mode 100644 index 00000000..74163ca0 --- /dev/null +++ b/projects/particle_simulation/README.md @@ -0,0 +1,20 @@ +# Particle simulation +An example project to show thousands of particles can be simulated with the VkCV framework + + + + + +## Details + +Similar to the projects to show rendering a single triangle or a simple mesh was possible. This +project shows that many particles can be simulated using compute shaders and rendered using the +usual graphics pipeline, all with the VkCV framework. + +The behavior of the particles can easily be adjusted loading a different compute shader. That is +the reason the application can be started with three different pipelines using one of those +parameters: + + - `--space` to simulate particles flying around in a wild way through space + - `--water` to simulate particles dropping down like a waterfall to the ground + - `--gravity` to simulate particles being drawn by points of gravity in space flying around those points diff --git a/projects/particle_simulation/src/main.cpp b/projects/particle_simulation/src/main.cpp index 7f9e9fb7..7e48d53e 100644 --- a/projects/particle_simulation/src/main.cpp +++ b/projects/particle_simulation/src/main.cpp @@ -52,7 +52,7 @@ int main(int argc, const char **argv) { shaderPathFragment = "shaders/shader_space.frag"; } else if (strcmp(argv[i], "--water") == 0) { - shaderPathCompute = "shaders/shader_water1.comp"; + shaderPathCompute = "shaders/shader_water.comp"; shaderPathFragment = "shaders/shader_water.frag"; } else if (strcmp(argv[i], "--gravity") == 0) { diff --git a/projects/path_tracer/README.md b/projects/path_tracer/README.md new file mode 100644 index 00000000..0ff2970b --- /dev/null +++ b/projects/path_tracer/README.md @@ -0,0 +1,10 @@ +# Path tracer +An example project to show the implementation of a path tracer with the VkCV framework + + + +## Details + +The project shows off an example implementation of a path tracer using compute shaders to render +a physically plausible image given an artificial subset of materials. The path tracer uses a +converging technique to reduce the noise of the image iteratively. diff --git a/projects/ray_tracer/.gitignore b/projects/ray_tracer/.gitignore new file mode 100644 index 00000000..b9f0cf28 --- /dev/null +++ b/projects/ray_tracer/.gitignore @@ -0,0 +1 @@ +ray_tracer \ No newline at end of file diff --git a/projects/ray_tracer/CMakeLists.txt b/projects/ray_tracer/CMakeLists.txt new file mode 100644 index 00000000..8c8d80b4 --- /dev/null +++ b/projects/ray_tracer/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.16) +project(ray_tracer) + +# setting c++ standard for the project +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# adding source files to the project +add_project(ray_tracer src/main.cpp "src/scene.hpp") + +# including headers of dependencies and the VkCV framework +target_include_directories(ray_tracer SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_testing_include} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include}) + +# linking with libraries from all dependencies and the VkCV framework +target_link_libraries(ray_tracer vkcv vkcv_testing vkcv_asset_loader ${vkcv_asset_loader_libraries} vkcv_camera vkcv_shader_compiler) diff --git a/projects/ray_tracer/README.md b/projects/ray_tracer/README.md new file mode 100644 index 00000000..69094cb9 --- /dev/null +++ b/projects/ray_tracer/README.md @@ -0,0 +1,11 @@ +# Ray tracer +An example project to show the implementation of a ray tracer with the VkCV framework + + + +## Details + +The project shows off an example implementation of a ray tracer using compute shaders to render +an image containing abstract geometry and materials with different properties. The ray tracer +limits the maximal depth to allow highly detailed reflections without getting too slow for +realtime use. diff --git a/projects/saf_r/shaders/raytracing.comp b/projects/ray_tracer/shaders/raytracing.comp similarity index 100% rename from projects/saf_r/shaders/raytracing.comp rename to projects/ray_tracer/shaders/raytracing.comp diff --git a/projects/saf_r/src/main.cpp b/projects/ray_tracer/src/main.cpp similarity index 84% rename from projects/saf_r/src/main.cpp rename to projects/ray_tracer/src/main.cpp index 35b4737d..fadbadc2 100644 --- a/projects/saf_r/src/main.cpp +++ b/projects/ray_tracer/src/main.cpp @@ -13,14 +13,14 @@ #include <cstring> #include <GLFW/glfw3.h> -#include "safrScene.hpp" +#include "scene.hpp" -void createQuadraticLightCluster(std::vector<safrScene::Light>& lights, int countPerDimension, float dimension, float height, float intensity) { +void createQuadraticLightCluster(std::vector<scene::Light>& lights, int countPerDimension, float dimension, float height, float intensity) { float distance = dimension/countPerDimension; for(int x = 0; x <= countPerDimension; x++) { for (int z = 0; z <= countPerDimension; z++) { - lights.push_back(safrScene::Light(glm::vec3(x * distance, height, z * distance), + lights.push_back(scene::Light(glm::vec3(x * distance, height, z * distance), float (intensity/countPerDimension) / 10.f) // Divide by 10, because intensity is busting O.o ); } @@ -29,7 +29,7 @@ void createQuadraticLightCluster(std::vector<safrScene::Light>& lights, int coun } int main(int argc, const char** argv) { - const std::string applicationName = "SAF_R"; + const std::string applicationName = "Ray tracer"; //window creation const int windowWidth = 800; @@ -75,26 +75,26 @@ int main(int argc, const char** argv) { */ //materials for the spheres - std::vector<safrScene::Material> materials; - safrScene::Material ivory(glm::vec4(0.6, 0.3, 0.1, 0.0), glm::vec3(0.4, 0.4, 0.3), 50., 1.0); - safrScene::Material red_rubber(glm::vec4(0.9, 0.1, 0.0, 0.0), glm::vec3(0.3, 0.1, 0.1), 10., 1.0); - safrScene::Material mirror( glm::vec4(0.0, 10.0, 0.8, 0.0), glm::vec3(1.0, 1.0, 1.0), 1425., 1.0); - safrScene::Material glass( glm::vec4(0.0, 10.0, 0.8, 0.0), glm::vec3(1.0, 1.0, 1.0), 1425., 1.5); + std::vector<scene::Material> materials; + scene::Material ivory(glm::vec4(0.6, 0.3, 0.1, 0.0), glm::vec3(0.4, 0.4, 0.3), 50., 1.0); + scene::Material red_rubber(glm::vec4(0.9, 0.1, 0.0, 0.0), glm::vec3(0.3, 0.1, 0.1), 10., 1.0); + scene::Material mirror(glm::vec4(0.0, 10.0, 0.8, 0.0), glm::vec3(1.0, 1.0, 1.0), 1425., 1.0); + scene::Material glass(glm::vec4(0.0, 10.0, 0.8, 0.0), glm::vec3(1.0, 1.0, 1.0), 1425., 1.5); materials.push_back(ivory); materials.push_back(red_rubber); materials.push_back(mirror); //spheres for the scene - std::vector<safrScene::Sphere> spheres; - spheres.push_back(safrScene::Sphere(glm::vec3(-3, 0, -16), 2, ivory)); + std::vector<scene::Sphere> spheres; + spheres.push_back(scene::Sphere(glm::vec3(-3, 0, -16), 2, ivory)); //spheres.push_back(safrScene::Sphere(glm::vec3(-1.0, -1.5, 12), 2, mirror)); - spheres.push_back(safrScene::Sphere(glm::vec3(-1.0, -1.5, -12), 2, glass)); - spheres.push_back(safrScene::Sphere(glm::vec3( 1.5, -0.5, -18), 3, red_rubber)); - spheres.push_back(safrScene::Sphere(glm::vec3( 7, 5, -18), 4, mirror)); + spheres.push_back(scene::Sphere(glm::vec3(-1.0, -1.5, -12), 2, glass)); + spheres.push_back(scene::Sphere(glm::vec3(1.5, -0.5, -18), 3, red_rubber)); + spheres.push_back(scene::Sphere(glm::vec3(7, 5, -18), 4, mirror)); //lights for the scene - std::vector<safrScene::Light> lights; + std::vector<scene::Light> lights; /* lights.push_back(safrScene::Light(glm::vec3(-20, 20, 20), 1.5)); lights.push_back(safrScene::Light(glm::vec3(30, 50, -25), 1.8)); @@ -105,14 +105,14 @@ int main(int argc, const char** argv) { vkcv::SamplerHandle sampler = vkcv::samplerLinear(core); //create Buffer for compute shader - vkcv::Buffer<safrScene::Light> lightsBuffer = vkcv::buffer<safrScene::Light>( + vkcv::Buffer<scene::Light> lightsBuffer = vkcv::buffer<scene::Light>( core, vkcv::BufferType::STORAGE, lights.size() ); lightsBuffer.fill(lights); - vkcv::Buffer<safrScene::Sphere> sphereBuffer = vkcv::buffer<safrScene::Sphere>( + vkcv::Buffer<scene::Sphere> sphereBuffer = vkcv::buffer<scene::Sphere>( core, vkcv::BufferType::STORAGE, spheres.size() diff --git a/projects/saf_r/src/safrScene.hpp b/projects/ray_tracer/src/scene.hpp similarity index 98% rename from projects/saf_r/src/safrScene.hpp rename to projects/ray_tracer/src/scene.hpp index fc149a7b..be1cee22 100644 --- a/projects/saf_r/src/safrScene.hpp +++ b/projects/ray_tracer/src/scene.hpp @@ -10,7 +10,7 @@ #include <vector> #include <string.h> // memcpy(3) -class safrScene { +class scene { public: diff --git a/projects/rtx_ambient_occlusion/README.md b/projects/rtx_ambient_occlusion/README.md new file mode 100644 index 00000000..d9fd98cf --- /dev/null +++ b/projects/rtx_ambient_occlusion/README.md @@ -0,0 +1,25 @@ +# RTX ambient occlusion +An example project to show usage of hardware accelerated ray tracing with the VkCV framework + + + +## Details + +The project utilizes multiple Vulkan extensions to make use of hardware accelerated ray tracing. +Newer GPU architectures provide special hardware to allow the use of acceleration structures and +ray tracing pipelines. This application uses those features to render an implementation of +ambient occlusion in realtime. + +## Extensions + +Here is a list of the used extensions: + +- [VK_KHR_get_physical_device_properties2](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_get_physical_device_properties2.html) +- [VK_KHR_maintenance3](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance3.html) +- [VK_KHR_deferred_host_operations](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_deferred_host_operations.html) +- [VK_KHR_spirv_1_4](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_spirv_1_4.html) +- [VK_KHR_pipeline_library](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_pipeline_library.html) +- [VK_EXT_descriptor_indexing](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_descriptor_indexing.html) +- [VK_KHR_buffer_device_address](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_buffer_device_address.html) +- [VK_KHR_acceleration_structure](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_acceleration_structure.html) +- [VK_KHR_ray_tracing_pipeline](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_ray_tracing_pipeline.html) diff --git a/projects/saf_r/.gitignore b/projects/saf_r/.gitignore deleted file mode 100644 index ff3dff30..00000000 --- a/projects/saf_r/.gitignore +++ /dev/null @@ -1 +0,0 @@ -saf_r \ No newline at end of file diff --git a/projects/saf_r/CMakeLists.txt b/projects/saf_r/CMakeLists.txt deleted file mode 100644 index ca315a2d..00000000 --- a/projects/saf_r/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(saf_r) - -# setting c++ standard for the project -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -# adding source files to the project -add_project(saf_r src/main.cpp "src/safrScene.hpp") - -# including headers of dependencies and the VkCV framework -target_include_directories(saf_r SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_testing_include} ${vkcv_asset_loader_include} ${vkcv_camera_include} ${vkcv_shader_compiler_include}) - -# linking with libraries from all dependencies and the VkCV framework -target_link_libraries(saf_r vkcv vkcv_testing vkcv_asset_loader ${vkcv_asset_loader_libraries} vkcv_camera vkcv_shader_compiler) diff --git a/projects/sph/README.md b/projects/sph/README.md new file mode 100644 index 00000000..90e04529 --- /dev/null +++ b/projects/sph/README.md @@ -0,0 +1,10 @@ +# SPH +An example project to show the implementation of an SPH fluid simulation with the VkCV framework + + + +## Details + +The project shows off an example implementation of an SPH fluid simulation which are widely used +in computer graphics to simulate the behavior of fluids with a discrete amount of particles. The +implementation is able to run in realtime allowing interactive use. diff --git a/projects/voxelization/README.md b/projects/voxelization/README.md new file mode 100644 index 00000000..569b911a --- /dev/null +++ b/projects/voxelization/README.md @@ -0,0 +1,21 @@ +# Voxelization +An example project to show a volumetric global illumination technique with the VkCV framework + + + +## Details + +The project utilizes multiple Vulkan extensions (some of them optionally) to implement multiple +graphics effects in an advanced visualization of a whole scene. Together this brings visual +features like shadow maps, indirect lighting via discrete voxels and multiple post-processing +effects like bloom and lens-flares to the screen. To make all of this available in realtime even +on low powered hardware, it is possible to utilize multiple different upscaling methods. + +## Extensions + +Here is a list of the used extensions: + +- [VK_EXT_descriptor_indexing](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_descriptor_indexing.html) +- [VK_KHR_shader_subgroup_extended_types](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_shader_subgroup_extended_types.html) +- [VK_KHR_shader_float16_int8](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_shader_float16_int8.html) +- [VK_KHR_16bit_storage](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_16bit_storage.html) diff --git a/screenshots/bindless_textures.png b/screenshots/bindless_textures.png new file mode 100644 index 00000000..e25ed64c --- /dev/null +++ b/screenshots/bindless_textures.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffc3bb769bd6ed17520ed0ee5e055246b2f8769451ef79bc9bd2d08aa064f50a +size 181594 diff --git a/screenshots/fire_works.png b/screenshots/fire_works.png new file mode 100644 index 00000000..79dcf386 --- /dev/null +++ b/screenshots/fire_works.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31aeb780a731731c8c680e10c8d3336921881b0ae6f3cff575c71af834b8bd5b +size 282503 diff --git a/screenshots/first_mesh.png b/screenshots/first_mesh.png new file mode 100644 index 00000000..980baafb --- /dev/null +++ b/screenshots/first_mesh.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f585b69b4f5c517d5f44c5eefa5cf2324d2cd58ee0e215135b824926377bfd61 +size 190960 diff --git a/screenshots/first_scene.png b/screenshots/first_scene.png new file mode 100644 index 00000000..3ac8147b --- /dev/null +++ b/screenshots/first_scene.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bce66f549f154b5d5ad20d6fcb633e62d0e9a1d62889d148bf6e73d46287edc +size 1185543 diff --git a/screenshots/first_triangle.png b/screenshots/first_triangle.png new file mode 100644 index 00000000..7eda745a --- /dev/null +++ b/screenshots/first_triangle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82577075fbbcc774b08cccdcace4cc1ab94e10e135f176091faadcb089047c3f +size 20840 diff --git a/screenshots/head_demo.png b/screenshots/head_demo.png new file mode 100644 index 00000000..4fb51ce5 --- /dev/null +++ b/screenshots/head_demo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd4beee1709a1f4b85537b7d951b06b1cdf27ea1c00c73cea5a8b8b261bd11b6 +size 438783 diff --git a/screenshots/indirect_dispatch.png b/screenshots/indirect_dispatch.png new file mode 100644 index 00000000..196a28a8 --- /dev/null +++ b/screenshots/indirect_dispatch.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6b64f1ca2fe9ab5324be8917c1a36fdf2efb83d46a83dee5c1200ca51479096 +size 795319 diff --git a/screenshots/indirect_draw.png b/screenshots/indirect_draw.png new file mode 100644 index 00000000..13f0aaf3 --- /dev/null +++ b/screenshots/indirect_draw.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f37958116905dd90f57326f78e086a4b2739424e850c49439421d0986dd4454f +size 2353039 diff --git a/screenshots/mesh_shader.png b/screenshots/mesh_shader.png new file mode 100644 index 00000000..bf9fe85f --- /dev/null +++ b/screenshots/mesh_shader.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37049cc8301eea437be01d6f485553b96e8961b2bd63d1ade7d0b2be3c17d5d4 +size 39343 diff --git a/screenshots/mpm.png b/screenshots/mpm.png new file mode 100644 index 00000000..bf8e1722 --- /dev/null +++ b/screenshots/mpm.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3443fe0eee59cc56f0b675704b1f4c7dc94eb1ede1ce6af7866bcd85c52b816 +size 36964 diff --git a/screenshots/particle_simulation_gravity.png b/screenshots/particle_simulation_gravity.png new file mode 100644 index 00000000..88e39c11 --- /dev/null +++ b/screenshots/particle_simulation_gravity.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47e8b6d364a696fb011a9fabc888b29031a2c54f0a0e4418b09ba6c2b40557e2 +size 721671 diff --git a/screenshots/particle_simulation_space.png b/screenshots/particle_simulation_space.png new file mode 100644 index 00000000..81ba7839 --- /dev/null +++ b/screenshots/particle_simulation_space.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bd48bab2359e3f819d702012a4adde9699a3a093d96f4980edd9d7eed84379d +size 541571 diff --git a/screenshots/particle_simulation_water.png b/screenshots/particle_simulation_water.png new file mode 100644 index 00000000..46bc5b6a --- /dev/null +++ b/screenshots/particle_simulation_water.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c8d3262556252815f922e37eae809c727eed3870c05a2aaedf0b651dc61b7f9 +size 587136 diff --git a/screenshots/path_tracer.png b/screenshots/path_tracer.png new file mode 100644 index 00000000..154e7b1a --- /dev/null +++ b/screenshots/path_tracer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e331aabbd5947b7b62d6762e3087ee2c2be18e2b53005f2eca77be9d80c183e9 +size 1547130 diff --git a/screenshots/ray_tracer.png b/screenshots/ray_tracer.png new file mode 100644 index 00000000..71041d94 --- /dev/null +++ b/screenshots/ray_tracer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c39817e4eec1dd7661d76a539670699df9caaf64c077bff6b1430b57ac99bc54 +size 62317 diff --git a/screenshots/rtx_ambient_occlusion.png b/screenshots/rtx_ambient_occlusion.png new file mode 100644 index 00000000..87c2471d --- /dev/null +++ b/screenshots/rtx_ambient_occlusion.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0df2a044b9ccc69ad221a0421ae3c79ff94b72eda7773625a26a000855592545 +size 50286 diff --git a/screenshots/sph.png b/screenshots/sph.png new file mode 100644 index 00000000..3a4fd8bf --- /dev/null +++ b/screenshots/sph.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d238d48ffcfe1e28b73811d4d2bfea8ca3d2c23cf12e1b3ac9d095a8f7930384 +size 312081 diff --git a/screenshots/voxelization.png b/screenshots/voxelization.png new file mode 100644 index 00000000..88060119 --- /dev/null +++ b/screenshots/voxelization.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:946ae03143eaeb5d202dafbaa30e560427a3e887e8c3fddb6852e5c8c5c031ac +size 3060521 -- GitLab