Jackalope / jen (public) (License: GPLv3 or later version) (since 2018-10-24) (hash sha1)
----> ABOUT:

3D rendering and computing framework based on Vulkan API.

Libraries:
- simdcpp submodule (see my simdcpp repo)
- jmath submodule (see my jmath repo)
- mesh (constexpr generation of cubes, spheres, icosahedrons subdivisions)
- atlas (1D lines and 2D rectangles cutting)
- jlib submodule (see my jlib repo)
- jrf submodule (see my jrf repo)
- vkw (Vulkan API C++ wrapper)
Modules:
- compute (run compute shaders on gpu)
- graphics (draw models with clustered forward rendering and onscreen text)
- resource manager (load meshes, models, textures, scene data from
files and create related objects in graphics module)

----> INSTALLING:

To download all the parts of this framework it's enough to launch
git clone with recursive flag:

$ git clone —recursive ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/jen

After this look at git tags:

$ git tag

It is recommended to use a tagged version instead of the latest commit,
because the first commit after the tagged one mostly includes incompatible
parts of future changes for the next version.

$ git checkout v0.1.0

----> DEPENDENCIES:

To use JEN as CMake subdirectory and successfully build programs with it
you need to make sure you have all of its dependencies:
- compiler: Clang or GCC, support for C++17. Clang 10+ or GCC 9+ is recommended,
compiling on Windows OS is tricky and requires something like MinGW with MSYS,
there are also some complications to go through to make dependencies work;
- GLFW3 library, supported version is 3.2.1;
- FreeType library, if graphics module will be used;
- Vulkan API headers, and optional validation layers to debug sneaky problems,
you also need Vulkan support in your graphics driver to run compiled programs;
- LibZip can be necessary, if JRF is used to read zip files;
- CMake, for obvious reasons;
- glslangValidator to compile shader for the graphics module.

CMake must be able to find GLFW3, Vulkan and FreeType (for graphics)
with find_package().

----> HOW TO USE IT:

To use JEN, you need to add it as a subdirectory:

add_subdirecroty(${PATH_TO_JEN})

There are several configuration options:
- JEN_MODULE_COMPUTE - turn compute module on for compiling and including;
- JEN_MODULE_GRAPHICS - turn graphics module on ...;
- JEN_MULTITHREADED_DRAW_FRAME - draw_frame function will use thread pool queue
instead of linear executing;
- JEN_MODULE_RESOURCE_MANAGER - resource manager module ON, if graphics is ON;
- JEN_VLK_VALIDATION - enable Vulkan Validation Layers to debug some errors
related to JEN. This will often produce false-positive,
as well as true-positive errors.

Look in CMakeLists.txt at JenExamples repo for details on how to use and
configure JEN automatically:

$ git clone ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/JenExamples

Also I recommend to compile and run examples to make sure it works correctly.

----> SUPPORTED HARDWARE:

JEN has not been tested well, because it requires running it on large amount of
different hardware to do so. It must work with mesa driver and modern
Intel i965 GPUs as well as AMD GPUs.


----> DOCUMENTATION:

You can generate Doxygen documentation, to do so
turn on any of JEN_DOXYGEN_* options and run documentation target in cmake:

$ cmake -G %1 -DJEN_DOXYGEN_HTML=ON -DJEN_DOXYGEN_LATEX=ON
$ cmake —build —target documentation

