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)
Update jrf-0.3.0 abeec591e143c53f960ab1703c7b4001c72b4061 Jackalope 2020-06-04 21:12:56
Increment version to 0.2.1 6d9b0c9f788e93a2c4a13e4f1792112dca699ca3 Jackalope 2020-06-04 21:30:35
Version 0.2.0 d6d2564a42613aa4eb64ab623226717cdf0fd5c2 Jackalope 2020-06-01 13:17:28
JEN_NATIVE option. Better build type flags selection. b77b104ecd4aa47553941cf6bcf9531176bbdc5c Jackalope 2020-06-01 13:17:19
Compilation fixes. 49eec7c7159bbc58dd899cef498beeec2b965e32 Jackalope 2020-06-01 12:42:03
Remove debug overlay from framework settings, instead load on request. 33c0b44a748570c1c8dcce58794fdac21d517156 Jackalope 2020-06-01 12:24:31
Shaders shading bug fix. Shader shared code moved for including with extention. 7de6429997bda227a175db8fba81e8f960b1a340 Jackalope 2020-06-01 12:23:05
Window laggy input fixes. 1d136d616277dde9262a3093c802f3d24ca8aa5d Jackalope 2020-06-01 12:21:00
New shading type SHADOW_MAPPING is added to remove experimental shadow mapping from DEFAULT. d4651206b1798ddec7e3275352f48445b8a184d2 Jackalope 2020-06-01 04:01:29
Debug pipelines crash fix. 9b0a75d94e30eb7fd45360f7fe10429bf05c243e Jackalope 2020-06-01 04:00:24
Window improvements. scroll_diff and cursor_diff members. Update noclip screen. 8d659590a0fb52e1e24683305a7ee8699bdff6da Jackalope 2020-06-01 01:30:50
Update jlib 0.4.1 Update jrf 0.2.2 d36e5263523a9b0443476b2db8d856e86086af81 Jackalope 2020-05-31 23:58:41
Update jmath 0.1.2. 8d3566336ef87f73318e84cde87bdf841240dcdc Jackalope 2020-05-31 23:57:25
Use scanf instead of fgets for interactive device selection. fd7ff8b61ef1e21852d6c0a15ab0d17d09c5cccc Jackalope 2020-05-31 23:56:34
Include FreeType as system library to prevent warnings. dc92c7f8acdaa90b25cf272f1730d338111780fc Jackalope 2020-05-31 23:54:37
Add glfw required version. 3.3.1 is not working. ee727d7efda88af1e8a227b542f5b79d0ba6f301 Jackalope 2020-05-31 23:53:33
GCC Compatibility. c828a38456627d0383d431165b802f97fd303349 Jackalope 2020-05-29 16:48:24
Solved clang compiler warnings from compute module. b9416237761f8648bbddb7e7ba59e833a7879528 Jackalope 2020-05-28 11:09:55
CMake: two shaders targets, instead of single target per shader. a708650319e44c7b98056f3bc85a896dd65d96f3 Jackalope 2020-05-28 11:06:13
Reduced amount of warnings. 18bf33ca4e0e7f0369f6b5fdc59b81a8420dde8e Jackalope 2020-05-27 15:11:37
Commit abeec591e143c53f960ab1703c7b4001c72b4061 - Update jrf-0.3.0
Author: Jackalope
Author date (UTC): 2020-06-04 21:12
Committer name: Jackalope
Committer date (UTC): 2020-06-05 00:46
Parent(s): 6d9b0c9f788e93a2c4a13e4f1792112dca699ca3
Signing key:
Tree: 0de3d5937a7658d254edc118b12d4350abae1f2e
File Lines added Lines deleted
include/jen/resource_manager.h 1 1
libs/jlib 1 1
libs/jrf 1 1
src/resource_manager/resource_manager.cpp 10 10
File include/jen/resource_manager.h changed (mode: 100644) (index e31b10d..a2520ae)
... ... struct jen::ModuleResourceManager
111 111
112 112 using SceneData = jl::rarray<jen::Model>; using SceneData = jl::rarray<jen::Model>;
113 113
114 Result create_scene(const jl::string_ro &path, uint32_t shift_scale,
114 Result create_scene(const jl::string_ro &path, uint32_t offset_shift,
115 115 SceneData *p_dst); SceneData *p_dst);
116 116
117 117 void destroy_scene(const jl::string_ro &scene_path); void destroy_scene(const jl::string_ro &scene_path);
File libs/jlib changed (mode: 160000) (index 4d923f2..df04729)
1 Subproject commit 4d923f27553a9c12ac24f0060039160975c25f7f
1 Subproject commit df04729ff078822e7144d85071bed6e6123e1f3b
File libs/jrf changed (mode: 160000) (index d6aaf17..95dff05)
1 Subproject commit d6aaf170a2db27ddcd429a89fd873341ea8a0082
1 Subproject commit 95dff051377ef783b45f14da380fd91a5f52bb90
File src/resource_manager/resource_manager.cpp changed (mode: 100644) (index 56fb7b3..52cc282)
... ... create_render(jen::ModuleGraphics mg, jrf::Vertices *p_jrf, jen::VertexData *p)
154 154 jen::WriteData wd; jen::WriteData wd;
155 155 wd.size = p_jrf->data_size; wd.size = p_jrf->data_size;
156 156 wd.p = p_jrf->p_data; wd.p = p_jrf->p_data;
157 auto res = mg.create(wd, &p->p_data, true);
157 jen::Result res = mg.create(wd, &p->p_data, true);
158 158 if (res == VK_SUCCESS) if (res == VK_SUCCESS)
159 159 *p_jrf = {}; *p_jrf = {};
160 160 return res; return res;
 
