Jackalope / JenExamples (public) (License: GPLv3 or later version) (since 2020-04-27) (hash sha1)
Examples for JEN framework:
- images modification and onscreen displaying;
- presudo-random noise data generation benchmark with SIMDCPP implementation comparison.

Define CMake variable JEN_PROJECT_DIR to path of JEN root project directory.
List of commits:
Subject Hash Author Date (UTC)
Scroll and move image. ffe8b2e45051b5cd2289cd9ea2b2d3aad00f1e35 TheArtOfGriefing 2020-06-01 01:32:07
Select GPU from user input 8878add2280364c5746891de1669b8d3c5c3426e Jackalope 2020-05-23 16:29:39
Buttons initialization 3585652b9b140f9b7c3e184377a9ec09f7c83cc6 TheArtOfGriefing 2020-05-21 12:00:12
Removed number of layers from transferring information, because it is removed from compute interface 343787507bfaefb9a7b5c54455f985bfb433acd3 TheArtOfGriefing 2020-05-21 11:59:57
Following JEN image format update, also image was flipped. c08650be038e74cbb7d1a8f83b423a59b7d0ab45 Jackalope 2020-05-19 17:47:47
More effects: smooth, pixelate, edge effect. Key: white noise key, pixel and smooth lookup size. Buttons effects: left and right. Buttons key: up and down. f501d5ed98a2f03045299f2c87d2a6b79ff2d780 Jackalope 2020-05-19 07:49:43
Update for JEN interface changes 8395931f8fc80fb120248d5567507b78f8e8b1d3 Jackalope 2020-05-18 18:12:28
automated shader compiling 55c15b781350f51650725a2f39009ceab2af9d77 Jackalope 2020-05-17 11:22:16
Better help message 4b7dbf8b853121843fc35f5ded8b46970c1c710a TheArtOfGriefing 2020-05-17 07:46:12
Wrong "to prepare" elapsed fix 85d29943a123dcaf09f57c9e8a10791fbc0cc960 TheArtOfGriefing 2020-05-17 07:45:11
added program name macro 0d63722828b002e3bd67cf84dd1c432478ad1ce0 TheArtOfGriefing 2020-05-17 06:38:54
Allow to select SIMD levels to run on CPU 5846904d6c2fbccd8a9bee307b1c55955598109d TheArtOfGriefing 2020-05-16 03:26:45
Pass shader specialization by constant refference, as of JEN commit 9e14c11 9944226ca4948c30fd9a98e7cca894cafa96db12 Jackalope 2020-05-15 12:47:49
Added support for custom hash function for white noise in GLSL code. 6a2d79f322efc837e8110b39c5771e918c3eae52 TheArtOfGriefing 2020-05-15 12:24:43
Added license 986f3561f7a32c88e12dbd07c017a801d474a752 TheArtOfGriefing 2020-05-12 22:23:36
JEN is not submodule now 513a2aaaaf4834c0944b271f503d895717ecc06e TheArtOfGriefing 2020-05-12 18:39:53
updated framework, added tga image reading to image example a15f21e611f2116bd999a4a4d79ea1f6616e9c46 Jackalope 2020-05-11 07:53:53
Examples are updated for the new framework version 492108b8c695abccd90c83d65a0a80aa08dbaa55 TheArtOfGriefing 2020-05-08 23:40:07
image example 5d6e9a53c423fca0a45dfbac79fb3ff0a85b970f Jackalope 2020-05-04 18:02:13
benchmarking example for cpu and gpu running 1,2,3,4D simplex and white noise 16153303e47565e606b8bbb7807f49f8fa150c5d TheArtOfGriefing 2020-04-26 08:08:41
Commit ffe8b2e45051b5cd2289cd9ea2b2d3aad00f1e35 - Scroll and move image.
Author: TheArtOfGriefing
Author date (UTC): 2020-06-01 01:32
Committer name: TheArtOfGriefing
Committer date (UTC): 2020-06-01 01:32
Parent(s): 8878add2280364c5746891de1669b8d3c5c3426e
Signing key:
Tree: 88532a528415aef81d6669cf2bd8f25933330f69
File Lines added Lines deleted
src/image_main.cpp 22 5
File src/image_main.cpp changed (mode: 100644) (index 18558a6..554d7c1)
... ... struct RenderImage {
203 203 model.ind.p_data = model.ver.p_data; model.ind.p_data = model.ver.p_data;
204 204
205 205 model.world.position_offset = {}; model.world.position_offset = {};
206 model.world.position = {-0.5,1,-0.5};
206 model.world.position = {-0.5,0,-0.5};
207 207 model.world.transform = jm::scale<4>(1.f); model.world.transform = jm::scale<4>(1.f);
208 208 return res; return res;
209 209 } }
 