Resource manager is not documented because it still requires large enhancements.
List of commits:
Subject Hash Author Date (UTC)
Automated shaders compilation with cmake, no more binaries in git efa9657336852c3543221bc56f4121f698f26044 Jackalope 2020-05-16 13:07:12
Compute process bug fix: correctly fences reset and removed reference to temporary c30b7bf737890cc3a23022c5c5470225bb324443 Jackalope 2020-05-16 07:00:15
pass shader specialization by constant refference 9e14c11e60d709d374f71aec393d28377b1525d2 Jackalope 2020-05-15 12:45:06
Added second template argument for white noise to support custom hash function. 9a714ad51903e35d158ff285fc6e1f517e7100c0 TheArtOfGriefing 2020-05-15 12:22:08
Added shadow map commads fence 447a75b3124eae48d64bf3646df90a7db1adcc57 Jackalope 2020-05-13 09:38:49
Fixed bug with timeline semaphores 08be9cf8af7d32c460fc77ca7c5b0a25976a6d79 Jackalope 2020-05-13 08:21:33
added pipeline cache, refactoring of pipeline stages af2d7d18e63fdeaaec3ca7d92a8f02b107358f27 Jackalope 2020-05-13 08:35:26
window unititialized values fix d9f6249e63550b07d932887c37a233182e7740af Jackalope 2020-05-13 04:21:26
added project information to cmake 2db949aaf90729d4226511773815eb19a314dc35 Jackalope 2020-05-12 18:42:50
Improved cmake scripts c38f2da172d553d519f0cee5d9b6b3f904234806 Jackalope 2020-05-12 07:02:26
license added c72e7e36f528ca69e96e970acf1e732734621f63 Jackalope 2020-05-12 05:25:34
Doxygen documentation improvements 5e8201cd9a74707457ae97a10bed6681d091f10e Jackalope 2020-05-11 23:49:58
added Button state helper 15729a25a75a73f464b33e7f17d6cc7f609a3eb1 Jackalope 2020-05-11 09:05:05
bug fixes 504ff4b14e1b5a1b0cd21b10d7d867596b5b5ada Jackalope 2020-05-11 08:29:03
fixed issues with mesh lib 92c9562548dffacefaff5daadd1e39504810a633 Jackalope 2020-05-11 08:16:40
jrf update, added 2 formats to gpu_transfer b88f688303205c2e44078220f858761b84de045c Jackalope 2020-05-11 07:51:30
Doxygen documentation 34da4d6ff049e1315d58a34d8b42306dca16d89d Jackalope 2020-05-11 03:49:22
jlib update c4e0f05cd2479b8da334cd681337771dc579899d Jackalope 2020-05-09 23:32:14
math libriary update (renamed to jmath) 44798c932745bd021f5c11d018d09a055a7a1903 Jackalope 2020-05-09 19:18:59
moved window to jen namespace, moved settings update to settings member function 1541c40679cfc28f2d0f173499196f458a11f952 Jackalope 2020-05-09 17:07:23
Commit efa9657336852c3543221bc56f4121f698f26044 - Automated shaders compilation with cmake, no more binaries in git
Author: Jackalope
Author date (UTC): 2020-05-16 13:07
Committer name: Jackalope
Committer date (UTC): 2020-05-16 13:08
Parent(s): c30b7bf737890cc3a23022c5c5470225bb324443
Signer:
Signing key:
Signing status: N
Tree: ab507230ce5d67fc4f39a17e41e860152c2cf2e2
File Lines added Lines deleted
CMakeLists.txt 1 1
resources/shaders/CMakeLists.txt 35 22
resources/shaders/bin/composition/fragment.spv 0 0
resources/shaders/bin/composition/vertex.spv 0 0
resources/shaders/bin/debug_depth_cube_frag.spv 0 0
resources/shaders/bin/debug_depth_cube_vert.spv 0 0
resources/shaders/bin/debug_normals_frag.spv 0 0
resources/shaders/bin/debug_normals_geom.spv 0 0
resources/shaders/bin/debug_normals_vert.spv 0 0
resources/shaders/bin/fonts/fragment.spv 0 0
resources/shaders/bin/fonts/vertex.spv 0 0
resources/shaders/bin/fragment_default.spv 0 0
resources/shaders/bin/fragment_terrain.spv 0 0
resources/shaders/bin/shadow_cube_frag.spv 0 0
resources/shaders/bin/shadow_cube_geom.spv 0 0
resources/shaders/bin/shadow_cube_vert.spv 0 0
resources/shaders/bin/vertex_default.spv 0 0
resources/shaders/bin/vertex_terrain.spv 0 0
resources/shaders/compile.sh 0 22
src/graphics/draw_stages/composition/composition.h 2 2
src/graphics/draw_stages/fonts/fonts.h 2 2
src/graphics/draw_stages/offscreen/offscreen.h 4 4
File CMakeLists.txt changed (mode: 100644) (index f004471..3d4c6c8)
... ... set(JEN_COMPILE_OPTIONS ${JEN_COMPILE_OPTIONS}
56 56 -Wno-missing-braces -Wno-missing-braces
57 57 ) )
58 58
59 add_subdirectory(resources/shaders)
60 59 add_subdirectory(libs/simdcpp) add_subdirectory(libs/simdcpp)
61 60 add_subdirectory(libs/math) add_subdirectory(libs/math)
62 61 add_subdirectory(libs/jlib) add_subdirectory(libs/jlib)
 