... ... create_render(jen::ModuleGraphics mg, jrf::Indices *p_jrf, jen::IndexData *p)
175 175 p->count = uint32_t(p_jrf->size / p_jrf->format); p->count = uint32_t(p_jrf->size / p_jrf->format);
176 176 wd.size = p_jrf->size; wd.size = p_jrf->size;
177 177 wd.p = p_jrf->p_data; wd.p = p_jrf->p_data;
178 auto res = mg.create(wd, &p->p_data, true);
178 jen::Result res = mg.create(wd, &p->p_data, true);
179 179 if (res == VK_SUCCESS) if (res == VK_SUCCESS)
180 180 *p_jrf = {}; *p_jrf = {};
181 181 return res; return res;
 
... ... create_render(jen::ModuleGraphics mg, jrf::Indices *p_jrf, jen::IndexData *p)
185 185 create_render(jen::ModuleGraphics mg, jrf::Image *p_jrf, jen::TextureData *p) create_render(jen::ModuleGraphics mg, jrf::Image *p_jrf, jen::TextureData *p)
186 186 { {
187 187 p->layer_index = 0; p->layer_index = 0;
188 auto res = mg.create(*p_jrf, &p->p_data, true);
188 jen::Result res = mg.create(*p_jrf, &p->p_data, true);
189 189 if (res == VK_SUCCESS) if (res == VK_SUCCESS)
190 190 *p_jrf = {}; *p_jrf = {};
191 191 return res; return res;
 
... ... create(const jl::string_ro &path, detail::ResHandle<RT> *p_dst) {
275 275 if (not path_move.init(path)) if (not path_move.init(path))
276 276 return { VK_ERROR_OUT_OF_HOST_MEMORY, {}}; return { VK_ERROR_OUT_OF_HOST_MEMORY, {}};
277 277 Result res = create_res(&path_move, p_dst); Result res = create_res(&path_move, p_dst);
278 if (res != VK_SUCCESS)
278 if (not res)
279 279 path_move.destroy(); path_move.destroy();
280 280 return res; return res;
281 281 } }
 
... ... template<jrf::ResourceType RT>
285 285 create(const jl::string_ro &path, Resource<RT> *p_dst) { create(const jl::string_ro &path, Resource<RT> *p_dst) {
286 286 detail::ResHandle<RT> rh; detail::ResHandle<RT> rh;
287 287 Result res = create(path, &rh); Result res = create(path, &rh);
288 if (res != VK_SUCCESS)
288 if (not res)
289 289 return res; return res;
290 290 *p_dst = rh; *p_dst = rh;
291 291 return {}; return {};
 
... ... void RMM::destroy_model(const jl::string_ro &model_path) {
605 605 ///*****************************SCENE****************************************/// ///*****************************SCENE****************************************///
606 606
607 607 [[nodiscard]] RMM::Result RMM:: [[nodiscard]] RMM::Result RMM::
608 create_scene(const jl::string_ro &path, uint32_t shift_scale, SceneData *p_dst)
608 create_scene(const jl::string_ro &path, uint32_t offset_shift, SceneData *p_dst)
609 609 { {
610 610 detail::ResHandle<jrf::SCENE> rh; detail::ResHandle<jrf::SCENE> rh;
611 611 jrf::Scene &scene = rh.res; jrf::Scene &scene = rh.res;
 
... ... create_scene(const jl::string_ro &path, uint32_t shift_scale, SceneData *p_dst)
613 613 if (jrfres != jrf::SUCCESS) if (jrfres != jrf::SUCCESS)
614 614 return { vkw::ERROR_JRF, jrfres }; return { vkw::ERROR_JRF, jrfres };
615 615
616 int32_t scale_diff = int32_t(shift_scale) - scene.options.shift_po2;
616 int32_t shift_diff = int32_t(offset_shift) - scene.options.offset_shift;
617 617 uint64_t i = 0; uint64_t i = 0;
618 618
619 619 Result res; Result res;
 
... ... create_scene(const jl::string_ro &path, uint32_t shift_scale, SceneData *p_dst)
636 636 sizeof(jrf::SceneEntryOptions::transform) == 0, sizeof(jrf::SceneEntryOptions::transform) == 0,
637 637 "checking memcpy"); "checking memcpy");
638 638
639 memcpy(&ed.world.position, &e.options.pos,
639 memcpy(&ed.world.position, &e.options.position,
640 640 sizeof(jen::ModelWorld::position)); sizeof(jen::ModelWorld::position));
641 641 static_assert(sizeof(jen::ModelWorld::position) - static_assert(sizeof(jen::ModelWorld::position) -
642 sizeof(jrf::SceneEntryOptions::pos) == 0,
642 sizeof(jrf::SceneEntryOptions::position) == 0,
643 643 "checking memcpy"); "checking memcpy");
644 644
645 645 for (unsigned int c = 0; c < 3; ++c) for (unsigned int c = 0; c < 3; ++c)
646 646 ed.world.position_offset[c] ed.world.position_offset[c]
647 = (e.options.shift[c] + scene.options.shift[c]) << scale_diff;
647 = (e.options.offset[c] + scene.options.offset[c]) << shift_diff;
648 648 } }
649 649
650 650 if (rh.path.init(path)) { if (rh.path.init(path)) {
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