... ... struct Program
263 263 res = model.init_mesh(&fw.graphics); res = model.init_mesh(&fw.graphics);
264 264 jassert_release(res == VK_SUCCESS, vkw::to_string(res)); jassert_release(res == VK_SUCCESS, vkw::to_string(res));
265 265
266 screen.init(*fw.get_window(), {}, {0,1,0}, {0,0,1});
266 screen.init(*fw.get_window(), {0,-1, 0}, {0,1,0}, {0,0,1});
267 267 screen.frustum.zNear = 0.01f; screen.frustum.zNear = 0.01f;
268 268 screen.frustum.zFar = 10; screen.frustum.zFar = 10;
269 269
270 270 button_next = button_prev = button_key_up = button_key_down = {}; button_next = button_prev = button_key_up = button_key_down = {};
271 button_rm = {};
271 272 is_drawn = false; is_drawn = false;
272 273 loop.run(fw.graphics, this, [](void *p){ loop.run(fw.graphics, this, [](void *p){
273 274 reinterpret_cast<Program*>(p)->update(); reinterpret_cast<Program*>(p)->update();
 
... ... struct Program
284 285 void update() { void update() {
285 286 auto &w = *fw.get_window(); auto &w = *fw.get_window();
286 287 bool is_changed = false; bool is_changed = false;
287 if (button_next.is_fired(Key::Board::kRight, w)) {
288 if (button_next.is_fired(Key::Board::kRight, w)
289 or
290 button_rm.is_fired(Key::Mouse::mR, w)) {
288 291 shader_type = ShaderType(shader_type + 1); shader_type = ShaderType(shader_type + 1);
289 292 if (shader_type == SHADER_TYPE_COUNT) if (shader_type == SHADER_TYPE_COUNT)
290 293 shader_type = ShaderType(); shader_type = ShaderType();
291 294 is_changed = true; is_changed = true;
292 295 } }
293 if (button_next.is_fired(Key::Board::kLeft, w)) {
296 if (button_prev.is_fired(Key::Board::kLeft, w)) {
294 297 if (shader_type == 0) if (shader_type == 0)
295 298 shader_type = ShaderType(SHADER_TYPE_COUNT - 1); shader_type = ShaderType(SHADER_TYPE_COUNT - 1);
296 299 else else
 
... ... struct Program
302 305 case 3: shader_key = 7; is_changed = true; break; case 3: shader_key = 7; is_changed = true; break;
303 306 case 7: shader_key = 15; is_changed = true; break; case 7: shader_key = 15; is_changed = true; break;
304 307 } }
305
306 308 } }
307 309 if (button_key_up.is_fired(Key::Board::kDown, w)) { if (button_key_up.is_fired(Key::Board::kDown, w)) {
308 310 switch(shader_key) { switch(shader_key) {
 
... ... struct Program
312 314 } }
313 315
314 316 loop.draw = w.is_damaged; loop.draw = w.is_damaged;
317
318 if (w.scroll_diff.y != 0) {
319 auto &pos = screen.camera.position.y;
320 pos *= 1 + w.scroll_diff.y / 12;
321 pos = jl::max(pos,-screen.frustum.zFar);
322 pos = jl::min(pos,-screen.frustum.zNear);
323 loop.draw = true;
324 }
325 if (w.is_on(Key::Mouse::mL) and not w.cursor_diff.all_equal(0)) {
326 screen.camera.position.x += w.cursor_diff.x / 200;
327 screen.camera.position.z -= w.cursor_diff.y / 200;
328 loop.draw = true;
329 }
330
315 331 if (not loop.is_drawn) if (not loop.is_drawn)
316 332 is_drawn = false; is_drawn = false;
317 333
 
... ... struct Program
352 368 jen::Button button_prev; jen::Button button_prev;
353 369 jen::Button button_key_up; jen::Button button_key_up;
354 370 jen::Button button_key_down; jen::Button button_key_down;
371 jen::Button button_rm;
355 372 jrf::Image src_image; jrf::Image src_image;
356 373 jrf::Image result_image; jrf::Image result_image;
357 374 bool is_drawn; bool is_drawn;
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/JenExamples

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

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

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