... ... add_subdirectory(libs/vkw)
66 65
67 66 set(JEN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) set(JEN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
68 67 add_subdirectory(src) add_subdirectory(src)
68 add_subdirectory(resources/shaders)
69 69
70 70 target_compile_options(JEN PRIVATE ${JEN_COMPILE_OPTIONS}) target_compile_options(JEN PRIVATE ${JEN_COMPILE_OPTIONS})
71 71
File resources/shaders/CMakeLists.txt changed (mode: 100644) (index b2caf37..1c77436)
14 14 # #
15 15 # You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
16 16 # along with this library. If not, see <https://www.gnu.org/licenses/> # along with this library. If not, see <https://www.gnu.org/licenses/>
17
18 17 cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
19 18
19 set(SPIRV_COMPILER "glslangValidator" CACHE
20 STRING "Path to glslangValidator, compiler from GLSL to SPIR-V")
20 21 set(DST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/shaders) set(DST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/shaders)
21 22
22 configure_file(bin/debug_normals_vert.spv ${DST}/debug_normals_vert.spv COPYONLY)
23 configure_file(bin/debug_normals_geom.spv ${DST}/debug_normals_geom.spv COPYONLY)
24 configure_file(bin/debug_normals_frag.spv ${DST}/debug_normals_frag.spv COPYONLY)
25
26 configure_file(bin/fragment_default.spv ${DST}/fragment_default.spv COPYONLY)
27 configure_file(bin/vertex_default.spv ${DST}/vertex_default.spv COPYONLY)
28
29 configure_file(bin/shadow_cube_vert.spv ${DST}/shadow_cube_vert.spv COPYONLY)
30 configure_file(bin/shadow_cube_geom.spv ${DST}/shadow_cube_geom.spv COPYONLY)
31 configure_file(bin/shadow_cube_frag.spv ${DST}/shadow_cube_frag.spv COPYONLY)
32
33 configure_file(bin/debug_depth_cube_vert.spv ${DST}/debug_depth_cube_vert.spv COPYONLY)
34 configure_file(bin/debug_depth_cube_frag.spv ${DST}/debug_depth_cube_frag.spv COPYONLY)
35
36 configure_file(bin/fragment_terrain.spv ${DST}/fragment_terrain.spv COPYONLY)
37 configure_file(bin/vertex_terrain.spv ${DST}/vertex_terrain.spv COPYONLY)
38
39 configure_file(bin/composition/vertex.spv ${DST}/composition/vertex.spv COPYONLY)
40 configure_file(bin/composition/fragment.spv ${DST}/composition/fragment.spv COPYONLY)
41 configure_file(bin/fonts/vertex.spv ${DST}/fonts/vertex.spv COPYONLY)
42 configure_file(bin/fonts/fragment.spv ${DST}/fonts/fragment.spv COPYONLY)
23 function(add_shader_extra NAME FORMAT NAME2 PARAMS)
24 set(SHADER_IN ${NAME}.${FORMAT})
25 set(SHADER_OUT ${NAME}${NAME2}_${FORMAT}.spv)
26 add_custom_command(
27 OUTPUT ${DST}/${SHADER_OUT}
28 COMMAND ${SPIRV_COMPILER} -V ${SHADER_IN} -o ${DST}/${SHADER_OUT} ${PARAMS}
29 DEPENDS ${SHADER_IN}
30 COMMENT "Compiling shader ${SHADER_OUT}"
31 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
32 )
33 add_custom_target(${SHADER_OUT} ALL DEPENDS ${DST}/${SHADER_OUT})
34 add_dependencies(JEN ${SHADER_OUT})
35 endfunction()
36 function(add_shader NAME FORMAT)
37 add_shader_extra(${NAME} ${FORMAT} "" "")
38 endfunction()
39
40 add_shader(debug_normals vert)
41 add_shader(debug_normals geom)
42 add_shader(debug_normals frag)
43 add_shader(default vert)
44 add_shader(default frag)
45 add_shader_extra(default vert "_terrain" "-DMIX_TEXTURES")
46 add_shader_extra(default frag "_terrain" "-DMIX_TEXTURES")
47 add_shader(composition vert)
48 add_shader(composition frag)
49 add_shader(fonts vert)
50 add_shader(fonts frag)
51 add_shader(shadow_cube vert)
52 add_shader(shadow_cube geom)
53 add_shader(shadow_cube frag)
54 add_shader(debug_depth_cube vert)
55 add_shader(debug_depth_cube frag)
File resources/shaders/bin/composition/fragment.spv deleted (index 358b637..0000000)
File resources/shaders/bin/composition/vertex.spv deleted (index 5085215..0000000)
File resources/shaders/bin/debug_depth_cube_frag.spv deleted (index 1d1bf47..0000000)
File resources/shaders/bin/debug_depth_cube_vert.spv deleted (index a2629db..0000000)
File resources/shaders/bin/debug_normals_frag.spv deleted (index e00c592..0000000)
File resources/shaders/bin/debug_normals_geom.spv deleted (index 2ab55c5..0000000)
File resources/shaders/bin/debug_normals_vert.spv deleted (index 75a4541..0000000)
File resources/shaders/bin/fonts/fragment.spv deleted (index 430853b..0000000)
File resources/shaders/bin/fonts/vertex.spv deleted (index d8de4af..0000000)
File resources/shaders/bin/fragment_default.spv deleted (index 7dec4db..0000000)
File resources/shaders/bin/fragment_terrain.spv deleted (index 90d7d4a..0000000)
File resources/shaders/bin/shadow_cube_frag.spv deleted (index bb36e07..0000000)
File resources/shaders/bin/shadow_cube_geom.spv deleted (index 444624d..0000000)
File resources/shaders/bin/shadow_cube_vert.spv deleted (index 334bf61..0000000)
File resources/shaders/bin/vertex_default.spv deleted (index 7f17b48..0000000)
File resources/shaders/bin/vertex_terrain.spv deleted (index 9ae8c45..0000000)
File resources/shaders/compile.sh deleted (index f3b94f8..0000000)
1 #!/usr/bin/env bash
2 glslangValidator -V debug_normals.vert -o bin/debug_normals_vert.spv
3 glslangValidator -V debug_normals.geom -o bin/debug_normals_geom.spv
4 glslangValidator -V debug_normals.frag -o bin/debug_normals_frag.spv
5
6 glslangValidator -V default.vert -o bin/vertex_default.spv
7 glslangValidator -V default.frag -o bin/fragment_default.spv
8
9 glslangValidator -V default.vert -DMIX_TEXTURES -o bin/vertex_terrain.spv
10 glslangValidator -V default.frag -DMIX_TEXTURES -o bin/fragment_terrain.spv
11
12 glslangValidator -V composition.vert -o bin/composition/vertex.spv
13 glslangValidator -V composition.frag -o bin/composition/fragment.spv
14 glslangValidator -V fonts.vert -o bin/fonts/vertex.spv
15 glslangValidator -V fonts.frag -o bin/fonts/fragment.spv
16
17 glslangValidator -V shadow_cube.vert -o bin/shadow_cube_vert.spv
18 glslangValidator -V shadow_cube.geom -o bin/shadow_cube_geom.spv
19 glslangValidator -V shadow_cube.frag -o bin/shadow_cube_frag.spv
20
21 glslangValidator -V debug_depth_cube.vert -o bin/debug_depth_cube_vert.spv
22 glslangValidator -V debug_depth_cube.frag -o bin/debug_depth_cube_frag.spv
File src/graphics/draw_stages/composition/composition.h changed (mode: 100644) (index 9b6e6fa..318c5a7)
... ... struct jen::vk::StageComposition
30 30 update(Device*, PassMain*, vkw::Extent2D); update(Device*, PassMain*, vkw::Extent2D);
31 31 void void
32 32 destroy(vkw::Device, vkw::DescrPool); destroy(vkw::Device, vkw::DescrPool);
33 constexpr static const char SH_VERT[] = "shaders/composition/vertex.spv";
34 constexpr static const char SH_FRAG[] = "shaders/composition/fragment.spv";
33 constexpr static const char SH_VERT[] = "shaders/composition_vert.spv";
34 constexpr static const char SH_FRAG[] = "shaders/composition_frag.spv";
35 35 vkw::Pipeline pipeline; vkw::Pipeline pipeline;
36 36 vkw::PipelineLayout pipeline_layout; vkw::PipelineLayout pipeline_layout;
37 37 DescriptorImageView descriptor; DescriptorImageView descriptor;
File src/graphics/draw_stages/fonts/fonts.h changed (mode: 100644) (index b4d7273..93c8d16)
... ... struct jen::vk::StageFonts
34 34 jm::v2f scale; jm::v2f scale;
35 35 jm::v2f pos; jm::v2f pos;
36 36 }; };
37 constexpr static const char SH_VERT[] = "shaders//fonts//vertex.spv";
38 constexpr static const char SH_FRAG[] = "shaders//fonts//fragment.spv";
37 constexpr static const char SH_VERT[] = "shaders/fonts_vert.spv";
38 constexpr static const char SH_FRAG[] = "shaders/fonts_frag.spv";
39 39 GpuImage<GpuImageMode::SAMP_DESCR> atlas; GpuImage<GpuImageMode::SAMP_DESCR> atlas;
40 40 vkw::Extent2D extent; vkw::Extent2D extent;
41 41 vkw::Pipeline pipeline; vkw::Pipeline pipeline;
File src/graphics/draw_stages/offscreen/offscreen.h changed (mode: 100644) (index 444cc4b..498c4be)
... ... struct jen::vk::StageOffscreen
151 151 TERRAIN_VERT, TERRAIN_FRAG, TERRAIN_VERT, TERRAIN_FRAG,
152 152 DEBUG_NORMALS_VERT, DEBUG_NORMALS_GEOM, DEBUG_NORMALS_FRAG DEBUG_NORMALS_VERT, DEBUG_NORMALS_GEOM, DEBUG_NORMALS_FRAG
153 153 }; };
154 constexpr static const char S_VERT [] = "shaders/vertex_default.spv";
155 constexpr static const char S_FRAG [] = "shaders/fragment_default.spv";
156 constexpr static const char S_VERT_TM[] = "shaders/vertex_terrain.spv";
157 constexpr static const char S_FRAG_TM[] = "shaders/fragment_terrain.spv";
154 constexpr static const char S_VERT [] = "shaders/default_vert.spv";
155 constexpr static const char S_FRAG [] = "shaders/default_frag.spv";
156 constexpr static const char S_VERT_TM[] = "shaders/default_terrain_vert.spv";
157 constexpr static const char S_FRAG_TM[] = "shaders/default_terrain_frag.spv";
158 158 constexpr static const char S_DN_VERT[] = "shaders/debug_normals_vert.spv"; constexpr static const char S_DN_VERT[] = "shaders/debug_normals_vert.spv";
159 159 constexpr static const char S_DN_GEOM[] = "shaders/debug_normals_geom.spv"; constexpr static const char S_DN_GEOM[] = "shaders/debug_normals_geom.spv";
160 160 constexpr static const char S_DN_FRAG[] = "shaders/debug_normals_frag.spv"; constexpr static const char S_DN_FRAG[] = "shaders/debug_normals_frag.spv";
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Jackalope/jen

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/jen

Clone this repository using git:
git clone git://git.rocketgit.com/user/Jackalope/jen

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main