Compare commits

318 Commits

Author SHA1 Message Date
316441b954 merge upstream 2025-05-20 20:00:31 +00:00
9d7613be8f Update Binaries 2025-05-18 22:12:06 +00:00
c989f3254f Delete Krom/Krom.exe 2025-05-18 22:00:02 +00:00
f8d76929ae Delete Krom/Krom_opengl.exe 2025-05-18 21:59:54 +00:00
a51c28b607 Delete Krom/Krom 2025-05-18 21:59:44 +00:00
9142371f88 Merge pull request 'Update shader data and custom particles' (#53) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#53
2025-05-17 08:45:06 +00:00
35f92341fa Update leenkx/blender/lnx/nodes_logic.py 2025-05-17 08:05:49 +00:00
a8d1eebdaf Merge branch 'main' into main 2025-05-17 03:21:14 +00:00
87922c9389 Upload files to "leenkx/blender/data" 2025-05-17 03:19:57 +00:00
38287f56b0 Delete leenkx/blender/data/lnx_data.blend 2025-05-17 03:18:52 +00:00
42ad5b01c1 Merge pull request 't3du - Fix NoiseTexture fac output for FBM and include params: detail and distortion' (#51) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#51
2025-05-13 20:57:19 +00:00
2b46d6ebca Update leenkx/blender/lnx/material/cycles_nodes/nodes_texture.py 2025-05-13 20:55:03 +00:00
953ad8391c Update leenkx/blender/lnx/material/cycles_nodes/nodes_texture.py 2025-05-13 20:51:26 +00:00
1458ecd84f Update leenkx/blender/lnx/material/cycles_functions.py 2025-05-13 20:49:49 +00:00
288b085d0c Merge pull request 'moisesjpelaez - Add particles random size' (#50) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#50
2025-05-13 20:03:56 +00:00
aa0b2b1b7e Update Kha/Backends/Krom/kha/audio2/Audio.hx 2025-05-13 19:53:49 +00:00
acede01167 Update Kha/Backends/Krom/kha/audio2/Audio.hx 2025-05-13 19:52:40 +00:00
92a2b0305e Update Kha/Backends/Krom/kha/SystemImpl.hx 2025-05-13 19:50:08 +00:00
4886953722 Update Kha/Backends/Krom/Krom.hx 2025-05-13 19:46:24 +00:00
601860b242 Update Kha/Sources/kha/Scheduler.hx 2025-05-13 19:41:30 +00:00
f00cef2e21 Update Kha/Sources/kha/Scheduler.hx 2025-05-13 19:40:30 +00:00
e733dca053 Update Kha/Backends/Krom/kha/krom/Graphics.hx 2025-05-13 19:37:45 +00:00
387be05826 Update Kha/Backends/Krom/kha/SystemImpl.hx 2025-05-13 19:35:50 +00:00
c5b21a9bb3 Update Kha/Backends/Krom/kha/Display.hx 2025-05-13 19:34:29 +00:00
5b2c7bfc84 Update Kha/Backends/Krom/Krom.hx 2025-05-13 19:33:41 +00:00
47d913ab64 moisesjpelaez - Add particles random size 2025-05-13 18:00:51 +00:00
878ce14254 moisesjpelaez - Add particles random size 2025-05-13 17:59:36 +00:00
9075931c51 moisesjpelaez - Add particles random size 2025-05-13 17:58:05 +00:00
39ab42f2da Merge pull request 'moisesjpelaez and T3du - Oimo Physics, Bloom condition, array index list, camera spawn fix' (#48) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#48
2025-05-13 16:59:59 +00:00
30cab4d79b Update leenkx/Sources/leenkx/trait/physics/bullet/DebugDrawHelper.hx 2025-05-13 16:55:45 +00:00
8ee2aaa70a Update leenkx/Sources/leenkx/trait/physics/bullet/DebugDrawHelper.hx 2025-05-12 07:39:22 +00:00
2f9694632d Update leenkx/Sources/leenkx/trait/physics/bullet/DebugDrawHelper.hx 2025-05-12 07:31:37 +00:00
7b8d73cd84 Update leenkx/Sources/leenkx/trait/physics/bullet/DebugDrawHelper.hx 2025-05-12 07:29:05 +00:00
3d8bd77c59 Update leenkx/Sources/leenkx/trait/physics/bullet/DebugDrawHelper.hx 2025-05-12 04:08:17 +00:00
290289f413 Update leenkx/Sources/leenkx/trait/physics/bullet/PhysicsWorld.hx 2025-05-11 20:37:34 +00:00
2732210fc9 moisesjpelaez - Oimo Physics 2025-05-11 19:46:28 +00:00
68900fb992 moisesjpelaez - Fix Bloom condition 2025-05-11 19:43:09 +00:00
ef724ae323 moisesjpelaez - Oimo Physics 2025-05-11 19:41:09 +00:00
6d4c1a680b moisesjpelaez - Oimo Physics 2025-05-11 19:37:04 +00:00
8aeaa0368e moisesjpelaez - Oimo Physics 2025-05-11 17:50:43 +00:00
7969286fdc moisesjpelaez - Oimo Physics 2025-05-11 17:49:43 +00:00
cde2bead97 moisesjpelaez - Oimo Physics 2025-05-11 17:47:56 +00:00
c42e4c09a8 moisesjpelaez - Oimo Physics 2025-05-11 17:46:49 +00:00
b8c8ccad9d moisesjpelaez - Oimo Physics 2025-05-11 17:46:28 +00:00
335f3541f1 moisesjpelaez - Oimo Physics 2025-05-11 17:44:49 +00:00
808dcef817 moisesjpelaez - Oimo Physics 2025-05-11 17:41:38 +00:00
6ac06cc504 moisesjpelaez - Oimo Physics 2025-05-11 17:40:38 +00:00
86de9617f3 moisesjpelaez - Oimo Physics 2025-05-11 17:39:01 +00:00
29761ec9e6 moisesjpelaez - Oimo Physics 2025-05-11 17:38:02 +00:00
ea7cf849b8 t3du - Add ArrayIndexListNode.hx 2025-05-11 17:14:38 +00:00
5d559734b9 t3du - Add LN_array_index_list.py 2025-05-11 17:13:05 +00:00
939346c896 moisesjpelaez - Fix camera spawn position in Blender 4.2.x 2025-05-11 17:03:13 +00:00
f2dcfc0ffa Merge pull request 'main' (#47) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#47
2025-05-10 16:32:31 +00:00
e78bd17d93 Update leenkx/blender/lnx/utils.py 2025-05-10 16:30:16 +00:00
f9a02f03cb Update leenkx.py 2025-05-10 16:27:51 +00:00
21a4ee0af7 Update leenkx.py 2025-05-10 16:25:06 +00:00
9bf83bc49f Update leenkx/blender/lnx/material/make_mesh.py 2025-04-18 22:52:53 +00:00
d88e1f0f42 Update leenkx/blender/lnx/material/make_cluster.py 2025-04-18 22:52:03 +00:00
96f4e29778 Update leenkx/blender/lnx/material/make_mesh.py 2025-04-12 08:49:04 +00:00
1d705d2ca2 Update leenkx/blender/lnx/material/make_cluster.py 2025-04-12 08:48:33 +00:00
0979cd976f Update leenkx/blender/lnx/write_data.py 2025-04-11 22:20:24 +00:00
db6d786ee4 merge upstream 2025-04-11 22:06:01 +00:00
06319131fd Update leenkx/blender/lnx/handlers.py 2025-04-11 21:16:04 +00:00
c08e1d3835 Update leenkx/Sources/leenkx/trait/physics/bullet/PhysicsWorld.hx 2025-04-11 21:04:00 +00:00
27bd360317 Update lib/haxebullet/hl/bullet.cpp 2025-04-11 16:28:33 +00:00
82a53a868a Merge pull request 'Debug Raycast Drawing' (#45) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#45
2025-04-11 08:37:13 +00:00
94eaba7319 Update leenkx/Sources/leenkx/trait/physics/bullet/PhysicsWorld.hx 2025-04-11 08:22:17 +00:00
8d1c2c51bd Update leenkx/Sources/leenkx/trait/physics/bullet/PhysicsWorld.hx 2025-04-11 08:18:30 +00:00
07d98639f2 Update leenkx/Sources/leenkx/trait/physics/bullet/DebugDrawHelper.hx 2025-04-11 08:17:40 +00:00
1944fc97b8 Update leenkx/Sources/leenkx/trait/physics/bullet/PhysicsWorld.hx 2025-04-10 22:22:46 +00:00
d69e3438ff Update leenkx/Sources/leenkx/trait/physics/bullet/DebugDrawHelper.hx 2025-04-10 21:55:56 +00:00
62e52a7316 Update leenkx/Sources/leenkx/trait/physics/bullet/PhysicsWorld.hx 2025-04-10 21:45:24 +00:00
c4b48c2d87 Update leenkx/blender/lnx/exporter.py 2025-04-10 21:29:34 +00:00
96f69a7cfe Update leenkx/blender/lnx/props_ui.py 2025-04-10 21:23:53 +00:00
90950970f0 Update leenkx/blender/lnx/props.py 2025-04-10 21:21:21 +00:00
106e36e30d merge upstream 2025-04-10 17:16:12 +00:00
e71b0849b3 Merge pull request 'HashLeenkx Updates!' (#44) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#44
2025-04-10 15:56:16 +00:00
e079c94832 Update leenkx/blender/lnx/make.py 2025-04-10 15:54:53 +00:00
5572494f3d Upload files to "Kha/Kinc/Tools/freebsd_x64" 2025-04-10 11:02:33 +00:00
8f03927391 Delete Kha/Kinc/Tools/freebsd_x64/icon.png 2025-04-10 11:02:20 +00:00
6586d90177 Upload files to "Kha/Kinc/Tools/linux_arm" 2025-04-10 11:02:04 +00:00
952cee36a3 Delete Kha/Kinc/Tools/linux_arm/icon.png 2025-04-10 11:01:52 +00:00
35bfdf3715 Upload files to "Kha/Kinc/Tools/linux_arm64" 2025-04-10 11:01:37 +00:00
135aaa0669 Delete Kha/Kinc/Tools/linux_arm64/icon.png 2025-04-10 11:01:22 +00:00
c6b776a329 Upload files to "Kha/Kinc/Tools/macos" 2025-04-10 11:01:09 +00:00
67c7443985 Delete Kha/Kinc/Tools/macos/icon.png 2025-04-10 11:00:57 +00:00
42273470c3 Upload files to "Kha/Kinc/Tools/linux_x64" 2025-04-10 11:00:38 +00:00
4dfc6be702 Delete Kha/Kinc/Tools/linux_x64/icon.png 2025-04-10 11:00:25 +00:00
92e1abcfdc Upload files to "Kha/Kinc/Tools/windows_x64" 2025-04-10 11:00:11 +00:00
764eefeb06 Delete Kha/Kinc/Tools/windows_x64/icon.png 2025-04-10 10:59:52 +00:00
979dfc605d Update leenkx/blender/lnx/make.py 2025-04-10 10:12:22 +00:00
55fb300901 Update Kha/Backends/Kinc-HL/kha/graphics4/FragmentShader.hx 2025-04-10 08:47:21 +00:00
c59e6a66d4 merge upstream 2025-04-10 07:48:11 +00:00
659802b888 Update Kha/Backends/Kinc-HL/kha/graphics4/FragmentShader.hx 2025-04-10 07:36:58 +00:00
33f6fcaaaf Merge pull request 'HashLeenkx' (#43) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#43
2025-04-09 22:15:26 +00:00
d37b41b181 Update leenkx/Sources/iron/system/LnxPack.hx 2025-04-09 22:14:24 +00:00
70742b823f Update Kha/Backends/Kinc-HL/kinc-bridge/kinc.c.h 2025-04-09 22:09:15 +00:00
da8f9d23e4 Update lib/aura/Sources/aura/Aura.hx 2025-04-09 22:07:36 +00:00
ff886e6d46 Update Kha/Backends/Kinc-HL/kfile.js 2025-04-09 22:05:14 +00:00
70a603cf7a Update Kha/Backends/Kinc-HL/kinc-bridge/compute.c.h 2025-04-09 21:25:07 +00:00
bfc4c2644f Update leenkx/blender/lnx/props.py 2025-04-09 20:59:05 +00:00
f101124d24 Update leenkx/blender/lnx/utils.py 2025-04-09 20:44:54 +00:00
c6f672bd61 Update leenkx/blender/lnx/props.py 2025-04-09 20:35:42 +00:00
7f38b15fe7 Update leenkx/blender/lnx/make.py 2025-04-09 20:33:24 +00:00
2bb296028f merge upstream 2025-04-09 17:30:27 +00:00
5628493493 Merge pull request 'Transforms_and_Rotations' (#42) from Onek8/LNXSDK:Transforms_and_Rotations into main
Reviewed-on: LeenkxTeam/LNXSDK#42
2025-04-09 17:12:32 +00:00
f8a08a41b1 Update leenkx/Sources/iron/math/Quat.hx 2025-04-09 15:02:07 +00:00
2cd91f598c Update leenkx/blender/lnx/logicnode/lnx_sockets.py 2025-04-08 21:50:49 +00:00
a20d6b581c Update leenkx/blender/lnx/nodes_logic.py 2025-04-08 17:24:50 +00:00
e34ed0794f Update leenkx/Sources/leenkx/logicnode/RotationNode.hx 2025-04-08 17:20:50 +00:00
bdcf4c980b Update leenkx/blender/lnx/logicnode/lnx_sockets.py 2025-04-08 17:19:06 +00:00
25d7ba3e72 merge upstream 2025-04-08 06:33:53 +00:00
30e5acf9bf Update leenkx/blender/lnx/make_renderpath.py 2025-04-07 21:20:53 +00:00
c3435b9533 Update leenkx/blender/lnx/write_data.py 2025-04-07 21:19:28 +00:00
8765e894f5 Update leenkx/blender/lnx/props_ui.py 2025-04-07 21:17:23 +00:00
2c5c8d0e4f Update leenkx/blender/lnx/props_renderpath.py 2025-04-07 21:16:29 +00:00
4805dd06a7 Update leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl 2025-04-07 21:14:52 +00:00
2bc2ab43a1 Update leenkx/Shaders/std/tonemap.glsl 2025-04-07 21:12:11 +00:00
bf7b4416ec Update leenkx/blender/lnx/make_renderpath.py 2025-04-07 17:29:09 +00:00
a2d03cfe6e Update leenkx/Shaders/std/light.glsl 2025-04-07 17:26:00 +00:00
95f0ecfc54 Update leenkx/Sources/leenkx/system/Starter.hx 2025-04-07 17:07:52 +00:00
07f59224fc Update leenkx/blender/lnx/write_data.py 2025-04-07 16:50:46 +00:00
02259985be Update leenkx/blender/lnx/props.py 2025-04-07 16:46:33 +00:00
6b8585c81a Update leenkx/blender/lnx/props_renderpath.py 2025-04-07 16:43:01 +00:00
5d78eabf94 Update leenkx/blender/lnx/material/cycles_nodes/nodes_texture.py 2025-04-07 16:39:49 +00:00
41c1459c4e Update leenkx/blender/lnx/material/make_voxel.py 2025-04-07 16:34:12 +00:00
304a497565 Update leenkx/blender/lnx/make_renderpath.py 2025-04-07 16:27:25 +00:00
9fa399371a Update leenkx/blender/lnx/material/make_mesh.py 2025-04-07 16:25:06 +00:00
4625fdb6b2 Update leenkx/blender/lnx/material/make_cluster.py 2025-04-07 16:13:16 +00:00
79553927aa Update leenkx/Shaders/water_pass/water_pass.frag.glsl 2025-04-07 16:06:53 +00:00
86661c1012 Update leenkx/Shaders/voxel_light/voxel_light.comp.glsl 2025-04-07 16:04:17 +00:00
03967c7a2b Update leenkx/Sources/leenkx/system/Starter.hx 2025-04-07 15:50:41 +00:00
61fd48a12f Update leenkx/Shaders/ssr_pass/ssr_pass.frag.glsl 2025-04-07 15:47:22 +00:00
519039b8b6 Update leenkx/Shaders/std/light.glsl 2025-04-07 15:45:04 +00:00
5244b1b3e8 Update leenkx/Sources/leenkx/renderpath/RenderPathForward.hx 2025-04-07 15:41:41 +00:00
7ae3bbe496 Update leenkx/Sources/leenkx/renderpath/RenderPathDeferred.hx 2025-04-07 15:39:38 +00:00
001be2f8da Update leenkx/Sources/leenkx/renderpath/Inc.hx 2025-04-07 15:35:22 +00:00
6a25b3c5d7 Update leenkx/Shaders/deferred_light/deferred_light.frag.glsl 2025-04-07 15:28:46 +00:00
8d4ac7251a Update leenkx/Shaders/voxel_temporal/voxel_temporal.comp.glsl 2025-04-07 15:22:49 +00:00
ae63b252c6 Update leenkx/Shaders/voxel_sdf_jumpflood/voxel_sdf_jumpflood.comp.glsl 2025-04-07 15:19:03 +00:00
ee73823206 Update leenkx/Shaders/voxel_resolve_specular/voxel_resolve_specular.comp.glsl 2025-04-07 15:17:43 +00:00
af2850e20c Update leenkx/Shaders/voxel_resolve_diffuse/voxel_resolve_diffuse.comp.glsl 2025-04-07 14:49:37 +00:00
bc4a31d415 Update leenkx/Shaders/voxel_resolve_ao/voxel_resolve_ao.comp.glsl 2025-04-07 14:47:58 +00:00
5303ad3ac6 Update leenkx/Shaders/ssrefr_pass/ssrefr_pass.frag.glsl 2025-04-07 14:44:14 +00:00
5153cff790 Update leenkx/Shaders/std/shadows.glsl 2025-04-07 14:41:53 +00:00
abe17870ce Update leenkx/Shaders/std/conetrace.glsl 2025-04-07 14:38:30 +00:00
c798f122d0 Merge pull request 'Transforms and rotations math' (#41) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#41
2025-04-06 15:48:46 +00:00
d1edb1464e Update leenkx/Sources/iron/math/Quat.hx 2025-04-06 15:27:05 +00:00
ee8d3314b5 Update leenkx/Sources/leenkx/logicnode/TransformNode.hx 2025-04-06 15:25:39 +00:00
c6139282ed Update leenkx/blender/lnx/logicnode/lnx_sockets.py 2025-04-06 14:34:19 +00:00
559a3b8b39 Update leenkx/Sources/iron/math/Quat.hx 2025-04-06 14:30:52 +00:00
8d072ae481 Update leenkx/blender/lnx/logicnode/math/LN_rotation_math.py 2025-04-06 10:28:18 +00:00
293a612e9c Update leenkx/blender/lnx/logicnode/network/LN_network_event.py 2025-04-06 10:25:39 +00:00
8020599513 Update leenkx/blender/lnx/logicnode/native/LN_get_date_time.py 2025-04-06 10:25:01 +00:00
4fbc1aba7f Update leenkx/blender/lnx/logicnode/native/LN_call_haxe_static.py 2025-04-06 10:24:11 +00:00
1380585297 Update leenkx/blender/lnx/logicnode/miscellaneous/LN_group_output.py 2025-04-06 10:23:47 +00:00
beee036a3d Update leenkx/blender/lnx/logicnode/miscellaneous/LN_group_input.py 2025-04-06 10:23:01 +00:00
76b2ba8f80 Update leenkx/blender/lnx/logicnode/miscellaneous/LN_call_group.py 2025-04-06 10:22:41 +00:00
e7143cc740 Update leenkx/blender/lnx/logicnode/math/LN_vector_math.py 2025-04-06 10:22:15 +00:00
bd0886b1d7 Update leenkx/blender/lnx/logicnode/math/LN_quaternion_math.py 2025-04-06 10:20:29 +00:00
8eb8c0bd98 Update leenkx/blender/lnx/logicnode/math/LN_math_term.py 2025-04-06 10:19:19 +00:00
dd06e490a7 Update leenkx/blender/lnx/logicnode/math/LN_math_expression.py 2025-04-06 10:18:20 +00:00
5e4ac6dd0b Update leenkx/blender/lnx/logicnode/math/LN_math.py 2025-04-06 10:16:57 +00:00
be0a9149ad Update leenkx/blender/lnx/logicnode/math/LN_compare.py 2025-04-06 10:14:40 +00:00
7ab3398941 Update leenkx/blender/lnx/logicnode/map/LN_string_map.py 2025-04-06 10:14:02 +00:00
c10e988d2d Update leenkx/blender/lnx/logicnode/logic/LN_wait_for.py 2025-04-06 10:13:28 +00:00
caafeea2f1 Update leenkx/blender/lnx/logicnode/logic/LN_switch_output.py 2025-04-06 10:12:43 +00:00
2edee3fe68 Update leenkx/blender/lnx/logicnode/logic/LN_select.py 2025-04-06 10:11:19 +00:00
af147c9c63 Update leenkx/blender/lnx/logicnode/array/LN_array_remove_by_value.py 2025-04-06 10:10:23 +00:00
8e4c20647b Update leenkx/blender/lnx/lightmapper/utility/log.py 2025-04-06 10:09:42 +00:00
594cbeffbe Update leenkx/blender/lnx/logicnode/random/LN_random_output.py 2025-04-06 10:06:39 +00:00
e1d48e4289 Update leenkx/blender/lnx/logicnode/random/LN_probabilistic_output.py 2025-04-06 10:06:04 +00:00
7960ca94a6 Update leenkx/blender/lnx/logicnode/physics/LN_physics_constraint.py 2025-04-06 10:02:08 +00:00
72f14f59bf Update leenkx/blender/lnx/logicnode/physics/LN_add_physics_constraint.py 2025-04-06 10:01:08 +00:00
d994d040ef Update leenkx/blender/lnx/logicnode/network/LN_network_send_message.py 2025-04-06 09:54:19 +00:00
1e18795d29 Update leenkx/blender/lnx/logicnode/string/LN_concatenate_string.py 2025-04-06 09:40:14 +00:00
9557b82970 Update leenkx/blender/lnx/props_renderpath.py 2025-04-05 13:27:30 +00:00
88949c63c5 Update leenkx/Shaders/std/tonemap.glsl 2025-04-05 13:11:56 +00:00
7cab325397 Update leenkx/blender/lnx/props_renderpath.py 2025-04-05 13:10:44 +00:00
8792ef5cee Update leenkx/blender/lnx/props_renderpath.py 2025-04-05 10:54:48 +00:00
761b1832ad Update leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl 2025-04-05 10:47:18 +00:00
074a51866f Update leenkx/blender/lnx/props_renderpath.py 2025-04-05 10:24:00 +00:00
c382460355 Update leenkx/blender/lnx/props_renderpath.py 2025-04-05 09:02:03 +00:00
4a3544b5d8 Update leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl 2025-04-05 08:59:31 +00:00
7cebe8340f Update leenkx/blender/lnx/props_renderpath.py 2025-04-05 08:57:20 +00:00
ecaea8ad9d Merge pull request 'AgX color space' (#40) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#40
2025-04-05 08:27:30 +00:00
cae7963b21 Update leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl 2025-04-05 08:25:54 +00:00
7a2976ced1 Update leenkx/blender/lnx/props_renderpath.py 2025-04-05 08:18:32 +00:00
aae64aa8f8 Update leenkx/Shaders/std/tonemap.glsl 2025-04-05 08:12:43 +00:00
ef25d15aed Merge pull request 'Update leenkx/Shaders/voxel_resolve_specular/voxel_resolve_specular.comp.glsl' (#35) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#35
2025-04-04 20:47:40 +00:00
01bcf029f9 Update leenkx/Shaders/voxel_resolve_specular/voxel_resolve_specular.comp.glsl 2025-04-04 20:42:41 +00:00
2b9baef712 Merge pull request 'Update' (#24) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#24
2025-04-03 20:57:15 +00:00
489057018e Update leenkx/blender/lnx/material/cycles_nodes/nodes_shader.py 2025-04-03 16:59:29 +00:00
501a064d25 Update leenkx/Shaders/voxel_resolve_specular/voxel_resolve_specular.comp.glsl 2025-04-03 16:20:12 +00:00
9478e4e957 Merge pull request 'Audio flag to prevent crashing when audio is disabled' (#22) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#22
2025-04-03 12:38:38 +00:00
32c6535f8a Update leenkx/Sources/leenkx/logicnode/StopSoundNode.hx 2025-04-03 12:36:33 +00:00
21c2abe67c Update leenkx/Sources/leenkx/logicnode/SetVolumeSoundNode.hx 2025-04-03 12:35:51 +00:00
2b1b56bc0a Update leenkx/Sources/leenkx/logicnode/SetSoundNode.hx 2025-04-03 12:35:02 +00:00
9e47c1db6d Update leenkx/Sources/leenkx/logicnode/PlaySoundRawNode.hx 2025-04-03 12:34:08 +00:00
6be977da7e Update leenkx/Sources/leenkx/logicnode/PlaySoundNode.hx 2025-04-03 12:30:45 +00:00
693fa36ee1 Update leenkx/Sources/leenkx/logicnode/PauseSoundNode.hx 2025-04-03 12:30:03 +00:00
6ec480930a Merge pull request 'More 4.4 updates' (#17) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#17
2025-04-03 10:06:05 +00:00
a627a52d46 Update leenkx/blender/lnx/logicnode/logic/LN_output_sequence.py 2025-04-03 10:04:43 +00:00
be63323c09 Update leenkx/blender/lnx/logicnode/logic/LN_merge.py 2025-04-03 10:04:15 +00:00
38595db46b Update leenkx/blender/lnx/logicnode/logic/LN_gate.py 2025-04-03 10:03:25 +00:00
48d28f6873 Update leenkx/blender/lnx/logicnode/logic/LN_function.py 2025-04-03 10:02:33 +00:00
eb033149a0 Update leenkx/blender/lnx/logicnode/logic/LN_case_index.py 2025-04-03 10:01:30 +00:00
db1c3bdf4c Update leenkx/blender/lnx/logicnode/logic/LN_call_function.py 2025-04-03 09:59:20 +00:00
2b16b565a8 Update leenkx/blender/lnx/logicnode/logic/LN_alternate_output.py 2025-04-03 09:57:33 +00:00
8c758bf51f Update leenkx/blender/lnx/logicnode/input/LN_on_swipe.py 2025-04-03 09:46:41 +00:00
1764081740 Update leenkx/blender/lnx/logicnode/draw/LN_draw_polygon.py 2025-04-03 09:45:19 +00:00
c90bde8719 Update leenkx/blender/lnx/logicnode/draw/LN_draw_camera.py 2025-04-03 09:44:34 +00:00
bfb11275df Update leenkx/blender/lnx/logicnode/custom/LN_touch_pad.py 2025-04-03 09:43:48 +00:00
3185f61f39 Update leenkx/blender/lnx/logicnode/custom/LN_set_element_data.py 2025-04-03 09:43:13 +00:00
fb00ca88ff Update leenkx/blender/lnx/logicnode/custom/LN_seed_torrent.py 2025-04-03 09:42:15 +00:00
78109cfee2 Update leenkx/blender/lnx/logicnode/custom/LN_leenkx_send_message.py 2025-04-03 09:41:20 +00:00
fa65c02e8a Update leenkx/blender/lnx/logicnode/custom/LN_leenkx_event.py 2025-04-03 09:37:54 +00:00
cb93ede7d7 Update leenkx/blender/lnx/logicnode/custom/LN_create_torrent.py 2025-04-03 09:37:04 +00:00
2a3f8db0bc Update leenkx/blender/lnx/logicnode/custom/LN_create_style.py 2025-04-03 09:36:23 +00:00
3ab9123000 Update leenkx/blender/lnx/logicnode/custom/LN_call_wasm.py 2025-04-03 09:34:57 +00:00
d6b4b6eeea Update leenkx/blender/lnx/logicnode/custom/LN_add_torrent.py 2025-04-03 09:34:21 +00:00
2f1e6783a4 Update leenkx/blender/lnx/logicnode/array/LN_array_vector.py 2025-04-03 09:33:39 +00:00
603a976adf Update leenkx/blender/lnx/logicnode/array/LN_array_string.py 2025-04-03 09:32:59 +00:00
1e0d32a88d Update leenkx/blender/lnx/logicnode/array/LN_array_object.py 2025-04-03 09:32:27 +00:00
82a7075308 Update leenkx/blender/lnx/logicnode/array/LN_array_integer.py 2025-04-03 09:31:30 +00:00
de8f7d08ed Update leenkx/blender/lnx/logicnode/array/LN_array_float.py 2025-04-03 09:30:57 +00:00
caf95e2611 Update leenkx/blender/lnx/logicnode/array/LN_array_color.py 2025-04-03 09:30:04 +00:00
b639f06aba Update leenkx/blender/lnx/logicnode/array/LN_array_boolean.py 2025-04-03 09:29:40 +00:00
de41800e1c Update leenkx/blender/lnx/logicnode/array/LN_array_add.py 2025-04-03 09:28:34 +00:00
d2746fb087 Update leenkx/blender/lnx/logicnode/array/LN_array.py 2025-04-03 09:27:55 +00:00
62d3e65796 Update leenkx/blender/lnx/logicnode/animation/LN_switch_action_multi.py 2025-04-03 09:27:03 +00:00
74473087b5 Update leenkx/blender/lnx/logicnode/animation/LN_one_shot_action_multi.py 2025-04-03 09:26:00 +00:00
392da64d1f Update leenkx/blender/lnx/logicnode/animation/LN_blend_space_gpu.py 2025-04-03 09:24:45 +00:00
30748390ca Update Kha/Kinc/Backends/System/Linux/Sources/kinc/backend/sound.c.h 2025-04-03 06:41:21 +00:00
f9d463ca1d Update leenkx/blender/lnx/exporter.py 2025-03-31 21:06:33 +00:00
b8771e9d81 Update leenkx/blender/lnx/props.py 2025-03-31 20:17:15 +00:00
1f52eed66c Update leenkx/blender/lnx/material/cycles_nodes/nodes_shader.py 2025-03-31 16:18:28 +00:00
e562b626cb Merge pull request 'main' (#10) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#10
2025-03-31 13:54:10 +00:00
ccb554ba16 Update leenkx/blender/lnx/utils.py 2025-03-31 13:51:58 +00:00
972775b432 Upload files to "Krom" 2025-03-31 11:28:16 +00:00
ee984c332e Update leenkx/Shaders/std/shadows.glsl 2025-03-31 10:07:41 +00:00
038e5123c9 Merge pull request 'Update leenkx/Sources/leenkx/logicnode/ApplyForceNode.hx' (#9) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#9
2025-03-28 18:13:48 +00:00
b5575e5a48 Update leenkx/Sources/leenkx/logicnode/ApplyForceNode.hx 2025-03-28 18:12:17 +00:00
76d79e6e18 Merge pull request 'Update leenkx/Sources/iron/object/Animation.hx' (#8) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#8
2025-03-27 21:22:55 +00:00
ca8fd0b357 Update leenkx/Sources/iron/object/Animation.hx 2025-03-27 21:20:54 +00:00
87fa82e3d3 Merge pull request 'main' (#6) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#6
2025-03-25 23:36:02 +00:00
9fa58d9d7c Update leenkx/blender/lnx/logicnode/lnx_sockets.py 2025-03-25 23:34:47 +00:00
864568d66b Update leenkx/blender/lnx/node_utils.py 2025-03-25 23:29:22 +00:00
f3e96546ae Update leenkx/blender/lnx/logicnode/lnx_sockets.py 2025-03-25 19:52:50 +00:00
fcc114aed3 Update leenkx.py 2025-03-25 19:26:40 +00:00
df33848bee Merge pull request 'Animation fixes' (#5) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#5
2025-03-24 16:30:58 +00:00
c17516a4e2 Update leenkx/blender/lnx/logicnode/animation/LN_blend_space_gpu.py 2025-03-24 16:28:49 +00:00
9b9acd5e15 Update leenkx/blender/lnx/logicnode/lnx_sockets.py 2025-03-24 16:27:16 +00:00
3b0eb0e075 Update leenkx/blender/lnx/logicnode/animation/LN_bone_ik.py 2025-03-24 16:25:00 +00:00
f5b3da3a15 Update leenkx/blender/lnx/logicnode/animation/LN_blend_action.py 2025-03-24 16:22:49 +00:00
b71275d0d5 Merge pull request 'Update leenkx/blender/lnx/make.py' (#4) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#4
2025-03-23 16:47:47 +00:00
6aeb9b0f22 Update leenkx/blender/lnx/make.py 2025-03-23 16:46:18 +00:00
609477737e Update leenkx/blender/lnx/make.py 2025-03-23 13:17:06 +00:00
a747f89438 Update leenkx/blender/lnx/props.py 2025-03-19 16:26:03 +00:00
0bd0c57a00 Update leenkx/blender/lnx/write_data.py 2025-03-19 16:24:04 +00:00
f3ab801928 Update leenkx/blender/lnx/write_data.py 2025-03-19 12:36:00 +00:00
9b821d4b8e Update leenkx/blender/lnx/props.py 2025-03-19 12:34:18 +00:00
f2a0dbe36c Update leenkx/Shaders/std/shadows.glsl 2025-03-17 20:31:43 +00:00
12e66d8cf1 Update leenkx/Sources/leenkx/trait/physics/bullet/PhysicsWorld.hx 2025-03-15 21:23:07 +00:00
4b6424b702 Update leenkx/Shaders/ssrefr_pass/ssrefr_pass.frag.glsl 2025-03-15 15:44:22 +00:00
e66e082cc7 Update leenkx/blender/lnx/material/make_cluster.py 2025-03-15 07:22:49 +00:00
42eff22cbb Update leenkx/Shaders/std/shadows.glsl 2025-03-14 19:59:02 +00:00
448898a634 Update leenkx/blender/lnx/write_data.py 2025-03-14 17:33:00 +00:00
15ec41b1f0 Update leenkx/blender/lnx/material/make_mesh.py 2025-03-14 11:04:03 +00:00
c5a7746c84 Update leenkx/Sources/leenkx/logicnode/SetBoneTransformNode.hx 2025-03-12 13:02:09 +00:00
51aa8ea1d4 Upload files to "leenkx/Sources/leenkx/logicnode" 2025-03-12 13:00:54 +00:00
ccdfc4246f Upload files to "leenkx/blender/lnx/logicnode/animation" 2025-03-12 13:00:13 +00:00
aead4c4903 Update leenkx/Sources/leenkx/logicnode/SetParentBoneNode.hx 2025-03-11 19:00:35 +00:00
d2f4c0e221 Update leenkx/blender/lnx/logicnode/animation/LN_set_parent_bone.py 2025-03-11 18:59:58 +00:00
887eeebe27 Update leenkx/Sources/leenkx/logicnode/PlayActionFromNode.hx.backup 2025-03-11 18:57:52 +00:00
83077e3f15 Update leenkx/Sources/leenkx/logicnode/TouchPadNode.hx.backup 2025-03-11 18:57:25 +00:00
f5c20c5a13 Update leenkx/Sources/leenkx/logicnode/AudioHRTFPannerNode.hx 2025-03-11 18:56:39 +00:00
4bd4995b6e Update leenkx/Sources/leenkx/logicnode/SetParentBoneNode.hx 2025-03-11 11:27:26 +00:00
381744e678 Update leenkx/blender/lnx/logicnode/animation/LN_set_parent_bone.py 2025-03-11 11:26:34 +00:00
34c15c29cd Update leenkx/blender/lnx/props_ui.py 2025-03-07 11:15:32 +00:00
0346e27657 Update leenkx/blender/lnx/props_ui.py 2025-03-07 11:14:50 +00:00
9087b9c98c Update leenkx/Sources/zui/Zui.hx 2025-03-07 11:05:17 +00:00
f2cbcc88a7 moisesjpelaez - Enable touch input from mobile browsers #3129 2025-03-07 11:03:28 +00:00
b8d9ea2aff Update leenkx/Sources/leenkx/logicnode/GetBoneTransformNode.hx 2025-02-08 21:19:41 +00:00
37a09d0a21 Update leenkx/blender/lnx/keymap.py 2025-02-08 17:29:46 +00:00
ed932e3fa4 Update leenkx/blender/lnx/material/cycles_nodes/nodes_shader.py 2025-02-06 17:13:41 +00:00
f00edd882f Update leenkx/blender/lnx/material/cycles_nodes/nodes_shader.py 2025-02-06 17:08:33 +00:00
f403955fcd Update leenkx/blender/lnx/utils.py 2025-02-05 23:03:31 +00:00
a562af9b60 Update Kha/Backends/Kinc-HL/kinc-bridge/shader.c.h 2025-02-01 17:09:05 +00:00
bdd9b0197f Update lib/aura/Backends/hl/aura/math/FFT.h 2025-02-01 16:02:29 +00:00
f200933375 Update lib/aura/Backends/hl/aura/aurahl.c 2025-02-01 14:18:03 +00:00
829ef5f269 Update Kha/Kinc/Sources/kinc/input/gamepad.h 2025-02-01 14:10:05 +00:00
0d73133f36 Update Kha/Backends/Kinc-HL/kinc-bridge/system.c.h 2025-02-01 14:08:47 +00:00
181b860360 Update Kha/Backends/Kinc-HL/kinc-bridge/kinc.c.h 2025-02-01 13:53:43 +00:00
20db9cc24d Update Kha/Backends/Kinc-HL/kinc-bridge/compute.c.h 2025-02-01 12:16:54 +00:00
c67b38ea1e Update Compute Shader 2025-01-31 20:35:00 +00:00
adb95eab1e Hashlink Voxels Fix 2025-01-31 20:05:18 +00:00
93addd1200 Update Kha/Backends/Kinc-HL/hl/include/mbedtls/library/entropy_poll.c 2025-01-31 20:00:32 +00:00
7f9a7c9b4a Update leenkx/blender/lnx/material/make_mesh.py 2025-01-31 12:37:04 +00:00
7433409cda Anti aliasing only working with TAA 2025-01-31 08:56:57 +00:00
2a6e05aff1 Update new repo node links 2025-01-31 07:17:39 +00:00
348d7bf343 Merge pull request 'More 4.3 + support' (#3) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#3
2025-01-30 13:43:29 +00:00
4c6df16aa7 Update leenkx/blender/lnx/write_data.py 2025-01-30 13:39:55 +00:00
8a7f5ee519 Update leenkx/blender/lnx/props_ui.py 2025-01-30 13:21:20 +00:00
1958342a74 Add leenkx/blender/lnx/logicnode/browser/LN_detect_mobile_browser.py 2025-01-29 08:11:04 +00:00
16e8e00783 Delete leenkx/blender/lnx/logicnode/native/LN_detect_mobile_browser.py 2025-01-29 08:10:15 +00:00
bcdcbfb106 Delete leenkx/blender/lnx/logicnode/native/LN_loadUrl.py 2025-01-29 08:09:43 +00:00
28afefbbf7 Add leenkx/blender/lnx/logicnode/browser/LN_loadUrl.py 2025-01-29 08:04:56 +00:00
3d2130e26a Delete leenkx/blender/lnx/logicnode/browser/LN_loadUrl.py 2025-01-27 11:58:52 +00:00
9761719dd5 Delete leenkx/blender/lnx/logicnode/browser/LN_detect_mobile_browser.py 2025-01-27 11:58:45 +00:00
b2a781c7c2 Update leenkx/blender/lnx/material/make_mesh.py 2025-01-24 11:45:21 +00:00
7121737297 Fix missing export 2025-01-24 11:41:47 +00:00
b0991a8928 Update README.md 2025-01-24 08:38:05 +00:00
b84fc93899 Update leenkx/blender/lnx/material/make_mesh.py 2025-01-24 08:03:17 +00:00
06c0c430a8 Update leenkx/blender/lnx/utils.py 2025-01-23 17:15:03 +00:00
0f0c67dc07 Update leenkx/blender/lnx/utils.py 2025-01-23 17:07:29 +00:00
3bb2d65faa Update leenkx.py 2025-01-23 17:05:07 +00:00
20e33afeac Merge pull request 'main' (#2) from Onek8/LNXSDK:main into main
Reviewed-on: LeenkxTeam/LNXSDK#2
2025-01-23 16:09:12 +00:00
165 changed files with 5034 additions and 4188 deletions

View File

@ -18,7 +18,7 @@
* *
* This file is part of mbed TLS (https://tls.mbed.org) * This file is part of mbed TLS (https://tls.mbed.org)
*/ */
#define _GNU_SOURCE
#if !defined(MBEDTLS_CONFIG_FILE) #if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h" #include "mbedtls/config.h"
#else #else

View File

@ -9,6 +9,7 @@ if (platform == Platform.OSX) project.addDefine('KORE_DEBUGDIR="osx-hl"');
if (platform == Platform.iOS) project.addDefine('KORE_DEBUGDIR="ios-hl"'); if (platform == Platform.iOS) project.addDefine('KORE_DEBUGDIR="ios-hl"');
if (platform !== Platform.Windows || audio !== AudioApi.DirectSound) { if (platform !== Platform.Windows || audio !== AudioApi.DirectSound) {
project.addDefine('KORE_MULTITHREADED_AUDIO'); project.addDefine('KORE_MULTITHREADED_AUDIO');
project.addDefine('KINC_MULTITHREADED_AUDIO');
} }
project.addDefine('KORE'); project.addDefine('KORE');

View File

@ -1,16 +1,55 @@
package kha.graphics4; package kha.graphics4;
using StringTools;
import kha.Blob; import kha.Blob;
class FragmentShader { class FragmentShader {
public var _shader: Pointer; public var _shader: Pointer;
public function new(sources: Array<Blob>, files: Array<String>) { public function new(sources: Array<Blob>, files: Array<String>) {
initShader(sources[0]); //initShader(sources[0]);
var shaderBlob: Blob = null;
var shaderFile: String = null;
#if kha_opengl
final expectedExtension = ".glsl";
#elseif kha_direct3d11
final expectedExtension = ".d3d11";
#elseif kha_direct3d12
final expectedExtension = ".d3d12";
#elseif kha_metal
final expectedExtension = ".metal";
#elseif kha_vulkan
final expectedExtension = ".spirv";
#else
final expectedExtension = ".glsl";
#end
if (sources != null && files != null) {
for (i in 0...files.length) {
if (files[i].endsWith(expectedExtension)) {
shaderBlob = sources[i];
shaderFile = files[i];
break;
}
}
}
if (shaderBlob == null && sources != null && sources.length > 0) {
trace('Warning: Could not find shader with extension ${expectedExtension}. Falling back to sources[0]: ${files != null && files.length > 0 ? files[0] : "Unknown"}');
shaderBlob = sources[0];
}
if (shaderBlob != null) {
initShader(shaderBlob);
} else {
trace('Error: No suitable fragment shader source found!');
}
} }
function initShader(source: Blob): Void { function initShader(source: Blob): Void {
_shader = kinc_create_fragmentshader(source.bytes.getData(), source.bytes.getData().length); //_shader = kinc_create_fragmentshader(source.bytes.getData(), source.bytes.getData().length);
_shader = kinc_create_fragmentshader(source.bytes.getData(), source.length); // Use source.length here
} }
public static function fromSource(source: String): FragmentShader { public static function fromSource(source: String): FragmentShader {

View File

@ -1,179 +1,38 @@
#include <kinc/compute/compute.h> #include <kinc/graphics4/compute.h>
#include <kinc/graphics4/texture.h> #include <kinc/graphics4/texture.h>
#include <hl.h> #include <hl.h>
vbyte *hl_kinc_compute_create_shader(vbyte *data, int length) { vbyte *hl_kinc_compute_create_shader(vbyte *data, int length) {
kinc_compute_shader_t *shader = (kinc_compute_shader_t *)malloc(sizeof(kinc_compute_shader_t)); kinc_g4_compute_shader *shader = (kinc_g4_compute_shader *)malloc(sizeof(kinc_g4_compute_shader));
kinc_compute_shader_init(shader, data, length); kinc_g4_compute_shader_init(shader, data, length);
return (vbyte *)shader; return (vbyte *)shader;
} }
void hl_kinc_compute_delete_shader(vbyte *shader) { void hl_kinc_compute_delete_shader(vbyte *shader) {
kinc_compute_shader_t *sh = (kinc_compute_shader_t *)shader; kinc_g4_compute_shader *sh = (kinc_g4_compute_shader *)shader;
kinc_compute_shader_destroy(sh); kinc_g4_compute_shader_destroy(sh);
free(sh); free(sh);
} }
vbyte *hl_kinc_compute_get_constantlocation(vbyte *shader, vbyte *name) { vbyte *hl_kinc_compute_get_constantlocation(vbyte *shader, vbyte *name) {
kinc_compute_shader_t *sh = (kinc_compute_shader_t *)shader; kinc_g4_compute_shader *sh = (kinc_g4_compute_shader *)shader;
kinc_compute_constant_location_t *location = (kinc_compute_constant_location_t *)malloc(sizeof(kinc_compute_constant_location_t)); kinc_g4_constant_location_t *location = (kinc_g4_constant_location_t *)malloc(sizeof(kinc_g4_constant_location_t));
*location = kinc_compute_shader_get_constant_location(sh, (char *)name), sizeof(kinc_compute_constant_location_t); *location = kinc_g4_compute_shader_get_constant_location(sh, (char *)name);
return (vbyte *)location; return (vbyte *)location;
} }
vbyte *hl_kinc_compute_get_textureunit(vbyte *shader, vbyte *name) { vbyte *hl_kinc_compute_get_textureunit(vbyte *shader, vbyte *name) {
kinc_compute_shader_t *sh = (kinc_compute_shader_t *)shader; kinc_g4_compute_shader *sh = (kinc_g4_compute_shader *)shader;
kinc_compute_texture_unit_t *unit = (kinc_compute_texture_unit_t *)malloc(sizeof(kinc_compute_texture_unit_t)); kinc_g4_texture_unit_t *unit = (kinc_g4_texture_unit_t *)malloc(sizeof(kinc_g4_texture_unit_t));
*unit = kinc_compute_shader_get_texture_unit(sh, (char *)name), sizeof(kinc_compute_texture_unit_t); *unit = kinc_g4_compute_shader_get_texture_unit(sh, (char *)name);
return (vbyte *)unit; return (vbyte *)unit;
} }
void hl_kinc_compute_set_bool(vbyte *location, bool value) { void hl_kinc_set_compute_shader(vbyte *shader) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location; kinc_g4_set_compute_shader((kinc_g4_compute_shader *)shader);
kinc_compute_set_bool(*loc, value);
} }
void hl_kinc_compute_set_int(vbyte *location, int value) { void hl_kinc_compute(int x, int y, int z) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location; kinc_g4_compute(x, y, z);
kinc_compute_set_int(*loc, value);
}
void hl_kinc_compute_set_float(vbyte *location, float value) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
kinc_compute_set_float(*loc, value);
}
void hl_kinc_compute_set_float2(vbyte *location, float value1, float value2) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
kinc_compute_set_float2(*loc, value1, value2);
}
void hl_kinc_compute_set_float3(vbyte *location, float value1, float value2, float value3) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
kinc_compute_set_float3(*loc, value1, value2, value3);
}
void hl_kinc_compute_set_float4(vbyte *location, float value1, float value2, float value3, float value4) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
kinc_compute_set_float4(*loc, value1, value2, value3, value4);
}
void hl_kinc_compute_set_floats(vbyte *location, vbyte *values, int count) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
kinc_compute_set_floats(*loc, (float *)values, count);
}
void hl_kinc_compute_set_matrix(vbyte *location, float _00, float _10, float _20, float _30, float _01, float _11, float _21, float _31, float _02, float _12,
float _22, float _32, float _03, float _13, float _23, float _33) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
kinc_matrix4x4_t value;
kinc_matrix4x4_set(&value, 0, 0, _00);
kinc_matrix4x4_set(&value, 0, 1, _01);
kinc_matrix4x4_set(&value, 0, 2, _02);
kinc_matrix4x4_set(&value, 0, 3, _03);
kinc_matrix4x4_set(&value, 1, 0, _10);
kinc_matrix4x4_set(&value, 1, 1, _11);
kinc_matrix4x4_set(&value, 1, 2, _12);
kinc_matrix4x4_set(&value, 1, 3, _13);
kinc_matrix4x4_set(&value, 2, 0, _20);
kinc_matrix4x4_set(&value, 2, 1, _21);
kinc_matrix4x4_set(&value, 2, 2, _22);
kinc_matrix4x4_set(&value, 2, 3, _23);
kinc_matrix4x4_set(&value, 3, 0, _30);
kinc_matrix4x4_set(&value, 3, 1, _31);
kinc_matrix4x4_set(&value, 3, 2, _32);
kinc_matrix4x4_set(&value, 3, 3, _33);
kinc_compute_set_matrix4(*loc, &value);
}
void hl_kinc_compute_set_matrix3(vbyte *location, float _00, float _10, float _20, float _01, float _11, float _21, float _02, float _12, float _22) {
kinc_compute_constant_location_t *loc = (kinc_compute_constant_location_t *)location;
kinc_matrix3x3_t value;
kinc_matrix3x3_set(&value, 0, 0, _00);
kinc_matrix3x3_set(&value, 0, 1, _01);
kinc_matrix3x3_set(&value, 0, 2, _02);
kinc_matrix3x3_set(&value, 1, 0, _10);
kinc_matrix3x3_set(&value, 1, 1, _11);
kinc_matrix3x3_set(&value, 1, 2, _12);
kinc_matrix3x3_set(&value, 2, 0, _20);
kinc_matrix3x3_set(&value, 2, 1, _21);
kinc_matrix3x3_set(&value, 2, 2, _22);
kinc_compute_set_matrix3(*loc, &value);
}
void hl_kinc_compute_set_texture(vbyte *unit, vbyte *texture, int access) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_g4_texture_t *tex = (kinc_g4_texture_t *)texture;
kinc_compute_set_texture(*u, tex, (kinc_compute_access_t)access);
}
void hl_kinc_compute_set_target(vbyte *unit, vbyte *renderTarget, int access) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
kinc_compute_set_render_target(*u, rt, (kinc_compute_access_t)access);
}
void hl_kinc_compute_set_sampled_texture(vbyte *unit, vbyte *texture) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_g4_texture_t *tex = (kinc_g4_texture_t *)texture;
kinc_compute_set_sampled_texture(*u, tex);
}
void hl_kinc_compute_set_sampled_target(vbyte *unit, vbyte *renderTarget) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
kinc_compute_set_sampled_render_target(*u, rt);
}
void hl_kinc_compute_set_sampled_depth_target(vbyte *unit, vbyte *renderTarget) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
kinc_compute_set_sampled_depth_from_render_target(*u, rt);
}
void hl_kinc_compute_set_sampled_cubemap_texture(vbyte *unit, vbyte *texture) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_g4_texture_t *tex = (kinc_g4_texture_t *)texture;
kinc_compute_set_sampled_texture(*u, tex);
}
void hl_kinc_compute_set_sampled_cubemap_target(vbyte *unit, vbyte *renderTarget) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
kinc_compute_set_sampled_render_target(*u, rt);
}
void hl_kinc_compute_set_sampled_cubemap_depth_target(vbyte *unit, vbyte *renderTarget) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_g4_render_target_t *rt = (kinc_g4_render_target_t *)renderTarget;
kinc_compute_set_sampled_depth_from_render_target(*u, rt);
}
void hl_kinc_compute_set_texture_parameters(vbyte *unit, int uAddressing, int vAddressing, int minificationFilter, int magnificationFilter, int mipmapFilter) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_compute_set_texture_addressing(*u, KINC_G4_TEXTURE_DIRECTION_U, (kinc_g4_texture_addressing_t)uAddressing);
kinc_compute_set_texture_addressing(*u, KINC_G4_TEXTURE_DIRECTION_V, (kinc_g4_texture_addressing_t)vAddressing);
kinc_compute_set_texture_minification_filter(*u, (kinc_g4_texture_filter_t)minificationFilter);
kinc_compute_set_texture_magnification_filter(*u, (kinc_g4_texture_filter_t)magnificationFilter);
kinc_compute_set_texture_mipmap_filter(*u, (kinc_g4_mipmap_filter_t)mipmapFilter);
}
void hl_kinc_compute_set_texture3d_parameters(vbyte *unit, int uAddressing, int vAddressing, int wAddressing, int minificationFilter, int magnificationFilter,
int mipmapFilter) {
kinc_compute_texture_unit_t *u = (kinc_compute_texture_unit_t *)unit;
kinc_compute_set_texture3d_addressing(*u, KINC_G4_TEXTURE_DIRECTION_U, (kinc_g4_texture_addressing_t)uAddressing);
kinc_compute_set_texture3d_addressing(*u, KINC_G4_TEXTURE_DIRECTION_V, (kinc_g4_texture_addressing_t)vAddressing);
kinc_compute_set_texture3d_addressing(*u, KINC_G4_TEXTURE_DIRECTION_W, (kinc_g4_texture_addressing_t)wAddressing);
kinc_compute_set_texture3d_minification_filter(*u, (kinc_g4_texture_filter_t)minificationFilter);
kinc_compute_set_texture3d_magnification_filter(*u, (kinc_g4_texture_filter_t)magnificationFilter);
kinc_compute_set_texture3d_mipmap_filter(*u, (kinc_g4_mipmap_filter_t)mipmapFilter);
}
void hl_kinc_compute_set_shader(vbyte *shader) {
kinc_compute_set_shader((kinc_compute_shader_t *)shader);
}
void hl_kinc_compute_compute(int x, int y, int z) {
kinc_compute(x, y, z);
} }

View File

@ -42,8 +42,8 @@ static void update(void *data) {
static bool mixThreadregistered = false; static bool mixThreadregistered = false;
static void mix(kinc_a2_buffer_t *buffer, int samples) { static void mix(kinc_a2_buffer_t *buffer, uint32_t samples, void *userdata) {
#ifdef KORE_MULTITHREADED_AUDIO #ifdef KINC_MULTITHREADED_AUDIO
if (!mixThreadregistered) { if (!mixThreadregistered) {
vdynamic *ret; vdynamic *ret;
hl_register_thread(&ret); hl_register_thread(&ret);
@ -54,16 +54,18 @@ static void mix(kinc_a2_buffer_t *buffer, int samples) {
audioCallCallback(samples); audioCallCallback(samples);
for (int i = 0; i < samples; ++i) { for (uint32_t i = 0; i < samples; i += 2) {
float value = audioReadSample(); float left_value = audioReadSample();
*(float *)&buffer->data[buffer->write_location] = value; float right_value = audioReadSample();
buffer->write_location += 4; *(float *)&buffer->channels[0][buffer->write_location] = left_value;
*(float *)&buffer->channels[1][buffer->write_location] = right_value;
buffer->write_location += 1;
if (buffer->write_location >= buffer->data_size) { if (buffer->write_location >= buffer->data_size) {
buffer->write_location = 0; buffer->write_location = 0;
} }
} }
#ifdef KORE_MULTITHREADED_AUDIO #ifdef KINC_MULTITHREADED_AUDIO
hl_blocking(false); hl_blocking(false);
#endif #endif
} }
@ -92,9 +94,9 @@ void hl_init_kore(vbyte *title, int width, int height, int samplesPerPixel, bool
void hl_kinc_init_audio(vclosure *callCallback, vclosure *readSample, int *outSamplesPerSecond) { void hl_kinc_init_audio(vclosure *callCallback, vclosure *readSample, int *outSamplesPerSecond) {
audioCallCallback = *((FN_AUDIO_CALL_CALLBACK *)(&callCallback->fun)); audioCallCallback = *((FN_AUDIO_CALL_CALLBACK *)(&callCallback->fun));
audioReadSample = *((FN_AUDIO_READ_SAMPLE *)(&readSample->fun)); audioReadSample = *((FN_AUDIO_READ_SAMPLE *)(&readSample->fun));
kinc_a2_set_callback(mix);
kinc_a2_init(); kinc_a2_init();
*outSamplesPerSecond = kinc_a2_samples_per_second; kinc_a2_set_callback(mix, NULL);
*outSamplesPerSecond = kinc_a2_samples_per_second();
} }
void hl_run_kore(void) { void hl_run_kore(void) {

View File

@ -94,11 +94,11 @@ void hl_kinc_system_load_url(vbyte *url) {
} }
vbyte *hl_kinc_get_gamepad_id(int index) { vbyte *hl_kinc_get_gamepad_id(int index) {
return (vbyte*)kinc_gamepad_product_name(index); return (vbyte *)kinc_gamepad_product_name(index);
} }
vbyte *hl_kinc_get_gamepad_vendor(int index) { vbyte *hl_kinc_get_gamepad_vendor(int index) {
return (vbyte*)kinc_gamepad_vendor(index); return (vbyte *)kinc_gamepad_vendor(index);
} }
bool hl_kinc_gamepad_connected(int index) { bool hl_kinc_gamepad_connected(int index) {
@ -137,12 +137,12 @@ void hl_kinc_register_pen(vclosure *penDown, vclosure *penUp, vclosure *penMove)
kinc_pen_set_move_callback(*((FN_PEN_MOVE *)(&penMove->fun))); kinc_pen_set_move_callback(*((FN_PEN_MOVE *)(&penMove->fun)));
} }
typedef void (*FN_GAMEPAD_AXIS)(int, int, float); typedef void (*FN_GAMEPAD_AXIS)(int, int, float, void *);
typedef void (*FN_GAMEPAD_BUTTON)(int, int, float); typedef void (*FN_GAMEPAD_BUTTON)(int, int, float, void *);
void hl_kinc_register_gamepad(vclosure *gamepadAxis, vclosure *gamepadButton) { void hl_kinc_register_gamepad(vclosure *gamepadAxis, vclosure *gamepadButton) {
kinc_gamepad_set_axis_callback(*((FN_GAMEPAD_AXIS *)(&gamepadAxis->fun))); kinc_gamepad_set_axis_callback(*((FN_GAMEPAD_AXIS *)(&gamepadAxis->fun)), NULL);
kinc_gamepad_set_button_callback(*((FN_GAMEPAD_BUTTON *)(&gamepadButton->fun))); kinc_gamepad_set_button_callback(*((FN_GAMEPAD_BUTTON *)(&gamepadButton->fun)), NULL);
} }
typedef void (*FN_TOUCH_START)(int, int, int); typedef void (*FN_TOUCH_START)(int, int, int);

View File

@ -80,6 +80,7 @@ extern class Krom {
static function unloadImage(image: kha.Image): Void; static function unloadImage(image: kha.Image): Void;
static function loadSound(file: String): Dynamic; static function loadSound(file: String): Dynamic;
static function writeAudioBuffer(buffer: js.lib.ArrayBuffer, samples: Int): Void; static function writeAudioBuffer(buffer: js.lib.ArrayBuffer, samples: Int): Void;
static function getSamplesPerSecond(): Int;
static function loadBlob(file: String): js.lib.ArrayBuffer; static function loadBlob(file: String): js.lib.ArrayBuffer;
static function init(title: String, width: Int, height: Int, samplesPerPixel: Int, vSync: Bool, windowMode: Int, windowFeatures: Int, kromApi: Int): Void; static function init(title: String, width: Int, height: Int, samplesPerPixel: Int, vSync: Bool, windowMode: Int, windowFeatures: Int, kromApi: Int): Void;
@ -115,6 +116,7 @@ extern class Krom {
static function screenDpi(): Int; static function screenDpi(): Int;
static function systemId(): String; static function systemId(): String;
static function requestShutdown(): Void; static function requestShutdown(): Void;
static function displayFrequency(): Int;
static function displayCount(): Int; static function displayCount(): Int;
static function displayWidth(index: Int): Int; static function displayWidth(index: Int): Int;
static function displayHeight(index: Int): Int; static function displayHeight(index: Int): Int;

View File

@ -79,7 +79,7 @@ class Display {
public var frequency(get, never): Int; public var frequency(get, never): Int;
function get_frequency(): Int { function get_frequency(): Int {
return 60; return Krom.displayFrequency();
} }
public var pixelsPerInch(get, never): Int; public var pixelsPerInch(get, never): Int;

View File

@ -171,8 +171,9 @@ class SystemImpl {
Krom.setGamepadAxisCallback(gamepadAxisCallback); Krom.setGamepadAxisCallback(gamepadAxisCallback);
Krom.setGamepadButtonCallback(gamepadButtonCallback); Krom.setGamepadButtonCallback(gamepadButtonCallback);
kha.audio2.Audio._init(); kha.audio2.Audio.samplesPerSecond = Krom.getSamplesPerSecond();
kha.audio1.Audio._init(); kha.audio1.Audio._init();
kha.audio2.Audio._init();
Krom.setAudioCallback(audioCallback); Krom.setAudioCallback(audioCallback);
Scheduler.start(); Scheduler.start();
@ -207,7 +208,7 @@ class SystemImpl {
} }
public static function getRefreshRate(): Int { public static function getRefreshRate(): Int {
return 60; return Krom.displayFrequency();
} }
public static function getSystemId(): String { public static function getSystemId(): String {

View File

@ -10,8 +10,7 @@ class Audio {
public static function _init() { public static function _init() {
var bufferSize = 1024 * 2; var bufferSize = 1024 * 2;
buffer = new Buffer(bufferSize * 4, 2, 44100); buffer = new Buffer(bufferSize * 4, 2, samplesPerSecond);
Audio.samplesPerSecond = 44100;
} }
public static function _callCallback(samples: Int): Void { public static function _callCallback(samples: Int): Void {
@ -32,11 +31,11 @@ class Audio {
} }
} }
public static function _readSample(): Float { public static function _readSample(): FastFloat {
if (buffer == null) if (buffer == null)
return 0; return 0;
var value = buffer.data.get(buffer.readLocation); var value = buffer.data.get(buffer.readLocation);
buffer.readLocation += 1; ++buffer.readLocation;
if (buffer.readLocation >= buffer.size) { if (buffer.readLocation >= buffer.size) {
buffer.readLocation = 0; buffer.readLocation = 0;
} }

View File

@ -59,7 +59,7 @@ class Graphics implements kha.graphics4.Graphics {
} }
public function refreshRate(): Int { public function refreshRate(): Int {
return 60; return Krom.displayFrequency();
} }
public function clear(?color: Color, ?depth: Float, ?stencil: Int): Void { public function clear(?color: Color, ?depth: Float, ?stencil: Int): Void {

View File

@ -39,14 +39,38 @@ int playback_callback(snd_pcm_sframes_t nframes) {
int ni = 0; int ni = 0;
while (ni < nframes) { while (ni < nframes) {
int i = 0; int i = 0;
for (; ni < nframes && i < 4096 * 2; ++i, ++ni) { for (; ni < nframes && i < 4096; ++i, ++ni) {
copySample(&buf[i * 2]); copySample(&buf[i * 2]);
} }
int err2; int err2 = snd_pcm_writei(playback_handle, buf, i);
if ((err2 = snd_pcm_writei(playback_handle, buf, i)) < 0) { if (err2 < 0) {
fprintf(stderr, "write failed (%s)\n", snd_strerror(err2)); fprintf(stderr, "ALSA write failed in playback_callback: %s\n", snd_strerror(err2));
return err2;
} }
err += err2; if (err2 < i) {
fprintf(stderr, "ALSA short write in playback_callback: wrote %d of %d frames\n", err2, i);
}
}
err = nframes;
}
else {
// Write silence data to prevent recovery
if (nframes > 4096) {
fprintf(stderr, "Warning: ALSA requested %ld frames for silence, exceeding local buffer size %d. Clamping.\n", nframes, 4096);
nframes = 4096;
}
memset(buf, 0, nframes * 4);
int err2 = snd_pcm_writei(playback_handle, buf, nframes);
if (err2 < 0) {
fprintf(stderr, "ALSA silence write failed in playback_callback: %s\n", snd_strerror(err2));
err = err2;
} else {
if (err2 < nframes) {
fprintf(stderr, "ALSA short silence write in playback_callback: wrote %d of %d frames\n", err2, (int)nframes);
}
err = err2;
} }
} }
return err; return err;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 281 KiB

View File

@ -51,7 +51,7 @@ class Scheduler {
static var vsync: Bool; static var vsync: Bool;
// Html5 target can update display frequency after some delay // Html5 target can update display frequency after some delay
#if kha_html5 #if (kha_html5 || kha_debug_html5)
static var onedifhz(get, never): Float; static var onedifhz(get, never): Float;
static inline function get_onedifhz(): Float { static inline function get_onedifhz(): Float {
@ -97,7 +97,7 @@ class Scheduler {
public static function start(restartTimers: Bool = false): Void { public static function start(restartTimers: Bool = false): Void {
vsync = Window.get(0).vSynced; vsync = Window.get(0).vSynced;
#if !kha_html5 #if !(kha_html5 || kha_debug_html5)
var hz = Display.primary != null ? Display.primary.frequency : 60; var hz = Display.primary != null ? Display.primary.frequency : 60;
if (hz >= 57 && hz <= 63) if (hz >= 57 && hz <= 63)
hz = 60; hz = 60;

BIN
Krom/Krom Executable file → Normal file

Binary file not shown.

Binary file not shown.

BIN
Krom/Krom_opengl.exe Normal file

Binary file not shown.

View File

@ -6,22 +6,12 @@ Welcome to Leenkx!
<br> <br>
- <a style="color:#2AE0E0;" class="text primary primary-text" href="https://leenkx.com/files/LeenkxSDK3_RC.zip">LeenkxSDKV3.6 lts</a> - Run your own private p2p torrent socket changing Leenkx javascript file directly in /lnxsdk/lib/leenkx_tools/lnxjs/Leenkx.js or by configuring the OPTS map in the create Leenkx node.
<br> <br>
- <a style="color:#2AE0E0;" class="text primary primary-text" href="https://leenkx.com/files/lx/Leenkx.js">Leenkx.js</a> - LNXJS Works as a standalone library
<br>
- Run your own private p2p torrent socket changing Leenkx javascript file directly in /lnxsdk/lib/leenkx_tools/lxjs/Leenkx.js or by configuring the OPTS map in the create Leenkx node.
<br>
- All works are open source ZLIB / MIT and any compatible licence that guarantee the softwares freedom from my additions to the previous maintainers
<br>
- LxJS Works as a standalone library
<br> <br>
- The SDK is not ready for production, use for educational purposes. Help the team by reaching out at Leenkx.com! - The SDK is not ready for production, use for educational purposes. Help the team by reaching out at Leenkx.com!
<br> <br>
- This build is based on QuantumCoder's whole new core animation system packed with new features! Timmodrians Aura library is also built into this build when audio is enabled!
<br>
- The SDK is still undergoing many changes so working on large projects is not recommended.
<br>
- Special thanks to all contributors from the following projects! - Special thanks to all contributors from the following projects!
<br> <br>
* https://github.com/armory3d/armory/graphs/contributors<br> * https://github.com/armory3d/armory/graphs/contributors<br>

View File

@ -310,9 +310,9 @@ class LeenkxAddonPreferences(AddonPreferences):
layout.label(text="Welcome to Leenkx!") layout.label(text="Welcome to Leenkx!")
# Compare version Blender and Leenkx (major, minor) # Compare version Blender and Leenkx (major, minor)
if bpy.app.version[0] != 3 or bpy.app.version[1] != 6: if bpy.app.version[:2] not in [(4, 4), (4, 2), (3, 6), (3, 3)]:
box = layout.box().column() box = layout.box().column()
box.label(text="Warning: For Leenkx to work correctly, you need Blender 3.6 LTS.") box.label(text="Warning: For Leenkx to work correctly, use a Blender LTS version")
layout.prop(self, "sdk_path") layout.prop(self, "sdk_path")
sdk_path = get_sdk_path(context) sdk_path = get_sdk_path(context)
@ -914,7 +914,10 @@ def restart_leenkx(context):
@persistent @persistent
def on_load_post(context): def on_load_post(context):
if bpy.context is not None:
restart_leenkx(bpy.context) # context is None, use bpy.context instead restart_leenkx(bpy.context) # context is None, use bpy.context instead
else:
bpy.app.timers.register(lambda: restart_leenkx(bpy.context), first_interval=0.1)
def on_register_post(): def on_register_post():

View File

@ -475,7 +475,11 @@ fragColor.rgb = min(fragColor.rgb, 65504 * 0.5);
} else { } else {
fragColor.rgb = mix(midLumColor, maxLumColor, luminance); fragColor.rgb = mix(midLumColor, maxLumColor, luminance);
} }
} else if (PPComp4.x == 9){
fragColor.rgb = tonemapAgXSimple(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
} else if (PPComp4.x == 10){
fragColor.rgb = tonemapAgXFull(fragColor.rgb);
} else { } else {
fragColor.rgb = vec3(0,1,0); //ERROR fragColor.rgb = vec3(0,1,0); //ERROR
} }
@ -498,6 +502,13 @@ fragColor.rgb = min(fragColor.rgb, 65504 * 0.5);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
fragColor.rgb = clamp(fragColor.rgb, 0.0, 2.2); fragColor.rgb = clamp(fragColor.rgb, 0.0, 2.2);
#endif #endif
#ifdef _CToneAgXSimple
fragColor.rgb = tonemapAgXSimple(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
#endif
#ifdef _CToneAgXFull
fragColor.rgb = tonemapAgXFull(fragColor.rgb);
#endif
#ifdef _CToneNone #ifdef _CToneNone
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
#endif #endif
@ -614,4 +625,37 @@ fragColor.rgb = min(fragColor.rgb, 65504 * 0.5);
#ifdef _CLUT #ifdef _CLUT
fragColor = LUTlookup(fragColor, lutTexture); fragColor = LUTlookup(fragColor, lutTexture);
#endif #endif
#ifdef _CDitheringBlueNoise
const float ditherStrength = ditherStrengthValue / 255.0;
float noise = ditherBlueNoiseStyle(gl_FragCoord.xy);
float noiseOffset = (noise - 0.5) * ditherStrength;
fragColor.rgb += noiseOffset;
#endif
#ifdef _CDitheringWhiteNoise
const float ditherStrength = ditherStrengthValue / 255.0;
float noise = ditherWhiteNoise(gl_FragCoord.xy);
float noiseOffset = (noise - 0.5) * ditherStrength;
fragColor.rgb += noiseOffset;
#endif
#ifdef _CDitheringOrderedBayer4x4
const float ditherStrength = ditherStrengthValue / 255.0;
float noise = ditherOrderedBayer4x4(ivec2(gl_FragCoord.xy));
float noiseOffset = (noise - 0.5) * ditherStrength;
fragColor.rgb += noiseOffset;
#endif
#ifdef _CDitheringOrderedBayer8x8
const float ditherStrength = ditherStrengthValue / 255.0;
float noise = ditherOrderedBayer8x8(ivec2(gl_FragCoord.xy));
float noiseOffset = (noise - 0.5) * ditherStrength;
fragColor.rgb += noiseOffset;
#endif
//fragColor.rgb = clamp(fragColor.rgb, 0.0, 1.0);
} }

View File

@ -20,7 +20,7 @@ uniform sampler2D gbuffer0;
uniform sampler2D gbuffer1; uniform sampler2D gbuffer1;
#ifdef _gbuffer2 #ifdef _gbuffer2
uniform sampler2D gbuffer2; //!uniform sampler2D gbuffer2;
#endif #endif
#ifdef _EmissionShaded #ifdef _EmissionShaded
uniform sampler2D gbufferEmission; uniform sampler2D gbufferEmission;
@ -286,7 +286,7 @@ void main() {
#ifdef _VoxelGI #ifdef _VoxelGI
vec4 indirect_diffuse = textureLod(voxels_diffuse, texCoord, 0.0); vec4 indirect_diffuse = textureLod(voxels_diffuse, texCoord, 0.0);
fragColor.rgb = (indirect_diffuse.rgb * albedo + envl.rgb * (1.0 - indirect_diffuse.a)) * voxelgiDiff; fragColor.rgb = (indirect_diffuse.rgb + envl.rgb * (1.0 - indirect_diffuse.a)) * albedo * voxelgiDiff;
if(roughness < 1.0 && occspec.y > 0.0) if(roughness < 1.0 && occspec.y > 0.0)
fragColor.rgb += textureLod(voxels_specular, texCoord, 0.0).rgb * occspec.y * voxelgiRefl; fragColor.rgb += textureLod(voxels_specular, texCoord, 0.0).rgb * occspec.y * voxelgiRefl;
#endif #endif
@ -380,7 +380,7 @@ void main() {
#endif #endif
#ifdef _VoxelShadow #ifdef _VoxelShadow
svisibility *= (1.0 - traceShadow(p, n, voxels, voxelsSDF, sunDir, clipmaps, gl_FragCoord.xy).r) * voxelgiShad; svisibility *= (1.0 - traceShadow(p, n, voxels, voxelsSDF, sunDir, clipmaps, gl_FragCoord.xy, g2.rg).r) * voxelgiShad;
#endif #endif
#ifdef _SSRS #ifdef _SSRS

View File

@ -92,7 +92,7 @@ void main() {
vec3 viewNormal = V3 * n; vec3 viewNormal = V3 * n;
vec3 viewPos = getPosView(viewRay, d, cameraProj); vec3 viewPos = getPosView(viewRay, d, cameraProj);
vec3 reflected = reflect(viewPos, viewNormal); vec3 reflected = reflect(normalize(viewPos), viewNormal);
hitCoord = viewPos; hitCoord = viewPos;
#ifdef _CPostprocess #ifdef _CPostprocess

View File

@ -62,9 +62,12 @@ vec4 rayCast(vec3 dir) {
for (int i = 0; i < maxSteps; i++) { for (int i = 0; i < maxSteps; i++) {
hitCoord += dir; hitCoord += dir;
ddepth = getDeltaDepth(hitCoord); ddepth = getDeltaDepth(hitCoord);
if (ddepth > 0.0) return binarySearch(dir); if (ddepth > 0.0)
return binarySearch(dir);
} }
return vec4(texCoord, 0.0, 1.0); // No hit — fallback to projecting the ray to UV space
vec2 fallbackUV = getProjectedCoord(hitCoord);
return vec4(fallbackUV, 0.0, 0.5); // We set .w lower to indicate fallback
} }
void main() { void main() {
@ -74,7 +77,7 @@ void main() {
float ior = gr.x; float ior = gr.x;
float opac = gr.y; float opac = gr.y;
float d = textureLod(gbufferD, texCoord, 0.0).r * 2.0 - 1.0; float d = textureLod(gbufferD, texCoord, 0.0).r * 2.0 - 1.0;
if (d == 0.0 || d == 1.0 || opac == 1.0 || ior == 1.0) { if (d == 0.0 || opac == 1.0 || ior == 1.0) {
fragColor.rgb = textureLod(tex1, texCoord, 0.0).rgb; fragColor.rgb = textureLod(tex1, texCoord, 0.0).rgb;
return; return;
} }
@ -86,7 +89,7 @@ void main() {
vec3 viewNormal = V3 * n; vec3 viewNormal = V3 * n;
vec3 viewPos = getPosView(viewRay, d, cameraProj); vec3 viewPos = getPosView(viewRay, d, cameraProj);
vec3 refracted = refract(viewPos, viewNormal, 1.0 / ior); vec3 refracted = refract(normalize(viewPos), viewNormal, 1.0 / ior);
hitCoord = viewPos; hitCoord = viewPos;
vec3 dir = refracted * (1.0 - rand(texCoord) * ss_refractionJitter * roughness) * 2.0; vec3 dir = refracted * (1.0 - rand(texCoord) * ss_refractionJitter * roughness) * 2.0;

View File

@ -166,7 +166,7 @@ vec4 traceDiffuse(const vec3 origin, const vec3 normal, const sampler3D voxels,
} }
vec4 traceSpecular(const vec3 origin, const vec3 normal, const sampler3D voxels, const sampler3D voxelsSDF, const vec3 viewDir, const float roughness, const float clipmaps[voxelgiClipmapCount * 10], const vec2 pixel, const vec2 velocity) { vec4 traceSpecular(const vec3 origin, const vec3 normal, const sampler3D voxels, const sampler3D voxelsSDF, const vec3 viewDir, const float roughness, const float clipmaps[voxelgiClipmapCount * 10], const vec2 pixel, const vec2 velocity) {
vec3 specularDir = reflect(-viewDir, normal); vec3 specularDir = reflect(normalize(-viewDir), normal);
vec3 P = origin + specularDir * ((BayerMatrix8[int(pixel.x + velocity.x) % 8][int(pixel.y + velocity.y) % 8] - 0.5)) * voxelgiStep; vec3 P = origin + specularDir * ((BayerMatrix8[int(pixel.x + velocity.x) % 8][int(pixel.y + velocity.y) % 8] - 0.5)) * voxelgiStep;
vec4 amount = traceCone(voxels, voxelsSDF, P, normal, specularDir, 0, true, roughness, voxelgiStep, clipmaps); vec4 amount = traceCone(voxels, voxelsSDF, P, normal, specularDir, 0, true, roughness, voxelgiStep, clipmaps);
@ -176,9 +176,9 @@ vec4 traceSpecular(const vec3 origin, const vec3 normal, const sampler3D voxels,
return amount * voxelgiOcc; return amount * voxelgiOcc;
} }
vec4 traceRefraction(const vec3 origin, const vec3 normal, sampler3D voxels, sampler3D voxelsSDF, const vec3 viewDir, const float ior, const float roughness, const float clipmaps[voxelgiClipmapCount * 10], const vec2 pixel, const vec2 velocity) { vec4 traceRefraction(const vec3 origin, const vec3 normal, sampler3D voxels, sampler3D voxelsSDF, const vec3 viewDir, const float ior, const float roughness, const float clipmaps[voxelgiClipmapCount * 10], const vec2 pixel, const vec2 velocity, const float opacity) {
const float transmittance = 1.0; const float transmittance = 1.0 - opacity;
vec3 refractionDir = refract(-viewDir, normal, 1.0 / ior); vec3 refractionDir = refract(normalize(-viewDir), normal, 1.0 / ior);
vec3 P = origin + refractionDir * (BayerMatrix8[int(pixel.x + velocity.x) % 8][int(pixel.y + velocity.y) % 8] - 0.5) * voxelgiStep; vec3 P = origin + refractionDir * (BayerMatrix8[int(pixel.x + velocity.x) % 8][int(pixel.y + velocity.y) % 8] - 0.5) * voxelgiStep;
vec4 amount = transmittance * traceCone(voxels, voxelsSDF, P, normal, refractionDir, 0, true, roughness, voxelgiStep, clipmaps); vec4 amount = transmittance * traceCone(voxels, voxelsSDF, P, normal, refractionDir, 0, true, roughness, voxelgiStep, clipmaps);
@ -328,8 +328,8 @@ float traceConeShadow(const sampler3D voxels, const sampler3D voxelsSDF, const v
} }
float traceShadow(const vec3 origin, const vec3 normal, const sampler3D voxels, const sampler3D voxelsSDF, const vec3 dir, const float clipmaps[voxelgiClipmapCount * 10], const vec2 pixel) { float traceShadow(const vec3 origin, const vec3 normal, const sampler3D voxels, const sampler3D voxelsSDF, const vec3 dir, const float clipmaps[voxelgiClipmapCount * 10], const vec2 pixel, const vec2 velocity) {
vec3 P = origin + dir * (BayerMatrix8[int(pixel.x) % 8][int(pixel.y) % 8] - 0.5) * voxelgiStep; vec3 P = origin + dir * (BayerMatrix8[int(pixel.x + velocity.x) % 8][int(pixel.y + velocity.y) % 8] - 0.5) * voxelgiStep;
float amount = traceConeShadow(voxels, voxelsSDF, P, normal, dir, DIFFUSE_CONE_APERTURE, voxelgiStep, clipmaps); float amount = traceConeShadow(voxels, voxelsSDF, P, normal, dir, DIFFUSE_CONE_APERTURE, voxelgiStep, clipmaps);
amount = clamp(amount, 0.0, 1.0); amount = clamp(amount, 0.0, 1.0);
return amount * voxelgiOcc; return amount * voxelgiOcc;

View File

@ -9,7 +9,9 @@
#endif #endif
#ifdef _VoxelShadow #ifdef _VoxelShadow
#include "std/conetrace.glsl" #include "std/conetrace.glsl"
//!uniform sampler2D voxels_shadows; #endif
#ifdef _gbuffer2
uniform sampler2D gbuffer2;
#endif #endif
#ifdef _LTC #ifdef _LTC
#include "std/ltc.glsl" #include "std/ltc.glsl"
@ -146,7 +148,8 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
#endif #endif
#ifdef _VoxelShadow #ifdef _VoxelShadow
direct *= (1.0 - traceShadow(p, n, voxels, voxelsSDF, l, clipmaps, gl_FragCoord.xy).r) * voxelgiShad; vec4 g2 = textureLod(gbuffer2, gl_FragCoord.xy, 0.0);
direct *= (1.0 - traceShadow(p, n, voxels, voxelsSDF, l, clipmaps, gl_FragCoord.xy, g2.rg).r) * voxelgiShad;
#endif #endif
#ifdef _LTC #ifdef _LTC

View File

@ -1,4 +1,3 @@
vec3 uncharted2Tonemap(const vec3 x) { vec3 uncharted2Tonemap(const vec3 x) {
const float A = 0.15; const float A = 0.15;
const float B = 0.50; const float B = 0.50;
@ -36,3 +35,106 @@ vec3 acesFilm(const vec3 x) {
vec3 tonemapReinhard(const vec3 color) { vec3 tonemapReinhard(const vec3 color) {
return color / (color + vec3(1.0)); return color / (color + vec3(1.0));
} }
// Blender AgX Implementation
// Troy Sobotka https://github.com/sobotka/AgX
// AGX Simple
vec3 tonemapAgXSimple(vec3 x) {
// TODO CORRECT AND OPTIMIZE
x = max(x, vec3(0.0));
float exposure = 0.6;
x *= exposure;
const vec3 AgX_A = vec3(0.92, 0.92, 0.72);
const vec3 AgX_B = vec3(0.24, 0.24, 0.36);
const vec3 AgX_C = vec3(0.92, 0.92, 0.72);
const vec3 AgX_D = vec3(0.24, 0.24, 0.36);
const vec3 AgX_E = vec3(0.08, 0.08, 0.12);
const vec3 AgX_F = vec3(0.0);
vec3 result = (x * (AgX_A * x + AgX_B)) / (x * (AgX_C * x + AgX_D) + AgX_E) + AgX_F;
float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));
result = mix(vec3(luma), result, 0.6);
return clamp(result, vec3(0.0), vec3(1.0));
}
// AGX Full Contrast Approx
vec3 agxDefaultContrastApprox(vec3 x) {
vec3 x2 = x * x;
vec3 x4 = x2 * x2;
return + 15.5 * x4 * x2
- 40.14 * x4 * x
+ 31.96 * x4
- 6.868 * x2 * x
+ 0.4298 * x2
+ 0.1191 * x
- 0.00232;
}
// AGX Full Look
vec3 agxLook(vec3 x, float strength) {
const vec3 slope = vec3(1.0);
const vec3 power = vec3(1.35);
const vec3 sat = vec3(1.4);
vec3 lw = vec3(0.2126, 0.7152, 0.0722);
float luma = dot(x, lw);
return pow(x * slope, power) * sat - (pow(luma * slope, power) * (sat - 1.0));
}
// AGX Full
vec3 tonemapAgXFull(vec3 x) {
// x *= 2.0 * (1.0/0.8); // Brightness scale to match Blender's default
x = clamp(x, 0.0, 65504.0);
x = log2(x + 1.0);
x = agxDefaultContrastApprox(clamp(x * 0.5 - 10.5, -12.0, 12.0));
x = mix(x, agxLook(x, 0.5), 0.5);
x = clamp(x, 0.0, 1.0);
return pow(x, vec3(1.0/2.2));
}
// Interleaved Gradient Noise (Pseudo-random, AKA Blue Noise style)
// Based on http://momentsingraphics.de/BlueNoise.html
float ditherBlueNoiseStyle(vec2 p) {
return fract(sin(dot(p.xy, vec2(12.9898, 78.233))) * 43758.5453123);
}
// White Noise Dithering
float ditherWhiteNoise(vec2 p) {
return fract(sin(dot(p, vec2(12.9898, 4.1414))) * 43758.5453);
}
// Ordered Dithering (4x4 Bayer Matrix)
float ditherOrderedBayer4x4(ivec2 p) {
const float bayer[16] = float[16](
0.0, 8.0, 2.0, 10.0,
12.0, 4.0, 14.0, 6.0,
3.0, 11.0, 1.0, 9.0,
15.0, 7.0, 13.0, 5.0
);
int index = (p.x % 4) * 4 + (p.y % 4);
return bayer[index] / 16.0;
}
// Ordered Dithering (8x8 Bayer Matrix)
float ditherOrderedBayer8x8(ivec2 p) {
const float bayer8x8[64] = float[64](
0.0, 32.0, 8.0, 40.0, 2.0, 34.0, 10.0, 42.0,
48.0, 16.0, 56.0, 24.0, 50.0, 18.0, 58.0, 26.0,
12.0, 44.0, 4.0, 36.0, 14.0, 46.0, 6.0, 38.0,
60.0, 28.0, 52.0, 20.0, 62.0, 30.0, 54.0, 22.0,
3.0, 35.0, 11.0, 43.0, 1.0, 33.0, 9.0, 41.0,
51.0, 19.0, 59.0, 27.0, 49.0, 17.0, 57.0, 25.0,
15.0, 47.0, 7.0, 39.0, 13.0, 45.0, 5.0, 37.0,
63.0, 31.0, 55.0, 23.0, 61.0, 29.0, 53.0, 21.0
);
int index = (p.x % 8) * 8 + (p.y % 8);
return bayer8x8[index] / 64.0;
}
//vec3 applyDither(vec3 color, vec2 screenCoord) {
// float quantizationLevels = 255.0;
// float noise = randomDither(screenCoord);
// float noiseOffset = (noise - 0.5) / quantizationLevels;
// vec3 ditheredColor = color + noiseOffset;
// return clamp(ditheredColor, 0.0, 1.0);
//}

View File

@ -33,6 +33,7 @@ uniform layout(r32ui) uimage3D voxelsLight;
#ifdef _ShadowMap #ifdef _ShadowMap
uniform sampler2DShadow shadowMap; uniform sampler2DShadow shadowMap;
uniform sampler2D shadowMapTransparent;
uniform sampler2DShadow shadowMapSpot; uniform sampler2DShadow shadowMapSpot;
#ifdef _ShadowMapAtlas #ifdef _ShadowMapAtlas
uniform sampler2DShadow shadowMapPoint; uniform sampler2DShadow shadowMapPoint;
@ -86,27 +87,22 @@ float lpToDepth(vec3 lp, const vec2 lightProj) {
void main() { void main() {
int res = voxelgiResolution.x; int res = voxelgiResolution.x;
for (int i = 0; i < 6; i++) {
ivec3 dst = ivec3(gl_GlobalInvocationID.xyz); ivec3 dst = ivec3(gl_GlobalInvocationID.xyz);
dst.y += clipmapLevel * res;
vec3 P = (gl_GlobalInvocationID.xyz + 0.5) / voxelgiResolution; vec3 P = (gl_GlobalInvocationID.xyz + 0.5) / voxelgiResolution;
P = P * 2.0 - 1.0; P = P * 2.0 - 1.0;
P *= clipmaps[int(clipmapLevel * 10)];
P *= voxelgiResolution;
P += vec3(clipmaps[int(clipmapLevel * 10 + 4)], clipmaps[int(clipmapLevel * 10 + 5)], clipmaps[int(clipmapLevel * 10 + 6)]);
vec3 visibility; float visibility;
vec3 lp = lightPos - P; vec3 lp = lightPos - P;
vec3 l; vec3 l;
if (lightType == 0) { l = lightDir; visibility = vec3(1.0); } if (lightType == 0) { l = lightDir; visibility = 1.0; }
else { l = normalize(lp); visibility = vec3(attenuate(distance(P, lightPos))); } else { l = normalize(lp); visibility = attenuate(distance(P, lightPos)); }
#ifdef _ShadowMap #ifdef _ShadowMap
if (lightShadow == 1) { if (lightShadow == 1) {
vec4 lightPosition = LVP * vec4(P, 1.0); vec4 lightPosition = LVP * vec4(P, 1.0);
vec3 lPos = lightPosition.xyz / lightPosition.w; vec3 lPos = lightPosition.xyz / lightPosition.w;
visibility = texture(shadowMap, vec3(lPos.xy, lPos.z - shadowsBias)).rrr; visibility = texture(shadowMap, vec3(lPos.xy, lPos.z - shadowsBias)).r;
} }
else if (lightShadow == 2) { else if (lightShadow == 2) {
vec4 lightPosition = LVP * vec4(P, 1.0); vec4 lightPosition = LVP * vec4(P, 1.0);
@ -128,11 +124,14 @@ void main() {
visibility *= texture(shadowMapPoint, vec4(-l, lpToDepth(lp, lightProj) - shadowsBias)).r; visibility *= texture(shadowMapPoint, vec4(-l, lpToDepth(lp, lightProj) - shadowsBias)).r;
#endif #endif
} }
#endif #endif
vec3 uvw_light = (P - vec3(clipmaps[int(clipmapLevel * 10 + 4)], clipmaps[int(clipmapLevel * 10 + 5)], clipmaps[int(clipmapLevel * 10 + 6)])) / (float(clipmaps[int(clipmapLevel * 10)]) * voxelgiResolution);
uvw_light = (uvw_light * 0.5 + 0.5);
if (any(notEqual(uvw_light, clamp(uvw_light, 0.0, 1.0)))) return;
vec3 writecoords_light = floor(uvw_light * voxelgiResolution);
vec3 light = visibility * lightColor; imageAtomicMax(voxelsLight, ivec3(writecoords_light), uint(visibility * lightColor.r * 255));
imageAtomicMax(voxelsLight, ivec3(writecoords_light) + ivec3(0, 0, voxelgiResolution.x), uint(visibility * lightColor.g * 255));
imageAtomicAdd(voxelsLight, dst + ivec3(0, 0, 0), uint(light.r * 255)); imageAtomicMax(voxelsLight, ivec3(writecoords_light) + ivec3(0, 0, voxelgiResolution.x * 2), uint(visibility * lightColor.b * 255));
imageAtomicAdd(voxelsLight, dst + ivec3(0, 0, voxelgiResolution.x), uint(light.g * 255)); }
imageAtomicAdd(voxelsLight, dst + ivec3(0, 0, voxelgiResolution.x * 2), uint(light.b * 255));
} }

View File

@ -33,7 +33,7 @@ layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
uniform sampler3D voxels; uniform sampler3D voxels;
uniform sampler2D gbufferD; uniform sampler2D gbufferD;
uniform sampler2D gbuffer0; uniform sampler2D gbuffer0;
uniform layout(r8) image2D voxels_ao; uniform layout(r16) image2D voxels_ao;
uniform float clipmaps[voxelgiClipmapCount * 10]; uniform float clipmaps[voxelgiClipmapCount * 10];
uniform mat4 InvVP; uniform mat4 InvVP;

View File

@ -33,7 +33,7 @@ layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
uniform sampler3D voxels; uniform sampler3D voxels;
uniform sampler2D gbufferD; uniform sampler2D gbufferD;
uniform sampler2D gbuffer0; uniform sampler2D gbuffer0;
uniform layout(rgba8) image2D voxels_diffuse; uniform layout(rgba16) image2D voxels_diffuse;
uniform float clipmaps[voxelgiClipmapCount * 10]; uniform float clipmaps[voxelgiClipmapCount * 10];
uniform mat4 InvVP; uniform mat4 InvVP;
@ -46,7 +46,7 @@ void main() {
const vec2 pixel = gl_GlobalInvocationID.xy; const vec2 pixel = gl_GlobalInvocationID.xy;
vec2 uv = (pixel + 0.5) / postprocess_resolution; vec2 uv = (pixel + 0.5) / postprocess_resolution;
#ifdef _InvY #ifdef _InvY
uv.y = 1.0 - uv.y uv.y = 1.0 - uv.y;
#endif #endif
float depth = textureLod(gbufferD, uv, 0.0).r * 2.0 - 1.0; float depth = textureLod(gbufferD, uv, 0.0).r * 2.0 - 1.0;

View File

@ -34,7 +34,7 @@ uniform sampler2D gbufferD;
uniform sampler2D gbuffer0; uniform sampler2D gbuffer0;
uniform sampler3D voxels; uniform sampler3D voxels;
uniform sampler3D voxelsSDF; uniform sampler3D voxelsSDF;
uniform layout(rgba8) image2D voxels_specular; uniform layout(rgba16) image2D voxels_specular;
uniform float clipmaps[voxelgiClipmapCount * 10]; uniform float clipmaps[voxelgiClipmapCount * 10];
uniform mat4 InvVP; uniform mat4 InvVP;
@ -48,7 +48,7 @@ void main() {
const vec2 pixel = gl_GlobalInvocationID.xy; const vec2 pixel = gl_GlobalInvocationID.xy;
vec2 uv = (pixel + 0.5) / postprocess_resolution; vec2 uv = (pixel + 0.5) / postprocess_resolution;
#ifdef _InvY #ifdef _InvY
uv.y = 1.0 - uv.y uv.y = 1.0 - uv.y;
#endif #endif
float depth = textureLod(gbufferD, uv, 0.0).r * 2.0 - 1.0; float depth = textureLod(gbufferD, uv, 0.0).r * 2.0 - 1.0;
@ -71,7 +71,7 @@ void main() {
vec2 velocity = -textureLod(sveloc, uv, 0.0).rg; vec2 velocity = -textureLod(sveloc, uv, 0.0).rg;
vec3 color = traceSpecular(P, n, voxels, voxelsSDF, normalize(eye - P), g0.z, clipmaps, pixel, velocity).rgb; vec3 color = traceSpecular(P, n, voxels, voxelsSDF, normalize(eye - P), g0.z * g0.z, clipmaps, pixel, velocity).rgb;
imageStore(voxels_specular, ivec2(pixel), vec4(color, 1.0)); imageStore(voxels_specular, ivec2(pixel), vec4(color, 1.0));
} }

View File

@ -23,8 +23,8 @@ THE SOFTWARE.
#include "compiled.inc" #include "compiled.inc"
uniform layout(r16) image3D input_sdf; uniform layout(r8) image3D input_sdf;
uniform layout(r16) image3D output_sdf; uniform layout(r8) image3D output_sdf;
uniform float jump_size; uniform float jump_size;
uniform int clipmapLevel; uniform int clipmapLevel;

View File

@ -46,15 +46,15 @@ uniform layout(r32ui) uimage3D voxels;
uniform layout(r32ui) uimage3D voxelsLight; uniform layout(r32ui) uimage3D voxelsLight;
uniform layout(rgba8) image3D voxelsB; uniform layout(rgba8) image3D voxelsB;
uniform layout(rgba8) image3D voxelsOut; uniform layout(rgba8) image3D voxelsOut;
uniform layout(r16) image3D SDF; uniform layout(r8) image3D SDF;
#else #else
#ifdef _VoxelAOvar #ifdef _VoxelAOvar
#ifdef _VoxelShadow #ifdef _VoxelShadow
uniform layout(r16) image3D SDF; uniform layout(r8) image3D SDF;
#endif #endif
uniform layout(r32ui) uimage3D voxels; uniform layout(r32ui) uimage3D voxels;
uniform layout(r16) image3D voxelsB; uniform layout(r8) image3D voxelsB;
uniform layout(r16) image3D voxelsOut; uniform layout(r8) image3D voxelsOut;
#endif #endif
#endif #endif
@ -80,7 +80,6 @@ void main() {
light.r = float(imageLoad(voxelsLight, src)) / 255; light.r = float(imageLoad(voxelsLight, src)) / 255;
light.g = float(imageLoad(voxelsLight, src + ivec3(0, 0, voxelgiResolution.x))) / 255; light.g = float(imageLoad(voxelsLight, src + ivec3(0, 0, voxelgiResolution.x))) / 255;
light.b = float(imageLoad(voxelsLight, src + ivec3(0, 0, voxelgiResolution.x * 2))) / 255; light.b = float(imageLoad(voxelsLight, src + ivec3(0, 0, voxelgiResolution.x * 2))) / 255;
light /= 3;
#endif #endif
for (int i = 0; i < 6 + DIFFUSE_CONE_COUNT; i++) for (int i = 0; i < 6 + DIFFUSE_CONE_COUNT; i++)
@ -125,7 +124,7 @@ void main() {
envl.g = float(imageLoad(voxels, src + ivec3(0, 0, voxelgiResolution.x * 10))) / 255; envl.g = float(imageLoad(voxels, src + ivec3(0, 0, voxelgiResolution.x * 10))) / 255;
envl.b = float(imageLoad(voxels, src + ivec3(0, 0, voxelgiResolution.x * 11))) / 255; envl.b = float(imageLoad(voxels, src + ivec3(0, 0, voxelgiResolution.x * 11))) / 255;
envl /= 3; envl /= 3;
envl *= 100;
//clipmap to world //clipmap to world
vec3 wposition = (gl_GlobalInvocationID.xyz + 0.5) / voxelgiResolution.x; vec3 wposition = (gl_GlobalInvocationID.xyz + 0.5) / voxelgiResolution.x;
@ -137,7 +136,7 @@ void main() {
radiance = basecol; radiance = basecol;
vec4 trace = traceDiffuse(wposition, wnormal, voxelsSampler, clipmaps); vec4 trace = traceDiffuse(wposition, wnormal, voxelsSampler, clipmaps);
vec3 indirect = trace.rgb + envl.rgb * (1.0 - trace.a); vec3 indirect = trace.rgb + envl.rgb * (1.0 - trace.a);
radiance.rgb *= light + indirect; radiance.rgb *= light / PI + indirect;
radiance.rgb += emission.rgb; radiance.rgb += emission.rgb;
#else #else

View File

@ -75,16 +75,17 @@ vec4 binarySearch(vec3 dir) {
} }
vec4 rayCast(vec3 dir) { vec4 rayCast(vec3 dir) {
#ifdef _CPostprocess float ddepth;
dir *= PPComp9.x; dir *= ss_refractionRayStep;
#else
dir *= ssrRayStep;
#endif
for (int i = 0; i < maxSteps; i++) { for (int i = 0; i < maxSteps; i++) {
hitCoord += dir; hitCoord += dir;
if (getDeltaDepth(hitCoord) > 0.0) return binarySearch(dir); ddepth = getDeltaDepth(hitCoord);
if (ddepth > 0.0)
return binarySearch(dir);
} }
return vec4(0.0); // No hit — fallback to projecting the ray to UV space
vec2 fallbackUV = getProjectedCoord(hitCoord);
return vec4(fallbackUV, 0.0, 0.5); // We set .w lower to indicate fallback
} }
#endif //SSR #endif //SSR

View File

@ -66,12 +66,32 @@ class Quat {
} }
public inline function fromAxisAngle(axis: Vec4, angle: FastFloat): Quat { public inline function fromAxisAngle(axis: Vec4, angle: FastFloat): Quat {
var s: FastFloat = Math.sin(angle * 0.5); //var s: FastFloat = Math.sin(angle * 0.5);
x = axis.x * s; //x = axis.x * s;
y = axis.y * s; //y = axis.y * s;
z = axis.z * s; //z = axis.z * s;
w = Math.cos(angle * 0.5); //w = Math.cos(angle * 0.5);
return normalize(); //return normalize();
// Normalize the axis vector first
var axisLen = Math.sqrt(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z);
if (axisLen > 0.00001) {
var aL = 1.0 / axisLen;
var nX = axis.x * aL;
var nY = axis.y * aL;
var nZ = axis.z * aL;
var halfAngle = angle * 0.5;
var s: FastFloat = Math.sin(halfAngle);
x = nX * s;
y = nY * s;
z = nZ * s;
w = Math.cos(halfAngle);
} else {
x = 0.0;
y = 0.0;
z = 0.0;
w = 1.0;
}
return this;
} }
public inline function toAxisAngle(axis: Vec4): FastFloat { public inline function toAxisAngle(axis: Vec4): FastFloat {
@ -379,17 +399,33 @@ class Quat {
@return This quaternion. @return This quaternion.
**/ **/
public inline function fromEulerOrdered(e: Vec4, order: String): Quat { public inline function fromEulerOrdered(e: Vec4, order: String): Quat {
var c1 = Math.cos(e.x / 2);
var c2 = Math.cos(e.y / 2);
var c3 = Math.cos(e.z / 2);
var s1 = Math.sin(e.x / 2);
var s2 = Math.sin(e.y / 2);
var s3 = Math.sin(e.z / 2);
var mappedAngles = new Vec4();
switch (order) {
case "XYZ":
mappedAngles.set(e.x, e.y, e.z);
case "XZY":
mappedAngles.set(e.x, e.z, e.y);
case "YXZ":
mappedAngles.set(e.y, e.x, e.z);
case "YZX":
mappedAngles.set(e.y, e.z, e.x);
case "ZXY":
mappedAngles.set(e.z, e.x, e.y);
case "ZYX":
mappedAngles.set(e.z, e.y, e.x);
}
var c1 = Math.cos(mappedAngles.x / 2);
var c2 = Math.cos(mappedAngles.y / 2);
var c3 = Math.cos(mappedAngles.z / 2);
var s1 = Math.sin(mappedAngles.x / 2);
var s2 = Math.sin(mappedAngles.y / 2);
var s3 = Math.sin(mappedAngles.z / 2);
var qx = new Quat(s1, 0, 0, c1); var qx = new Quat(s1, 0, 0, c1);
var qy = new Quat(0, s2, 0, c2); var qy = new Quat(0, s2, 0, c2);
var qz = new Quat(0, 0, s3, c3); var qz = new Quat(0, 0, s3, c3);
// Original multiplication sequence (implements reverse of 'order')
if (order.charAt(2) == 'X') if (order.charAt(2) == 'X')
this.setFrom(qx); this.setFrom(qx);
else if (order.charAt(2) == 'Y') else if (order.charAt(2) == 'Y')
@ -409,6 +445,12 @@ class Quat {
else else
this.mult(qz); this.mult(qz);
// TO DO quick fix somethings wrong..
this.x = -this.x;
this.y = -this.y;
this.z = -this.z;
this.w = -this.w;
return this; return this;
} }

View File

@ -411,12 +411,23 @@ class ActionSampler {
*/ */
public inline function setBoneAction(actionData: Array<TObj>) { public inline function setBoneAction(actionData: Array<TObj>) {
this.actionData = actionData; this.actionData = actionData;
if (actionData != null && actionData.length > 0 && actionData[0] != null && actionData[0].anim != null) {
if (actionData[0].anim.tracks != null && actionData[0].anim.tracks.length > 0) {
this.totalFrames = actionData[0].anim.tracks[0].frames.length; this.totalFrames = actionData[0].anim.tracks[0].frames.length;
}
else {
this.totalFrames = 0;
}
if(actionData[0].anim.root_motion_pos) this.rootMotionPos = true; if(actionData[0].anim.root_motion_pos) this.rootMotionPos = true;
if(actionData[0].anim.root_motion_rot) this.rootMotionRot = true; if(actionData[0].anim.root_motion_rot) this.rootMotionRot = true;
}
else {
this.totalFrames = 0;
}
actionDataInit = true; actionDataInit = true;
} }
/** /**
* Cache raw object data for object animation. * Cache raw object data for object animation.
* @param actionData Raw object data. * @param actionData Raw object data.

View File

@ -51,6 +51,7 @@ class ParticleSystem {
seed = pref.seed; seed = pref.seed;
particles = []; particles = [];
ready = false; ready = false;
Data.getParticle(sceneName, pref.particle, function(b: ParticleData) { Data.getParticle(sceneName, pref.particle, function(b: ParticleData) {
data = b; data = b;
r = data.raw; r = data.raw;
@ -70,7 +71,13 @@ class ParticleSystem {
lifetime = r.lifetime / frameRate; lifetime = r.lifetime / frameRate;
animtime = (r.frame_end - r.frame_start) / frameRate; animtime = (r.frame_end - r.frame_start) / frameRate;
spawnRate = ((r.frame_end - r.frame_start) / r.count) / frameRate; spawnRate = ((r.frame_end - r.frame_start) / r.count) / frameRate;
for (i in 0...r.count) particles.push(new Particle(i));
for (i in 0...r.count) {
var particle = new Particle(i);
particle.sr = 1 - Math.random() * r.size_random;
particles.push(particle);
}
ready = true; ready = true;
}); });
} }
@ -108,7 +115,7 @@ class ParticleSystem {
} }
// Animate // Animate
time += Time.realDelta * speed; time += Time.delta * speed;
lap = Std.int(time / animtime); lap = Std.int(time / animtime);
lapTime = time - lap * animtime; lapTime = time - lap * animtime;
count = Std.int(lapTime / spawnRate); count = Std.int(lapTime / spawnRate);
@ -143,7 +150,7 @@ class ParticleSystem {
} }
function setupGeomGpu(object: MeshObject, owner: MeshObject) { function setupGeomGpu(object: MeshObject, owner: MeshObject) {
var instancedData = new Float32Array(particles.length * 3); var instancedData = new Float32Array(particles.length * 6);
var i = 0; var i = 0;
var normFactor = 1 / 32767; // pa.values are not normalized var normFactor = 1 / 32767; // pa.values are not normalized
@ -162,6 +169,10 @@ class ParticleSystem {
instancedData.set(i, pa.values[j * pa.size ] * normFactor * scaleFactor.x); i++; instancedData.set(i, pa.values[j * pa.size ] * normFactor * scaleFactor.x); i++;
instancedData.set(i, pa.values[j * pa.size + 1] * normFactor * scaleFactor.y); i++; instancedData.set(i, pa.values[j * pa.size + 1] * normFactor * scaleFactor.y); i++;
instancedData.set(i, pa.values[j * pa.size + 2] * normFactor * scaleFactor.z); i++; instancedData.set(i, pa.values[j * pa.size + 2] * normFactor * scaleFactor.z); i++;
instancedData.set(i, p.sr); i++;
instancedData.set(i, p.sr); i++;
instancedData.set(i, p.sr); i++;
} }
case 1: // Face case 1: // Face
@ -185,6 +196,10 @@ class ParticleSystem {
instancedData.set(i, pos.x * normFactor * scaleFactor.x); i++; instancedData.set(i, pos.x * normFactor * scaleFactor.x); i++;
instancedData.set(i, pos.y * normFactor * scaleFactor.y); i++; instancedData.set(i, pos.y * normFactor * scaleFactor.y); i++;
instancedData.set(i, pos.z * normFactor * scaleFactor.z); i++; instancedData.set(i, pos.z * normFactor * scaleFactor.z); i++;
instancedData.set(i, p.sr); i++;
instancedData.set(i, p.sr); i++;
instancedData.set(i, p.sr); i++;
} }
case 2: // Volume case 2: // Volume
@ -195,9 +210,13 @@ class ParticleSystem {
instancedData.set(i, (Math.random() * 2.0 - 1.0) * scaleFactorVolume.x); i++; instancedData.set(i, (Math.random() * 2.0 - 1.0) * scaleFactorVolume.x); i++;
instancedData.set(i, (Math.random() * 2.0 - 1.0) * scaleFactorVolume.y); i++; instancedData.set(i, (Math.random() * 2.0 - 1.0) * scaleFactorVolume.y); i++;
instancedData.set(i, (Math.random() * 2.0 - 1.0) * scaleFactorVolume.z); i++; instancedData.set(i, (Math.random() * 2.0 - 1.0) * scaleFactorVolume.z); i++;
instancedData.set(i, p.sr); i++;
instancedData.set(i, p.sr); i++;
instancedData.set(i, p.sr); i++;
} }
} }
object.data.geom.setupInstanced(instancedData, 1, Usage.StaticUsage); object.data.geom.setupInstanced(instancedData, 3, Usage.StaticUsage);
} }
function fhash(n: Int): Float { function fhash(n: Int): Float {
@ -236,9 +255,10 @@ class ParticleSystem {
class Particle { class Particle {
public var i: Int; public var i: Int;
public var x = 0.0; public var px = 0.0;
public var y = 0.0; public var py = 0.0;
public var z = 0.0; public var pz = 0.0;
public var sr = 1.0; // Size random
public var cameraDistance: Float; public var cameraDistance: Float;
public function new(i: Int) { public function new(i: Int) {

View File

@ -160,6 +160,7 @@ class LnxPack {
case "anim": TAnimation; case "anim": TAnimation;
case "tracks": TTrack; case "tracks": TTrack;
case "morph_target": TMorphTarget; case "morph_target": TMorphTarget;
case "vertex_groups": TVertex_groups;
case _: TSceneFormat; case _: TSceneFormat;
} }
} }

View File

@ -2,9 +2,11 @@ package leenkx.logicnode;
import iron.object.Object; import iron.object.Object;
#if lnx_physics #if lnx_bullet
import leenkx.trait.physics.PhysicsConstraint; import leenkx.trait.physics.PhysicsConstraint;
import leenkx.trait.physics.bullet.PhysicsConstraint.ConstraintType; import leenkx.trait.physics.bullet.PhysicsConstraint.ConstraintType;
#elseif lnx_oimo
// TODO
#end #end
class AddPhysicsConstraintNode extends LogicNode { class AddPhysicsConstraintNode extends LogicNode {
@ -25,7 +27,7 @@ class AddPhysicsConstraintNode extends LogicNode {
if (pivotObject == null || rb1 == null || rb2 == null) return; if (pivotObject == null || rb1 == null || rb2 == null) return;
#if lnx_physics #if lnx_bullet
var disableCollisions: Bool = inputs[4].get(); var disableCollisions: Bool = inputs[4].get();
var breakable: Bool = inputs[5].get(); var breakable: Bool = inputs[5].get();
@ -108,6 +110,8 @@ class AddPhysicsConstraintNode extends LogicNode {
} }
pivotObject.addTrait(con); pivotObject.addTrait(con);
} }
#elseif lnx_oimo
// TODO
#end #end
runOutput(0); runOutput(0);
} }

View File

@ -4,7 +4,7 @@ import iron.object.Object;
#if lnx_physics #if lnx_physics
import leenkx.trait.physics.RigidBody; import leenkx.trait.physics.RigidBody;
import leenkx.trait.physics.bullet.RigidBody.Shape; import leenkx.trait.physics.RigidBody.Shape;
#end #end

View File

@ -21,7 +21,7 @@ class ApplyForceNode extends LogicNode {
#if lnx_physics #if lnx_physics
var rb: RigidBody = object.getTrait(RigidBody); var rb: RigidBody = object.getTrait(RigidBody);
if (rb == null) return;
!local ? rb.applyForce(force) : rb.applyForce(object.transform.worldVecToOrientation(force)); !local ? rb.applyForce(force) : rb.applyForce(object.transform.worldVecToOrientation(force));
#end #end

View File

@ -0,0 +1,26 @@
package leenkx.logicnode;
class ArrayIndexListNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var array: Array<Dynamic> = inputs[0].get();
array = array.map(item -> Std.string(item));
var value: Dynamic = inputs[1].get();
var from: Int = 0;
var arrayList: Array<Int> = [];
var index: Int = array.indexOf(Std.string(value), from);
while(index != -1){
arrayList.push(index);
index = array.indexOf(Std.string(value), index+1);
}
return arrayList;
}
}

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
import aura.Aura; import aura.Aura;
import aura.Types; import aura.Types;
import aura.types.HRTFData; import aura.types.HRTF;
import aura.dsp.panner.HRTFPanner; import aura.dsp.panner.HRTFPanner;
class AudioHRTFPannerNode extends LogicNode { class AudioHRTFPannerNode extends LogicNode {

View File

@ -26,9 +26,8 @@ class GetBoneTransformNode extends LogicNode {
// Get bone in armature // Get bone in armature
var bone = anim.getBone(boneName); var bone = anim.getBone(boneName);
//return anim.getAbsWorldMat(bone); return anim.getAbsWorldMat(anim.skeletonMats, bone);
return anim.getAbsMat(bone).clone().multmat(object.transform.world); //return anim.getAbsMat(bone).clone().multmat(object.transform.world);
//return anim.getAbsWorldMat(bone);
#else #else
return null; return null;

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
#if lnx_physics #if lnx_physics
import leenkx.trait.physics.bullet.PhysicsWorld; import leenkx.trait.physics.PhysicsWorld;
#end #end
import leenkx.trait.navigation.Navigation; import leenkx.trait.navigation.Navigation;
import iron.object.Object; import iron.object.Object;

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
#if lnx_audio
import iron.object.SpeakerObject; import iron.object.SpeakerObject;
#end
class PauseSoundNode extends LogicNode { class PauseSoundNode extends LogicNode {
public function new(tree: LogicTree) { public function new(tree: LogicTree) {
@ -9,9 +9,11 @@ class PauseSoundNode extends LogicNode {
} }
override function run(from: Int) { override function run(from: Int) {
#if lnx_audio
var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject); var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject);
if (object == null) return; if (object == null) return;
object.pause(); object.pause();
#end
runOutput(0); runOutput(0);
} }
} }

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
#if lnx_physics #if lnx_physics
import leenkx.trait.physics.bullet.PhysicsConstraint.ConstraintAxis; import leenkx.trait.physics.PhysicsConstraint.ConstraintAxis;
#end #end
class PhysicsConstraintNode extends LogicNode { class PhysicsConstraintNode extends LogicNode {

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
#if lnx_audio
import iron.object.SpeakerObject; import iron.object.SpeakerObject;
#end
class PlaySoundNode extends LogicNode { class PlaySoundNode extends LogicNode {
public function new(tree: LogicTree) { public function new(tree: LogicTree) {
@ -9,9 +9,11 @@ class PlaySoundNode extends LogicNode {
} }
override function run(from: Int) { override function run(from: Int) {
#if lnx_audio
var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject); var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject);
if (object == null) return; if (object == null) return;
object.play(); object.play();
#end
runOutput(0); runOutput(0);
} }
} }

View File

@ -16,15 +16,16 @@ class PlaySoundRawNode extends LogicNode {
public var property5: Bool; public var property5: Bool;
public var property6: String; public var property6: String;
#if lnx_audio
var sound: kha.Sound = null; var sound: kha.Sound = null;
var channel: kha.audio1.AudioChannel = null; var channel: kha.audio1.AudioChannel = null;
#end
public function new(tree: LogicTree) { public function new(tree: LogicTree) {
super(tree); super(tree);
} }
override function run(from: Int) { override function run(from: Int) {
#if lnx_audio
switch (from) { switch (from) {
case Play: case Play:
if (property6 == 'Sound' ? sound == null : true) { if (property6 == 'Sound' ? sound == null : true) {
@ -63,6 +64,10 @@ class PlaySoundRawNode extends LogicNode {
case UpdateVolume: case UpdateVolume:
if (channel != null) channel.volume = inputs[4].get(); if (channel != null) channel.volume = inputs[4].get();
} }
#end
#if !lnx_audio
runOutput(0);
#end
} }
function onUpdate() { function onUpdate() {

View File

@ -37,6 +37,7 @@ class RotationNode extends LogicNode {
value.y = vect.y; value.y = vect.y;
value.z = vect.z; value.z = vect.z;
value.w = inputs[1].get(); value.w = inputs[1].get();
value.normalize();
case "AxisAngle": case "AxisAngle":
var vec: Vec4 = inputs[0].get(); var vec: Vec4 = inputs[0].get();

View File

@ -0,0 +1,37 @@
package leenkx.logicnode;
import iron.object.Object;
#if lnx_skin
import iron.object.BoneAnimation;
#end
import iron.math.Mat4;
class SetBoneTransformNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from: Int) {
#if lnx_skin
var object: Object = inputs[1].get();
if (object == null) return;
var transform = inputs[3].get();
if (transform == null) return;
var boneName: String = inputs[2].get();
var anim = object.animation != null ? cast(object.animation, BoneAnimation) : null;
if (anim == null) anim = object.getBoneAnimation(object.uid);
// Get bone in armature
var bone = anim.getBone(boneName);
anim.setBoneMatFromWorldMat(anim.skeletonMats, transform, bone);
runOutput(0);
#end
}
}

View File

@ -17,7 +17,7 @@ class SetParentBoneNode extends LogicNode {
if (object == null || parent == null) return; if (object == null || parent == null) return;
object.setParent(parent, false, false); object.setParent(parent, inputs[4].get(), inputs[5].get());
var banim = object.getBoneAnimation(object.parent.uid); var banim = object.getBoneAnimation(object.parent.uid);
banim.addBoneChild(bone, object); banim.addBoneChild(bone, object);

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
#if lnx_audio
import iron.object.SpeakerObject; import iron.object.SpeakerObject;
#end
class SetSoundNode extends LogicNode { class SetSoundNode extends LogicNode {
public function new(tree: LogicTree) { public function new(tree: LogicTree) {
@ -9,10 +9,12 @@ class SetSoundNode extends LogicNode {
} }
override function run(from: Int) { override function run(from: Int) {
#if lnx_audio
var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject); var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject);
var sound: String = inputs[2].get(); var sound: String = inputs[2].get();
if (object == null || sound == null) return; if (object == null || sound == null) return;
object.setSound(sound); object.setSound(sound);
#end
runOutput(0); runOutput(0);
} }
} }

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
#if lnx_audio
import iron.object.SpeakerObject; import iron.object.SpeakerObject;
#end
class SetVolumeSoundNode extends LogicNode { class SetVolumeSoundNode extends LogicNode {
public function new(tree: LogicTree) { public function new(tree: LogicTree) {
@ -9,9 +9,11 @@ class SetVolumeSoundNode extends LogicNode {
} }
override function run(from: Int) { override function run(from: Int) {
#if lnx_audio
var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject); var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject);
if (object == null) return; if (object == null) return;
object.setVolume(inputs[2].get()); object.setVolume(inputs[2].get());
#end
runOutput(0); runOutput(0);
} }
} }

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
#if lnx_audio
import iron.object.SpeakerObject; import iron.object.SpeakerObject;
#end
class StopSoundNode extends LogicNode { class StopSoundNode extends LogicNode {
public function new(tree: LogicTree) { public function new(tree: LogicTree) {
@ -9,9 +9,11 @@ class StopSoundNode extends LogicNode {
} }
override function run(from: Int) { override function run(from: Int) {
#if lnx_audio
var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject); var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject);
if (object == null) return; if (object == null) return;
object.stop(); object.stop();
#end
runOutput(0); runOutput(0);
} }
} }

View File

@ -18,7 +18,7 @@ class TransformNode extends LogicNode {
override function get(from: Int): Dynamic { override function get(from: Int): Dynamic {
var loc: Vec4 = inputs[0].get(); var loc: Vec4 = inputs[0].get();
var rot: Quat = new Quat().setFrom(inputs[1].get()); var rot: Quat = new Quat().setFrom(inputs[1].get());
rot.normalize(); //rot.normalize();
var scale: Vec4 = inputs[2].get(); var scale: Vec4 = inputs[2].get();
if (loc == null && rot == null && scale == null) return this.value; if (loc == null && rot == null && scale == null) return this.value;
if (loc == null || rot == null || scale == null) return null; if (loc == null || rot == null || scale == null) return null;

View File

@ -77,6 +77,9 @@ class Inc {
#if (rp_voxels == "Voxel GI") #if (rp_voxels == "Voxel GI")
static var voxel_sh5:kha.compute.Shader = null; static var voxel_sh5:kha.compute.Shader = null;
static var voxel_ta5:kha.compute.TextureUnit; static var voxel_ta5:kha.compute.TextureUnit;
static var voxel_te5:kha.compute.TextureUnit;
static var voxel_tf5:kha.compute.TextureUnit;
static var voxel_tg5:kha.compute.TextureUnit;
static var voxel_ca5:kha.compute.ConstantLocation; static var voxel_ca5:kha.compute.ConstantLocation;
static var voxel_cb5:kha.compute.ConstantLocation; static var voxel_cb5:kha.compute.ConstantLocation;
static var voxel_cc5:kha.compute.ConstantLocation; static var voxel_cc5:kha.compute.ConstantLocation;
@ -677,7 +680,7 @@ class Inc {
} }
else { else {
if (t.name == "voxelsSDF" || t.name == "voxelsSDFtmp") { if (t.name == "voxelsSDF" || t.name == "voxelsSDFtmp") {
t.format = "R16"; t.format = "R8";
t.width = res; t.width = res;
t.height = res * Main.voxelgiClipmapCount; t.height = res * Main.voxelgiClipmapCount;
t.depth = res; t.depth = res;
@ -686,7 +689,7 @@ class Inc {
#if (rp_voxels == "Voxel AO") #if (rp_voxels == "Voxel AO")
{ {
if (t.name == "voxelsOut" || t.name == "voxelsOutB") { if (t.name == "voxelsOut" || t.name == "voxelsOutB") {
t.format = "R16"; t.format = "R8";
t.width = res * (6 + 16); t.width = res * (6 + 16);
t.height = res * Main.voxelgiClipmapCount; t.height = res * Main.voxelgiClipmapCount;
t.depth = res; t.depth = res;
@ -892,7 +895,9 @@ class Inc {
{ {
voxel_sh5 = path.getComputeShader("voxel_light"); voxel_sh5 = path.getComputeShader("voxel_light");
voxel_ta5 = voxel_sh5.getTextureUnit("voxelsLight"); voxel_ta5 = voxel_sh5.getTextureUnit("voxelsLight");
voxel_te5 = voxel_sh5.getTextureUnit("voxels");
voxel_tf5 = voxel_sh5.getTextureUnit("voxelsSampler");
voxel_tg5 = voxel_sh5.getTextureUnit("voxelsSDFSampler");
voxel_ca5 = voxel_sh5.getConstantLocation("clipmaps"); voxel_ca5 = voxel_sh5.getConstantLocation("clipmaps");
voxel_cb5 = voxel_sh5.getConstantLocation("clipmapLevel"); voxel_cb5 = voxel_sh5.getConstantLocation("clipmapLevel");
@ -1288,7 +1293,9 @@ class Inc {
kha.compute.Compute.setShader(voxel_sh5); kha.compute.Compute.setShader(voxel_sh5);
kha.compute.Compute.setTexture(voxel_ta5, rts.get("voxelsLight").image, kha.compute.Access.Write); kha.compute.Compute.setTexture(voxel_ta5, rts.get("voxelsLight").image, kha.compute.Access.Write);
kha.compute.Compute.setTexture(voxel_te5, rts.get("voxels").image, kha.compute.Access.Read);
kha.compute.Compute.setSampledTexture(voxel_tf5, rts.get("voxelsOut").image);
kha.compute.Compute.setSampledTexture(voxel_tg5, rts.get("voxelsSDF").image);
var fa:Float32Array = new Float32Array(Main.voxelgiClipmapCount * 10); var fa:Float32Array = new Float32Array(Main.voxelgiClipmapCount * 10);
for (i in 0...Main.voxelgiClipmapCount) { for (i in 0...Main.voxelgiClipmapCount) {
fa[i * 10] = clipmaps[i].voxelSize; fa[i * 10] = clipmaps[i].voxelSize;

View File

@ -368,7 +368,7 @@ class RenderPathDeferred {
t.scale = Inc.getSuperSampling(); t.scale = Inc.getSuperSampling();
path.createRenderTarget(t); path.createRenderTarget(t);
// holds background depth // holds background color
var t = new RenderTargetRaw(); var t = new RenderTargetRaw();
t.name = "refr"; t.name = "refr";
t.width = 0; t.width = 0;
@ -473,6 +473,13 @@ class RenderPathDeferred {
} }
#end #end
#if rp_ssrefr
{
path.setTarget("gbuffer_refraction");
path.clearTarget(0xffffff00);
}
#end
RenderPathCreator.setTargetMeshes(); RenderPathCreator.setTargetMeshes();
#if rp_dynres #if rp_dynres
@ -837,7 +844,7 @@ class RenderPathDeferred {
{ {
path.bindTarget("voxelsOut", "voxels"); path.bindTarget("voxelsOut", "voxels");
path.bindTarget("voxelsSDF", "voxelsSDF"); path.bindTarget("voxelsSDF", "voxelsSDF");
path.bindTarget("gbuffer2", "sveloc"); path.bindTarget("gbuffer2", "gbuffer2");
} }
#end #end

View File

@ -522,6 +522,17 @@ class RenderPathForward {
path.setTarget("lbuffer0", ["lbuffer1", "gbuffer_refraction"]); path.setTarget("lbuffer0", ["lbuffer1", "gbuffer_refraction"]);
#if rp_shadowmap
{
#if lnx_shadowmap_atlas
Inc.bindShadowMapAtlas();
#else
Inc.bindShadowMap();
#end
}
#end
#if (rp_voxels != "Off") #if (rp_voxels != "Off")
path.bindTarget("voxelsOut", "voxels"); path.bindTarget("voxelsOut", "voxels");
path.bindTarget("voxelsSDF", "voxelsSDF"); path.bindTarget("voxelsSDF", "voxelsSDF");

View File

@ -41,7 +41,11 @@ class Starter {
try { try {
#end #end
kha.System.start({title: Main.projectName, width: c.window_w, height: c.window_h, window: {mode: windowMode, windowFeatures: windowFeatures}, framebuffer: {samplesPerPixel: c.window_msaa, verticalSync: c.window_vsync}}, function(window: kha.Window) { kha.System.start({title: Main.projectName, width: c.window_w, height: c.window_h, window: {
#if lnx_render_viewport
visible: false,
#end
mode: windowMode, windowFeatures: windowFeatures}, framebuffer: {samplesPerPixel: c.window_msaa, verticalSync: c.window_vsync}}, function(window: kha.Window) {
iron.App.init(function() { iron.App.init(function() {
#if lnx_loadscreen #if lnx_loadscreen

View File

@ -10,6 +10,10 @@ class KinematicCharacterController extends iron.Trait { public function new() {
typedef KinematicCharacterController = leenkx.trait.physics.bullet.KinematicCharacterController; typedef KinematicCharacterController = leenkx.trait.physics.bullet.KinematicCharacterController;
#else
typedef KinematicCharacterController = leenkx.trait.physics.oimo.KinematicCharacterController;
#end #end
#end #end

View File

@ -3,17 +3,16 @@ package leenkx.trait.physics;
#if (!lnx_physics) #if (!lnx_physics)
class PhysicsConstraint extends iron.Trait { public function new() { super(); } } class PhysicsConstraint extends iron.Trait { public function new() { super(); } }
@:enum abstract ConstraintAxis(Int) from Int to Int { }
#else #else
#if lnx_bullet #if lnx_bullet
typedef PhysicsConstraint = leenkx.trait.physics.bullet.PhysicsConstraint; typedef PhysicsConstraint = leenkx.trait.physics.bullet.PhysicsConstraint;
typedef ConstraintAxis = leenkx.trait.physics.bullet.PhysicsConstraint.ConstraintAxis;
#else #else
typedef PhysicsConstraint = leenkx.trait.physics.oimo.PhysicsConstraint; typedef PhysicsConstraint = leenkx.trait.physics.oimo.PhysicsConstraint;
typedef ConstraintAxis = leenkx.trait.physics.oimo.PhysicsConstraint.ConstraintAxis;
#end #end
#end #end

View File

@ -2,6 +2,7 @@ package leenkx.trait.physics;
#if (!lnx_physics) #if (!lnx_physics)
class Hit { }
class PhysicsWorld extends iron.Trait { public function new() { super(); } } class PhysicsWorld extends iron.Trait { public function new() { super(); } }
#else #else
@ -9,11 +10,11 @@ class PhysicsWorld extends iron.Trait { public function new() { super(); } }
#if lnx_bullet #if lnx_bullet
typedef PhysicsWorld = leenkx.trait.physics.bullet.PhysicsWorld; typedef PhysicsWorld = leenkx.trait.physics.bullet.PhysicsWorld;
typedef Hit = leenkx.trait.physics.bullet.PhysicsWorld.Hit;
#else #else
typedef PhysicsWorld = leenkx.trait.physics.oimo.PhysicsWorld; typedef PhysicsWorld = leenkx.trait.physics.oimo.PhysicsWorld;
typedef Hit = leenkx.trait.physics.oimo.PhysicsWorld.Hit;
#end #end
#end #end

View File

@ -3,16 +3,19 @@ package leenkx.trait.physics;
#if (!lnx_physics) #if (!lnx_physics)
class RigidBody extends iron.Trait { public function new() { super(); } } class RigidBody extends iron.Trait { public function new() { super(); } }
@:enum abstract Shape(Int) from Int to Int { }
#else #else
#if lnx_bullet #if lnx_bullet
typedef RigidBody = leenkx.trait.physics.bullet.RigidBody; typedef RigidBody = leenkx.trait.physics.bullet.RigidBody;
typedef Shape = leenkx.trait.physics.bullet.RigidBody.Shape;
#else #else
typedef RigidBody = leenkx.trait.physics.oimo.RigidBody; typedef RigidBody = leenkx.trait.physics.oimo.RigidBody;
typedef Shape = leenkx.trait.physics.oimo.RigidBody.Shape;
#end #end

View File

@ -1,5 +1,8 @@
package leenkx.trait.physics.bullet; package leenkx.trait.physics.bullet;
#if lnx_bullet
import leenkx.trait.physics.bullet.PhysicsWorld.DebugDrawMode;
import bullet.Bt.Vector3; import bullet.Bt.Vector3;
import kha.FastFloat; import kha.FastFloat;
@ -18,15 +21,21 @@ class DebugDrawHelper {
static inline var contactPointNormalColor = 0xffffffff; static inline var contactPointNormalColor = 0xffffffff;
static inline var contactPointDrawLifetime = true; static inline var contactPointDrawLifetime = true;
final rayCastColor: Vec4 = new Vec4(0.0, 1.0, 0.0);
final rayCastHitColor: Vec4 = new Vec4(1.0, 0.0, 0.0);
final rayCastHitPointColor: Vec4 = new Vec4(1.0, 1.0, 0.0);
final physicsWorld: PhysicsWorld; final physicsWorld: PhysicsWorld;
final lines: Array<LineData> = []; final lines: Array<LineData> = [];
final texts: Array<TextData> = []; final texts: Array<TextData> = [];
var font: kha.Font = null; var font: kha.Font = null;
var debugMode: PhysicsWorld.DebugDrawMode = NoDebug; var rayCasts:Array<TRayCastData> = [];
var debugDrawMode: DebugDrawMode = NoDebug;
public function new(physicsWorld: PhysicsWorld) { public function new(physicsWorld: PhysicsWorld, debugDrawMode: DebugDrawMode) {
this.physicsWorld = physicsWorld; this.physicsWorld = physicsWorld;
this.debugDrawMode = debugDrawMode;
#if lnx_ui #if lnx_ui
iron.data.Data.getFont(Canvas.defaultFontName, function(defaultFont: kha.Font) { iron.data.Data.getFont(Canvas.defaultFontName, function(defaultFont: kha.Font) {
@ -35,6 +44,11 @@ class DebugDrawHelper {
#end #end
iron.App.notifyOnRender2D(onRender); iron.App.notifyOnRender2D(onRender);
if (debugDrawMode & DrawRayCast != 0) {
iron.App.notifyOnUpdate(function () {
rayCasts.resize(0);
});
}
} }
public function drawLine(from: bullet.Bt.Vector3, to: bullet.Bt.Vector3, color: bullet.Bt.Vector3) { public function drawLine(from: bullet.Bt.Vector3, to: bullet.Bt.Vector3, color: bullet.Bt.Vector3) {
@ -49,9 +63,10 @@ class DebugDrawHelper {
final fromScreenSpace = worldToScreenFast(new Vec4(from.x(), from.y(), from.z(), 1.0)); final fromScreenSpace = worldToScreenFast(new Vec4(from.x(), from.y(), from.z(), 1.0));
final toScreenSpace = worldToScreenFast(new Vec4(to.x(), to.y(), to.z(), 1.0)); final toScreenSpace = worldToScreenFast(new Vec4(to.x(), to.y(), to.z(), 1.0));
// For now don't draw lines if any point is outside of clip space z,
// investigate how to clamp lines to clip space borders // investigate how to clamp lines to clip space borders
if (fromScreenSpace.w == 1 && toScreenSpace.w == 1) { // If at least one point is within the Z clip space (w==1), attempt to draw.
// Note: This is not full clipping, line may still go off screen sides.
if (fromScreenSpace.w == 1 || toScreenSpace.w == 1) {
lines.push({ lines.push({
fromX: fromScreenSpace.x, fromX: fromScreenSpace.x,
fromY: fromScreenSpace.y, fromY: fromScreenSpace.y,
@ -112,6 +127,61 @@ class DebugDrawHelper {
} }
} }
public function rayCast(rayCastData:TRayCastData) {
rayCasts.push(rayCastData);
}
function drawRayCast(f: Vec4, t: Vec4, hit: Bool) {
final from = worldToScreenFast(f.clone());
final to = worldToScreenFast(t.clone());
var c: kha.Color;
if (from.w == 1 && to.w == 1) {
if (hit) c = kha.Color.fromFloats(rayCastHitColor.x, rayCastHitColor.y, rayCastHitColor.z);
else c = kha.Color.fromFloats(rayCastColor.x, rayCastColor.y, rayCastColor.z);
lines.push({
fromX: from.x,
fromY: from.y,
toX: to.x,
toY: to.y,
color: c
});
}
}
function drawHitPoint(hp: Vec4) {
final hitPoint = worldToScreenFast(hp.clone());
final c = kha.Color.fromFloats(rayCastHitPointColor.x, rayCastHitPointColor.y, rayCastHitPointColor.z);
if (hitPoint.w == 1) {
lines.push({
fromX: hitPoint.x - contactPointSizePx,
fromY: hitPoint.y - contactPointSizePx,
toX: hitPoint.x + contactPointSizePx,
toY: hitPoint.y + contactPointSizePx,
color: c
});
lines.push({
fromX: hitPoint.x - contactPointSizePx,
fromY: hitPoint.y + contactPointSizePx,
toX: hitPoint.x + contactPointSizePx,
toY: hitPoint.y - contactPointSizePx,
color: c
});
if (font != null) {
texts.push({
x: hitPoint.x,
y: hitPoint.y,
color: c,
text: 'RAYCAST HIT'
});
}
}
}
public function reportErrorWarning(warningString: bullet.Bt.BulletString) { public function reportErrorWarning(warningString: bullet.Bt.BulletString) {
trace(warningString.toHaxeString().trim()); trace(warningString.toHaxeString().trim());
} }
@ -135,13 +205,13 @@ class DebugDrawHelper {
}); });
} }
public function setDebugMode(debugMode: PhysicsWorld.DebugDrawMode) { public function setDebugMode(debugDrawMode: DebugDrawMode) {
this.debugMode = debugMode; this.debugDrawMode = debugDrawMode;
} }
public function getDebugMode(): PhysicsWorld.DebugDrawMode { public function getDebugMode(): DebugDrawMode {
#if js #if js
return debugMode; return debugDrawMode;
#elseif hl #elseif hl
return physicsWorld.getDebugDrawMode(); return physicsWorld.getDebugDrawMode();
#else #else
@ -161,6 +231,7 @@ class DebugDrawHelper {
// before some user-specific physics update, which would result in a // before some user-specific physics update, which would result in a
// one-frame drawing delay... Ideally we would ensure that debugDrawWorld() // one-frame drawing delay... Ideally we would ensure that debugDrawWorld()
// is called when all other (late) update callbacks are already executed... // is called when all other (late) update callbacks are already executed...
physicsWorld.world.debugDrawWorld(); physicsWorld.world.debugDrawWorld();
g.opacity = 1.0; g.opacity = 1.0;
@ -180,6 +251,17 @@ class DebugDrawHelper {
} }
texts.resize(0); texts.resize(0);
} }
if (debugDrawMode & DrawRayCast != 0) {
for (rayCastData in rayCasts) {
if (rayCastData.hasHit) {
drawRayCast(rayCastData.from, rayCastData.hitPoint, true);
drawHitPoint(rayCastData.hitPoint);
} else {
drawRayCast(rayCastData.from, rayCastData.to, false);
}
}
}
} }
/** /**
@ -222,3 +304,14 @@ class TextData {
public var color: kha.Color; public var color: kha.Color;
public var text: String; public var text: String;
} }
@:structInit
typedef TRayCastData = {
var from: Vec4;
var to: Vec4;
var hasHit: Bool;
@:optional var hitPoint: Vec4;
@:optional var hitNormal: Vec4;
}
#end

View File

@ -85,6 +85,22 @@ class PhysicsWorld extends Trait {
public static var physTime = 0.0; public static var physTime = 0.0;
#end #end
public static function getSolverInfo(world:bullet.Bt.DynamicsWorld):Dynamic {
return Reflect.callMethod(world, Reflect.field(world, "getSolverInfo"), []);
}
public static function setSolverIterations(world:bullet.Bt.DynamicsWorld, iterations:Int):Void {
var solverInfo = getSolverInfo(world);
if (solverInfo != null) {
Reflect.setField(solverInfo, "m_numIterations", iterations);
} else {
trace("Warning: Could not access solver info. Solver iterations not applied.");
}
}
public function new(timeScale = 1.0, maxSteps = 10, solverIterations = 10, debugDrawMode: DebugDrawMode = NoDebug) { public function new(timeScale = 1.0, maxSteps = 10, solverIterations = 10, debugDrawMode: DebugDrawMode = NoDebug) {
super(); super();
@ -164,7 +180,8 @@ class PhysicsWorld extends Trait {
#else #else
world = new bullet.Bt.DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration); world = new bullet.Bt.DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
#end #end
// TO DO: Set the solver iterations from Blender's rigid body world
// setSolverIterations(world, solverIterations);
setGravity(gravity); setGravity(gravity);
} }
@ -378,6 +395,7 @@ class PhysicsWorld extends Trait {
rayTo.setValue(to.x, to.y, to.z); rayTo.setValue(to.x, to.y, to.z);
var rayCallback = new bullet.Bt.ClosestRayResultCallback(rayFrom, rayTo); var rayCallback = new bullet.Bt.ClosestRayResultCallback(rayFrom, rayTo);
#if js #if js
rayCallback.set_m_collisionFilterGroup(group); rayCallback.set_m_collisionFilterGroup(group);
rayCallback.set_m_collisionFilterMask(mask); rayCallback.set_m_collisionFilterMask(mask);
@ -387,6 +405,7 @@ class PhysicsWorld extends Trait {
#end #end
var worldDyn: bullet.Bt.DynamicsWorld = world; var worldDyn: bullet.Bt.DynamicsWorld = world;
var worldCol: bullet.Bt.CollisionWorld = worldDyn; var worldCol: bullet.Bt.CollisionWorld = worldDyn;
worldCol.rayTest(rayFrom, rayTo, rayCallback); worldCol.rayTest(rayFrom, rayTo, rayCallback);
var rb: RigidBody = null; var rb: RigidBody = null;
var hitInfo: Hit = null; var hitInfo: Hit = null;
@ -412,6 +431,16 @@ class PhysicsWorld extends Trait {
#end #end
} }
if (getDebugDrawMode() & DrawRayCast != 0) {
debugDrawHelper.rayCast({
from: from,
to: to,
hasHit: rc.hasHit(),
hitPoint: hitPointWorld,
hitNormal: hitNormalWorld
});
}
#if js #if js
bullet.Bt.Ammo.destroy(rayCallback); bullet.Bt.Ammo.destroy(rayCallback);
#else #else
@ -493,7 +522,7 @@ class PhysicsWorld extends Trait {
if (debugDrawMode == NoDebug) { if (debugDrawMode == NoDebug) {
return; return;
} }
initDebugDrawing(); initDebugDrawing(debugDrawMode);
} }
#if js #if js
@ -517,8 +546,8 @@ class PhysicsWorld extends Trait {
#end #end
} }
function initDebugDrawing() { function initDebugDrawing(debugDrawMode: DebugDrawMode) {
debugDrawHelper = new DebugDrawHelper(this); debugDrawHelper = new DebugDrawHelper(this, debugDrawMode);
#if js #if js
final drawer = new bullet.Bt.DebugDrawer(); final drawer = new bullet.Bt.DebugDrawer();
@ -644,10 +673,7 @@ enum abstract DebugDrawMode(Int) from Int to Int {
// We could use it in the future to toggle depth testing for lines, i.e. draw actual 3D lines if not set and Kha's g2 lines if set. // We could use it in the future to toggle depth testing for lines, i.e. draw actual 3D lines if not set and Kha's g2 lines if set.
var FastWireframe = 1 << 13; var FastWireframe = 1 << 13;
/** /** Draw the normal vectors of the triangles of the physics collider meshes. **/
Draw the normal vectors of the triangles of the physics collider meshes.
This only works for `Mesh` collision shapes.
**/
// Outside of Leenkx this works for a few more collision shapes // Outside of Leenkx this works for a few more collision shapes
var DrawNormals = 1 << 14; var DrawNormals = 1 << 14;
@ -657,6 +683,8 @@ enum abstract DebugDrawMode(Int) from Int to Int {
**/ **/
var DrawFrames = 1 << 15; var DrawFrames = 1 << 15;
var DrawRayCast = 1 << 16;
@:op(~A) public inline function bitwiseNegate(): DebugDrawMode { @:op(~A) public inline function bitwiseNegate(): DebugDrawMode {
return ~this; return ~this;
} }

View File

@ -1,8 +1,5 @@
package zui; package zui;
// Immediate Mode UI Library
// https://github.com/leenkx3d/zui
import kha.input.Mouse; import kha.input.Mouse;
import kha.input.Pen; import kha.input.Pen;
import kha.input.Surface; import kha.input.Surface;
@ -255,7 +252,7 @@ class Zui {
Mouse.get().notifyWindowed(ops.khaWindowId, onMouseDown, onMouseUp, onMouseMove, onMouseWheel); Mouse.get().notifyWindowed(ops.khaWindowId, onMouseDown, onMouseUp, onMouseMove, onMouseWheel);
if (Pen.get() != null) Pen.get().notify(onPenDown, onPenUp, onPenMove); if (Pen.get() != null) Pen.get().notify(onPenDown, onPenUp, onPenMove);
Keyboard.get().notify(onKeyDown, onKeyUp, onKeyPress); Keyboard.get().notify(onKeyDown, onKeyUp, onKeyPress);
#if (kha_android || kha_ios) #if (kha_android || kha_ios || kha_html5 || kha_debug_html5)
if (Surface.get() != null) Surface.get().notify(onTouchDown, onTouchUp, onTouchMove); if (Surface.get() != null) Surface.get().notify(onTouchDown, onTouchUp, onTouchMove);
#end #end
// Reset mouse delta on foreground // Reset mouse delta on foreground
@ -268,7 +265,7 @@ class Zui {
Mouse.get().removeWindowed(ops.khaWindowId, onMouseDown, onMouseUp, onMouseMove, onMouseWheel); Mouse.get().removeWindowed(ops.khaWindowId, onMouseDown, onMouseUp, onMouseMove, onMouseWheel);
if (Pen.get() != null) Pen.get().remove(onPenDown, onPenUp, onPenMove); if (Pen.get() != null) Pen.get().remove(onPenDown, onPenUp, onPenMove);
Keyboard.get().remove(onKeyDown, onKeyUp, onKeyPress); Keyboard.get().remove(onKeyDown, onKeyUp, onKeyPress);
#if (kha_android || kha_ios) #if (kha_android || kha_ios || kha_html5 || kha_debug_html5)
if (Surface.get() != null) Surface.get().remove(onTouchDown, onTouchUp, onTouchMove); if (Surface.get() != null) Surface.get().remove(onTouchDown, onTouchUp, onTouchMove);
#end #end
endInput(); endInput();
@ -1760,7 +1757,7 @@ class Zui {
button == 0 ? inputStarted = true : inputStartedR = true; button == 0 ? inputStarted = true : inputStartedR = true;
button == 0 ? inputDown = true : inputDownR = true; button == 0 ? inputDown = true : inputDownR = true;
inputStartedTime = kha.Scheduler.time(); inputStartedTime = kha.Scheduler.time();
#if (kha_android || kha_ios) #if (kha_android || kha_ios || kha_html5 || kha_debug_html5)
setInputPosition(x, y); setInputPosition(x, y);
#end #end
inputStartedX = x; inputStartedX = x;
@ -1787,7 +1784,7 @@ class Zui {
button == 0 ? inputReleased = true : inputReleasedR = true; button == 0 ? inputReleased = true : inputReleasedR = true;
} }
button == 0 ? inputDown = false : inputDownR = false; button == 0 ? inputDown = false : inputDownR = false;
#if (kha_android || kha_ios) #if (kha_android || kha_ios || kha_html5 || kha_debug_html5)
setInputPosition(x, y); setInputPosition(x, y);
#end #end
deselectText(); deselectText();
@ -1811,7 +1808,7 @@ class Zui {
} }
public function onPenDown(x: Int, y: Int, pressure: Float) { public function onPenDown(x: Int, y: Int, pressure: Float) {
#if (kha_android || kha_ios) #if (kha_android || kha_ios || kha_html5 || kha_debug_html5)
return; return;
#end #end
@ -1819,7 +1816,7 @@ class Zui {
} }
public function onPenUp(x: Int, y: Int, pressure: Float) { public function onPenUp(x: Int, y: Int, pressure: Float) {
#if (kha_android || kha_ios) #if (kha_android || kha_ios || kha_html5 || kha_debug_html5)
return; return;
#end #end
@ -1829,7 +1826,7 @@ class Zui {
} }
public function onPenMove(x: Int, y: Int, pressure: Float) { public function onPenMove(x: Int, y: Int, pressure: Float) {
#if (kha_android || kha_ios) #if (kha_android || kha_ios || kha_html5 || kha_debug_html5)
return; return;
#end #end
@ -1889,7 +1886,7 @@ class Zui {
isKeyPressed = true; isKeyPressed = true;
} }
#if (kha_android || kha_ios) #if (kha_android || kha_ios || kha_html5 || kha_debug_html5)
public function onTouchDown(index: Int, x: Int, y: Int) { public function onTouchDown(index: Int, x: Int, y: Int) {
// Reset movement delta on touch start // Reset movement delta on touch start
if (index == 0) { if (index == 0) {

Binary file not shown.

View File

@ -324,6 +324,20 @@ class LeenkxExporter:
def export_object_transform(self, bobject: bpy.types.Object, o): def export_object_transform(self, bobject: bpy.types.Object, o):
wrd = bpy.data.worlds['Lnx'] wrd = bpy.data.worlds['Lnx']
# HACK: In Blender 4.2.x, each camera must be selected to ensure its matrix is correctly assigned
if bpy.app.version >= (4, 2, 0) and bobject.type == 'CAMERA' and bobject.users_scene:
current_scene = bpy.context.window.scene
bpy.context.window.scene = bobject.users_scene[0]
bpy.context.view_layer.update()
bobject.select_set(True)
bpy.context.view_layer.update()
bobject.select_set(False)
bpy.context.window.scene = current_scene
bpy.context.view_layer.update()
# Static transform # Static transform
o['transform'] = {'values': LeenkxExporter.write_matrix(bobject.matrix_local)} o['transform'] = {'values': LeenkxExporter.write_matrix(bobject.matrix_local)}
@ -1001,6 +1015,7 @@ class LeenkxExporter:
action = actions.get('leenkxpose') action = actions.get('leenkxpose')
if action is None: if action is None:
action = actions.new(name='leenkxpose') action = actions.new(name='leenkxpose')
adata.action = action
# Export actions # Export actions
export_actions = [action] export_actions = [action]
@ -1551,8 +1566,7 @@ class LeenkxExporter:
log.error(e.message) log.error(e.message)
else: else:
# Assume it was caused because of encountering n-gons # Assume it was caused because of encountering n-gons
log.error(f"""object {bobject.name} contains n-gons in its mesh, so it's impossible to compute tanget space for normal mapping. log.error(f"""object {bobject.name} contains n-gons in its mesh, so it's impossible to compute tanget space for normal mapping. Make sure the mesh only has tris/quads.""")
Make sure the mesh only has tris/quads.""")
tangdata = np.empty(num_verts * 3, dtype='<f4') tangdata = np.empty(num_verts * 3, dtype='<f4')
if has_col: if has_col:
@ -3025,14 +3039,15 @@ Make sure the mesh only has tris/quads.""")
if rbw is not None and rbw.enabled: if rbw is not None and rbw.enabled:
out_trait['parameters'] = [str(rbw.time_scale), str(rbw.substeps_per_frame), str(rbw.solver_iterations)] out_trait['parameters'] = [str(rbw.time_scale), str(rbw.substeps_per_frame), str(rbw.solver_iterations)]
if phys_pkg == 'bullet': if phys_pkg == 'bullet' or phys_pkg == 'oimo':
debug_draw_mode = 1 if wrd.lnx_bullet_dbg_draw_wireframe else 0 debug_draw_mode = 1 if wrd.lnx_physics_dbg_draw_wireframe else 0
debug_draw_mode |= 2 if wrd.lnx_bullet_dbg_draw_aabb else 0 debug_draw_mode |= 2 if wrd.lnx_physics_dbg_draw_aabb else 0
debug_draw_mode |= 8 if wrd.lnx_bullet_dbg_draw_contact_points else 0 debug_draw_mode |= 8 if wrd.lnx_physics_dbg_draw_contact_points else 0
debug_draw_mode |= 2048 if wrd.lnx_bullet_dbg_draw_constraints else 0 debug_draw_mode |= 2048 if wrd.lnx_physics_dbg_draw_constraints else 0
debug_draw_mode |= 4096 if wrd.lnx_bullet_dbg_draw_constraint_limits else 0 debug_draw_mode |= 4096 if wrd.lnx_physics_dbg_draw_constraint_limits else 0
debug_draw_mode |= 16384 if wrd.lnx_bullet_dbg_draw_normals else 0 debug_draw_mode |= 16384 if wrd.lnx_physics_dbg_draw_normals else 0
debug_draw_mode |= 32768 if wrd.lnx_bullet_dbg_draw_axis_gizmo else 0 debug_draw_mode |= 32768 if wrd.lnx_physics_dbg_draw_axis_gizmo else 0
debug_draw_mode |= 65536 if wrd.lnx_physics_dbg_draw_raycast else 0
out_trait['parameters'].append(str(debug_draw_mode)) out_trait['parameters'].append(str(debug_draw_mode))
self.output['traits'].append(out_trait) self.output['traits'].append(out_trait)

View File

@ -132,6 +132,7 @@ def always() -> float:
return 0.5 return 0.5
def poll_threads() -> float: def poll_threads() -> float:
"""Polls the thread callback queue and if a thread has finished, it """Polls the thread callback queue and if a thread has finished, it
is joined with the main thread and the corresponding callback is is joined with the main thread and the corresponding callback is
@ -141,19 +142,25 @@ def poll_threads() -> float:
thread, callback = make.thread_callback_queue.get(block=False) thread, callback = make.thread_callback_queue.get(block=False)
except queue.Empty: except queue.Empty:
return 0.25 return 0.25
if thread.is_alive():
thread.join()
try: try:
make.thread_callback_queue.put((thread, callback), block=False)
except queue.Full:
return 0.5
return 0.1
else:
try:
thread.join()
callback() callback()
except Exception as e: except Exception as e:
# If there is an exception, we can no longer return the time to # If there is an exception, we can no longer return the time to
# the next call to this polling function, so to keep it running # the next call to this polling function, so to keep it running
# we re-register it and then raise the original exception. # we re-register it and then raise the original exception.
try:
bpy.app.timers.unregister(poll_threads) bpy.app.timers.unregister(poll_threads)
except ValueError:
pass
bpy.app.timers.register(poll_threads, first_interval=0.01, persistent=True) bpy.app.timers.register(poll_threads, first_interval=0.01, persistent=True)
raise e
# Quickly check if another thread has finished # Quickly check if another thread has finished
return 0.01 return 0.01

View File

@ -7,48 +7,46 @@ if lnx.is_reload(__name__):
else: else:
lnx.enable_reload(__name__) lnx.enable_reload(__name__)
lnx.keymaps = [] #lnx.keymaps = []
def register(): def register():
wm = bpy.context.window_manager wm = bpy.context.window_manager
addon_keyconfig = wm.keyconfigs.addon keyconfig = wm.keyconfigs.user
# Keyconfigs are not available in background mode. If the keyconfig # Keyconfigs are not available in background mode. If the keyconfig
# was not found despite running _not_ in background mode, a warning # was not found despite running _not_ in background mode, a warning
# is printed # is printed
if addon_keyconfig is None: if keyconfig is None:
if not bpy.app.background: if not bpy.app.background:
log.warn("No keyconfig path found") log.warn("No keyconfig path found")
return return
km = keyconfig.keymaps.get('Window')
km = addon_keyconfig.keymaps.new(name='Window', space_type='EMPTY', region_type="WINDOW") if km is None:
km.keymap_items.new(props_ui.LeenkxPlayButton.bl_idname, type='F5', value='PRESS') log.warn("Window keymaps not available")
km.keymap_items.new("tlm.build_lightmaps", type='F6', value='PRESS') return
km.keymap_items.new("tlm.clean_lightmaps", type='F7', value='PRESS') lnx_start = any(kmi.idname == props_ui.LeenkxPlayButton.bl_idname for kmi in km.keymap_items)
lnx.keymaps.append(km) if not lnx_start:
kmw = keyconfig.keymaps.new(name='Window', space_type='EMPTY', region_type="WINDOW")
km = addon_keyconfig.keymaps.new(name='Node Editor', space_type='NODE_EDITOR') kmw.keymap_items.new(props_ui.LeenkxPlayButton.bl_idname, type='F5', value='PRESS')
kmw.keymap_items.new('tlm.build_lightmaps', type='F6', value='PRESS')
# shift+G: Create a new node call group node kmw.keymap_items.new('tlm.clean_lightmaps', type='F7', value='PRESS')
km.keymap_items.new('lnx.add_call_group_node', 'G', 'PRESS', shift=True) kmn = keyconfig.keymaps.new(name='Node Editor', space_type='NODE_EDITOR')
kmn.keymap_items.new('lnx.add_call_group_node', 'G', 'PRESS', shift=True)
# ctrl+G: make node group from selected kmn.keymap_items.new('lnx.add_group_tree_from_selected', 'G', 'PRESS', ctrl=True)
km.keymap_items.new('lnx.add_group_tree_from_selected', 'G', 'PRESS', ctrl=True) kmn.keymap_items.new('lnx.edit_group_tree', 'TAB', 'PRESS')
kmn.keymap_items.new('node.tree_path_parent', 'TAB', 'PRESS', ctrl=True)
# TAB: enter node groups depending on selection kmn.keymap_items.new('lnx.ungroup_group_tree', 'G', 'PRESS', alt=True)
km.keymap_items.new('lnx.edit_group_tree', 'TAB', 'PRESS')
# ctrl+TAB: exit node groups depending on selectio
km.keymap_items.new('node.tree_path_parent', 'TAB', 'PRESS', ctrl=True)
# alt+G: ungroup node tree
km.keymap_items.new('lnx.ungroup_group_tree', 'G', 'PRESS', alt=True)
lnx.keymaps.append(km)
def unregister(): def unregister():
wm = bpy.context.window_manager kmw = bpy.context.window_manager.keyconfigs.user.keymaps.get('Window')
for km in lnx.keymaps: kmw.keymap_items.remove(kmw.keymap_items[props_ui.LeenkxPlayButton.bl_idname])
wm.keyconfigs.addon.keymaps.remove(km) kmw.keymap_items.remove(kmw.keymap_items['tlm.build_lightmaps'])
del lnx.keymaps[:] kmw.keymap_items.remove(kmw.keymap_items['tlm.clean_lightmaps'])
kmn = bpy.context.window_manager.keyconfigs.user.keymaps.get('Node Editor')
kmn.keymap_items.remove(kmn.keymap_items['lnx.add_call_group_node'])
kmn.keymap_items.remove(kmn.keymap_items['lnx.add_group_tree_from_selected'])
kmn.keymap_items.remove(kmn.keymap_items['lnx.edit_group_tree'])
kmn.keymap_items.remove(kmn.keymap_items['node.tree_path_parent'])
kmn.keymap_items.remove(kmn.keymap_items['lnx.ungroup_group_tree'])

View File

@ -5,7 +5,8 @@ class TLM_Logman:
_log = [] _log = []
def __init__(self): def __init__(self, *args, **kwargs):
super(TLM_Logman, self).__init__(*args, **kwargs)
print("Logger started Init") print("Logger started Init")
self.append("Logger started.") self.append("Logger started.")

View File

@ -10,7 +10,7 @@ class BlendActionNode(LnxLogicTreeNode):
self.add_input('LnxNodeSocketObject', 'Object') self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxNodeSocketAnimTree', 'Action 1') self.add_input('LnxNodeSocketAnimTree', 'Action 1')
self.add_input('LnxNodeSocketAnimTree', 'Action 2') self.add_input('LnxNodeSocketAnimTree', 'Action 2')
self.add_input('ArmFactorSocket', 'Factor', default_value = 0.5) self.add_input('LnxFactorSocket', 'Factor', default_value = 0.5)
self.add_input('LnxIntSocket', 'Bone Group', default_value = -1) self.add_input('LnxIntSocket', 'Bone Group', default_value = -1)
self.add_output('LnxNodeSocketAnimTree', 'Result') self.add_output('LnxNodeSocketAnimTree', 'Result')

View File

@ -90,7 +90,8 @@ class BlendSpaceNode(LnxLogicTreeNode):
draw_handler_dict = {} draw_handler_dict = {}
modal_handler_dict = {} modal_handler_dict = {}
def __init__(self): def __init__(self, *args, **kwargs):
super(BlendSpaceNode, self).__init__(*args, **kwargs)
array_nodes[str(id(self))] = self array_nodes[str(id(self))] = self
if self.advanced_draw_run: if self.advanced_draw_run:
self.add_advanced_draw() self.add_advanced_draw()
@ -112,8 +113,8 @@ class BlendSpaceNode(LnxLogicTreeNode):
def lnx_init(self, context): def lnx_init(self, context):
self.add_input('LnxNodeSocketObject', 'Object') self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxNodeSocketArray', 'Actions') self.add_input('LnxNodeSocketArray', 'Actions')
self.add_input('ArmBlendSpaceSocket', 'Cursor X') self.add_input('LnxBlendSpaceSocket', 'Cursor X')
self.add_input('ArmBlendSpaceSocket', 'Cursor Y') self.add_input('LnxBlendSpaceSocket', 'Cursor Y')
self.add_output('LnxNodeSocketAnimTree', 'Out') self.add_output('LnxNodeSocketAnimTree', 'Out')
def add_advanced_draw(self): def add_advanced_draw(self):

View File

@ -45,7 +45,7 @@ class BoneIKNode(LnxLogicTreeNode):
self.add_input('LnxBoolSocket', 'Enable Pole') self.add_input('LnxBoolSocket', 'Enable Pole')
self.add_input('LnxVectorSocket', 'Pole Position') self.add_input('LnxVectorSocket', 'Pole Position')
self.add_input('LnxFloatSocket', 'Roll Angle') self.add_input('LnxFloatSocket', 'Roll Angle')
self.add_input('ArmFactorSocket', 'Influence', default_value = 1.0) self.add_input('LnxFactorSocket', 'Influence', default_value = 1.0)
self.add_input('LnxIntSocket', 'Bone Group', default_value = 0) self.add_input('LnxIntSocket', 'Bone Group', default_value = 0)
self.add_output('LnxNodeSocketAnimTree', 'Result') self.add_output('LnxNodeSocketAnimTree', 'Result')

View File

@ -8,8 +8,8 @@ class OneShotActionMultiNode(LnxLogicTreeNode):
lnx_version = 1 lnx_version = 1
min_inputs = 10 min_inputs = 10
def __init__(self): def __init__(self, *args, **kwargs):
super(OneShotActionMultiNode, self).__init__() super(OneShotActionMultiNode, self).__init__(*args, **kwargs)
array_nodes[self.get_id_str()] = self array_nodes[self.get_id_str()] = self
property0: HaxeStringProperty('property0', name = 'Action ID', default = '') property0: HaxeStringProperty('property0', name = 'Action ID', default = '')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
class SetBoneTransformNode(LnxLogicTreeNode):
"""Sets the bones transform in world space."""
bl_idname = 'LNSetBoneTransformNode'
bl_label = 'Set Bone Transform'
lnx_version = 1
lnx_section = 'armature'
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxStringSocket', 'Bone')
self.add_input('LnxDynamicSocket', 'Transform')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -12,5 +12,7 @@ class SetParentBoneNode(LnxLogicTreeNode):
self.add_input('LnxNodeSocketObject', 'Object') self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxNodeSocketObject', 'Parent') self.add_input('LnxNodeSocketObject', 'Parent')
self.add_input('LnxStringSocket', 'Bone', default_value='Bone') self.add_input('LnxStringSocket', 'Bone', default_value='Bone')
self.add_input('LnxBoolSocket', 'Set Inverse')
self.add_input('LnxBoolSocket', 'Keep Transform')
self.add_output('LnxNodeSocketAction', 'Out') self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -7,8 +7,8 @@ class SwitchActionMultiNode(LnxLogicTreeNode):
lnx_version = 1 lnx_version = 1
min_inputs = 8 min_inputs = 8
def __init__(self): def __init__(self, *args, **kwargs):
super(SwitchActionMultiNode, self).__init__() super(SwitchActionMultiNode, self).__init__(*args, **kwargs)
array_nodes[self.get_id_str()] = self array_nodes[self.get_id_str()] = self
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,7 +9,8 @@ class ArrayNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
lnx_section = 'variable' lnx_section = 'variable'
min_inputs = 0 min_inputs = 0
def __init__(self): def __init__(self, *args, **kwargs):
super(ArrayNode, self).__init__(*args, **kwargs)
self.register_id() self.register_id()
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -12,8 +12,8 @@ class ArrayAddNode(LnxLogicTreeNode):
lnx_version = 5 lnx_version = 5
min_inputs = 6 min_inputs = 6
def __init__(self): def __init__(self, *args, **kwargs):
super(ArrayAddNode, self).__init__() super(ArrayAddNode, self).__init__(*args, **kwargs)
array_nodes[self.get_id_str()] = self array_nodes[self.get_id_str()] = self
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,8 +9,8 @@ class BooleanArrayNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
lnx_section = 'variable' lnx_section = 'variable'
min_inputs = 0 min_inputs = 0
def __init__(self): def __init__(self, *args, **kwargs):
super(BooleanArrayNode, self).__init__() super(BooleanArrayNode, self).__init__(*args, **kwargs)
self.register_id() self.register_id()
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,8 +9,8 @@ class ColorArrayNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
lnx_section = 'variable' lnx_section = 'variable'
min_inputs = 0 min_inputs = 0
def __init__(self): def __init__(self, *args, **kwargs):
super(ColorArrayNode, self).__init__() super(ColorArrayNode, self).__init__(*args, **kwargs)
self.register_id() self.register_id()
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,8 +9,8 @@ class FloatArrayNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
lnx_section = 'variable' lnx_section = 'variable'
min_inputs = 0 min_inputs = 0
def __init__(self): def __init__(self, *args, **kwargs):
super(FloatArrayNode, self).__init__() super(FloatArrayNode, self).__init__(*args, **kwargs)
self.register_id() self.register_id()
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -0,0 +1,13 @@
from lnx.logicnode.lnx_nodes import *
class ArrayIndexNode(LnxLogicTreeNode):
"""Returns the array index list of the given value as an array."""
bl_idname = 'LNArrayIndexListNode'
bl_label = 'Array Index List'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketArray', 'Array')
self.add_input('LnxDynamicSocket', 'Value')
self.add_output('LnxNodeSocketArray', 'Array')

View File

@ -9,8 +9,8 @@ class IntegerArrayNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
lnx_section = 'variable' lnx_section = 'variable'
min_inputs = 0 min_inputs = 0
def __init__(self): def __init__(self, *args, **kwargs):
super(IntegerArrayNode, self).__init__() super(IntegerArrayNode, self).__init__(*args, **kwargs)
self.register_id() self.register_id()
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,8 +9,8 @@ class ObjectArrayNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
lnx_section = 'variable' lnx_section = 'variable'
min_inputs = 0 min_inputs = 0
def __init__(self): def __init__(self, *args, **kwargs):
super(ObjectArrayNode, self).__init__() super(ObjectArrayNode, self).__init__(*args, **kwargs)
self.register_id() self.register_id()
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -8,7 +8,8 @@ class ArrayRemoveValueNode(LnxLogicTreeNode):
bl_label = 'Array Remove by Value' bl_label = 'Array Remove by Value'
lnx_version = 1 lnx_version = 1
# def __init__(self): # def __init__(self, *args, **kwargs):
# super(ArrayRemoveValueNode, self).__init__(*args, **kwargs)
# array_nodes[str(id(self))] = self # array_nodes[str(id(self))] = self
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,8 +9,8 @@ class StringArrayNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
lnx_section = 'variable' lnx_section = 'variable'
min_inputs = 0 min_inputs = 0
def __init__(self): def __init__(self, *args, **kwargs):
super(StringArrayNode, self).__init__() super(StringArrayNode, self).__init__(*args, **kwargs)
self.register_id() self.register_id()
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,8 +9,9 @@ class VectorArrayNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
lnx_section = 'variable' lnx_section = 'variable'
min_inputs = 0 min_inputs = 0
def __init__(self): def __init__(self, *args, **kwargs):
super(VectorArrayNode, self).__init__() super(VectorArrayNode, self).__init__(*args, **kwargs)
self.register_id() self.register_id()
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,7 +9,8 @@ class AddTorrentNode(LnxLogicTreeNode):
lnx_category = 'Leenkx' lnx_category = 'Leenkx'
lnx_version = 1 lnx_version = 1
def __init__(self): def __init__(self, *args, **kwargs):
super(AddTorrentNode, self).__init__(*args, **kwargs)
array_nodes[str(id(self))] = self array_nodes[str(id(self))] = self

View File

@ -17,8 +17,8 @@ class CallWASMNode(LnxLogicTreeNode):
default=False, default=False,
) )
def __init__(self): def __init__(self, *args, **kwargs):
super(CallWASMNode, self).__init__() super(CallWASMNode, self).__init__(*args, **kwargs)
array_nodes[str(id(self))] = self array_nodes[str(id(self))] = self
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -406,8 +406,8 @@ class CreateStyleNode(LnxLogicTreeNode):
def __init__(self): def __init__(self, *args, **kwargs):
super(CreateStyleNode, self).__init__() super(CreateStyleNode, self).__init__(*args, **kwargs)
array_nodes[str(id(self))] = self array_nodes[str(id(self))] = self
def lnx_init(self, context): def lnx_init(self, context):

View File

@ -9,7 +9,8 @@ class CreateTorrentNode(LnxLogicTreeNode):
lnx_category = 'Leenkx' lnx_category = 'Leenkx'
lnx_version = 1 lnx_version = 1
def __init__(self): def __init__(self, *args, **kwargs):
super(CreateTorrentNode, self).__init__(*args, **kwargs)
array_nodes[str(id(self))] = self array_nodes[str(id(self))] = self

Some files were not shown because too many files have changed in this diff Show More