Compare commits

...

1666 commits

Author SHA1 Message Date
Lubos Lenco 9220e6b57e
Merge pull request #2381 from Skehmatics/fix/abc_deprication
Correct depricated (and now removed) import
2021-11-08 10:14:09 +01:00
Lubos Lenco 15ec53830f
Merge pull request #2379 from MoritzBrueckner/fix-cpu-count
Fix cpu_count() for incomplete PATH var on Windows and improve error handling
2021-11-08 10:13:36 +01:00
Lubos Lenco 946610c793
Merge pull request #2382 from Skehmatics/fix/morph_targets_linux
Fix morph target exporting on Unix-based systems
2021-11-08 09:07:13 +01:00
Moritz Brückner 1430e22a90 Make utils.cpu_count() even more failsafe on Windows 2021-11-07 16:50:20 +01:00
Derek Schmidt 07f4bea206 Fix morph target exporting on Unix-based systems
Also fixes some extra space issues since my editor auto-fixed them
2021-11-06 17:18:36 -07:00
Derek Schmidt 8581a75f9c Correct depricated (and now removed) import 2021-11-06 14:52:05 -07:00
Moritz Brückner 6bb2513001 Fix cpu_count() for incomplete PATH var on Windows and improve error handling 2021-11-06 22:36:04 +01:00
Lubos Lenco f581e91ba9 Move in morph target texture links 2021-11-06 12:34:03 +01:00
Lubos Lenco 263d5853a5
Merge pull request #2375 from QuantumCoderQC/shape-keys
Implementing Shape keys
2021-11-06 12:31:23 +01:00
QuantumCoderQC 1cec287891 Conditional compilation for shape key node 2021-11-02 15:59:40 +01:00
QuantumCoderQC 83a60e7462 Implement shape key conditions 2021-11-02 15:59:15 +01:00
QuantumCoderQC 603d23fbfd Add shape key export option 2021-11-02 15:58:38 +01:00
QuantumCoderQC 03090cafa2 remove shape key textures on clean 2021-11-02 15:56:46 +01:00
QuantumCoderQC a1951bb66e clean up export 2021-11-02 15:56:24 +01:00
QuantumCoderQC 3c0f580f69 fix morph weights lookup 2021-11-02 13:42:09 +01:00
QuantumCoderQC 8116729822 fix pixel count for images, fix max shape keys 2021-11-02 13:42:09 +01:00
QuantumCoderQC 6c0d4bdead fix error when all shape keys muted 2021-11-02 13:42:09 +01:00
QuantumCoderQC 8f733222a9 fix shape keys and multiple uv 2021-11-02 13:42:09 +01:00
QuantumCoderQC 4b65d8d68c do not export muted shape keys 2021-11-02 13:42:09 +01:00
QuantumCoderQC 13a2f4538a move shape key textures to dedicated directory 2021-11-02 13:42:09 +01:00
QuantumCoderQC b7cafbb4e3 add node to set shape key value 2021-11-02 13:42:08 +01:00
QuantumCoderQC d4f9982768 documentation 1 2021-11-02 13:42:08 +01:00
QuantumCoderQC 8e69bea14e appy position scale 2021-11-02 13:42:08 +01:00
QuantumCoderQC 669898fae1 fix normals with shape key and skin 2021-11-02 13:42:08 +01:00
QuantumCoderQC 8df6fc9176 fix shape key with skinning 2021-11-02 13:42:08 +01:00
QuantumCoderQC edeaf488b9 remove debug prints 2021-11-02 13:42:08 +01:00
QuantumCoderQC cb2cf0c9b4 keep both vert colors and shape keys 2021-11-02 13:42:07 +01:00
QuantumCoderQC 4522055fac use vec4 uniform array instead of float array 2021-11-02 13:42:07 +01:00
QuantumCoderQC 1d0eaf9371 debug prints 2021-11-02 13:42:07 +01:00
QuantumCoderQC e562d2515e export with optimized texture size 2021-11-02 13:42:07 +01:00
QuantumCoderQC 8e7d8a4f56 additional uniforms 2021-11-02 13:42:06 +01:00
QuantumCoderQC 6e153569dc make attrib skin fix 2021-11-02 13:42:06 +01:00
QuantumCoderQC d01c55fcd4 mordify to export shape keys 2021-11-02 13:42:06 +01:00
QuantumCoderQC 3814cd9da7 methods to get if vertex colors and if shapekey present 2021-11-02 13:42:06 +01:00
QuantumCoderQC 0636eb85c6 add morph attribute to shaders 2021-11-02 13:42:06 +01:00
QuantumCoderQC 2f77c5b060 modify normals calculation in skinning for morphing 2021-11-02 13:42:06 +01:00
QuantumCoderQC 26a0fb8c5a add morph target to make_shader.py 2021-11-02 13:42:05 +01:00
QuantumCoderQC 8c034655be implement morph_target.glsl 2021-11-02 13:42:05 +01:00
QuantumCoderQC 6f9b51a57a move make_morph_target 2021-11-02 13:42:05 +01:00
QuantumCoderQC 34243ed74c implement make_morph_target 2021-11-02 13:42:05 +01:00
QuantumCoderQC fb004f5dcc make attributes for shadow maps and depth 2021-11-02 13:42:05 +01:00
QuantumCoderQC 867100d151 make shader attribute for morph targets 2021-11-02 13:42:05 +01:00
QuantumCoderQC 09433f2a19 init morph target glsl 2021-11-02 13:42:05 +01:00
QuantumCoderQC 10d41e5eca init make morph target 2021-11-02 13:42:05 +01:00
QuantumCoderQC b7941d2fa8 export shape keys as texture 2021-11-02 13:42:04 +01:00
Lubos Lenco 93563dbba5 Bump version 2021-11-02 10:29:01 +01:00
Lubos Lenco 9094154440
Merge pull request #2367 from MoritzBrueckner/fix-library-textures
Fix exporting textures from linked libraries
2021-11-01 21:51:20 +01:00
Lubos Lenco 6ad9941d43
Merge pull request #2374 from tong/fix-uniformsmanager-register
Fix switch expression
2021-11-01 20:53:23 +01:00
Lubos Lenco 326d3bbf0d
Merge pull request #2373 from QuantumCoderQC/pick-rb-imp
add normal output for pick rb node
2021-11-01 20:52:23 +01:00
Lubos Lenco b2566a8249
Merge pull request #2372 from QuantumCoderQC/decal-fix
Decal fix
2021-11-01 20:51:37 +01:00
tong 18c5636d03 Fix switch expression 2021-11-01 02:44:56 +01:00
QuantumCoderQC 07cfa40727 add normal output for pick rb node 2021-10-31 23:06:11 +01:00
QuantumCoderQC e06ca4b9e7 get material from decal object too 2021-10-31 23:03:25 +01:00
QuantumCoderQC ec1f25cfec add support for decal object uniforms 2021-10-31 23:02:45 +01:00
QuantumCoderQC 1dc733ca88 dont cast decal objects to mesh objects 2021-10-31 20:58:27 +01:00
Lubos Lenco f22542a0b4
Merge pull request #2369 from t3du/master
add Between and Not Equal to Compare Logic
2021-10-28 11:40:37 +02:00
t3du c97c738870
add Between and Not Equal to Compare Logic 2021-10-27 10:35:58 -03:00
t3du 130e470290
add Between and Not Equal to Compare Logic 2021-10-27 10:32:58 -03:00
Lubos Lenco fabb4c0c3c
Merge pull request #2368 from t3du/master
add Not Equal to Gate Node
2021-10-26 16:50:04 +02:00
t3du ca03897811
Update LN_gate.py 2021-10-26 10:08:46 -03:00
t3du 6e255bcb05
add Not Equal to Gate node logic 2021-10-26 10:05:11 -03:00
t3du f6dfc43dde
add Not Equal to Gate Node 2021-10-26 10:04:31 -03:00
Moritz Brückner 36e42ad736 Fix exporting textures from linked libraries 2021-10-25 19:43:13 +02:00
Lubos Lenco 3df2916f5b
Merge pull request #2366 from MoritzBrueckner/fix-collection-export
Fix exporting collections with parent object in another collection
2021-10-25 10:00:41 +02:00
Moritz Brückner 59aca7ea41 Fix exporting collections with parent object in another collection 2021-10-23 17:12:22 +02:00
Lubos Lenco 297f7cdfca
Merge pull request #2363 from t3du/master
add get object uid nodes / agg args to call haxe static function / add Between to gate node
2021-10-22 09:18:51 +02:00
t3du 176ab43fd0
fix return with correct screen cords
solution from:

https://forums.armory3d.org/t/worldtoscreencoord-draw-debug-lines-with-2d-api/3467/9
2021-10-20 16:51:11 -03:00
t3du 6b1333902c
change version and add NodeReplacement 2021-10-20 11:15:06 -03:00
t3du 89ff1c29fc
change node version and add NodeReplacement 2021-10-20 11:12:01 -03:00
t3du 086c05eba2
change node version and add NodeReplacement 2021-10-20 11:11:44 -03:00
t3du 3e6e1e4bd1
change info 2021-10-20 09:49:00 -03:00
t3du 977b2db376
change info 2021-10-20 09:48:17 -03:00
t3du ebb3076431
add between logic condition 2021-10-19 21:19:16 -03:00
t3du 826dbd786d
add property0 between 2021-10-19 21:18:02 -03:00
t3du 4fe8f683dc
add args to the call of haxe static function 2021-10-19 19:11:10 -03:00
t3du b9b5c65141
add args to the haxe static function 2021-10-19 19:07:49 -03:00
t3du ec3054cdeb
add uid nodes 2021-10-18 17:55:44 -03:00
t3du d3b006c873
add nodes for uid 2021-10-18 17:53:09 -03:00
Lubos Lenco 9c931aff56
Merge pull request #2362 from tong/fix-doc-generation
Fix dox when using special characters
2021-10-15 16:02:15 +02:00
tong 622b8a275f Fix dox when using special characters 2021-10-14 17:35:23 +02:00
Lubos Lenco ea9b01e733
Merge pull request #2361 from SaxonGao-SZ/master
Use project name for web title
2021-10-14 12:35:03 +02:00
SaxonGao-SZ 34897c9747
feature: Use project name for web title
feature: Use project name for web title
2021-10-13 20:52:36 +08:00
Lubos Lenco c1f98dc668
Merge pull request #2359 from t3du/master
add logic nodes: set/get canvas font size and set progress bar color
2021-10-12 16:20:55 +02:00
t3du 67d511568f
add new nodes 2021-10-11 17:41:03 -03:00
t3du b8319fe28b
add new nodes 2021-10-11 17:38:18 -03:00
t3du d5e0208fd6
add getCanvasFontSize and fix setCanvasFontSize 2021-10-11 17:35:56 -03:00
Lubos Lenco 0fadefab69
Merge pull request #2357 from QuantumCoderQC/fix-random-color
random color node fix
2021-10-08 10:27:07 +02:00
QuantumCoderQC 50a1994867 random color node fix 2021-10-07 19:18:43 +02:00
Lubos Lenco b9a220fbcb
Merge pull request #2356 from MoritzBrueckner/fix-world-geometry
Fix Geometry and Texture Coordinate nodes for world shaders
2021-10-06 10:17:43 +02:00
Moritz Brückner 5e1105f51d Fix some Texture Coordinate node outputs for world shaders 2021-10-05 19:03:08 +02:00
Moritz Brückner b060953a7e Further fixes for the geometry node on world shaders 2021-10-05 18:41:45 +02:00
Moritz Brückner a4d09936d6 Fix world normals and position (adjust to Blender) 2021-10-05 18:40:39 +02:00
Lubos Lenco 786e68e475
Merge pull request #2355 from MoritzBrueckner/fix-deprecated-nodes
Fix deprecated nodes and improve deprecation handling
2021-10-05 11:02:00 +02:00
Lubos Lenco c7cba9d792
Merge pull request #2353 from MoritzBrueckner/debug-renderpath
Allow to set default renderpath for debugging
2021-10-05 11:01:00 +02:00
Lubos Lenco d9ddb5f4a3
Merge pull request #2352 from MoritzBrueckner/fix-cmft-cpu-count
Fix CPU count parameter for cmft
2021-10-05 09:39:18 +02:00
Moritz Brückner 8e8e8f586d Assert correct category for deprecated nodes 2021-10-05 00:03:48 +02:00
Moritz Brückner e8fa3b1b9a Whitespace cleanup 2021-10-04 23:57:15 +02:00
Moritz Brückner 7289b95a48 Don't show empty "Deprecated" node category menu 2021-10-04 23:56:35 +02:00
Moritz Brückner 7f5d382131 Allow to set default renderpath for debugging 2021-10-03 22:40:29 +02:00
Lubos Lenco ea02600d14 Bump version 2021-10-03 20:15:36 +02:00
Lubos Lenco a2c33b2f6a
Merge pull request #2351 from MoritzBrueckner/debug-console-trace
Debug console: make log output more readable
2021-09-28 13:00:51 +02:00
Moritz Brückner c40fd26c20 Fix CPU count parameter for cmft 2021-09-27 23:13:30 +02:00
Moritz Brückner 308ab2d77b Add some tooltips to the debug console 2021-09-27 16:02:29 +02:00
Moritz Brückner d979e4fde9 Debug console: make spacing between log lines smaller 2021-09-27 15:53:08 +02:00
Moritz Brückner 1c237dd6c3 Make printing with PosInfos configurable in the debug console UI 2021-09-27 15:46:35 +02:00
Moritz Brückner 152959699a Debug console: optionally omit PosInfos when printing 2021-09-27 15:43:03 +02:00
Moritz Brückner 259c375fda Whitespace cleanup 2021-09-27 15:41:53 +02:00
Lubos Lenco b579c8a15d
Merge pull request #2350 from MoritzBrueckner/fix-nodes-reload
Fix add-on reloading when there are new unimported node files
2021-09-27 11:03:02 +02:00
Lubos Lenco 73a352b76e
Merge pull request #2349 from MoritzBrueckner/global-canvas-scale-nodes
Add nodes to get/set global canvas scale
2021-09-27 11:02:16 +02:00
Moritz Brückner 957c5371c8 Fix add-on reloading when there are new unimported node files 2021-09-26 22:34:09 +02:00
Moritz Brückner 962f8a79a5 Add nodes to get/set global canvas scale 2021-09-26 22:31:56 +02:00
Lubos Lenco 8604e670c3
Merge pull request #2342 from tong/log-message-improvements
Improve log messages
2021-09-26 09:51:06 +02:00
tong d1d266a0f0 Improve log messages 2021-09-23 11:30:46 +02:00
Lubos Lenco 62d399e01a
Merge pull request #2338 from tong/no-haxe-times-param
Remove haxe --times param per default
2021-09-22 19:21:52 +02:00
tong 128efcc0ef Use haxe_times prefs field 2021-09-21 14:56:12 +02:00
tong 3920c475be No haxe times param 2021-09-21 14:43:47 +02:00
Lubos Lenco e3a55db813
Merge pull request #2339 from tong/fix-local-sdk-path
Fix invalid fp when using local sdk
2021-09-21 11:42:22 +02:00
Lubos Lenco 597c291da7
Merge pull request #2336 from QuantumCoderQC/tweenNodes
Introducing Tween nodes
2021-09-19 10:25:45 +02:00
Lubos Lenco 16976cdc5b
Merge pull request #2335 from MoritzBrueckner/fix-trait-fakeuser
Fix fake user export for traits
2021-09-18 11:05:19 +02:00
tong d1fe4d6686 Fix invalid fp when using local sdk 2021-09-17 13:21:36 +02:00
QuantumCoderQC ca966588ff add documentation 2021-09-13 23:10:31 +02:00
QuantumCoderQC 0ce0c5c115 change socket order 2021-09-13 22:48:32 +02:00
QuantumCoderQC 05465bcea1 minor clean-up 2021-09-13 22:30:39 +02:00
Moritz Brückner 77815d95ed Fix fake user export for traits 2021-09-13 21:29:21 +02:00
Lubos Lenco 156f1f433a
Merge pull request #2334 from tong/fix-throw-assert-error
Fix assert throw error
2021-09-13 10:03:11 +02:00
Lubos Lenco 5b4d24f067
Merge pull request #2332 from MoritzBrueckner/fix-realtime-postprocess
Fix realtime postprocess & cleanup arm.lib.make_datas
2021-09-12 08:05:29 +02:00
tong c24389813f Fix assert throw error 2021-09-12 00:03:57 +02:00
Lubos Lenco c398c1181e
Merge pull request #2331 from tong/fix-background-mode-open-build-dir
Do not open build directory in background mode
2021-09-11 13:49:20 +02:00
Lubos Lenco 7d9d5ac50f
Merge pull request #2329 from MoritzBrueckner/fix-ArmNodeAddInputOutputButton
Fix ArmNodeAddInputOutputButton
2021-09-10 09:12:59 +02:00
QuantumCoderQC eb5ef99309 create tween vector node 2021-09-10 01:08:31 +02:00
QuantumCoderQC 62294c8bb4 create tween rotation node 2021-09-10 01:08:12 +02:00
QuantumCoderQC ed6aa96fb0 create tween float node 2021-09-10 01:07:52 +02:00
Lubos Lenco f3fcb2846e
Merge pull request #2326 from onelsonic/patch-2
Update props_ui.py
2021-09-08 08:51:07 +02:00
Lubos Lenco afeecd4df1
Merge pull request #2325 from onelsonic/patch-1
Update props.py
2021-09-08 08:49:39 +02:00
Moritz Brückner de72bbf3a4 Cleanup arm.lib.make_datas 2021-09-07 23:40:52 +02:00
Moritz Brückner ecc4317919 Fix realtime postprocess: use compositor defines also for non-compositor pass shaders 2021-09-07 22:19:12 +02:00
tong 667e73c867 Do not open build directory in background mode 2021-09-07 10:15:11 +02:00
Moritz Brückner 56d84b08f4 Cleanup 2021-09-06 18:23:21 +02:00
Moritz Brückner adb2468245 Fix ArmNodeAddInputOutputButton 2021-09-06 18:22:38 +02:00
onelsonic abc52627a3
Update props_ui.py
change the UI to reflect common order to setup Android SDK values
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html
android:minSdkVersion="integer"
then
android:targetSdkVersion="integer"
then
android:maxSdkVersion="integer"
2021-09-06 15:33:16 +02:00
onelsonic 68ef00b668
Update props.py
proposed UI descriptions changes to reflect current Android SDK
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html
and updating default SDK values to Android Oreo
2021-09-06 15:26:13 +02:00
Lubos Lenco 55cfead084 Bump version 2021-09-06 09:22:25 +02:00
Lubos Lenco fe6d1fa372
Merge pull request #2320 from QuantumCoderQC/AddTraitFix
Add trait fix
2021-09-06 09:02:22 +02:00
Lubos Lenco 974181e75e
Merge pull request #2319 from MoritzBrueckner/assert-string-expr
Allow to use more complex string expressions as assert() messages
2021-09-05 11:55:28 +02:00
Lubos Lenco a4ab1dcc98
Merge pull request #2318 from QuantumCoderQC/navMeshImprove
Small improvement to Navigation nodes
2021-09-04 15:15:44 +02:00
QuantumCoderQC ccbc946bf1 Add warning if trait is already applied on the object 2021-09-03 23:42:43 +02:00
QuantumCoderQC fddef0983c Modify Add Trait Node To Accept String Trait 2021-09-03 23:37:13 +02:00
Moritz Brückner e715bf0108 Allow to use more complex string expressions as assert() messages 2021-09-03 22:21:57 +02:00
QuantumCoderQC 214b84fcf7 Modify NavAgent Trait 2021-09-03 21:00:58 +02:00
QuantumCoderQC 32b745f829 Modify Navigation Go To Location Node 2021-09-03 21:00:33 +02:00
QuantumCoderQC 8caf859db9 Create and implement Get Nav Agent Data Node 2021-09-03 20:59:49 +02:00
Lubos Lenco d6692efbdc
Merge pull request #2316 from onelsonic/patch-1
correcting Haxe Warnings : Std.is is deprecated. Use Std.isOfType ins…
2021-09-03 12:37:23 +02:00
onelsonic c77eea93fa
correcting Haxe Warnings : Std.is is deprecated. Use Std.isOfType instead.
correcting Warning : Std.is is deprecated. Use Std.isOfType instead.
2021-09-03 08:36:13 +02:00
Lubos Lenco e0cbf1b332
Merge pull request #2315 from MoritzBrueckner/fix-ppcomp-warnings
Fix "Uniform PPCompXX not found" warnings
2021-09-02 20:05:11 +02:00
Moritz Brückner b7024a5854 Whitespace cleanup 2021-09-02 17:18:59 +02:00
Moritz Brückner 44d8325001 Fix "Uniform PPCompXX not found" warnings 2021-09-02 17:14:18 +02:00
Lubos Lenco 052c7b00c5
Merge pull request #2309 from MoritzBrueckner/assert
Add assert() macro
2021-09-01 09:16:46 +02:00
Lubos Lenco 675618e529
Merge pull request #2308 from tong/html5-server-settings
HTML5 webserver log, port prefs
2021-08-30 09:10:26 +02:00
Moritz Brückner a6b67e4e00 Improve assert() docstring 2021-08-27 14:34:59 +02:00
Moritz Brückner 4b75a896d6 Auto-import assert() macro 2021-08-27 01:32:38 +02:00
Moritz Brückner ecddc0af92 Add assert() macro 2021-08-27 01:26:00 +02:00
tong e05d556552 Webserver log, port prefs 2021-08-26 10:01:35 +02:00
Lubos Lenco 85edde6d24
Merge pull request #2305 from niacdoial/newrotation
Added a rotation node-socket
2021-08-26 09:53:25 +02:00
niacdoial 703c618c7d
Misc. patches before merge [watch for amends]
- fixed type/import bugs in RotationNode.hx and SeparateRotationNode.hx
2021-08-21 16:07:34 +02:00
Lubos Lenco df715db381
Merge pull request #2307 from MoritzBrueckner/krom-es6
Switch to ES6 on krom target and fix 'armory' define
2021-08-20 10:35:19 +02:00
Lubos Lenco a8a44df249
Merge pull request #2306 from MoritzBrueckner/various-node-fixes
Various node fixes
2021-08-20 10:34:22 +02:00
Moritz Brückner 1eb087125f Fix 'armory' define 2021-08-19 22:27:09 +02:00
Moritz Brückner 2347348504 Switch to ES6 on krom target
See https://github.com/armory3d/armorcore/issues/32
2021-08-19 22:26:30 +02:00
Moritz Brückner 3e22cb3375 Update ArmOpenNodeWikiEntry to new wiki page structure 2021-08-19 22:02:01 +02:00
Moritz Brückner 4e526a6dd3 Various smaller node fixes 2021-08-19 21:59:52 +02:00
Moritz Brückner 2630c159d8 Align new custom sockets to Blender UI 2021-08-19 21:58:43 +02:00
niacdoial a67452802d
React to commit 14d33ee0530e5db640e0fafb8604662333c1b066 in iron. 2021-08-19 11:31:12 +02:00
niacdoial f892fdfd8a
Merge months of changes into 'newrotation' branch
(and homogeneised the contents of said branch in the process)
(plus a couple bugfixes, because what else)
2021-08-18 17:04:00 +02:00
Lubos Lenco 29785172f4
Merge pull request #2304 from tong/just-run
Shift click play just run
2021-08-18 11:03:21 +02:00
niacdoial 1d0a6d7955
Did the haxe part of the ongoing update.
Also fixed a ton of bugs in the python part.
NOTE: this requires a yet-to-be-done commit to Iron to work.
2021-08-17 19:29:35 +02:00
tong 7b6d3536e3 Shift click play just run 2021-08-17 17:47:04 +02:00
Lubos Lenco f017d68ed7
Merge pull request #2303 from MoritzBrueckner/fix-nishita-LUT
Fix nishita artifacts and improve LUT value range
2021-08-17 09:30:22 +02:00
Moritz Brückner 1de97e1898 Minor cleanup 2021-08-15 00:30:41 +02:00
Moritz Brückner ca96174b6b Fix nishita sky artifacts on some GPUs
It could happen that values returned by dot() were slightly larger than 1 or less than -1 due to precision errors, but acos() is undefined outside of [-1, 1]. This would lead to NaN values on some GPUs, causing visible artifacts.
2021-08-14 23:45:33 +02:00
niacdoial bd67667a6e Added node replacement routines for previous commits
(and fixed a couple bugs along the way)
2021-08-12 20:58:35 +02:00
Lubos Lenco 2910fcf1a8
Merge pull request #2302 from MoritzBrueckner/fix-addon-reload
Fix accidental module reloading caused by name conflicts of global vars
2021-08-11 18:25:44 +02:00
Moritz Brückner c56a0c3a72 Fix accidental module reloading caused by name conflicts of global vars 2021-08-11 14:32:21 +02:00
Moritz Brückner d610cc6a2f Fix value range in Nishita LUT 2021-08-09 16:51:26 +02:00
Lubos Lenco 34f6e0fc7c Kha update 2021-08-08 13:02:19 +02:00
Lubos Lenco 45e3c1c138
Merge pull request #2298 from MoritzBrueckner/reload-addon
Implement basic addon reloading
2021-08-07 19:06:44 +02:00
Lubos Lenco c49bece460
Merge pull request #2299 from MoritzBrueckner/fix-armsdk-ci
Fix armsdk CI
2021-08-07 19:03:57 +02:00
Lubos Lenco 2ef4f19eb7
Merge pull request #2300 from N8n5h/volumetric-light
fix volumetric lights not working when shadow map atlas is enabled
2021-08-07 16:54:08 +02:00
N8n5h 5509096158 fix volumetric lights not working with shadow map atlas enabled
Added missing code so the shader refers to the correct variable when
using shadow map atlasing.
2021-08-06 18:34:39 -03:00
Moritz Brückner 2d3e15064a Fix armsdk CI
Updated Logic.hx with changes made in make_logic.py. Is this file even used somewhere?
2021-08-06 22:33:20 +02:00
Lubos Lenco 386d2a3bf4 Bump version 2021-08-06 11:10:28 +02:00
Lubos Lenco 7607cc8ccd
Merge pull request #2296 from tong/physics-drag-limit-props
PhysicsDrag trait limit props
2021-08-05 22:13:58 +02:00
Lubos Lenco 52a594c910
Merge pull request #2297 from MoritzBrueckner/ui-font-fix
Canvas: fix using non-default fonts
2021-08-05 22:13:30 +02:00
Moritz Brückner 4c4bebcf4f Canvas: fix using non-default fonts 2021-08-04 23:35:54 +02:00
Moritz Brückner ea8c13686c Implement basic addon reloading 2021-08-04 22:56:11 +02:00
tong 4c34c2a5ce PhysicsDrag trait limit props 2021-08-04 22:09:54 +02:00
Lubos Lenco b664e3a010
Merge pull request #2287 from MoritzBrueckner/fix-thread-polling
Continue thread polling after an exception in the done callback
2021-08-02 08:23:37 +02:00
Lubos Lenco 60d0f443f8
Merge pull request #2286 from MoritzBrueckner/fix-getfp-drive-root
Windows: fix arm.utils.get_fp() if the project path is a drive root
2021-08-01 16:50:22 +02:00
Lubos Lenco aeffd76b75
Merge pull request #2285 from tong/arcball-improvements
ArcBall axis trait prop
2021-07-31 20:07:16 +02:00
Lubos Lenco 1532a332ff
Merge pull request #2284 from QuantumCoderQC/TerrainTextureFix
Fix terrain export for Krom
2021-07-30 08:25:01 +02:00
Moritz Brückner 4fc1f38b3b Continue thread polling after an exception in the done callback 2021-07-27 00:21:27 +02:00
Moritz Brückner 5f2dce140e Windows: fix arm.utils.get_fp() if the project path is a drive root 2021-07-26 23:40:47 +02:00
tong 13cf22ecc2 ArcBall axis trait prop 2021-07-26 19:26:17 +02:00
QuantumCoderQC 9f7af6a1cd Change terrain material bump output to normal 2021-07-26 18:02:23 +02:00
QuantumCoderQC 9ec425f6ae get file name only if specifiedin node 2021-07-26 13:50:52 +02:00
QuantumCoderQC 3bad878650 Add exception for null data 2021-07-26 13:48:44 +02:00
Lubos Lenco ce75516c59
Merge pull request #2283 from MoritzBrueckner/live-patch
Live patch: refactor and logic nodes support
2021-07-26 09:00:31 +02:00
Moritz Brückner bce14549ac Fix LN live patch when using multiple instances of the same logic tree 2021-07-26 00:02:54 +02:00
Moritz Brückner ee208ece18 Live patch: ignore two more operators 2021-07-25 20:20:43 +02:00
Moritz Brückner 549040fc09 Fix publishing with live patch enabled 2021-07-25 20:13:47 +02:00
Moritz Brückner 62ff11747b Update nodes for live patch support (merge conflict cleanup) 2021-07-25 19:50:51 +02:00
Moritz Brückner 6a3045477f Fix physics node if arm_physics is false + cleanup 2021-07-25 18:36:36 +02:00
Moritz Brückner 8a758bbe26 Only stop live patch session if live patch was active 2021-07-25 17:07:51 +02:00
Moritz Brückner ffee6dc521 Fix error caused by resolving merge conflict 2021-07-25 17:02:29 +02:00
Moritz Brückner cca82a69bf
Merge branch 'master' into live-patch 2021-07-25 16:47:32 +02:00
Moritz Brückner c52d25e471 arm_props.py: cleanup and fix docstrings 2021-07-25 00:15:32 +02:00
Moritz Brückner cf1dd0ac71 Live patch: fix creation of node outputs 2021-07-24 23:07:22 +02:00
Moritz Brückner 8e1aa2fb0d Live patch: fix creation of nodes without properties 2021-07-24 23:06:53 +02:00
Moritz Brückner 6d2b825dd5 Fix LN replacement and take arm_watch and arm_logic_id properties into account 2021-07-24 20:24:04 +02:00
Moritz Brückner 6050bceaf1 Fix nodes with "..._get" property names 2021-07-24 20:17:29 +02:00
Moritz Brückner dbb0764ca7 Fix typo 2021-07-24 20:16:54 +02:00
Moritz Brückner 568f4f3a6d Remove unnecessary privateAccess metadata 2021-07-24 19:51:01 +02:00
Moritz Brückner 0a58279756 Live patch: add more ignored operators 2021-07-24 19:49:35 +02:00
Moritz Brückner ff5fd9c7ed Fix generator usage 2021-07-24 19:49:19 +02:00
Moritz Brückner 0456d5f080 Remove legacy code stub 2021-07-24 18:21:06 +02:00
Moritz Brückner af520b518e Fix compatibility for frames and reroutes 2021-07-24 13:54:48 +02:00
Moritz Brückner 82c7302dd9 Live patch: simplify node deletion code 2021-07-24 13:54:31 +02:00
Moritz Brückner 2b6a7a4f78 Live patch: add another ignored operator 2021-07-24 13:37:13 +02:00
Moritz Brückner 7eced3b4f5 Live patch: don't try to re-export if live patch is not active 2021-07-24 13:36:55 +02:00
Moritz Brückner aa21402221 Live patch: handle deletion of node links 2021-07-24 13:36:16 +02:00
Lubos Lenco 97cc737aff
Merge pull request #2280 from MoritzBrueckner/fix-multi-uv
Fix usage of multiple UV maps on mobile render path
2021-07-22 09:28:00 +02:00
Moritz Brückner 256d27e289 Fix vector/color handling for logic node live patching 2021-07-21 22:58:21 +02:00
Moritz Brückner 9ff726bac1 Fix usage of multiple UV maps on mobile render path 2021-07-21 00:01:27 +02:00
Moritz Brückner 5276711094 Live patch: add more ignored operators 2021-07-20 23:34:06 +02:00
Moritz Brückner 4f13ebc439 Live patch: fix updates of object sockets 2021-07-20 23:33:47 +02:00
Moritz Brückner 1edc7a9469 Live patch: support for adding nodes 2021-07-20 20:53:37 +02:00
Moritz Brückner 3ed915b654 Cleanup LivePatch.hx 2021-07-20 14:28:42 +02:00
Moritz Brückner e930da7388 Live patch: support for node deletion 2021-07-20 14:25:35 +02:00
Moritz Brückner c65764be99 Cleanup LivePatch.hx 2021-07-20 14:24:00 +02:00
Moritz Brückner bdee03873b Live patch: support for node duplication 2021-07-18 22:29:18 +02:00
Lubos Lenco 1b758ec32c
Merge pull request #2276 from tong/fix-fetch-prop-type
Fix fetch trait prop type
2021-07-18 09:12:44 +02:00
tong cfa941eab4 Fix fetch trait prop type 2021-07-17 18:49:37 +02:00
niacdoial 9b1393ea41
Make rotation its own socket in logic nodes, add rotation-specific math node
(part 1: conversion code not developed)
2021-07-11 11:28:00 +02:00
Lubos Lenco bfde181da6
Merge pull request #2268 from MoritzBrueckner/fix-gbuffer2-overlay
Fix visual artifacts caused by invalid gbuffer2 on OpenGL
2021-07-11 10:48:00 +02:00
Lubos Lenco a59c789528
Merge pull request #2266 from QuantumCoderQC/staticTargetFix
Static target fix
2021-07-11 10:46:52 +02:00
Lubos Lenco caa03b59c5
Merge pull request #2263 from knowledgenude/master
Fix nullability
2021-07-11 10:42:12 +02:00
Lubos Lenco ff93e5f824
Merge pull request #2262 from tong/replace-deprecated-std-is
Replace deprecated Std.is with Std.isOfType
2021-07-11 10:41:53 +02:00
Moritz Brückner b3162d8f6e Fix visual artifacts caused by invalid gbuffer2 on OpenGL 2021-07-10 22:41:19 +02:00
Moritz Brückner 823cc379b6 Live patch: ignore more operators & fix code style 2021-07-10 22:08:19 +02:00
Moritz Brückner ee194a1806 Live patch: support for socket default values 2021-07-10 21:50:30 +02:00
Moritz Brückner 96aa0ee890 Use custom sockets for default data types
This allows to listen for socket updates for the live patch system
2021-07-10 21:46:44 +02:00
QuantumCoderQC c0333db44f Fix typos. Fix fast float 2021-07-10 19:22:26 +02:00
QuantumCoderQC e0ff256f40 make boolean objects nullable for static targets 2021-07-10 19:20:56 +02:00
Henrique 28d21bf35f Fix nullability 2021-07-09 21:42:12 -03:00
tong b452acaebb Replace deprecated Std.is with Std.isOfType 2021-07-09 22:04:50 +02:00
Lubos Lenco 3c88ddcb23
Merge pull request #2260 from knowledgenude/master
Improved Input Map and added nodes to it
2021-07-09 07:52:24 +02:00
Henrique db5aed465e Add static method to remove keys 2021-07-08 16:10:45 -03:00
Henrique 55cf2896a2 Cleanup 2021-07-07 17:11:56 -03:00
Henrique daee309ad8 Add Remove Input Map Key node 2021-07-07 17:08:01 -03:00
Henrique 43a574eb15 Remove unnecessary read access 2021-07-07 16:51:07 -03:00
Henrique 919512fad0 Improve InputMap and add nodes to it 2021-07-07 16:33:20 -03:00
Lubos Lenco 14b18408aa
Merge pull request #2254 from N8n5h/fix-atlas-ui
Fix compiling error with shadow map atlas shadow size option
2021-07-06 23:35:35 +02:00
N8n5h 801668a0c2 Fix compiling error with shadow map atlas shadow size option
Added 512 option to Inc so it doesn't fails compilation because of
missing option as explained here
https://github.com/armory3d/armory/issues/2252#issue-937328497
2021-07-06 10:39:07 -03:00
Lubos Lenco dc6753c2ca Bump version 2021-07-06 10:46:44 +02:00
Lubos Lenco 6dd27bfeed
Merge pull request #2251 from MoritzBrueckner/ui-canvas-font
UI Canvas: use font from asset for all element types
2021-07-06 09:20:43 +02:00
Moritz Brückner e7da337530 UI Canvas: use font from asset for all element types 2021-07-05 19:25:47 +02:00
Lubos Lenco 50c8ceec1e
Merge pull request #2247 from QuantumCoderQC/LogicNodeFix
Add check to LogicNode run
2021-07-04 23:19:57 +02:00
Moritz Brückner a6ec652d5f Fix identity node replacement for Blender 2.93 2021-07-03 22:49:19 +02:00
QuantumCoderQC cb800729d2 Add check
Add a check to see if input socket is linked to correct output socket
2021-07-03 20:12:10 +02:00
Moritz Brückner 4e19ddfeb0 Do not send live patch events if live patch isn't running 2021-07-03 19:47:09 +02:00
Moritz Brückner b2153dbcd2 Cleanup 2021-07-03 19:45:35 +02:00
Moritz Brückner 4387d774cc Live patch: add support for node property updates 2021-07-03 19:45:05 +02:00
Lubos Lenco 738a217001
Merge pull request #2245 from QuantumCoderQC/NavMeshNodeFix
A few small fixes to UniformsManager calss and go to location node
2021-07-02 19:24:34 +02:00
QuantumCoderQC 9e493f6e79 do not remove trait at init 2021-07-01 15:33:28 +02:00
QuantumCoderQC 7504d5d92b Change input type from shader to vector 2021-07-01 15:32:53 +02:00
Lubos Lenco e308d9058b
Merge pull request #2242 from knowledgenude/master
Add "Parent Relative" option to location nodes
2021-06-29 08:44:17 +02:00
Henrique c7e1f5d0a9 Fix nodes 2021-06-28 16:12:05 -03:00
Moritz Brückner 202138304a Live patch: add support for creating connections between nodes 2021-06-28 12:17:13 +02:00
Lubos Lenco 8c0b6ba13e
Merge pull request #2240 from QuantumCoderQC/RelativePhysConstraint
Add option for relative physics constraint
2021-06-28 11:44:39 +02:00
Henrique 7515a20d93 Keep compatibility 2021-06-27 20:47:55 -03:00
Henrique 3d49edee71 Add Subtract option to World Vector to Local Space node 2021-06-27 19:13:00 -03:00
Henrique 34b816b4d9 Remove default value 2021-06-27 18:27:16 -03:00
Henrique 13c1e0508d Fix for null parent 2021-06-27 18:26:13 -03:00
Henrique f940e8566e Remove unused quat 2021-06-27 18:21:59 -03:00
Henrique dfad6902af Add Relative Parent option to location nodes 2021-06-27 18:18:04 -03:00
Moritz Brückner 441f42383e Correctly stop live patching after player terminates 2021-06-27 22:35:37 +02:00
Lubos Lenco 616a0e230d
Merge pull request #2239 from QuantumCoderQC/MatParamPerObject
Set material parameter on per object basis
2021-06-26 12:17:40 +02:00
Lubos Lenco 20540ccb11
Merge pull request #2238 from MoritzBrueckner/background-mode
Fix threading and publishing in background mode
2021-06-25 08:57:16 +02:00
QuantumCoderQC 31a2c9c4d3 Modify export of physics constraint 2021-06-24 23:13:29 +02:00
QuantumCoderQC ac48fd0bc9 Implement adding of relative physics constraint 2021-06-24 23:12:51 +02:00
QuantumCoderQC f2cf3bdeda Add new property to set if constraint is relative 2021-06-24 23:12:15 +02:00
QuantumCoderQC 112c00a649 Modify unifroms manager 2021-06-24 21:33:53 +02:00
QuantumCoderQC ee43724b97 Change imports 2021-06-24 21:33:21 +02:00
QuantumCoderQC 5a2f952f89 Add uniforms manager to mesh objects 2021-06-24 21:32:48 +02:00
QuantumCoderQC 936f11ed8e Move uniforms manager back to armory 2021-06-24 18:19:33 +02:00
QuantumCoderQC eab7fcbbe6 update node implementations 2021-06-24 18:13:13 +02:00
QuantumCoderQC 5a591fa15a set default vector and float parameter 2021-06-24 18:13:13 +02:00
QuantumCoderQC 975ec76f38 Set default image file 2021-06-24 18:13:13 +02:00
QuantumCoderQC 340f7e8af4 Pass default image file name when adding uniform 2021-06-24 18:13:13 +02:00
QuantumCoderQC fa44147ee6 Pass default float value when adding uniform 2021-06-24 18:13:13 +02:00
QuantumCoderQC c44e2cf555 Pass default vector value when adding uniform 2021-06-24 18:13:13 +02:00
QuantumCoderQC 15da6ccf58 Upgrade nodes to include object. Add documnetation 2021-06-24 18:13:12 +02:00
QuantumCoderQC 39922bc0f3 move uniforms manager to iron 2021-06-24 18:13:12 +02:00
QuantumCoderQC ea4f88aca8 remove debug trace 2021-06-24 18:13:12 +02:00
QuantumCoderQC 39bd32f9d3 get image from node 2021-06-24 18:13:12 +02:00
QuantumCoderQC e744fd901c create and implement uniforms manager
remove node mapping

Revert "remove node mapping"

This reverts commit e70aa60e120e71236cba885bd7e0e5f1b6acf39d.
2021-06-24 18:13:12 +02:00
QuantumCoderQC dbd348ad5d update node scripts 2021-06-24 18:13:12 +02:00
QuantumCoderQC f542dc00ca update similar nodes 2021-06-24 18:13:12 +02:00
QuantumCoderQC aaa21bc019 implement per object option 2021-06-24 18:13:12 +02:00
QuantumCoderQC a9f430c374 Add per object option 2021-06-24 18:13:12 +02:00
QuantumCoderQC 6cf3299ffe Implement and upgrade set material value parameter node 2021-06-24 18:13:12 +02:00
QuantumCoderQC a588396dea Update set material value param node 2021-06-24 18:13:12 +02:00
Moritz Brückner dc34e48c52 Unregister timers on exit/disabling addon 2021-06-24 17:26:21 +02:00
Moritz Brückner fce97a5ddf Cleanup 2021-06-24 15:03:30 +02:00
Moritz Brückner d18aede964 run_proc: no thread in background mode and call done in main thread 2021-06-24 14:59:32 +02:00
Moritz Brückner 66856e7ecc Build/publish: add poll() function to prevent exception when executing from outside of UI
If there was no exporter, calling `bpy.ops.arm.publish_project()` would result in an exception before. Now the call is simply ignored and a "poll failed" message is emitted instead.
2021-06-23 20:19:08 +02:00
Lubos Lenco ebfbb68bb4
Merge pull request #2235 from knowledgenude/master
Cleanup in ui Ext
2021-06-20 20:53:48 +02:00
Henrique 3c1264378b Cleanup in ui Ext 2021-06-19 13:39:18 -03:00
Lubos Lenco cbcc3e4e04
Merge pull request #2233 from MoritzBrueckner/fix-compilation
Fix compilation of some nodes
2021-06-16 08:10:03 +02:00
Moritz Brückner f45304ea10 Fix compilation of some nodes 2021-06-15 15:24:58 +02:00
Lubos Lenco dd13cc31b7
Merge pull request #2231 from knowledgenude/master
Fix GetBoneFkIkOnly node & add new input nodes
2021-06-14 10:41:51 +02:00
Henrique a5fa3445d9 Add new input nodes 2021-06-13 22:43:13 -03:00
Henrique 1ece052aee Fix GetBoneFkIkOnly node 2021-06-13 21:38:15 -03:00
Lubos Lenco 24d917ae6a
Merge pull request #2228 from MoritzBrueckner/fix-movie-texture
Fix rendering multiple movie textures
2021-06-10 21:12:32 +02:00
Moritz Brückner 3288c3dcf5 MovieTexture: add documentation 2021-06-10 20:28:30 +02:00
Moritz Brückner 251ad8e47e Cache and reuse movietexture render targets with same size 2021-06-10 20:27:23 +02:00
Moritz Brückner b2619828eb Fix rendering multiple movie textures
Fixes https://github.com/armory3d/armory/issues/1562
2021-06-09 23:11:22 +02:00
Lubos Lenco 6c6d7c1419
Merge pull request #2221 from QuantumCoderQC/ExtraLogicNodes
Extra logic nodes
2021-06-09 07:38:28 +02:00
QuantumCoderQC 0e6ba5b0b0 reverse call order 2021-06-07 13:49:12 +02:00
QuantumCoderQC 107dc730f4 Create and implement once per frame node 2021-06-07 13:41:24 +02:00
Lubos Lenco b72e85894a
Merge pull request #2220 from MoritzBrueckner/select-node
Add Select node
2021-06-07 11:03:42 +02:00
Moritz Brückner 20f9f8a5f4 Add Select node
Implements feature requests #2200 and #2201
2021-06-05 20:35:21 +02:00
Lubos Lenco 5eb8fc781f Bump version 2021-06-02 21:18:47 +02:00
Lubos Lenco 70cb5ea421
Merge pull request #2216 from MoritzBrueckner/shader-fixes
Fix Layer Weight node and multiple cycles shaders in one material
2021-05-28 12:06:04 +02:00
Moritz Brückner ccc427c04a Cleanup 2021-05-27 22:57:53 +02:00
Moritz Brückner 6d37095014 Fix usage of layer weight node in shadowmap shaders 2021-05-27 22:56:07 +02:00
Moritz Brückner 7057ec4ba6 Fix mixing multiple cycles shaders in one material 2021-05-27 22:41:27 +02:00
Lubos Lenco 138386f02a
Merge pull request #2213 from MoritzBrueckner/fix-instancing-mobile
Fix instancing on mobile and solid renderpaths
2021-05-26 12:46:52 +02:00
Moritz Brückner bdc2d91c1e Fix instancing on mobile and solid renderpaths
`gl_Position` was set before the instancing code in the vertex shader, this was the same issue as already fixed for desktop renderpaths in https://github.com/armory3d/armory/pull/2141
2021-05-26 12:42:11 +02:00
Lubos Lenco 7b5294121d is_IK_FK_only -> is_ik_fk_only 2021-05-23 22:19:48 +02:00
Lubos Lenco 9330090179
Merge pull request #2206 from QuantumCoderQC/IKfix29_FK
Improve bone IK. Add new nodes for better animation control
2021-05-23 22:15:26 +02:00
Lubos Lenco 88f522c27b
Merge pull request #2210 from MoritzBrueckner/merge-node
Merge node: add execution mode and output for input index
2021-05-23 16:32:27 +02:00
Moritz Brückner 11da953407 Merge node: add update routine 2021-05-22 12:30:38 +02:00
Moritz Brückner 494e2336ac Node replacement: write original traceback to file also in case of update failures 2021-05-22 12:28:57 +02:00
Moritz Brückner 20c6c52ae6 Merge node: add execution mode and output for input index 2021-05-22 00:36:58 +02:00
Moritz Brückner 088bc0f666 Exporter: remove no longer used Blender version checks 2021-05-20 20:38:43 +02:00
QuantumCoderQC a35cab5482 Implement node to set bone animated by FK or IK only 2021-05-20 18:24:32 +02:00
QuantumCoderQC 03baa49ecd Implement node to get bone transform in world space 2021-05-20 18:24:32 +02:00
QuantumCoderQC c53d04374d Implement node to get if controlled by FK or IK 2021-05-20 18:24:32 +02:00
QuantumCoderQC 43e145c3da Add comments to bone IK node 2021-05-20 18:24:32 +02:00
QuantumCoderQC 6ded7e61f4 Improve bone FK node to accept transform in world space 2021-05-20 18:24:32 +02:00
QuantumCoderQC e7c1855b81 Create new node to set if bones are FK IK only 2021-05-20 18:24:32 +02:00
QuantumCoderQC 86316a10bd Create new node to get world transforms of bones 2021-05-20 18:24:32 +02:00
QuantumCoderQC 646d3a74cf Create new node to get if bones are FK IK 2021-05-20 18:24:32 +02:00
QuantumCoderQC 5ed5b8d6a7 Nodes for IK and FK fix
Edit logic node code

fkcommit30_04

Upgrade bone IK node. Add comments
2021-05-20 18:24:31 +02:00
Moritz Brückner 9fbc3d6cd4 Small cleanup 2021-05-19 21:17:57 +02:00
Moritz Brückner 7b2961459c Live patch support for light strength and color 2021-05-19 21:17:38 +02:00
Moritz Brückner 3d46910530 Live patch: don't re-export on trackball rotation (double 'r' key) 2021-05-18 21:34:46 +02:00
Moritz Brückner 68825516c9 Live patch: more robust shader paths 2021-05-18 21:31:02 +02:00
Moritz Brückner 07ffe06c1d Live patch: move to dedicated module and use msgbus 2021-05-18 21:24:45 +02:00
Lubos Lenco 3b72fff76d
Merge pull request #2196 from N8n5h/light-fix-2
Small improvements for the Shadow Map Atlas Blender UI
2021-05-16 12:29:31 +02:00
N8n5h 1945439cd1 Small improvements for the Shadow Map Atlas Blender UI
* Made shadow map atlas sizes enum's values dynamic:
This allows reducing issues related to picking a "wrong" size for the atlases.
* Added a legend below shadow map sizes to have an idea of how much lights can an option fit.
* Separated listing of subdivisions to include point lights.
* Disable cubemap size if single map is enabled to show that cascade size option is only used.
2021-05-14 11:22:11 -03:00
Lubos Lenco 98eeccd71d
Merge pull request #2082 from armory3d/blender2.9
Blender 2.9 LTS support
2021-05-10 11:14:39 +02:00
Lubos Lenco d31303391f
Merge pull request #2185 from MoritzBrueckner/fix-linked-objects-export
Fix double-export of linked objects (#2175)
2021-05-09 15:50:57 +02:00
Moritz Brückner 590afcc573 Fix double-export of linked objects (#2175) 2021-05-08 23:09:45 +02:00
Lubos Lenco 30b2093b94 Move game theme to armory.ui 2021-05-07 17:02:31 +02:00
Lubos Lenco 2f1fe4ef0b Move Canvas and game ui to armory.ui package 2021-05-07 15:24:03 +02:00
Lubos Lenco 57093c34cd
Merge pull request #2184 from MoritzBrueckner/debug-console-panel
[Blender 2.9] Slightly improve debug console panel UI
2021-05-07 10:29:09 +02:00
Moritz Brückner 2c761b2ff6 Slightly improve debug console panel UI 2021-05-06 21:29:59 +02:00
Lubos Lenco 4db37ea1c1
Merge pull request #2177 from QuantumCoderQC/get-object-node-fix
Get object by name node fix
2021-05-02 11:16:12 +02:00
QuantumCoderQC df372e9523 Spelling correction 2021-05-02 01:37:00 +02:00
QuantumCoderQC 5b6875947c New logic node to spawn objects not in current active scene 2021-05-02 01:33:38 +02:00
QuantumCoderQC badc8853b4 Make description more accurate 2021-05-02 01:31:44 +02:00
QuantumCoderQC 1ebe528417 Remove scene port from logic node 2021-05-02 01:30:34 +02:00
QuantumCoderQC c185882db8 Revert commit that creates an object if not in scene.
Returns object only if present in active scene
2021-05-01 22:19:29 +02:00
Lubos Lenco 0085f6fbd7 Bump version 2021-05-01 11:30:23 +02:00
Lubos Lenco 04909603ec
Merge pull request #2176 from MoritzBrueckner/2.9-version-info
Update Blender version information to 2.93 LTS
2021-05-01 11:15:54 +02:00
Moritz Brückner 22a557162f Update Blender version information to 2.93 LTS 2021-05-01 00:04:25 +02:00
Lubos Lenco ad9c7bfa6b
Merge pull request #2170 from N8n5h/debug-console-atlas
Fix artifact with point light soft shadow in shadow map atlas
2021-04-29 09:01:21 +02:00
Lubos Lenco 6d52238db3
Merge pull request #2174 from N8n5h/light-fix-2
Make tileSizes and TileSizesFactor non-static
2021-04-29 09:00:38 +02:00
N8n5h 939649f492 Make tileSizes and TileSizesFactor non-static
This solves an oversight that basically made all atlases share the
their tileSizesFactor, a variable used to quickly lookup tile tile sizes
depending on the shadowMapScale. So if cascade size was higher than cube
map size, then point light atlases would use incorrect values and break.
2021-04-28 19:12:45 -03:00
N8n5h ddc3da7799 Fix artifact with point light soft shadow in sm atlas 2021-04-26 16:45:20 -03:00
Lubos Lenco a4e9ad945b
Merge pull request #2168 from N8n5h/debug-console-atlas
Add profiling of shadow map atlas logic to debug console
2021-04-25 09:35:52 +02:00
N8n5h 41c6924231 Separate shadow map atlas logic and rendering time 2021-04-24 21:48:24 -03:00
N8n5h 9247b09c88 Add profiling of shadow map atlas logic 2021-04-24 20:31:03 -03:00
Lubos Lenco bb5ff191b7
Merge pull request #2163 from MoritzBrueckner/fix-attribute-node
Fix export of attribute node if no UV map exists
2021-04-20 09:36:37 +02:00
Lubos Lenco df50ba397e
Merge pull request #2162 from MoritzBrueckner/fix-overlay-mats
Fix creation of overlay materials
2021-04-20 09:35:38 +02:00
Moritz Brückner 97b578d0ed Fix export of attribute node if no UV map exists 2021-04-19 22:21:23 +02:00
Moritz Brückner 8a364259db Fix creation of overlay materials 2021-04-19 21:42:09 +02:00
Lubos Lenco 6d4952624a
Merge pull request #2161 from N8n5h/light-fix
Remove redundant 0 check when computing tile offset
2021-04-18 16:58:59 +02:00
Lubos Lenco 1955edf01c
Merge pull request #2160 from N8n5h/debug-console-atlas
Add visual representation of shadow map atlases to the debug console
2021-04-18 16:58:10 +02:00
N8n5h eb01b4652a remove redundant 0 check when computing tile offset 2021-04-18 10:32:36 -03:00
N8n5h c21d17d04e Add visual representation of shadow map atlases to the debug console
This is done to make it easier to understand what is going on with
atlases to help users and also the maintenance of the feature.

Max atlas size and max tile size where moved to the graph to make it
more understandable.
2021-04-18 10:25:27 -03:00
Lubos Lenco 069a9288ea
Merge pull request #2159 from N8n5h/debug-console-atlas
Fix compile error with debug and shadow map atlas LOD
2021-04-16 17:59:11 +02:00
N8n5h da41d1fb17 Fix compile error with debug and shadow map atlas LOD 2021-04-16 11:43:19 -03:00
Lubos Lenco 00af258b14
Merge pull request #2157 from N8n5h/debug-console-atlas
Add shadow map atlases info to the debug console
2021-04-14 11:14:18 +02:00
N8n5h c01b079cf1 Add custom highlighting for debug console
And use it to highlight "not enough lights" with a different color to
bring attention to it.
2021-04-14 01:06:14 -03:00
N8n5h e1cfa2f1da Add shadow map atlases info to the debug console
Display information like tile size, current size, max size, free tiles,
etc. to help debug atlases.
2021-04-14 00:32:54 -03:00
Lubos Lenco 6fbee167ab
Merge pull request #2155 from MoritzBrueckner/fcurve-datapath-warnings
Improve warning message for unsupported/unknown fcurve data paths
2021-04-10 08:32:02 +02:00
Moritz Brückner 78e266f77b Improve warning message for unsupported/unknown fcurve data paths 2021-04-09 20:55:17 +02:00
Lubos Lenco 1df882cad1
Merge pull request #2154 from MoritzBrueckner/fix-system-name-node
Fix GetSystemName node
2021-04-08 19:02:45 +02:00
Moritz Brückner cf56c4f1d8 Fix GetSystemName node 2021-04-08 15:44:18 +02:00
Lubos Lenco a3ca487183
Merge pull request #2152 from N8n5h/light-fix
Fix detection of removed lights by shadow map atlas
2021-04-07 20:47:10 +02:00
N8n5h 63716eea17 Modifications around addLight from Inc
* Removed redundant checks at the start of the function.
* changed the return value to void because the "return false" were
redundant, and simply made it so the lightInAtlas is set at the end of
the function.
* Removed unused variable
2021-04-07 12:44:54 -03:00
N8n5h 614385ea7b Setup callbacks so tiles are notified when a light is removed
A secondary callback is setup so the tile it's also removed from the
activeTiles, because it's freed in a "non standard" way.
2021-04-07 12:44:54 -03:00
Lubos Lenco 69207a6289
Merge pull request #2151 from N8n5h/coll-mask
Expose collision filter mask as integer to the UI
2021-04-04 10:49:13 +02:00
N8n5h 766e26a7df Expose collision filter mask as integer to the UI 2021-04-03 20:49:33 -03:00
Lubos Lenco 316eafd286
Merge pull request #2150 from MoritzBrueckner/blender2.9
[Blender 2.9] Resolve merge conflicts
2021-04-03 14:21:41 +02:00
Moritz Brückner f64419dd06 Merge branch 'master' into blender2.9
# Conflicts:
#	blender/arm/material/shader.py
#	blender/arm/props_collision_filter_mask.py
#	blender/arm/props_ui.py
2021-04-03 14:12:54 +02:00
Lubos Lenco c9182cc152
Merge pull request #2149 from MoritzBrueckner/2.9-NishitaSky
[Blender 2.9] Nishita sky model & (ir)radiance support for all world shaders
2021-04-03 10:07:25 +02:00
Moritz Brückner 899411dea4 Cleanup write_probes.py 2021-04-02 14:57:11 +02:00
Lubos Lenco b930b87bc9 Bump version 2021-04-02 13:34:08 +02:00
Moritz Brückner 34f08e6922 Fix irradiance brightness
See write_sky_irradiance() for reference
2021-04-02 01:59:55 +02:00
Moritz Brückner 656b018e5f Render (ir)radiance probes if no other probes are set 2021-04-02 01:59:28 +02:00
Moritz Brückner c5be90d0b0 Cleanup 2021-03-31 20:33:52 +02:00
Moritz Brückner ffcc5fcceb Make clouds work with Nishita sky model 2021-03-31 20:31:31 +02:00
Lubos Lenco 67110c15a9
Merge pull request #2147 from N8n5h/light-fix
Fix case where sun shadows are not working if there are other type of lights present
2021-03-30 09:08:25 +02:00
N8n5h ead7dc9d32 Moved biasLWVP matrix uniform reference to a new one for sun
This was done because the original "_biasLightWorldViewProjectionMatrix"
relies on renderpath.light, which is problematic when rendering the
deferred light pass and there is a sun and other lights of different
type on the scene. Which would result on the wrong light being picked up
for the calculation of the uniform value.
2021-03-29 10:55:58 -03:00
Lubos Lenco 4a784c70a8
Merge pull request #2144 from MoritzBrueckner/fix-matnames
Replace ' and " characters in asset names
2021-03-27 09:04:25 +01:00
Lubos Lenco 44f08a16ae
Merge pull request #2141 from MoritzBrueckner/instancing-fix
Fix writing to gl_Position before instancing code
2021-03-27 09:03:08 +01:00
Moritz Brückner de8073732a Replace ' and " characters in asset names 2021-03-27 00:30:05 +01:00
Moritz Brückner 420033c86d Add API to set Nishita density parameters 2021-03-26 20:59:26 +01:00
Moritz Brückner 845d2aff93 Use switch/case for uniform links 2021-03-26 15:39:18 +01:00
Lubos Lenco 8118733474
Merge pull request #2139 from Naxela/master
Add map range node, vector rotate node, missing math operations and blackbody node
2021-03-26 08:24:41 +01:00
Moritz Brückner 8d812548c4 Use 2D LUT for Nishita skies 2021-03-25 23:29:34 +01:00
Moritz Brückner 05c14238f2 shader.py: add API to set texture params 2021-03-25 23:03:08 +01:00
Moritz Brückner 24093d15df Fix writing to gl_Position before instancing code 2021-03-25 22:02:59 +01:00
Alexander Kleemann 930b2968fa
Include cycles glsl functions for vector rotation 2021-03-24 10:20:05 +01:00
Alexander Kleemann 6e0bfa272c
Remove float parsing 2021-03-24 10:13:46 +01:00
Alexander Kleemann dfe1a49f85 Implement the remaining 16 math node operations
Math node is now fully supported
2021-03-23 22:02:25 +01:00
Alexander Kleemann 0cc2ea4491 Add map range and vector rotate to node parser dictionary 2021-03-23 21:58:46 +01:00
Alexander Kleemann 5c1f8fe128 Implement vector rotate node
Should now be fully supported
2021-03-23 21:56:14 +01:00
Alexander Kleemann 07741abc55 Implement map range node
Map range node should now be fully supported
2021-03-23 21:53:24 +01:00
Alexander Kleemann 362fffa408 Reimplement blackbody node from python to GLSL
Should now work with changing values
2021-03-23 21:51:28 +01:00
Lubos Lenco fb56d85d02
Merge pull request #2138 from Naxela/blender2.9
[Blender 2.9] Fix material translucency in Blender 2.9+
2021-03-23 12:30:34 +01:00
Alexander Kleemann eb6d23fab3 Fix material translucency in Blender 2.9+
The extra input node in the principled is now taken into consideration
2021-03-22 20:26:01 +01:00
Lubos Lenco dc81aca823
Merge pull request #2137 from N8n5h/tangent-error
Show error in the UI for tangent calculation error instead of just crashing to blender UI
2021-03-22 08:39:12 +01:00
Lubos Lenco d88d2320ed
Merge pull request #2135 from N8n5h/physics-2
Expose the exported rigid body type to the UI to make rb less confusing
2021-03-21 13:03:34 +01:00
N8n5h 7851abc491 Clear error count after building again 2021-03-20 21:26:05 -03:00
Lubos Lenco 54fcd49c27
Merge pull request #2134 from QuantumCoderQC/patch-1
Make description of logic node more precise
2021-03-20 09:58:36 +01:00
Lubos Lenco 451e3484f0
Merge pull request #2133 from Naxela/blender2.9
[Blender 2.9] Ready lightmapper for the transition to the next Blender LTS
2021-03-20 09:58:04 +01:00
Lubos Lenco 8df7f66872
Merge pull request #2131 from N8n5h/physics
Modified UI for collision filter props_collision_filter_mask
2021-03-19 19:07:33 +01:00
N8n5h 57660631b5 Log errors and show them in the blender UI 2021-03-19 11:39:06 -03:00
N8n5h d4463a3611 Catch tangent n-gon error to properly show it to the user
Instead of just letting it crash whenever the users hits play.
2021-03-19 10:22:01 -03:00
N8n5h a778460d28 Expose the exported rigid body type to the UI to make rb less confusing 2021-03-18 22:52:08 -03:00
QuantumCoderQC 255921b9ee
Make description of logic node more precise
The OnVolumeTrigger node does not required a RigidBody.
2021-03-18 21:34:59 +01:00
Alexander Kleemann 5fe816d16a Add in-menu option for OpenCV installation 2021-03-18 19:25:02 +01:00
Alexander Kleemann ef8fb21536 Update lightmapper to Blender 2.9+
Finalized update to support Blender 2.9+ as well as new features, fixes and more stability
2021-03-18 18:49:30 +01:00
Lubos Lenco 4b593af4ee
Merge pull request #2129 from knowledgenude/master
Fix clamp node
2021-03-18 11:49:15 +01:00
N8n5h ca2c3e151a Modified UI for collision filter props_collision_filter_mask
* Moved to collision filter mask panel under armory props to keep UI
more tidy.
* Moved the `arm_rb_collision_filter_mask` property out of the
props_collision_filter_mask to be with the rest of the properties.
* Changed name and description of collision filter mask to be more
consistent with the existing rigid body UI.
2021-03-17 20:28:26 -03:00
knowledgenude 1ad1d564bd
Fix clamp node 2021-03-16 18:27:42 -03:00
Lubos Lenco 7d78e01bb4
Merge pull request #2128 from N8n5h/light-fix-2
Fix shadows not working when there are lights present with cast_shadow=false
2021-03-16 08:28:19 +01:00
Lubos Lenco 95af8f2f77
Merge pull request #2127 from N8n5h/light-fix-mobile
Fix shadow rendering for point and spot lights for deferred and forward mobile
2021-03-16 08:24:49 +01:00
Lubos Lenco 71a5ac6f6e
Merge pull request #2126 from MoritzBrueckner/trait-props
Make `@prop` recognition more robust
2021-03-15 13:45:02 +01:00
N8n5h c7211542b4 Make pointLightData work with lights with cast_shadow=false 2021-03-14 23:21:02 -03:00
N8n5h 7463de6140 Add cast_shadow to lightArray data
This was done to undo the hardcoded nature of "receiveShadows", which
doesn't play nice when you have multiple lights of the same type and
one or several have cast_shadow set to false.

By simply "passing" the cast_shadow parameter within the lightArray it
was possible to detect lights that don't cast shadows before actually
wasting gpu cycles to render shadows with garbage data.

Support for deferred desktop and mobile, and forward was added.
2021-03-14 23:20:57 -03:00
N8n5h efcef7dd25 Fix shadow rendering for deferred and forward mobile 2021-03-14 22:04:47 -03:00
Lubos Lenco 26c29fe15e
Merge pull request #2125 from N8n5h/light-fix-2
Fix light visual artifact when close to the camera
2021-03-14 16:44:43 +01:00
Moritz Brückner b7fef30b70 Further improve handling of final trait props 2021-03-14 15:50:27 +01:00
Moritz Brückner 4ad68304e5 Improve @prop warning messages 2021-03-13 21:22:42 +01:00
Moritz Brückner 7d9c6ce7c7 Make @prop recognition much more robust 2021-03-13 21:12:12 +01:00
N8n5h 404a1248a1 Make clusterNear be the same as in LightObject 2021-03-13 13:30:25 -03:00
N8n5h 8e972f75fd Fix light visual artifact when close to the camera
This fixes a current problem with lights that occurs when getting too
close to the camera. The issue is related to the clustering algorithm
and cluster near.

Cluster near explanation:

Because of the logarithmic nature of how the Z slice is calculated,
clusters slices get "burned" too quickly at the start of the frustum,
which is not ideal. To aid this, and offset is applied to the start of
the cluster frustum, and that is clusterNear.

Cluster near solves that problem but creates another one: There is a gap
between the near plane and the cluster near offset that gets completely
ignored when calculating. And this results in the visual artifact of
slices not being affected by light whatsoever.

The proposed solution is make the gap resolve to the first slice of Z
clusters.
2021-03-13 13:30:19 -03:00
Moritz Brückner 5f55b00710 Begin with Nishita LUT implementation for better performance 2021-03-11 23:16:44 +01:00
Lubos Lenco b1a412cfc7
Merge pull request #2124 from Naxela/master
Fix for material NoneType and fix for Blender exit error
2021-03-11 14:03:49 +01:00
Alexander Kleemann e5d6c47e3e Fix Blender exit error (Keymap winman hangs) 2021-03-10 20:49:51 +01:00
Alexander Kleemann 4009d9d3fe Fix for an error with NoneType materials
Solves an error where an unallocated material slot caused a bug
2021-03-10 20:48:46 +01:00
Lubos Lenco 7c56ee9304
Merge pull request #2122 from N8n5h/light-fix
Fix forward+single atlas failing to compile with just 1 light
2021-03-03 08:26:38 +01:00
Lubos Lenco 70c46407c3
Merge pull request #2120 from N8n5h/light-fix-2
Fix shadow artifacts for HTML5 with shadow map atlas
2021-03-03 08:24:04 +01:00
N8n5h 72dde10fb0 Fix forward+single atlas failing to compile with just 1 light
This should fix an issue where the uniform for shadowMapAtlas used with the single atlas option was not added when having just 1 light.
2021-03-02 20:20:31 -03:00
N8n5h cf99e5a382 Fixed point lights breaking for Krom Windows with shadow map atlas
https://github.com/armory3d/armory/issues/2110#issuecomment-787913813
2021-03-01 18:39:32 -03:00
N8n5h 5f8b92f9c3 Applied flip workaround for point light too for html5 and atlas
The same concept for spot lights was applied for point lights;
the difference is that because point lights require to do the projection in the shader, the first inversion was applied in sampleCube() when returning the uv coordinates.
"_FlipY" was added to replace "_InvY" in "PCFFakeCube()" because the inversion is only necessary for shaders and not anything else, otherwise it would break rendering of other parts.
2021-03-01 18:39:32 -03:00
N8n5h c07de1cc25 Remove the inversion in shader of spot light uv for atlas
With the change in iron, there is no longer a need to do this in the shader.
2021-03-01 18:39:32 -03:00
luboslenco 4dbf8a3b2a Bump version 2021-03-01 09:07:33 +01:00
Lubos Lenco 4ea5156f1e
Merge pull request #2116 from tong/debug-param
Write debug param by default
2021-02-27 09:31:08 +01:00
tong 3e15ed9b5c Write debug param by default 2021-02-25 14:06:31 +01:00
Lubos Lenco 91a10bea5c
Merge pull request #2115 from tong/update-custom-icons
Update custom trait icons
2021-02-25 08:11:45 +01:00
Lubos Lenco 31f1b58c07
Merge pull request #2114 from Naxela/master
Blending fix + ignore irradiance per material
2021-02-23 11:14:11 +01:00
Moritz Brückner 742b9ce1e1 Nishita sky: add support for ozone density 2021-02-22 18:52:56 +01:00
tong dbee605e3f Downscale icons to 32px 2021-02-22 18:05:28 +01:00
tong d20656339b Update custom icons 2021-02-22 15:50:19 +01:00
Lubos Lenco e7ca541b51
Merge pull request #2113 from MoritzBrueckner/fix-1689
Fix drawing of bool properties in UI (#1689)
2021-02-22 09:47:51 +01:00
Lubos Lenco f99ff0576d
Merge pull request #2111 from tong/console-improvements
Console improvements
2021-02-21 10:24:41 +01:00
Moritz Brückner 92554876f1 Fix nishita sky altitude
The scale was changed in recent Blender builds
2021-02-21 01:12:15 +01:00
Alexander Kleemann aec10274f4 Add option to ignore irradiance for baked environments 2021-02-20 15:30:18 +01:00
Alexander Kleemann f1858550d0 Blending fix
Fix for https://github.com/armory3d/armory/issues/1615
2021-02-20 13:51:25 +01:00
tong 352f37db0c More f string 2021-02-20 09:53:48 +01:00
tong a1fce84f59 Use f string to format console messages 2021-02-20 09:36:42 +01:00
Lubos Lenco a25c5a744b
Merge pull request #2112 from SunDaw/pick-rb-node-mask
Add mask option to pick RB node and physicsworld
2021-02-20 09:05:03 +01:00
Moritz Brückner 98481929df Fix drawing of bool properties in UI (#1689) 2021-02-19 20:59:54 +01:00
SunDaw c5855ad96f Add mask option to pick RB node and physicsworld 2021-02-19 19:42:18 +01:00
tong 0abb43f249 Revert terminal color change 2021-02-19 17:25:42 +01:00
tong d93de12252 Print human readable time 2021-02-19 17:04:18 +01:00
tong 325f7471c0 Fix printing build flags 2021-02-19 17:01:09 +01:00
tong b7c4a8bb3f Improve console build messages 2021-02-19 16:57:12 +01:00
tong d4ee144577 Improve console warning 2021-02-19 16:53:01 +01:00
tong 8bc831d7e2 Show scene name in missing camera warning 2021-02-19 16:50:29 +01:00
Lubos Lenco 84663bc981
Merge pull request #2106 from SunDaw/optimize-sendevent-nodes
Remove array allocation from SendEventNode
2021-02-16 15:48:57 +01:00
Lubos Lenco 6beb9efb88
Merge pull request #2108 from knowledgenude/master
Improved FSM
2021-02-15 08:11:48 +01:00
Lubos Lenco 02e9ff7c5c
Merge pull request #2109 from N8n5h/light-fix-2
Make sure compiled.inc is always first when parsing shaders for clusters
2021-02-15 08:10:29 +01:00
N8n5h 3ef380978e Make sure compiled.inc is always first when parsing shaders for clusters 2021-02-14 20:21:51 -03:00
knowledgenude 0ee35adc81 Improved FSM 2021-02-14 19:21:26 -03:00
Lubos Lenco 49a599dc66
Merge pull request #2102 from N8n5h/light-fix-2
Add support for shadow map atlasing
2021-02-14 16:32:59 +01:00
Lubos Lenco 6d8012b45c
Merge pull request #2107 from SunDaw/optimize-physics
Reuse contacts array instead of creating new
2021-02-14 09:44:53 +01:00
Moritz Brückner 702436e2a1 Add artistic option for darkening clouds at night 2021-02-13 19:01:14 +01:00
Moritz Brückner 28011bcc00 Nishita sky: add sun disk drawing 2021-02-13 18:23:37 +01:00
Lubos Lenco 726e2fec6d
Merge pull request #2105 from MoritzBrueckner/custom-mat-operator
Add button to create a new custom material
2021-02-13 17:30:54 +01:00
SunDaw 6cbe539098 Reuse contacts array instead of creating new
Remove unused import from PhysicsWorld
2021-02-13 17:23:16 +01:00
SunDaw a2e4850b12 Remove array allocation from SendEventNode
Remove entires member variable from SendEvent nodes
2021-02-13 16:56:21 +01:00
Moritz Brückner b4d5afd561 Remove unused fragment shader input 2021-02-12 20:54:02 +01:00
Moritz Brückner b70a60078b Fix and improve comments 2021-02-12 20:24:42 +01:00
Moritz Brückner 52e4aaa21c Add button to create a new custom material 2021-02-12 20:12:55 +01:00
Moritz Brückner 3260e627ce Fix custom material export when scene is exported in arm format
See af247f1876 for reference
2021-02-12 00:31:19 +01:00
N8n5h c64b47548e Added support for direct3d-like texture coords uv for shadow atlases
See http://thedev-log.blogspot.com/2012/07/texture-coordinates-tutorial-opengl-and.html,
the "opengl coordinates" where inverted for proper support of direct3d texture coordinate system.
2021-02-10 21:03:10 -03:00
N8n5h 1c3e24a8fd Add support for shadow map atlasing
With this it is now possible to enable atlasing of shadow maps, which solves the existing limitation of 4 lights in a scene. This is done by
grouping the rendering of shadow maps, that currently are drawn into their own images for each light, into one or several big textures. This was
done because the openGL and webGL version Armory targets do not support dynamic indexing of shadowMapSamplers, meaning that the index that
access an array of shadow maps has to be know by the compiler before hand so it can be unrolled into if/else branching. By instead simply
using a big shadow map texture and moving the dynamic part to other types of array that are allowed dynamic indexing like vec4 and mat4, this
limitation was solved.

The premise was simple enough for the shader part, but for the Haxe part, managing and solving where lights shadow maps should go in a shadow map
can be tricky. So to keep track and solve this, ShadowMapAtlas and ShadowMapTile were created. These classes have the minimally required logic
to solve the basic features needed for this problem: defining some kind of abstraction to prevent overlapping of shadowmaps, finding available
space, assigning such space efficiently, locking and freeing this space, etc. This functionality it is used by drawShadowMapAtlas(), which is a
modified version of drawShadowMap().

Shadow map atlases are represented with perfectly balanced 4-ary trees, where each tree of the previous definition represents a "tile" or slice
that results from dividing a square that represents the image into 4 slices or sub-images. The root of this "tile" it's a reference to the
tile-slice, and this tile is divided in 4 slices, and the process is repeated depth-times. If depth is 1, slices are kept at just the initial
4 tiles of max size, which is the default size of the shadow map. #arm_shadowmap_atlas_lod allows controlling if code to support more depth
levels is added or not when compiling.

the tiles that populate atlases tile trees are simply a data structure that contains a reference to the light they are linked to, inner
subtiles in case LOD is enabled, coordinates to where this tile starts in the atlas that go from 0 to Shadow Map Size, and a reference to a
linked tile for LOD. This simple definition allows tiles having a theoretically small memory footprint, but in turn this simplicity might make
some functionality that might be responsibility of tiles (for example knowing if they are overlapping) a responsibility of the ones that
utilizes tiles instead. This decision may complicate maintenance so it is to be revised in future iterations of this feature.
2021-02-04 17:53:59 -03:00
Lubos Lenco f0d7effb7c
Merge pull request #2101 from MoritzBrueckner/fix-skinning-normals
Fix normals export of skinned materials
2021-02-03 18:28:53 +01:00
Moritz Brückner afe133381c Fix normals export of skinned materials 2021-02-03 18:23:22 +01:00
luboslenco 6ffa58fb6b Bump version 2021-02-01 10:00:43 +01:00
Lubos Lenco cbb8ee4bae
Merge pull request #2099 from MoritzBrueckner/2.9-LodOperators
Fix lod operator polling and add some bl_options
2021-02-01 09:55:22 +01:00
Moritz Brückner f2c16097d4 Fix lod operator polling and add some bl_options 2021-01-30 20:21:31 +01:00
Lubos Lenco d0e92b927b
Merge pull request #2097 from armory3d/2.9-AttributeNode
[Blender 2.9] Update attribute node
2021-01-30 19:57:17 +01:00
Moritz Brückner 121d449c35 Blender 2.9: Cycles attribute node - support object/custom properties 2021-01-30 14:19:46 +01:00
Moritz Brückner 75bb88831c Blender 2.9: Cycles attribute node - support alpha output and new attribute_type prop 2021-01-30 14:19:46 +01:00
Lubos Lenco 129d59ab54
Merge pull request #2096 from kevinresol/patch-4
[PickLocation] Actually return null when input invalid
2021-01-30 11:37:39 +01:00
Kevin Leung 4ee1131f6e
[PickLocation] Actually return null when input invalid 2021-01-29 20:54:34 +08:00
Lubos Lenco 4273aff1fb
Merge pull request #2094 from knowledgenude/master
Update inputmap and added finite state machine
2021-01-26 18:27:49 +01:00
Lubos Lenco 74b99411df
Merge pull request #2095 from tong/sdk-path-normalize
Normalize sdk path
2021-01-26 18:27:39 +01:00
tong 725520081a Normalize sdk path 2021-01-26 16:38:49 +01:00
knowledgenude 6ef1195816 Update inputmap and add FSM 2021-01-25 20:19:24 -03:00
Lubos Lenco 0fdb516083
Merge pull request #2093 from MoritzBrueckner/2.9-UI
[Blender 2.9] Various UI improvements & redesigns
2021-01-25 17:24:19 +01:00
Moritz Brückner a1bbd76de7 Fix: Remove unused/non-existing armory icon 2021-01-25 16:51:28 +01:00
Moritz Brückner e3f992b1f3 Whitespace cleanup 2021-01-25 16:48:03 +01:00
Moritz Brückner 05307817ee Fix grammar in warnings report 2021-01-25 16:47:51 +01:00
Moritz Brückner d55f889a84 Another small compositor panel UI improvement 2021-01-25 16:45:30 +01:00
Moritz Brückner 1d79708b22 Fix trait type backward compatibility with pre-Blender2.9 files 2021-01-25 16:23:03 +01:00
Moritz Brückner ba62ba0285 Blender 2.9: Fix/Improve collision filter mask UI 2021-01-25 14:01:53 +01:00
Moritz Brückner d7e70c4c0a Blender 2.9: Improve project flags panel UI 2021-01-25 13:58:47 +01:00
Moritz Brückner 6ae76bfdf6 Blender 2.9: Improve exporter panel UI 2021-01-25 13:53:28 +01:00
Moritz Brückner 6b6dc6264f Blender 2.9: Improve exporter settings UI 2021-01-24 20:42:18 +01:00
Lubos Lenco 888fb5c376
Merge pull request #2092 from tong/print-human-build-time
Print rounded build time to console
2021-01-24 18:56:47 +01:00
tong 8619006757 Print rounded build time to console 2021-01-24 18:36:58 +01:00
Moritz Brückner 288ead64dc Nishita sky: implement air and dust density 2021-01-21 21:14:05 +01:00
Moritz Brückner 396e60574a Optimize Nishita sky shader 2021-01-21 20:36:03 +01:00
Moritz Brückner 22d3530863 Blender 2.9: Add Nishita sky model implementation 2021-01-21 16:12:32 +01:00
Moritz Brückner 562d39c203 Blender 2.9: Improve Armory player panel UI 2021-01-17 20:24:43 +01:00
Moritz Brückner ffd3d6e824 Show is_object property when Add Trait is not invoked from the UI 2021-01-17 16:54:08 +01:00
Moritz Brückner 7b55f3d8f5 Blender 2.9: Improve Add Trait operator UI 2021-01-17 16:53:17 +01:00
Lubos Lenco f2e2a3d7dd
Merge pull request #2091 from MoritzBrueckner/fix-reroutes
Fix Reroute nodes
2021-01-17 09:15:59 +01:00
Moritz Brückner 41657adb64 Cleanup 2021-01-17 00:23:19 +01:00
Moritz Brückner fb8a056394 Fix reroute socket indices 2021-01-17 00:23:02 +01:00
Moritz Brückner ee1b55184c Move icon code into module
This, combined with lazy loading, has the advantage of using icons in property definitions before the actual registration code runs
2021-01-15 19:26:31 +01:00
Moritz Brückner fa7f58e4dd Ensure that only logic node trees show up as node traits 2021-01-14 22:46:22 +01:00
Moritz Brückner 04fdcc5500 Cleanup 2021-01-14 22:28:58 +01:00
Moritz Brückner 820de42e83 Blender 2.9: Fix lod list layout 2021-01-14 22:17:42 +01:00
Moritz Brückner fb88361c5b Blender 2.9: Simplify and improve trait panel UI 2021-01-14 22:14:50 +01:00
Moritz Brückner b7903dbef1 Change canvas icon according to the canvas node category 2021-01-14 22:14:10 +01:00
Moritz Brückner 40efd58214 Blender 2.9: Improve trait list UI and fix checkbox position 2021-01-14 21:24:42 +01:00
Moritz Brückner b4f0df6367 Blender 2.9: Redesign renderpath compositor panel UI 2021-01-14 21:21:01 +01:00
Moritz Brückner 133777f7e5 Blender 2.9: Improve renderpath postprocess panel UI 2021-01-14 21:18:46 +01:00
Moritz Brückner 406d48eb7c Blender 2.9: Improve renderpath world panel UI 2021-01-14 21:13:02 +01:00
Moritz Brückner 4c0f0f4161 Blender 2.9: slightly improve renderpath "Renderer" panel UI 2021-01-14 21:06:37 +01:00
Moritz Brückner a98559ea7f Blender 2.9: Improve material blending panel UI 2021-01-14 20:57:44 +01:00
Moritz Brückner 1b9f010c57 Blender 2.9: Improve project window panel UI 2021-01-14 20:56:04 +01:00
Lubos Lenco 0a5c209dd9
Merge pull request #2087 from knowledgenude/master
Update input mapper
2021-01-13 12:58:32 +01:00
knowledgenude 081fcb2870 update-inputmap 2021-01-11 18:14:21 -03:00
Lubos Lenco 9bab721f5f
Merge pull request #2086 from MoritzBrueckner/2.9-Search-Fixes
[Blender 2.9] Search menu fixes
2021-01-11 21:57:11 +01:00
Moritz Brückner 4920098831 Blender 2.9: Fix another exception when using the search menu 2021-01-11 19:57:29 +01:00
Moritz Brückner 4f25af45ba Cleanup 2021-01-11 19:56:40 +01:00
Moritz Brückner c69774402c Blender 2.9: Fix tilesheet operator exceptions when using the search menu 2021-01-11 19:51:15 +01:00
Lubos Lenco 70041fe2a5
Merge pull request #2085 from MoritzBrueckner/fix-bundled-edit
Fix editing bundled traits if the project was never compiled
2021-01-09 12:46:46 +01:00
Moritz Brückner e742ca76c0 Fix editing bundled traits if the project was never compiled 2021-01-08 22:40:14 +01:00
Lubos Lenco 833b513969
Merge pull request #2084 from QuantumCoderQC/29RBFix
Blender 2.9 Fix Exporter and conversions for Physics World
2021-01-07 11:49:58 +01:00
Lubos Lenco ad12af6933
Merge pull request #2083 from MoritzBrueckner/2.9-Operators
Blender 2.9: Update operator options
2021-01-07 11:49:15 +01:00
QuantumCoderQC 80ea09671c Fix Exporter and conversions for Physics World in Blender 2.9.X 2021-01-06 20:26:43 +01:00
Moritz Brückner c5e9522442 Blender 2.9: Update operator options 2021-01-06 17:23:21 +01:00
Lubos Lenco bf7592ae32
Merge pull request #2081 from MoritzBrueckner/2.9-PrincipledBSDF
[Blender 2.9] Principled BSDF: update input socket indices
2021-01-05 13:12:30 +01:00
Lubos Lenco b7dc297d04
Merge pull request #2080 from knowledgenude/master
Fix mouse wheel key verification
2021-01-05 13:11:54 +01:00
Moritz Brückner cab20d0a64 Principled BSDF: update input socket indices to Blender 2.9 2021-01-04 19:34:42 +01:00
knowledgenude ae057508ca
Fix mouse wheel key verification 2021-01-04 12:09:30 -03:00
Lubos Lenco bc36bf571e
Merge pull request #2079 from knowledgenude/master
Added input mapper
2021-01-04 15:41:22 +01:00
knowledgenude 24f62623ad add-inputmapper 2021-01-04 11:28:59 -03:00
luboslenco 27521265df Bump version 2021-01-03 12:11:59 +01:00
Lubos Lenco 5838401cd9
Merge pull request #2077 from MoritzBrueckner/2.9-UI-ObjectPanel
[Blender 2.9] Object panel UI
2021-01-01 12:58:31 +01:00
Lubos Lenco 97582968bd
Merge pull request #2076 from MoritzBrueckner/instancing
Show warnings for invalid instancing configurations + cleanup
2021-01-01 12:56:52 +01:00
Lubos Lenco c2bf021770
Merge pull request #2075 from MoritzBrueckner/world-warning
Show warning when scene is missing a world and rp background is set to world
2020-12-31 16:29:50 +01:00
Moritz Brückner 14bca0ec80 Shorten too long node trait operator labels 2020-12-30 17:57:23 +01:00
Moritz Brückner 4862054bcf Reorder trait type selection 2020-12-30 17:56:58 +01:00
Moritz Brückner 52cee7f0ce Update "Armory Traits" object panel to Blender 2.9 layouts 2020-12-30 17:56:34 +01:00
Moritz Brückner 257f295b27 Update "Armory Lod" object panel to Blender 2.9 layouts 2020-12-30 17:54:44 +01:00
Moritz Brückner a647263d1a Update "Armory Proxy" object panel to Blender 2.9 layouts 2020-12-30 17:53:35 +01:00
Moritz Brückner 6a6d383970 Update "Armory Props" object panel to Blender 2.9 layouts 2020-12-30 17:52:27 +01:00
Moritz Brückner 11591c79a4 Cleanup 2020-12-30 01:06:54 +01:00
Moritz Brückner 96dfc06295 Show warnings for invalid instancing configurations 2020-12-30 00:43:46 +01:00
Moritz Brückner 93dc0d248b Show warning when scene is missing a world and rp background is set to world 2020-12-29 17:39:18 +01:00
Lubos Lenco 18070621db
Merge pull request #2073 from N8n5h/cluster-fix
Solve artifact with clustering of lights
2020-12-29 10:56:19 +01:00
N8n5h b05f719392 Solve artifact for deferred mobile too 2020-12-27 16:45:27 -03:00
N8n5h 893b313643 Solve artifact with clustering of lights
Changed how a spot light is detected when sampling light, which caused false positives and produced
that visual artifact when a cluster/pixel was detected incorrectly as being lit with a spot light when maybe none were there.
This issue seems somewhat related to that issue that prevents rendering spotlights and point lights shadow at the same time.
2020-12-27 16:02:35 -03:00
Lubos Lenco 3e819d7e99
Merge pull request #2071 from QuantumCoderQC/animLoopFix
Add speed and looping options in Play Action From Node
2020-12-27 16:05:05 +01:00
QuantumCoderQC 174ce72349 Correct Spacing 2020-12-27 00:35:24 +01:00
QuantumCoderQC 4ee36afc0c Add Speed and Loop options for Play Action From Node 2020-12-27 00:29:03 +01:00
Lubos Lenco 2dcd1a951b
Merge pull request #2066 from knowledgenude/master
Fix inverted margin for Kinematic Character
2020-12-26 10:22:31 +01:00
Lubos Lenco 268a59a4c7
Merge pull request #2068 from QuantumCoderQC/conFix
Improve physics constraint handling
2020-12-25 19:01:42 +01:00
QuantumCoderQC a0422d49f2 Improve physics constraint handling 2020-12-23 16:03:45 +01:00
Lubos Lenco 569b2daecc
Merge pull request #2065 from MoritzBrueckner/node-side-panel
Improve node side panel + context menu (more operators, icons)
2020-12-23 13:08:38 +01:00
knowledgenude f836e597d1 fix-inverted-margin 2020-12-22 20:49:03 -03:00
Moritz Brückner 372419c9ff arm.open_node_documentation: add icon and fix docstring 2020-12-22 17:25:26 +01:00
Lubos Lenco 70b989e25f
Merge pull request #2064 from MoritzBrueckner/pose-markers
Fix bone markers export
2020-12-20 11:50:45 +01:00
Lubos Lenco 3d69855935
Merge pull request #2063 from MoritzBrueckner/relative-paths
Use relative paths only when path/reference are on the same drive
2020-12-20 11:50:29 +01:00
Lubos Lenco 6ee5af2518
Merge pull request #2062 from QuantumCoderQC/conFix
Fix adding physics constraint at game start
2020-12-19 11:20:39 +01:00
Lubos Lenco 61986dfafd
Merge pull request #2061 from knowledgenude/master
Added World Vector to Local Space node
2020-12-19 11:19:02 +01:00
Moritz Brückner 15d832c66c Show node operator icons in dropdown menu 2020-12-19 01:11:55 +01:00
Moritz Brückner df522516f2 Rename Armory nodes panel: 'Node' -> 'Armory' 2020-12-19 01:09:55 +01:00
Moritz Brückner 76b2380ec4 Improve node side panel (more operators, icons) 2020-12-19 01:08:52 +01:00
Lubos Lenco fa6d1903c7
Merge pull request #2060 from onelsonic/patch-1
Update math.glsl
2020-12-18 10:35:29 +01:00
Moritz Brückner 563c04f456 Whitespace cleanup 2020-12-17 23:44:59 +01:00
Moritz Brückner f68debf39a Fix bone markers export 2020-12-17 23:44:51 +01:00
Moritz Brückner 3f1200417c Cleanup imports 2020-12-17 23:34:38 +01:00
Moritz Brückner 0bda1abfb7 Optimize on_same_drive() calls 2020-12-17 23:19:56 +01:00
Moritz Brückner 397d860a5a Cleanup write_data.py 2020-12-17 22:57:09 +01:00
Moritz Brückner d7e5d07e52 Only use relative paths when path/reference are on the same drive 2020-12-17 22:25:00 +01:00
QuantumCoderQC 2f911c756e Remove physics constraint helper trait 2020-12-17 15:05:46 +01:00
QuantumCoderQC bf22d7add6 Fix physics constraints at start-up 2020-12-17 15:01:21 +01:00
knowledgenude 570de6f699 fix-cap 2020-12-16 17:27:25 -03:00
knowledgenude 8c1baa2e9a add-world-vector-to-local-space-node 2020-12-16 17:24:43 -03:00
onelsonic a89e3923e7
Update math.glsl
fixing the float
2020-12-16 18:57:25 +01:00
Lubos Lenco 882dea8d6c
Merge pull request #2058 from MoritzBrueckner/dynamic-node-labels
Add dynamic node labels
2020-12-16 10:50:25 +01:00
Lubos Lenco e2231c7f16
Merge pull request #2055 from MoritzBrueckner/shader-uniform-node
Add SetShaderUniform node
2020-12-16 10:48:10 +01:00
Lubos Lenco 1b6d321eaa
Merge pull request #2056 from MoritzBrueckner/sound-node-stream
Add 'stream' option to Play Sound nodes
2020-12-16 10:47:40 +01:00
Moritz Brückner 76389c8652 Add dynamic node labels 2020-12-15 23:47:38 +01:00
Moritz Brückner b03e15edba Add 'stream' option to Play Sound nodes 2020-12-13 22:53:36 +01:00
Moritz Brückner 62dbc5f34a Add SetShaderUniform node 2020-12-13 22:41:05 +01:00
Lubos Lenco f69185a765
Merge pull request #2053 from QuantumCoderQC/ParticleFix
Fix normals and wposition in custom particle node
2020-12-12 18:24:05 +01:00
QuantumCoderQC c0bde50306 Fix normals and wposition in custom particle node 2020-12-12 14:10:03 +01:00
Lubos Lenco 9f35d55bd3
Merge pull request #2047 from QuantumCoderQC/bcon_nodes
New Physics Constraint nodes. Improve Bullet Physics constraint trait
2020-12-06 09:19:14 +01:00
Lubos Lenco fdcdf86c24
Merge pull request #2046 from MoritzBrueckner/node-replacement
Fix and further improve node replacement system
2020-12-06 09:17:38 +01:00
Lubos Lenco bcfbdae925
Merge pull request #2045 from knowledgenude/master
Fix volume trigger
2020-12-06 09:16:12 +01:00
Moritz Brückner 16700de7f0 Node replacement: write error message after file has been written 2020-12-05 12:50:05 +01:00
Moritz Brückner 10587900d4 Node replacement: give credit to @niacdoial (code moved to other module) 2020-12-05 12:48:49 +01:00
QuantumCoderQC 71763f9e47 Custom constraint node implemetation 2020-12-05 01:12:59 +01:00
QuantumCoderQC 8a1b59ef8b Haxe implementation of AddPhysicsTrait. 2020-12-05 01:12:59 +01:00
QuantumCoderQC c845301f7c New logic node to add custom physics constraints. Add documentation. 2020-12-05 01:12:59 +01:00
QuantumCoderQC c250be4735 Improvise logic node implementation. 2020-12-05 01:12:59 +01:00
QuantumCoderQC 300f5e37ea Add documentation. Cleanup. 2020-12-05 01:12:59 +01:00
QuantumCoderQC aab7a027c6 Add support functions to set limits. Add documentation. 2020-12-05 01:12:59 +01:00
QuantumCoderQC d87be744b2 Change SetDecativationParams in node to setUpDeactivation to prevent runtime errors. 2020-12-05 01:12:59 +01:00
QuantumCoderQC e2511fd460 Trying new designs 2020-12-05 01:12:59 +01:00
QuantumCoderQC 02e52341a5 New node to add physics constraints 2020-12-05 01:12:59 +01:00
QuantumCoderQC ca9be33152 Added addPhysicsConstraint and removePhysicsConstraint methods. Added internal Map to keep track of PhysicsConstraints 2020-12-05 01:12:59 +01:00
QuantumCoderQC 951f8298b8 Modify to use iron.object.Object instead of String for objects to be linked by PhysicsConstraint 2020-12-05 01:12:59 +01:00
QuantumCoderQC 174a7f66dd Modify exporter to use PhysicsConstraintExportHelper class 2020-12-05 01:12:59 +01:00
QuantumCoderQC 49e06b4b63 New helper class to add physics constraints via Blender Armory exporter 2020-12-05 01:12:59 +01:00
Moritz Brückner 01874e2287 Replacement error dialog: add button to open report folder 2020-12-04 22:57:47 +01:00
Moritz Brückner bd5953c39f Improve module docstring 2020-12-04 22:53:06 +01:00
Moritz Brückner 1b210d0f00 Node replacement: report original traceback for unknown exceptions 2020-12-04 22:50:25 +01:00
Moritz Brückner 332d60547b Node replacement: improve console output 2020-12-04 22:36:38 +01:00
Moritz Brückner 16376dafe2 Simplify replacement error handling 2020-12-04 22:32:44 +01:00
Moritz Brückner 0bddfea5e3 Move node replacement system into its own module 2020-12-04 22:29:31 +01:00
Moritz Brückner b5e33062b3 Improve replacement error message 2020-12-04 21:55:02 +01:00
Moritz Brückner 1fb1196979 Remove replacement node on error during replacement 2020-12-04 21:25:51 +01:00
Moritz Brückner e53d9446e7 Cleanup 2020-12-04 21:17:50 +01:00
knowledgenude 90daf7e077 rename-labels 2020-12-04 09:49:50 -03:00
knowledgenude d726e8fc83 fix-volume-trigger 2020-12-04 07:20:42 -03:00
Lubos Lenco 9ce721103e
Merge pull request #2042 from E1e5en/html5-settings-more
Added option for HTML5 Settings
2020-12-03 10:56:52 +01:00
E1e5en 59c31950c8 Added option for HTML5 Settings
- Disable browser context menu - disable the browser context menu for the canvas element on the page (index.html).
2020-12-02 20:54:14 +03:00
Lubos Lenco bd6078e303
Merge pull request #2037 from E1e5en/fix-on-swipe
Fix OnSwipe
2020-12-02 10:21:12 +01:00
E1e5en 1867975099 Fix OnSwipe
Correction of determining the direction of UP-LEFT.
Wrong 9 degrees =)
2020-12-01 21:18:12 +03:00
luboslenco dc19715571 Bump version 2020-12-01 13:39:44 +01:00
Lubos Lenco 67e2b0171b
Merge pull request #2030 from Naxela/master
Update lightmapper to version 0.4
2020-11-30 11:18:26 +01:00
Lubos Lenco 468da22b5b
Merge pull request #2029 from knowledgenude/master
Added functions to disable/enable collision
2020-11-30 10:41:42 +01:00
Lubos Lenco 5ff3ec9055
Merge pull request #2028 from QuantumCoderQC/rb_nodes
New Add rigid body node
2020-11-30 10:38:20 +01:00
Lubos Lenco 342e4fea14
Merge pull request #2027 from MoritzBrueckner/chromatic-aberration
Forward renderpath: add support for chromatic aberration
2020-11-30 10:34:34 +01:00
Moritz Brückner d18d9e1a27 Fix copy_pass missing on deferred when only compositor was enabled 2020-11-29 17:16:43 +01:00
knowledgenude 8a30a94523
Added functions to disable/enable collision 2020-11-29 10:15:47 -03:00
Moritz Brückner bfdcc1f1bd Fix tabs and spaces shenanigans 2020-11-29 13:40:49 +01:00
QuantumCoderQC d71284560e Implemented a new node to add rigid bodies to objects at run-time 2020-11-29 01:16:59 +01:00
QuantumCoderQC 1aa60e9315 Add params and flags description. Modify force deactivation to use deactivation in rigid bodies 2020-11-29 01:08:28 +01:00
Alexander 837a313c7a Fix indentation errors 2020-11-28 23:58:28 +01:00
Alexander b24a76f30f Update lightmapper 2020-11-28 23:23:52 +01:00
Moritz Brückner 4cef68c818 Cleanup chromatic aberration shader 2020-11-28 23:13:32 +01:00
Moritz Brückner 3f51b35b89 Reset compositor defs before renderpath building 2020-11-28 23:13:15 +01:00
Moritz Brückner 8814326bab write_data.py: cleanup and improve chromatic aberration section 2020-11-28 23:12:21 +01:00
Moritz Brückner 068a539f60 Forward renderpath: add support for chromatic aberration 2020-11-28 23:09:07 +01:00
Lubos Lenco 607c5e57cf
Merge pull request #2024 from MoritzBrueckner/mouse-movement
Improve `Get Mouse Movement` node
2020-11-28 12:30:52 +01:00
Moritz Brückner 0acadd2e74 Improve Get Mouse Movement node 2020-11-26 10:00:35 +01:00
Lubos Lenco 73cae5406e
Merge pull request #2023 from E1e5en/ln-math-expression
LN Math Expression
2020-11-26 08:49:04 +01:00
Lubos Lenco 2ca088fb85
Merge pull request #2022 from E1e5en/win-settings
Windows Settings – Publish and action after
2020-11-25 08:38:04 +01:00
E1e5en d084a8297e Windows Settings – Publish and action after
Windows Settings:
Visual Studio Version - select the studio version for which the project will be exported. Options: 2010, 2012, 2013, 2015, 2017, 2019. Default: 2019.
Update - checks the installed versions of Visual Studio on the PC and adds (installed) to the version in the list if available (for information). Example:
sample_vs_2
Action After Publishing - select an action after a successful publication. Options:
Nothing - do nothing. Default value;
Open In Visual Studio - open the project in the corresponding studio version;
Compile - compilation of the project;
Compile and Run - compile and run the project. Then the executable file will be copied to the windows-hl folder (where the resources are located).
Mode - compilation mode. Options: Debug, Release. Default: Debug.
Architecture - the architecture for which the application will be built. Options: x86, x64. Default: version of the user’s PC architecture.
Compile Log Parameter - setting the output of messages during compilation:
Summary - show the error and warning summary at the end. Default value;
No Summary - don \ 't show the error and warning summary at the end;
Warnings and Errors Only - show only warnings and errors;
Warnings Only - show only warnings;
Errors Only - show only errors.
More details can be found here - MSBuild command-line reference (I took only part of the settings).
Count CPU - specifies the maximum number of concurrent processes to use when building. More details can be found here - MSBuild command-line reference. The default is 1. Maximum value: the number of CPUs in the system (function multiprocessing.cpu_count()).
Open Build Directory - open the folder with the application after a successful build. If the Compile and Run option is selected, then the executable file will be copied to the windows-hl folder (where the resources are located) and this folder will open. Otherwise, the folder where the given Visual Studio file is going will open.
The user will also receive a message if the studio version selected for export and for opening in the studio or compilation is not on the PC. And a list of installed ones will be issued. Example:

Visual Studio 2017 (version 15) not found.
The following are installed on the PC:
- Visual Studio Community 2019 (version 16.8.30711.63)
To obtain information about the installed versions of Visual Studio, use the vswhere.exe utility (open source) included in Kha (located in the …\ArmorySDK\Kha\Kinc\Tools\kincmake\Data\windows).
2020-11-24 20:41:50 +03:00
Lubos Lenco a79c430882
Merge pull request #2021 from MoritzBrueckner/fix-exporter-opt
exporter_opt: fix `NameError: name 'log' is not defined`
2020-11-24 09:52:38 +01:00
Lubos Lenco 979844fc6e
Merge pull request #2013 from knowledgenude/master
More renames and cleanups
2020-11-24 09:52:09 +01:00
Moritz Brückner f492b9d756 exporter_opt: fix NameError: name 'log' is not defined 2020-11-23 18:21:33 +01:00
Lubos Lenco 48952e04a8
Merge pull request #2017 from MoritzBrueckner/nodes-context-menu
Add node context menu entry for material parameters
2020-11-22 08:27:15 +01:00
knowledgenude b699dfb0d6
Update LN_string.py 2020-11-21 14:37:51 -03:00
Lubos Lenco 29297513cf
Merge pull request #2018 from MoritzBrueckner/driver-api
Add per-material UI support for driver API
2020-11-21 16:54:26 +01:00
knowledgenude ce629455ad
Update VectorFromBooleanNode.hx 2020-11-19 13:57:39 -03:00
Lubos Lenco bfb999550e
Merge pull request #2019 from MoritzBrueckner/fix-node-docs
Fix some node docstrings
2020-11-19 16:14:16 +01:00
Lubos Lenco fdbd26840a
Merge pull request #2015 from E1e5en/fix-android-hmtl5-settings
Fix Android and HTML5 Settings
2020-11-19 16:13:08 +01:00
knowledgenude cc481ea15c fix-nodes 2020-11-19 10:38:46 -03:00
E1e5en 9ab9d5c5db LN Math Expression
First version:
- Dynamically checking the correctness of an expression in the IDE (Blender).
- The task is divided into 2 parts: checking the correctness through python in the Blender interface and when performing calculations when the application is running in haxe.
The following decisions are taken as a basis:

python - http://repl.it/3xv/1
haxe - https://github.com/maitag/formula (added all the necessary classes to the node code)
2020-11-19 11:41:24 +03:00
knowledgenude 97bbf0b9d2
fix-missing-return-dynamic 2020-11-18 14:07:23 -03:00
knowledgenude 17b4cb2028 update 2020-11-18 13:50:24 -03:00
Moritz Brückner 76907e1c5e Fix some node docstrings 2020-11-18 10:39:12 +01:00
Moritz Brückner f57d2168e3 Small API improvement 2020-11-18 08:41:28 +01:00
E1e5en 99a4c400b8 Fix Android and HTML5 Settings
- Fixed a bug with updating the list of emulators if they are not there.
- Fixed a bug with enabling/disabling options when changing links to Android SDK.
- Fixed display of settings in the form of open panels. When collapsing panels appear incorrect display.
2020-11-18 08:24:04 +03:00
knowledgenude ba7a897142 update-triggers 2020-11-17 17:55:53 -03:00
knowledgenude 7e674e06d2
Update LN_remove_object_parent.py 2020-11-17 17:50:04 -03:00
knowledgenude e46a86d4f5
Update GetCursorStateNode.hx 2020-11-17 17:47:17 -03:00
knowledgenude b19acb4971 fix-capitalization 2020-11-17 17:44:30 -03:00
knowledgenude 554f5854aa mouse-description 2020-11-17 17:38:57 -03:00
knowledgenude 46492cc425 fixes 2020-11-17 17:35:22 -03:00
knowledgenude 9e16c53494
fix-typo 2020-11-17 15:10:45 -03:00
knowledgenude 6c6b6dbe97
Update LN_on_canvas_element.py 2020-11-17 15:08:55 -03:00
Moritz Brückner a1b121a2a7 Add per-material custom UI for drivers 2020-11-17 18:54:53 +01:00
knowledgenude 4769b084d2 add 2020-11-17 14:46:14 -03:00
knowledgenude 9a29adb176 fix 2020-11-17 13:01:08 -03:00
knowledgenude a7863075e2 cleanups-and-renames 2020-11-17 12:01:15 -03:00
Moritz Brückner 14375b7fad Cleanup driver API code and add docstring + type info 2020-11-17 11:59:21 +01:00
Moritz Brückner e747190746 Whitespace cleanup 2020-11-16 19:55:15 +01:00
Moritz Brückner 07acf00b0c Add node context menu entry for material parameters 2020-11-16 19:54:52 +01:00
Lubos Lenco 09ec8f23f8
Merge pull request #2011 from knowledgenude/master
Map Range node
2020-11-16 09:18:15 +01:00
Lubos Lenco 8f7dabba5a
Merge pull request #2008 from E1e5en/html5-settings
HTML5 Settings
2020-11-16 09:17:09 +01:00
knowledgenude 7f82b2ae33 map-range-node 2020-11-14 14:39:32 -03:00
E1e5en 4b3aea0513
Merge branch 'master' into html5-settings 2020-11-14 15:12:20 +03:00
Lubos Lenco 64ddadab7b
Merge pull request #2010 from E1e5en/fix-vector-quat-math
Fixed logical nodes Vector Math and Quaternion Math
2020-11-14 12:45:37 +01:00
Lubos Lenco 3fae5c04bd
Merge pull request #2007 from E1e5en/exporter-panel-project-settings
Exporter Panel - Project Settings
2020-11-14 12:42:40 +01:00
Lubos Lenco f499bfc8ca
Merge pull request #2003 from MoritzBrueckner/khamake-debug
Add option to compile with khamake --debug flag
2020-11-14 12:41:35 +01:00
E1e5en 82ac44571a Additional terms
Additional terms
2020-11-14 11:52:07 +03:00
E1e5en 5f4a3104f1 Fixed logical nodes Vector Math and Quaternion Math
The error occurs when updating projects with old nodes. Unfortunately, the node is not completely replaced, but the error with deleting the output parameters has been fixed, the incorrect node will not be in the Logic Editor.
2020-11-14 10:28:15 +03:00
E1e5en 2bd08722a1 HTML5 Settings
Added Armory Exporter - HTML5 Settings panel:
- Copy Files To Specified Folder - copy files to the folder specified in the settings after publish. The name of the folder where the result will be copied is formed based on the name of the project and version. Sample, test-1.0.5.
- Run Browser After Copy - run browser after copy. The url is formed from the one specified in the settings and the directory with the project where it was copied. Sample, http: //localhost/test-1.0.5.

Added settings in Render: Armory:
- HTML5 Copy Path - path to copy project after successfully publish (directory on local web-server).
- Url To Web Server - url that runs the local server.
2020-11-13 21:45:31 +03:00
E1e5en 65dd6b701f Exporter Panel - Project Settings
1. Processing data entry into fields:
- Name - the field must not be empty. If the user tries to set an empty value, then this field specifies the name of the blend file (this is how it is implemented during assembly). The default is the name of the blend file.
- Package - the field must not be empty, it must not consist only of numbers and start with a number. The . symbol is replaced with _. The default is arm.
- Bundle - the field must be filled in according to the mask [string].[string]. Each part must not be empty, contain numbers, or start with a number. The default is org.armory3d. Previously, this field was blank, in which case the current default was used.
- Version.
Input in the Version field is processed and only allows input by masks:
- 0.0
- 0.0.0
- 0.0.0.0
In any case, the value is ignored and the previous value remains.

If the (Auto-increment Build Number) checkbox is checked and when performing the operation, Build and Publish will be automatically incremented by one after the version value.
Examples:
it was 1.0 - it is 1.1,
it was 1.9 - it is 1.10,
it was 1.0.1 - it is 1.0.2,
it was 0.1.1.2 - it is 0.1.1.3.

Defaults:
- Version - 1.0.0
- Auto-increment Build Number - enabled.

For all fields, special characters ([] / \ ;,> <& *:% = + @! # ^ () |? ^) Are also replaced with _.

2. Fixed display of Android Settings panel.
2020-11-13 20:36:27 +03:00
Lubos Lenco da5ed3c5e0
Merge pull request #2006 from MoritzBrueckner/normals
Fix usage of normals in shaders + smaller shader improvements
2020-11-13 14:14:50 +01:00
Lubos Lenco ea79838a7d
Merge pull request #2005 from E1e5en/android-settings-more
Android Settings More
2020-11-13 14:02:40 +01:00
E1e5en b741bd752d Fix and clear
- Fixed build error when there are problems in the project name
- Code cleanup
2020-11-13 09:06:51 +03:00
Moritz Brückner ac51183a15 Fix declaration order for some shader attributes 2020-11-12 20:11:42 +01:00
Moritz Brückner 6165c43321 Properly indent shader code in write_attrib() 2020-11-12 20:10:08 +01:00
E1e5en ab3d64d651 Android Settings More
Panel Armory Exporter - Android Settings - Build APK:
1. Rename APK To Project Name
Renames the APK file from app-debug.apk to [project-name]-[version] .apk. Example, for the project example_ball.blend, the result will be the name example-ball-1.0.apk.
2. Copy APK To Specified Folder
Copies the final file to the folder specified in Preferences.

Preferences Render: Armory:
1. Copy APK To Folder
The path to the folder where the final APK file will be copied.
2. Open Directory After Copy
Open this folder after copying.

Console messages:
Rename APK to example-ball-1.0.5.apk
Copy APK to C:\IDE\Test

Use-case:
These settings will allow you to have unique names for files, as well as copy them to the required folder for uploading to the device or to the cloud.
2020-11-12 22:09:55 +03:00
Moritz Brückner 8465e497f8 Small code style improvement 2020-11-12 20:09:53 +01:00
Moritz Brückner c520b32be0 Another small musgrave texture node fix 2020-11-12 20:09:43 +01:00
Moritz Brückner b49bd54901 Fix usage of normals in shaders 2020-11-12 20:09:25 +01:00
Lubos Lenco aa9a93b530
Merge pull request #2004 from E1e5en/ln-vector-math-fix
LN Vector Math Fix
2020-11-12 08:09:38 +01:00
E1e5en 91a2a3e00f LN Vector Math Fix
Fixed error:
On static platforms, null can't be used as basic type Float
2020-11-12 06:56:35 +03:00
Moritz Brückner 27857c2648 Add option to compile with khamake --debug flag 2020-11-11 20:34:10 +01:00
Lubos Lenco 25be45bc9e
Merge pull request #1998 from E1e5en/add-quat-math
Quat Math
2020-11-11 15:33:19 +01:00
Lubos Lenco 430e4a82fd
Merge pull request #2000 from knowledgenude/master
Update LN_value_changed.py
2020-11-10 19:37:08 +01:00
knowledgenude 85fb7a3f68
Update LN_value_changed.py 2020-11-10 15:32:02 -03:00
Lubos Lenco 13d9a890d9
Merge pull request #1999 from knowledgenude/master
Value Changed node
2020-11-10 13:04:29 +01:00
knowledgenude fde59db1e5 value-changed-node 2020-11-08 17:37:50 -03:00
E1e5en 6b804477b1 Quat Math
1. Move the Quaternion node from Transform to Variable
2. Move the Separate Quaternion node from Transform to Math
3. Added Quaternion Math Node
Linked to PR - https://github.com/armory3d/iron/pull/108
2020-11-08 22:40:01 +03:00
Lubos Lenco d210cea6d8
Merge pull request #1997 from E1e5en/ln-math-optimization
Update the Math Node
2020-11-08 14:13:58 +01:00
Lubos Lenco 0d944db767
Merge pull request #1995 from N8n5h/debug-print
Show commands that launch build better and play for debugging
2020-11-08 14:13:22 +01:00
Lubos Lenco 4adb01dc5f
Merge pull request #1994 from E1e5en/ln-vector-math-upgrading
Upgrading the Vector Math Node
2020-11-08 14:12:26 +01:00
Lubos Lenco 3f77a1e51d
Merge pull request #1993 from MoritzBrueckner/musgrave-tex-node
Fix musgrave texture node
2020-11-08 14:10:47 +01:00
E1e5en c759a48503 Update LN_vector_math.py
Refactoring, optimization, checkstyle
2020-11-08 11:38:19 +03:00
E1e5en 5228bd097b Update LN_math.py
Refactoring, optimization
2020-11-08 11:36:44 +03:00
Lubos Lenco 0e7a69363d
Merge pull request #1991 from knowledgenude/master
Get Trait Paused and Clamp nodes
2020-11-07 18:55:32 +01:00
N8n5h fde5760a29 Show commands that launch build and play for debugging
This is so you can easily copy and paste it for testing purposes instead of having to build the whole project again.
Alternatively a button to play without build could be added to the blender UI.
2020-11-07 09:38:11 -03:00
E1e5en 7dae9e38d0 Upgrading the Vector Math Node
Dynamically change the number of input and output parameters for the selected operation
2020-11-07 11:14:46 +03:00
Moritz Brückner 242f80357f Fix musgrave texture node 2020-11-07 00:27:51 +01:00
knowledgenude 5052d5119b update 2020-11-06 17:31:26 -03:00
knowledgenude 7159b90b45 change-socket-type 2020-11-06 17:22:10 -03:00
knowledgenude 72186140a9 new-nodes 2020-11-06 17:20:28 -03:00
luboslenco 085146b245 Write cascade params only when shadows are enabled 2020-11-05 11:04:11 +01:00
Lubos Lenco d9480bc5b2
Merge pull request #1987 from E1e5en/ln-math-upgrading
Upgrading the Math Node
2020-11-05 10:57:22 +01:00
Lubos Lenco 00c585811d
Merge pull request #1984 from knowledgenude/master
Update nodes that own 'On Local Axis'
2020-11-05 10:56:30 +01:00
E1e5en 1352811bcd Upgrading the Math Node
- Dynamically change the number of arguments for the selected operation;
- Exp() operation added.
2020-11-03 09:12:41 +03:00
knowledgenude 4d87a0d3ad fix 2020-11-02 12:55:11 -03:00
Lubos Lenco e7fd3cef8a
Merge pull request #1985 from davidbruce/master
Revert/fix for traits updating
2020-11-02 16:22:40 +01:00
David Bruce a559a0b28d
Revert/fix for traits updating
Changes compilation_server_done() back to before my change.  Updates the path it checks to krom/krom.js.temp, this should prevent it from deleting existing krom.js files on first project launch.
2020-11-02 10:15:26 -05:00
knowledgenude 7fcd3dc81d update-local-axis-nodes 2020-11-02 11:51:34 -03:00
luboslenco 8e839b84c7 Bump version 2020-11-02 14:08:09 +01:00
Lubos Lenco f0715ff2b6
Merge pull request #1982 from niacdoial/master
Some more (late) fixes to the node upgrading
2020-11-02 09:26:55 +01:00
Lubos Lenco 7ceb8746f8
Merge pull request #1981 from knowledgenude/master
Add worldVecToOrientation method
2020-11-02 09:25:15 +01:00
Lubos Lenco bed58984d1
Merge pull request #1980 from E1e5en/checking-version
Checking Blender version for Armory
2020-11-02 09:23:27 +01:00
Lubos Lenco 0d53925dd7
Merge pull request #1979 from MoritzBrueckner/logic-nodes
Custom nodes + libraries improvements (once more)
2020-11-02 09:20:38 +01:00
knowledgenude fe3e627e5d
Update TransformExtension.hx 2020-11-01 19:23:55 -03:00
knowledgenude f7ec11d5c5 add-worldVecToOrientation-method 2020-11-01 18:17:56 -03:00
niacdoial 3f9b633fbf Fixed a problem in the default (0->1) node upgrade mechanism
-> in NodeReplacement.Identity, made so that the properties of a given node are detected better. Still not perfect, but better.
2020-11-01 22:15:53 +01:00
niacdoial 7414a6846a Fixed a bunch of node class initializations 2020-11-01 22:15:53 +01:00
E1e5en 9fbd29b143 Checking Blender version for Armory
- Added compare function to utils.py module
- Added check of Blender version and display of a message about incorrectness during Play, Build, Publish operations
2020-11-01 21:10:44 +03:00
Moritz Brückner f7afe8e2f0 Also load libraries when a file is opened during registration 2020-11-01 01:44:22 +01:00
Moritz Brückner 0dfb6c2292 Use more os.path.join() 2020-11-01 01:23:00 +01:00
Moritz Brückner bc5b207544 Fix bug with dynamic socket amounts for custom nodes 2020-11-01 01:20:58 +01:00
Moritz Brückner 07ed438f99 Fix wrong package name for custom nodes 2020-11-01 01:20:41 +01:00
Moritz Brückner 0120910f92 Improve handling of custom logic nodes 2020-11-01 01:20:27 +01:00
Lubos Lenco 38103be7d3
Merge pull request #1973 from davidbruce/master
Fix for play button not working with Krom.
2020-10-31 17:13:25 +01:00
Lubos Lenco 931b999117
Merge pull request #1978 from MoritzBrueckner/fix-paths
Fix trait paths
2020-10-31 17:08:02 +01:00
Lubos Lenco 91c98c7dfc
Merge pull request #1977 from MoritzBrueckner/profiler
Implement optional profiling for export
2020-10-31 17:05:01 +01:00
Lubos Lenco 4236190f5d
Merge pull request #1976 from E1e5en/detect-mobile-browser
LN Detect Mobile Browser
2020-10-31 17:01:36 +01:00
Lubos Lenco ab6934c5c9
Merge pull request #1974 from knowledgenude/master
Replace None node
2020-10-31 17:00:06 +01:00
Moritz Brückner 25ed2059f1 Simplify get_pref_or_default 2020-10-31 13:18:05 +01:00
Moritz Brückner efad6d62e6 Fix trait paths 2020-10-31 01:41:53 +01:00
Moritz Brückner 0f3233d829 Implement optional profiling for export 2020-10-31 01:09:33 +01:00
Henrique fa0e5ae0a4 fix 2020-10-30 15:32:12 -03:00
Henrique 58a0d996aa renames 2020-10-30 15:28:38 -03:00
E1e5en 145686dbf4 LN Detect Mobile Browser
Detect Mobile Browser
2020-10-30 21:22:52 +03:00
Henrique 97d284c946 replace-none-node 2020-10-30 13:22:09 -03:00
David Bruce 561daa34fd Forces a build before compilation server to generate first krom.js.
Fixes bug where compilation server will delete krom.js if it exists
during first launch.
2020-10-30 11:39:25 -04:00
Lubos Lenco eb460a8e75
Merge pull request #1971 from MoritzBrueckner/set-active-camera
Debug console: add "Set Active Camera" button for camera objects
2020-10-30 09:36:08 +01:00
Lubos Lenco e39c17a808
Merge pull request #1969 from MoritzBrueckner/fix-nodes-registering
Further improve handling of nodes/menu registration
2020-10-30 09:35:53 +01:00
Moritz Brückner 6f1f97f9e9 Debug console: add "Set Active Camera" button for camera objects 2020-10-29 20:00:59 +01:00
Moritz Brückner 1d3c9cf23b Whitespace cleanup 2020-10-29 20:00:35 +01:00
Moritz Brückner 1cebb0b0fd Further improve handling of nodes/menu registration 2020-10-29 15:17:44 +01:00
Lubos Lenco 0472734eab
Merge pull request #1967 from MoritzBrueckner/node-deprecation
Improve handling of deprecated logic nodes
2020-10-29 09:34:24 +01:00
Lubos Lenco 1eaf05218f
Merge pull request #1966 from knowledgenude/master
Add Bounce and Elastic to Mix nodes
2020-10-29 09:32:13 +01:00
Moritz Brückner 60ea88658c Improve handling of deprecated nodes 2020-10-28 20:29:01 +01:00
Henrique bb1fab992d add-bounce-elastic-to-mix-nodes 2020-10-28 11:16:14 -03:00
Lubos Lenco 2f762187cf
Merge pull request #1964 from MoritzBrueckner/fix-nodes-registering
Fix and improve registration of nodes
2020-10-28 10:45:47 +01:00
Lubos Lenco 7d7b6a3ed5
Merge pull request #1963 from E1e5en/ln-get-fps
Add LN Get Frames Per Second
2020-10-28 10:44:25 +01:00
E1e5en 5eeb6ab559
Update LN_get_fps.py
Due to the change in PR (https://github.com/armory3d/armory/pull/1964)
2020-10-28 07:37:06 +03:00
Moritz Brückner bc05233ca5 Fix registration of node libraries 2020-10-27 22:39:07 +01:00
Moritz Brückner 4b9e5d533d Fix and improve registration of nodes 2020-10-27 19:44:37 +01:00
E1e5en fb00b4533c
Update GetFPSNode.hx
Checkstyle
2020-10-27 18:23:10 +03:00
E1e5en 658d2546d8 Add LN Get Frames Per Second
This is sometimes more convenient than enable the entire debug console.
2020-10-27 15:56:34 +03:00
Lubos Lenco 9e8117e9ee
Merge pull request #1958 from knowledgenude/master
Cleanups and renames
2020-10-26 19:30:20 +01:00
Henrique 4324d6196b more-cleanups 2020-10-26 11:32:59 -03:00
Henrique 413951cb62 cleanups 2020-10-26 11:20:50 -03:00
Lubos Lenco 27b3bb11c3
Merge pull request #1957 from knowledgenude/master
Fix new node
2020-10-26 15:14:15 +01:00
Henrique e7db53cca6 fix-node 2020-10-26 11:00:38 -03:00
Lubos Lenco 8bd93d0d96
Merge pull request #1955 from E1e5en/change-bundle-icon
Change Bundle icon for Armory Traits
2020-10-26 09:20:30 +01:00
Lubos Lenco b81486ac7a
Merge pull request #1954 from E1e5en/get-traits-name
LN for Traits
2020-10-26 09:19:54 +01:00
Lubos Lenco f1a65df4d2
Merge pull request #1952 from MoritzBrueckner/bump-node
Fix bump node when connected to vector output
2020-10-26 09:19:04 +01:00
Lubos Lenco 800498a78e
Merge pull request #1951 from MoritzBrueckner/cycles-nodes
More cycles nodes + improvements
2020-10-26 09:13:54 +01:00
Lubos Lenco dbb061bafc
Merge pull request #1953 from knowledgenude/master
Vector To Object Orientation node
2020-10-26 08:56:15 +01:00
E1e5en e840eead7e Change Bundle icon for Armory Traits
1. Add custom icon.
2. Change Bundle icon for Armory Traits.
2020-10-25 07:51:16 +03:00
Henrique ded3a7353d rename-node 2020-10-24 17:20:22 -03:00
E1e5en ef4dbd7611 LN for Traits
1. Modification of CanvasScript and WasmScript classes: added a field to save the name of the script / file in the class.
2. Added logical nodes for working with Traits.
- Get Object Traits - gets an array of Traits for the specified object;
- Get Trait Name - get the Trait name (the name that appears in the list in Armory Traits) and its type (Canvas, Wasm, Bundle, LogicNode or Haxe).
2020-10-24 22:04:47 +03:00
Henrique b942672990 new-vector-to-object-space-node 2020-10-24 14:39:20 -03:00
Moritz Brückner cf40b4255b Fix bump node when connected to vector output 2020-10-23 23:37:53 +02:00
Moritz Brückner 3f0122ad80 Fix noise texture node socket indices 2020-10-23 16:40:36 +02:00
Moritz Brückner 87d89cfa83 Improve MixRGB node 2020-10-23 16:40:02 +02:00
Moritz Brückner 095f44235c Fix TextureCoordinate node normals for world shaders 2020-10-23 16:24:37 +02:00
Moritz Brückner 070487dd7c Implement Light Falloff node according to Eevee 2020-10-23 16:23:56 +02:00
Moritz Brückner 1ddc106eb7 Implement Separate HSV node 2020-10-23 16:23:36 +02:00
Moritz Brückner 18464a5182 Fix light path node socket indices 2020-10-23 16:23:23 +02:00
Moritz Brückner a2c0ee7192 Align LightPath node to Eevee implementation 2020-10-23 16:16:18 +02:00
Moritz Brückner 5dab3500de Improve normal node parsing 2020-10-23 16:15:53 +02:00
Lubos Lenco 1dfa0c4644
Merge pull request #1948 from MoritzBrueckner/vectormath
Fully implement the VectorMath node
2020-10-23 09:08:12 +02:00
Lubos Lenco 343d22e47a
Merge pull request #1949 from MoritzBrueckner/clamp-node
Implement cycles clamp node
2020-10-23 09:07:37 +02:00
Lubos Lenco a9e59101e5
Merge pull request #1950 from knowledgenude/master
New node Vector From Boolean
2020-10-23 09:04:12 +02:00
Lubos Lenco 1d8edb3a7f
Merge pull request #1947 from E1e5en/build-apk
Added settings for building APK
2020-10-23 09:02:22 +02:00
Moritz Brückner b9fbb01ea4 Make glsl params const 2020-10-23 00:06:09 +02:00
Moritz Brückner 6d68b41f43 Small fix 2020-10-23 00:05:52 +02:00
Henrique 538e66e680 new-vector-from-boolean-node 2020-10-22 15:42:22 -03:00
Moritz Brückner 40a6a5cddc Implement cycles clamp node 2020-10-22 19:10:39 +02:00
Moritz Brückner 2ff90d55e4 Fully implement the VectorMath node 2020-10-22 18:47:21 +02:00
E1e5en 5451b3e7e2 Added settings for building APK
Added a panel with settings:
- Building APK After Publish - to start the build after the project has been successfully published (False by default). Disabled if SDK path is not specified;
- Emulator - list of installed emulators in Android Studio (AVD Manager). At the start of Blender, the list is always empty, to fill and update it, you must click the Refresh button. To start the emulator, if you wish, you need to press the "Start" button (the list of emulators is obtained with the emulator -list-avds command, the launch is performed with the emulator -avd [name] command). The "Start" button is disabled if the name of the emulator is not selected from the list;
- Run Emulator After Building APK - launch the emulator after successfully building the APK file. Disabled if no APK build is installed or no emulator name selected.

To perform these operations, you need to specify the ANDROID_SDK_ROOT environment variable, if it is not specified in the OS, then the "Android SDK Path" setting is read and set as the environment variable os.environ ['ANDROID_SDK_ROOT'] to perform operations.
If no value is specified, then the user receives a corresponding message to the console. If the specified value is incorrect, then the user will receive messages from the corresponding programs.
2020-10-22 19:19:03 +03:00
Lubos Lenco bf2252d09a
Merge pull request #1946 from MoritzBrueckner/fix-blend-action-node
Fix BlendActionNode for empty action sockets
2020-10-22 09:58:30 +02:00
Lubos Lenco 421d7612d9
Merge pull request #1945 from MoritzBrueckner/fix-volumetric-light
Fix volumetric light for different lamp combinations
2020-10-22 09:58:18 +02:00
Moritz Brückner f9e9dfdd41 Fix BlendActionNode for empty action sockets 2020-10-21 19:30:21 +02:00
Moritz Brückner 1505f94b2b Fix spaces/tabs 2020-10-21 16:18:30 +02:00
Moritz Brückner 93f0bcba78 Fix volumetric light for different lamp combinations 2020-10-21 15:30:11 +02:00
Lubos Lenco e2ecf3fea2
Merge pull request #1942 from MoritzBrueckner/random-nodes
Two new logic nodes for the "Random" category
2020-10-20 09:38:14 +02:00
Moritz Brückner 74d6b594a6 Two new logic nodes for the "Random" category 2020-10-19 18:21:56 +02:00
Lubos Lenco b36cf8327b
Merge pull request #1940 from MoritzBrueckner/fix-android-build-folder
Open correct folder after successful Android build
2020-10-19 09:09:25 +02:00
Lubos Lenco 84b41db63e
Merge pull request #1938 from MoritzBrueckner/fix-file-encoding
Set file encoding to utf-8
2020-10-19 09:09:04 +02:00
Moritz Brückner 597bb9aca5 Open correct folder after successful Android build 2020-10-18 21:57:49 +02:00
Moritz Brückner 863ec518f8 Set file encoding to utf-8 2020-10-18 17:50:35 +02:00
Lubos Lenco e9c351c7e0
Merge pull request #1936 from E1e5en/add-android-settings
Add Android Settings + LN Set Vibrate
2020-10-18 11:59:35 +02:00
Lubos Lenco b4e659c04a
Merge pull request #1935 from MoritzBrueckner/open-on-build
Add option to open build directory after sucessfully publishing
2020-10-17 18:05:16 +02:00
E1e5en 1a34e202a7 Add Android Settings + LN Set Vibrate
1. For the new settings to fully function, you need to update the submodules so that this Pull Request (https://github.com/Kode/kincmake/pull/100) gets into armsdk. Extended settings via khafile.js.

2. Added Android Settings panel:
- invisible until the target platform android-hl is added to the list;
- inactive until the target platform android-hl is selected in the list.
Options:
- Orientation;
- Compile Version SDK - from 26 to 30, default 29;
- Minimal Version SDK - from 14 to 30, default 14;
- Target Version SDK - from 26 to 30, default 29;
- Permissions - a list of permissions. If I will duplicate entries in the list, then only unique entries will be included during export. By default, the list is empty;
- Android ABI Filters - a list of platforms to build for (arm64-v8a, armeabi-v7a, x86, x86_64). If I will duplicate entries in the list, then only unique entries will be included during export. By default, the list is empty. If the list is empty, then all platforms will be used (as before).

3. The enum (names of permissions) and the function have been added to the utils.py modules, which adds the specified value to the list of permissions. Feature added for ease of use from different locations (different logical nodes).

4. List of permissions:
- ACCESS_COARSE_LOCATION - Allows an app to access approximate location;
- ACCESS_NETWORK_STATE - Allows applications to access information about networks;
- ACCESS_FINE_LOCATION - Allows an app to access precise location;
- ACCESS_WIFI_STATE - Allows applications to access information about Wi-Fi network;
- BLUETOOTH - Allows applications to connect to paired bluetooth devices;
- BLUETOOTH_ADMIN - Allows applications to discover and pair bluetooth devices;
- CAMERA - Required to be able to access the camera device;
- EXPAND_STATUS_BAR - Allows an application to expand or collapse the status bar;
- FOREGROUND_SERVICE - Allows a regular application to use Service.startForeground;
- GET_ACCOUNTS - Allows access to the list of accounts in the Accounts Service;
- INTERNET - Allows applications to open network sockets';
- READ_EXTERNAL_STORAGE - Allows an application to read from external storage;
- VIBRATE - Allows access to the vibrator;
- WRITE_EXTERNAL_STORAGE - Allows an application to write to external storage.

5. Added logical node Set Vibrate:
Category: Native
Pulses the vibration hardware on the device for time in milliseconds, if such hardware exists.
Input parameters:
- Milliseconds - time in milliseconds (data type Int, default value 100).
When adding the logical node Set Vibrate, the permission is automatically added to the list, even if the target android-hl has not been added to the export list (using a function from utils.py).
2020-10-17 16:47:54 +03:00
Moritz Brückner 4bafe8130c Add option to open build directory after successfully publishing 2020-10-17 15:09:21 +02:00
Moritz Brückner 203da296ad Make arm.utils.folder() work with every folder 2020-10-17 15:08:56 +02:00
Moritz Brückner 6dcc2f3fe8 Add arm.utils.get_arm_preferences() 2020-10-17 15:08:20 +02:00
Lubos Lenco 36c18d2ec8
Merge pull request #1932 from knowledgenude/master
Rename tilesheet sockets
2020-10-14 16:05:14 +02:00
Henrique f2afb4fcdb rename-tilesheet-sockets 2020-10-14 10:56:41 -03:00
Lubos Lenco e8a2e819b1
Merge pull request #1931 from knowledgenude/master
Get Tilesheet State node
2020-10-14 15:23:55 +02:00
knowledgenude 3760d9b36d
Update GetTilesheetStateNode.hx 2020-10-14 10:08:43 -03:00
knowledgenude 56f101e403
Update AnimationStateNode.hx 2020-10-14 10:05:31 -03:00
Henrique be137c3805 get-tilesheet-state-ln 2020-10-14 10:03:47 -03:00
Lubos Lenco aaa699c3cd
Merge pull request #1930 from E1e5en/screen-to-world-space-modif
Modifying the Screen To World Space node
2020-10-14 08:58:37 +02:00
Lubos Lenco a9d31c8e97
Merge pull request #1929 from E1e5en/get-system-language
Get System Language - LN
2020-10-14 08:55:34 +02:00
E1e5en 6116c665c4 Modifying the Screen To World Space node
Modifying the Screen To World Space node

Input parameters:
- Screen X - value of screen coordinates along the X axis (data type Int);
- Screen Y - the value of the screen coordinates along the Y axis (data type Int).

Options:
- Separator Out - whether or not to separate the output parameters (vectors) into components (XYZ).

Output parameters:
- World - coordinates of a point in 3D space (Vector data type)
- Direction - normalized direction vector from the camera towards the point/cursor indication (data type Vector).
- X, Y, Z - components of the corresponding vectors (data type Float).
2020-10-13 20:50:30 +03:00
E1e5en ebfb324abf
Update
Correction of an error in the node description
2020-10-13 18:25:10 +03:00
E1e5en c67246cd1a Get System Language - LN
Get System Language
Category: Native
To get the current system language according to the IS0 639 standard.
The Krom platform always returns “en”.
2020-10-13 17:29:50 +03:00
Lubos Lenco 20c8be3d0d
Merge pull request #1924 from MoritzBrueckner/world-nodes
World nodes support and nodes parsing refactor
2020-10-11 20:23:53 +02:00
Lubos Lenco 2e6227e85e
Merge pull request #1927 from knowledgenude/master
Add accidentally removed labels
2020-10-11 19:42:23 +02:00
Moritz Brückner eeee016927 Remove unused parameter 2020-10-11 17:15:35 +02:00
Moritz Brückner 34eafda885 Fix noise texture node socket indices 2020-10-11 17:13:36 +02:00
knowledgenude 5abe984920
Update LN_set_object_material.py 2020-10-11 12:08:05 -03:00
knowledgenude 6ed63ad7d0
Update LN_resume_action.py 2020-10-11 12:06:36 -03:00
knowledgenude 46f0c3eb9b
Update LN_play_action.py 2020-10-11 12:05:44 -03:00
knowledgenude ffffd6bc88
Update LN_resume_trait.py 2020-10-11 12:03:49 -03:00
knowledgenude 1d0d22594f
Update LN_pause_trait.py 2020-10-11 12:02:23 -03:00
Lubos Lenco 00bbe0109c
Merge pull request #1926 from knowledgenude/master
Update LN_pause_tilesheet.py
2020-10-11 16:59:46 +02:00
knowledgenude e5534c2998
Update LN_pause_tilesheet.py 2020-10-11 11:56:17 -03:00
Lubos Lenco 70ae143c9b
Merge pull request #1922 from E1e5en/debug-console-settings
Add Debug Console settings
2020-10-11 16:54:17 +02:00
Moritz Brückner 8f7e99530c Show node panels only when applicable 2020-10-11 00:24:11 +02:00
Moritz Brückner d8a5e9edea Fix parsing of glossy shaders 2020-10-11 00:11:25 +02:00
Moritz Brückner 64e23b9b72 Remove duplicate comments 2020-10-10 23:51:40 +02:00
Moritz Brückner ffaf09e5f6 Cleanup comment 2020-10-10 23:16:10 +02:00
Moritz Brückner 9c27779f19 Fix normalmap parsing 2020-10-10 23:09:16 +02:00
Moritz Brückner c7e42f3f9c Some more fixes 2020-10-10 23:04:56 +02:00
Moritz Brückner 4c13017c4f Fix export of brick/checker texture nodes 2020-10-10 22:54:11 +02:00
Moritz Brückner 860594266c Fix world shader compilation for various input coordinate types 2020-10-10 21:28:36 +02:00
Moritz Brückner 6b797b75ae Use world color for irradiance when no sky/texture exists but don't use static color only 2020-10-10 20:37:59 +02:00
Moritz Brückner c2cf227989 Autocompletion for rpdat 2020-10-10 20:34:39 +02:00
Moritz Brückner 2dd7407772 Fix parsing of transparent shader node 2020-10-10 20:27:19 +02:00
Moritz Brückner cf531856f7 Set vertex shader in world parser state 2020-10-10 20:26:39 +02:00
Moritz Brückner 3482878c22 Improve ParserState 2020-10-10 20:26:29 +02:00
Lubos Lenco 6e003acdd8
Merge pull request #1921 from knowledgenude/master
Merged pause/resume nodes
2020-10-10 16:45:16 +02:00
E1e5en 305878db42 Add Debug Console settings
1. Adding the ability to customize display, scale (size), shortcuts to the DebugConsole class.
2. Adding a function to utils.py to get Debug Console settings from Render: Armory.
3. Added Debug Console settings to the Armory Project interface:
- Enable (default value - False);
- Position (Left, Center, Right, default value - Right);
- Scale Console (from 0.3 to 10);
- Visible.
4. Added transfer of Debug Console settings to exporter.py.
5. Added logical nodes to control DebugConsole while the application is running.
2020-10-10 13:10:34 +03:00
Moritz Brückner 2f11b0c406 Further improve ParserState 2020-10-09 23:32:41 +02:00
Henrique 93cc768cb8 rename-variables 2020-10-09 17:46:46 -03:00
Henrique 677ae903a2 merge-pause-and-resume-nodes 2020-10-09 17:43:17 -03:00
Moritz Brückner 4f0316f076 cycles.py: move parents into ParserState 2020-10-09 21:15:21 +02:00
Moritz Brückner 2b45a3132b World shader: make procedural textures work 2020-10-09 19:46:20 +02:00
Moritz Brückner eed7329f57 Improve parsing oder 2020-10-09 19:46:06 +02:00
Moritz Brückner cc5513b9fc Cleanup whitespace 2020-10-09 19:45:40 +02:00
Moritz Brückner 968f687e5d Fix parser lookup 2020-10-09 19:43:54 +02:00
Moritz Brückner 23b9016f13 Fix node group handling 2020-10-09 19:24:55 +02:00
Moritz Brückner c6258894f1 Cleanup 2020-10-09 19:18:59 +02:00
Moritz Brückner ea5118dba9 cycles.py: Fix writing of normals 2020-10-09 19:18:44 +02:00
Moritz Brückner 51e2f10f02 Better error handling 2020-10-09 19:13:15 +02:00
Moritz Brückner 0279ed7669 Support for world shader nodes 2020-10-09 19:13:08 +02:00
Moritz Brückner 13cf5d12a5 Check for uniqueness when adding init statements to shader main() (+ indent) 2020-10-08 23:08:37 +02:00
Moritz Brückner 78d86515dc Fix parsing of hue-saturation node 2020-10-08 22:33:49 +02:00
Moritz Brückner a83189b0be Move basecol_only into ParserState 2020-10-08 21:19:52 +02:00
Moritz Brückner 75e73e09d6 Cleanup 2020-10-08 21:17:02 +02:00
Moritz Brückner c8bdd961f5 Make more use of the ParserState class 2020-10-08 21:03:14 +02:00
Lubos Lenco 646ff75669
Merge pull request #1917 from knowledgenude/master
Fix LN_on_tap_screen.py
2020-10-08 12:24:48 +02:00
knowledgenude e35c85de49
Update LN_on_tap_screen.py 2020-10-08 07:20:54 -03:00
Lubos Lenco de0f625c34
Merge pull request #1913 from knowledgenude/master
Improve LN descriptions
2020-10-08 09:59:28 +02:00
knowledgenude 72b1b12c21
Collision Group 1 as default in Ray Cast node 2020-10-07 16:01:05 -03:00
knowledgenude 83ad817832
Update LN_play_tilesheet.py 2020-10-05 19:09:00 -03:00
knowledgenude 31793011c9
Update LN_play_action_from.py 2020-10-05 19:08:43 -03:00
knowledgenude 6cd52a4d26
Delete LN_animation_state.py 2020-10-05 19:07:10 -03:00
Moritz Brückner f8b3315c2d Move node parsing into subpackages part 3 2020-10-05 23:37:48 +02:00
Moritz Brückner 0d2740daa8 Move node parsing into subpackages part 2 2020-10-05 20:51:58 +02:00
Moritz Brückner cd63597fad Add ParserState class for better handling of cycles.py state 2020-10-05 20:42:59 +02:00
knowledgenude 7dee6d97b4
Update GetGravityNode.hx 2020-10-05 15:09:15 -03:00
knowledgenude a90490a8f4
Update LN_trait.py 2020-10-05 15:06:10 -03:00
Henrique 9f9aa2cb81 delete-wrong-pick-rigid-body 2020-10-05 14:57:27 -03:00
Henrique 1436f9a5a4 improve-ln-descriptions 2020-10-05 14:55:56 -03:00
Lubos Lenco 49b35cbd25
Merge pull request #1910 from MoritzBrueckner/call-function-node
Fix CallFunctionNode
2020-10-05 09:44:55 +02:00
Moritz Brückner 4c917c59e9 cycles.py: more cleanup and add some comments 2020-10-05 01:59:49 +02:00
Moritz Brückner 2412a9b4cf cycles.py: further cleanup 2020-10-05 01:39:36 +02:00
Moritz Brückner 00e8952640 Fix parser function lookup 2020-10-05 01:39:23 +02:00
Moritz Brückner da8fca1b3b Move node parsing into subpackages part 1 2020-10-05 01:36:33 +02:00
Moritz Brückner a4cd48ec28 Add some typehints and docstrings 2020-10-05 01:27:36 +02:00
Moritz Brückner f27c885361 Fix CallFunctionNode 2020-10-04 21:33:32 +02:00
Lubos Lenco cc9add8790
Merge pull request #1905 from knowledgenude/master
Logic nodes cleanups
2020-10-03 10:55:46 +02:00
Lubos Lenco 7e6968b7a0
Merge pull request #1906 from E1e5en/on-swipe
Update logic node On Swipe
2020-10-03 10:54:36 +02:00
Lubos Lenco 00883c5133
Merge pull request #1907 from Lykdraft/patch-1
Bullet: Collision margin was inverted.
2020-10-03 10:53:51 +02:00
Lykdraft 3ce253c51a
Bullet: Collision margin was inverted. issue #1707
This should work now as expected.
2020-10-02 15:23:23 +02:00
Henrique 77e93724ba getlenstexture-update 2020-10-01 19:24:21 -03:00
Henrique 737c623a12 ssr-ssao-update 2020-10-01 19:22:46 -03:00
Henrique dd655aa8e1 more-adjustments 2020-10-01 19:18:58 -03:00
Henrique c8b828a6e9 adjustments 2020-10-01 19:16:22 -03:00
E1e5en 937c7eb86b Update logic node On Swipe
Change the data type for the Direction output parameter from Vec3 to Vec4.
2020-10-01 22:11:52 +03:00
knowledgenude b44170720b
Update ColorgradingGetGlobalNode.hx 2020-10-01 16:11:31 -03:00
Henrique a47dafe9ed ln-cleanups 2020-10-01 16:05:47 -03:00
luboslenco da1cf33930 Bump version 2020-10-01 11:35:55 +02:00
Lubos Lenco 4038a67385
Merge pull request #1903 from N8n5h/nodes-context-menu
Add 3 new context menu options for nodes to inspect source and wiki
2020-10-01 11:32:45 +02:00
Lubos Lenco a27bb06788
Merge pull request #1902 from MoritzBrueckner/fix-node-tooltips
Prevent exception when node has no bl_description attr and docstring
2020-10-01 11:32:02 +02:00
Lubos Lenco 871885eefb
Merge pull request #1901 from knowledgenude/master
More renames
2020-10-01 11:31:38 +02:00
N8n5h 63666ed731 Added a new operator and context menu option to open the wiki entry of a node 2020-09-30 17:42:35 -03:00
N8n5h 0dadfad886 remove remaining active_node's in implementation 2020-09-30 17:42:35 -03:00
N8n5h ee2764b877 Add two context menu options for logic nodes
The two new context menu options will let the user inspect the source code
of the node. For the haxe source the existing operator was used (ArmOpenNodeSource),
but it was modified because I thought it made more sense to guess the version the user has based on their last commit instead of master.
for python __module__ was used to obtain the relative path.

The options were appended to the existing menu instead of being its own class because I couldn't find how to implement it that way without redrawing.

- Added a way to obtain the last commit in utils without git cli
2020-09-30 17:42:35 -03:00
Moritz Brückner 4fed9da646 Prevent exception when node has no bl_description attribute and no docstring 2020-09-30 21:04:06 +02:00
Henrique 8d7c3a0910 replace-inverse-by-invert 2020-09-30 12:00:18 -03:00
Henrique 95c537a934 undo-input-renames 2020-09-29 13:42:38 -03:00
Henrique 0ba0884b35 rename-ln-labels 2020-09-29 13:38:17 -03:00
Lubos Lenco 3bc39d82cc
Merge pull request #1897 from MoritzBrueckner/node-docs
Update node docstrings
2020-09-28 20:51:39 +02:00
Lubos Lenco 30088df19c
Merge pull request #1892 from MoritzBrueckner/get-object-node
Get Object node: allow getting objects from other scenes
2020-09-28 20:49:26 +02:00
Moritz Brückner bb139d96f9 Fix SubString node socket labels 2020-09-28 16:21:18 +02:00
Moritz Brückner 431630d42e Update node docstrings 2020-09-28 15:58:41 +02:00
Lubos Lenco dc515c97d0
Merge pull request #1891 from niacdoial/master
Further handling of node depreciation
2020-09-28 10:14:34 +02:00
niacdoial 580902e8df and one more typo for the road 2020-09-28 10:07:03 +02:00
Lubos Lenco 95cc79339a
Merge pull request #1893 from MoritzBrueckner/on-application-state
Add "On Application State" node
2020-09-27 20:36:54 +02:00
Lubos Lenco 7042797185
Merge pull request #1894 from MoritzBrueckner/node-register
Automatically register new nodes and categories from libraries
2020-09-27 20:36:03 +02:00
Lubos Lenco 7bc594629e
Merge pull request #1895 from E1e5en/get-system-name
Get System Name - to get the name of the system while the application is running
2020-09-27 20:35:23 +02:00
E1e5en 1fec2d1e20 Get System Name
Get System Name - to get the name of the system while the application is running.

Output parameters:
- System Name — displays the system name as a string;
- List systems for quick comparison.
2020-09-27 20:22:41 +03:00
niacdoial 482a340c77 (fixed a few typos and docstrings in relation to the previous commit) 2020-09-27 17:17:22 +02:00
Moritz Brückner 4e234c0f56 Automatically register new nodes and categories from libraries 2020-09-27 17:12:45 +02:00
Moritz Brückner f4c004c8ea Reorganize imports according to PEP8 2020-09-27 17:12:22 +02:00
Moritz Brückner b132d4b171 Add "On Application State" node 2020-09-27 16:57:21 +02:00
Moritz Brückner bb5b7c5863 Fix invalid cast in SpawnObjectNode.hx 2020-09-26 16:33:43 +02:00
Moritz Brückner 2c2ecee2a9 GetObjectNode: allow getting objects from other scenes 2020-09-26 16:33:30 +02:00
niacdoial 24313d65a4 Further handling of node depreciation
(Depreciated nodes are moved elsewhere in the files to diminish clutter)

Also fixed a couple bugs for the handling of node replacement.
2020-09-26 16:14:35 +02:00
Lubos Lenco 9ad68b561a
Merge pull request #1888 from MoritzBrueckner/cwd_contextmanager
Implement context manager for safer cwd changing
2020-09-26 10:12:19 +02:00
Lubos Lenco 5abbc0211b
Merge pull request #1887 from knowledgenude/master
Rename logic nodes labels
2020-09-26 10:11:28 +02:00
Moritz Brückner fd4fcff19f Implement context manager for safer cwd changing 2020-09-25 21:20:11 +02:00
knowledgenude e01c7f5754 rename-material-labels 2020-09-24 21:20:21 -03:00
knowledgenude 4e114e02d3 replace-delete-by-remove 2020-09-24 21:02:26 -03:00
knowledgenude 618fa26dd4
Update LN_get_display_resolution.py 2020-09-24 19:54:29 -03:00
knowledgenude fdf24de3fb logic-nodes-labels 2020-09-24 19:49:21 -03:00
Lubos Lenco d5002d3783
Merge pull request #1886 from MoritzBrueckner/typo
Fix typo: is_obselete -> is_obsolete
2020-09-24 17:14:23 +02:00
Moritz Brückner bd50923411 Fix typo: obselete -> obsolete 2020-09-24 16:40:15 +02:00
Lubos Lenco 24643eac51
Merge pull request #1884 from knowledgenude/master
Add small logic nodes descriptions
2020-09-24 08:51:46 +02:00
knowledgenude 2d2e6d74db
Update LN_volume_trigger.py 2020-09-23 17:54:01 -03:00
knowledgenude cfbeb850bf
Update LN_blend_action.py 2020-09-23 17:26:09 -03:00
knowledgenude 79df9d7016 logic-nodes-descriptions 2020-09-23 17:12:25 -03:00
Lubos Lenco 58e4744aa1
Merge pull request #1880 from knowledgenude/master
Logic nodes improvements
2020-09-22 17:30:10 +02:00
Lubos Lenco 8f06f611b5
Merge pull request #1874 from MoritzBrueckner/lz4
Support for LZ4 compression
2020-09-21 09:48:20 +02:00
knowledgenude 558e22e20e logic-nodes-improvements 2020-09-20 15:10:01 -03:00
Lubos Lenco 5bf0044d50
Merge pull request #1876 from E1e5en/on-tap-screen
On Tap Screen - node for handling touches (double, triple…)
2020-09-18 08:29:40 +02:00
E1e5en 9ac4325a00 On Tap Screen - node for handling touches (double, triple…)
Input parameters:

Duration - time during which the number of touches is counted (default value is 0.3 seconds);
Interval - the time that must elapse between touches (default value is 0);
Repeat - the number of touches that need to be done to execute the event (default value is 2).
Output parameters:

Done - event for a successful completed action;
Fail - an event for a failed action;
Tap - event on each touch;
Tap Number - how many times the user has already touched the screen;
Coords - coordinates of the touch.
2020-09-18 08:37:44 +03:00
Moritz Brückner aab56427d5 Lz4: update docstring, Lz4.hx is now in Iron 2020-09-17 21:38:51 +02:00
Moritz Brückner 932d4d5065 Notification on LZ4 export that compressing might take some time 2020-09-17 21:32:05 +02:00
Moritz Brückner 8b3eefb382 Improve asset compression tooltip 2020-09-17 21:30:22 +02:00
Lubos Lenco 8ae493f30a
Merge pull request #1872 from QuantumCoderQC/master
Custom Particle Node
2020-09-17 09:05:27 +02:00
QuantumCoderQC 648e505617 Custom Particle Trait to enable instancing and instance count 2020-09-16 23:33:22 +02:00
QuantumCoderQC 5cf598bdf4 Custom Particle Node UI and implementation 2020-09-16 23:30:20 +02:00
QuantumCoderQC 822775b9cc Support parsing of Custom Particle Node in Vertex Shader 2020-09-16 23:28:21 +02:00
QuantumCoderQC 0b252093f5 Shadowmap and Depth shader parsing for Custom Particle Node 2020-09-16 23:24:51 +02:00
QuantumCoderQC fcc1db0743 Correct normals for instanced rendering when transparency enabled 2020-09-16 23:20:57 +02:00
QuantumCoderQC c3092e781c Add uniforms in Vertex Shader 2020-09-16 23:17:43 +02:00
Lubos Lenco 730dbbaccb
Merge pull request #1871 from MoritzBrueckner/fix-shader-socket
Fix export for sockets with no default value
2020-09-16 22:27:42 +02:00
Moritz Brückner 5cd6c3d09f Fix export for sockets with no default value 2020-09-16 16:39:35 +02:00
Lubos Lenco 88aaeffcf1
Merge pull request #1869 from E1e5en/on-swipe-logic-node
Logic Node - On Swipe
2020-09-15 12:50:01 +02:00
Lubos Lenco 495da3c4f2
Merge pull request #1868 from MoritzBrueckner/addnode-poll
Add poll() function to AddNodeOverride operator
2020-09-15 12:49:10 +02:00
Lubos Lenco 43aa2eca24
Merge pull request #1867 from MoritzBrueckner/socket-fixes
Socket fixes
2020-09-15 12:48:54 +02:00
E1e5en 813f77dc0a Logic Node - On Swipe
The node for the swipe event.

Input parameters:
- Time - duration of the swipe (default value 0.15 s);
- Min Length (px) - the minimum length that the swipe must “pass” (default value 100 px).

Output parameters:
- Direction - normalized vector of the swipe direction;
- Length (px) - the length of the swipe (to assess the “strength”);
The Length output parameter is calculated by the vector value (without normalization) to relate to the input value.
- Angle (0-360) - swipe angle in the range from 0 to 360 degrees (0 is on the right, i.e. Vector (1, 0) = 0 degrees).
- States are states with direction output (Up, Down …). By default, they are not displayed, but if you press “Add 4 State”, then 4 states will appear (Up, Down, Left, Right) and if again, then 8 states will already be displayed.
Determining direction for a state:
for 4 directions - "circle" is divided into 4 segments of 90 degrees;
for 8 directions - "circle" is divided into 8 segments of 45 degrees.
2020-09-15 09:08:59 +03:00
Moritz Brückner 73d8fbd1d6 Add poll() function to AddNodeOverride operator 2020-09-15 01:25:42 +02:00
Moritz Brückner 98fccc445a Fix naming of dynamic sockets 2020-09-14 23:20:19 +02:00
Moritz Brückner 818c2242da Don't write 'None' into the generated logic tree code 2020-09-14 23:11:03 +02:00
Lubos Lenco 0b01c4648d
Merge pull request #1864 from MoritzBrueckner/new-nodes
Some new nodes and improvements (by @knowledgenude )
2020-09-14 08:21:40 +02:00
Lubos Lenco f1b9e75dae
Merge pull request #1863 from MoritzBrueckner/fix-node-export
Fix export of String and Object sockets
2020-09-14 08:21:11 +02:00
Moritz Brückner 533c81e2cf Merge branch 'master' into new-nodes
# Conflicts:
#	blender/arm/logicnode/object/LN_get_visible.py
#	blender/arm/logicnode/object/LN_set_visible.py
2020-09-14 01:08:59 +02:00
Moritz Brückner e634fbf629 Fix export of String and Object sockets 2020-09-14 01:03:13 +02:00
knowledgenude 7d419481f2
Update .py files 2020-09-13 15:59:48 -03:00
knowledgenude e3c7731b63
Update object nodes .py 2020-09-13 15:43:27 -03:00
knowledgenude d2ecc78712
Improved nodes + LN_get_object_offscreen.py 2020-09-13 14:11:57 -03:00
Lubos Lenco 67fd575daf
Merge pull request #1860 from niacdoial/master
Node versioning system
2020-09-13 19:09:52 +02:00
knowledgenude 8d7c139375
Add LN_get_rigid_body_data.py 2020-09-13 14:09:42 -03:00
knowledgenude d44bf0f4bb
Improved nodes +2 new nodes .hx 2020-09-13 14:08:55 -03:00
niacdoial 19064c60b5 populated a previously empty error message 2020-09-13 15:40:35 +02:00
niacdoial 28722ee866 Fixed one bug/exploit waiting to happen
(and removed a debug print)
2020-09-13 15:32:39 +02:00
niacdoial c8a6743819 Merge branch 'logic-nodes' into master
(additions: node versioning system, slight rework of the NodeSockets)
2020-09-13 11:36:41 +02:00
niacdoial bdc33cb419 added node versioning information to all node classes 2020-09-13 11:27:58 +02:00
Lubos Lenco b2c00f3dfa
Merge pull request #1858 from MoritzBrueckner/arm-flag
Add "armory" flag on export to differ between Armory and Kha
2020-09-13 10:47:14 +02:00
Lubos Lenco cde5279a47
Merge pull request #1859 from MoritzBrueckner/canvas-nodes-fix
Fix canvas nodes for invalid element names
2020-09-13 10:28:14 +02:00
Lubos Lenco b89a757bc4
Merge pull request #1857 from E1e5en/master
Blender UI – Armory Trait – Logic Node
2020-09-13 10:27:14 +02:00
Lubos Lenco c03583410e
Merge pull request #1851 from MoritzBrueckner/logic-nodes
Logic nodes overhaul
2020-09-13 10:25:36 +02:00
niacdoial cd730249af Merge branch 'node-versioning' into logic-nodes 2020-09-12 18:29:28 +02:00
niacdoial 3a2952ced8 Added node versioning
- changed the way custom node sockets are handled at several places
 - updated the `replaceAll` and `replace` functions used to perform node replacements
 - renamed and improved the NodeReplacement [new name] class, which represents a replacement task
 - added an arm_version property to all logic nodes, as well as a `get_replacement_node` method (to be overridden for each node)
 - added an option to declare a node as obselete in add_node()  (useful in order to have the node defined, but out of the menu)
 - added classes for UI popups linked to node updates, as well as an operator dedicated to said node update

Thanks to MoritzBrueckner for part of the ground work!
2020-09-12 18:15:53 +02:00
Moritz Brückner b948641146 Fix indentation 2020-09-11 15:16:40 +02:00
Moritz Brückner 261edbdac9 Fix canvas nodes for invalid element names 2020-09-11 15:13:59 +02:00
Moritz Brückner e8b1859e8b Add "armory" flag on export so libraries can differ between Armory and Kha 2020-09-11 14:43:59 +02:00
E1e5en 4304be7a0a Blender UI – Armory Trait – Logic Node
Add buttons:
- New Node Tree – creates and sets a new Node Tree in the list;
- Edit Node Tree – loads the Node Tree selected from the list into all Logic Node Editor;
- From Node Tree – loops through all the working Logic Node Editor and from the last in the list sets the value to the list.
2020-09-11 12:18:31 +03:00
Lubos Lenco fc9f36334d
Merge pull request #1854 from MoritzBrueckner/deprecated-nodes
Deprecation warnings for old input nodes
2020-09-10 08:41:52 +02:00
Moritz Brückner af60d2000d Deprecation warnings for old input nodes 2020-09-09 22:05:23 +02:00
Moritz Brückner 2d33398f9f Merge remote-tracking branch 'upstream/master' into logic-nodes
# Conflicts:
#	blender/arm/logicnode/action_set_visible.py
#	blender/arm/logicnode/physics_get_gravity.py
2020-09-09 21:11:49 +02:00
Moritz Brückner fccd83bf14 Rename MODULE_AS_CATEGORY -> PKG_AS_CATEGORY 2020-09-09 20:48:35 +02:00
Moritz Brückner 1bde147a23 AddCollectionnode -> CreateCollectionNode 2020-09-09 20:34:23 +02:00
Moritz Brückner 3ea181fc37 Fix operator call 2020-09-09 20:30:49 +02:00
Moritz Brückner e6de489451 Better names for array remove nodes 2020-09-09 20:27:54 +02:00
Moritz Brückner d0f3c1e946 Ensure correct node section order 2020-09-09 15:18:48 +02:00
Lubos Lenco a96870750a
Merge pull request #1850 from knowledgenude/master
Canvas Get Visible , Get Mouse Lock and Get Mouse Visible
2020-09-09 08:34:34 +02:00
knowledgenude 9c8b6d3b98
Update action_set_visible.py 2020-09-08 21:05:51 -03:00
knowledgenude 546f8824d0
value_get_mouse_lock.py , value_get_mouse_visible.py 2020-09-08 20:12:45 -03:00
knowledgenude 020f79793e
GetMouseLockNode.hx , GetMouseVisibleNode.hx 2020-09-08 20:11:56 -03:00
knowledgenude bdb18496a3
canvas_get_visible.py 2020-09-08 19:34:45 -03:00
knowledgenude 289a6ce21b
CanvasGetVisibleNode.hx 2020-09-08 19:34:13 -03:00
Moritz Brückner cfd6b01f0a Remove alternative category icons 2020-09-09 00:32:38 +02:00
Moritz Brückner 83fe52b281 Put categories from logic node extension packs to the end of the menu 2020-09-09 00:31:50 +02:00
Moritz Brückner e48f682cdf Remove obsolete bl_icon='NONE' from node definitions 2020-09-09 00:28:41 +02:00
Moritz Brückner 179fdcf17c Show bl_description or docstring when hovering over nodes in the menu 2020-09-09 00:25:10 +02:00
Moritz Brückner 1c6444b511 Rename ray cast socket 2020-09-08 23:44:15 +02:00
Moritz Brückner dc00b6abd5 Fix ParseFloatNode label and add it to its own section 2020-09-08 23:31:09 +02:00
Moritz Brückner 7f2bbd8d49 CastPhysicsRayNode -> RayCastNode 2020-09-08 23:30:50 +02:00
Moritz Brückner ce3a4dd1a0 SelfNode -> SelfObjectNode 2020-09-08 23:30:37 +02:00
Moritz Brückner 8559505d2f InArrayNode -> ArrayContainsNode 2020-09-08 23:29:50 +02:00
Moritz Brückner 39fc1f3cad Remove unused imports 2020-09-08 23:21:41 +02:00
Moritz Brückner 4681149a90 Fix docstring format 2020-09-08 23:14:51 +02:00
Moritz Brückner 45ce65513b Make the mask node a variable node 2020-09-08 22:11:25 +02:00
Moritz Brückner 8e6c8031b0 Use new sockets for variable nodes 2020-09-08 22:08:29 +02:00
Moritz Brückner bec4e2e8ac Use new socket functions 2020-09-08 21:49:02 +02:00
Moritz Brückner d83cdc4f33 Add custom add input/output functions and denote variable socket functionality 2020-09-08 21:34:05 +02:00
Moritz Brückner 727c2d9f35 Make ArmLogicTreeNode a subclass of bpy.types.Node 2020-09-08 21:16:20 +02:00
Lubos Lenco 00cad1832a
Merge pull request #1848 from QuantumCoderQC/patch2
Support for displacement in instanced objects
2020-09-08 20:26:10 +02:00
Lubos Lenco 2a4bfcb146
Merge pull request #1849 from QuantumCoderQC/patch3
Re-Configure getChild node to search for immediate children only
2020-09-08 20:22:37 +02:00
Lubos Lenco dc16740360
Merge pull request #1847 from QuantumCoderQC/master
Add getGravity method. Fix getGravity logic node.
2020-09-08 20:20:43 +02:00
Lubos Lenco 036e8d6a13
Merge pull request #1841 from knowledgenude/master
+3 physics nodes
2020-09-08 20:19:42 +02:00
Moritz Brückner abf495bf2f Fix usage of custom socket types 2020-09-08 17:04:13 +02:00
Moritz Brückner bfa23a9d6a Don't register internal nodes again 2020-09-08 17:03:56 +02:00
Moritz Brückner c98f593459 Reassign node categories + rename files 2020-09-08 17:03:24 +02:00
QuantumCoderQC adf19390e6 Re-Configure getChild node to search for immidiate children only 2020-09-08 15:18:20 +02:00
Moritz Brückner 6168f68dd0 Don't hardcode the position of the 'default' node section 2020-09-08 01:26:41 +02:00
QuantumCoderQC 14a8d8698f Spoort for displacement in instanced objects 2020-09-08 00:26:44 +02:00
QuantumCoderQC cc35b01684 Add getGravity method. Fix getGravity logic node. 2020-09-07 22:11:03 +02:00
Moritz Brückner 2babf2f97b Alphabeticallysort nodes in node sections 2020-09-07 20:36:30 +02:00
Moritz Brückner b31c151cf3 Add possibility to use the module name as the node category 2020-09-07 19:15:39 +02:00
Moritz Brückner 430053bfb2 Remove unused debug print 2020-09-07 19:15:07 +02:00
knowledgenude 2438995069
Update SetActivationStateNode.hx 2020-09-07 11:01:27 -03:00
knowledgenude 6c723eb9c7
Update SetFrictionNode.hx 2020-09-07 11:00:23 -03:00
knowledgenude 2aedf8256e
Update RemovePhysicsNode.hx 2020-09-07 10:59:31 -03:00
knowledgenude b8ccf404e5
Remove rigid body verification 2020-09-07 10:57:39 -03:00
Moritz Brückner a5a15e472b Fix unregistering of categories 2020-09-07 01:26:31 +02:00
Moritz Brückner 14bd60d3f4 Fix docstring format 2020-09-07 01:15:12 +02:00
Moritz Brückner b248f2c8e8 Move socket classes to own module and remove now obsolete eye drop operator 2020-09-07 01:13:00 +02:00
Moritz Brückner dfb0c566c7 Fix missing add node menu registering 2020-09-07 01:10:43 +02:00
Moritz Brückner 74efd5df80 Add custom node search operator 2020-09-07 00:54:52 +02:00
Moritz Brückner 16d8df73b2 Implement custom node menu 2020-09-07 00:40:54 +02:00
Moritz Brückner 05c0a201ad Fix missing import 2020-09-07 00:33:46 +02:00
Moritz Brückner f8376e877f Fix register_node() for internal nodes 2020-09-07 00:33:31 +02:00
Moritz Brückner 153594985b Rename node_class -> node_type 2020-09-07 00:33:16 +02:00
Moritz Brückner 6c43fb9289 Whitespace and other small cleanups 2020-09-07 00:08:51 +02:00
Moritz Brückner 07817fed54 Add new node/category API 2020-09-07 00:06:41 +02:00
knowledgenude 974ad7cb36
Improve Set Activation node 2020-09-06 15:11:22 -03:00
knowledgenude 193c712bf4
Improve Set Activation Node 2020-09-06 15:10:51 -03:00
knowledgenude 37bd828784
Delete physics_sync_transform.py 2020-09-06 15:10:22 -03:00
knowledgenude 1c7b6c4c94
Delete SyncTransformNode.hx 2020-09-06 15:09:55 -03:00
knowledgenude 2ecb8fef39
Update SetActivationStateNode.hx 2020-09-06 12:46:10 -03:00
knowledgenude 32ee67e1db
Update SetActivationStateNode.hx 2020-09-06 11:08:18 -03:00
knowledgenude 42ab00b6ef
RemovePhysicsNode.hx 2020-09-06 10:50:27 -03:00
knowledgenude 72ee4da37d
physics_remove_physics.py 2020-09-06 10:50:03 -03:00
knowledgenude 0622b89c61
Delete physics_remove_from_world.py 2020-09-06 10:44:59 -03:00
knowledgenude 1ab9681712
Delete RemoveFromWorldNode.hx 2020-09-06 10:44:12 -03:00
knowledgenude 6e824580b9
Set Friction node .py 2020-09-05 18:05:35 -03:00
knowledgenude b1e09b6dc4
Set Friction Node and fix Ray Cast mask
Ray Cast node was not considering masks: https://github.com/armory3d/armory/issues/1780
2020-09-05 18:05:03 -03:00
knowledgenude b9fc172691
Fix crashes when object don't have rigid body 2020-09-05 12:27:29 -03:00
knowledgenude 042be35f06
+3 physics nodes 2020-09-05 10:31:28 -03:00
knowledgenude dc1ae7aece
+3 physics nodes 2020-09-05 10:30:55 -03:00
Lubos Lenco 5c1b55d221
Merge pull request #1839 from niacdoial/master
fixed a backwards compatibility problem with a node from before armory 2020.09
2020-09-05 10:39:41 +02:00
Lubos Lenco f86491000c
Merge pull request #1838 from knowledgenude/master
Fix rigid bodies continuing to move when parented
2020-09-05 09:59:14 +02:00
knowledgenude b178655487
Fix rigid bodies continuing to move when parented
This fixes one more bug from here: https://github.com/armory3d/armory/issues/1830

I don't know if this is a correct fix, but solved a problem for me.

One last bug that stills is the rigid body in "random" places when parented. To fix this, when the rigid body (no matter if active or passive) is parented, it must have Animated checkbox checked. I don't know how to do this. This will solve all problems related to it, except the "Keep Transform" unchecked one.
2020-09-04 20:50:46 -03:00
Lubos Lenco 86ebf8ef05
Merge pull request #1834 from MoritzBrueckner/spawn-collection
Add SpawnCollection node
2020-09-04 10:08:38 +02:00
Lubos Lenco 728706e7f5
Merge pull request #1836 from MoritzBrueckner/set-camera-nodes
Rename camera nodes (no longer duplicate names)
2020-09-04 09:38:37 +02:00
Lubos Lenco e00a625b6f
Merge pull request #1833 from QuantumCoderQC/master
Apply tansform for RigidBody if Keep Transform
2020-09-04 09:37:21 +02:00
Moritz Brückner a344209a79 Small format improvement 2020-09-03 22:50:35 +02:00
Moritz Brückner 720967c5d5 Remove duplicate naming from camera nodes 2020-09-03 22:50:02 +02:00
Moritz Brückner 1dbbc05557 Add SpawnCollection node 2020-09-03 18:53:19 +02:00
Moritz Brückner 5429a56e7a Fix logic node export of None type properties 2020-09-03 18:49:23 +02:00
niacdoial 8d6f44a34c fixed a backwards compatibility problem with armory < 2020.09 (pre-17daabeb29dfb0a5cc8b4bef840b02b9f83f409d to be exact)
(in that that commit, I tried to make so the new code could use pre-existing nodes without problem, but it seems I partially failed)
2020-09-03 18:18:57 +02:00
QuantumCoderQC 87ab504a61 Apply tansform for RigidBody if Keep Transform 2020-09-03 15:14:01 +02:00
Lubos Lenco cee7935093
Merge pull request #1828 from Naxela/master
Fix for OpenCV installation
2020-09-01 18:14:57 +02:00
Alexander ea5219e67d Fix for OpenCV installation 2020-09-01 18:06:35 +02:00
luboslenco 03077030f0 Bump version 2020-09-01 10:46:54 +02:00
Lubos Lenco 1bf56ba960
Merge pull request #1827 from armory3d/lightmapper
Lightmapper
2020-09-01 10:41:49 +02:00
Lubos Lenco 2139bdfce3
Merge pull request #1826 from Naxela/lightmapper
Lightmapper
2020-09-01 09:43:40 +02:00
Moritz Brückner 12b7885821 Small format improvements 2020-08-31 00:14:24 +02:00
Moritz Brückner 3066d5f98c Lz4: Fix bug with unsigned right-shifting 2020-08-30 22:53:21 +02:00
Lubos Lenco 5e2074a58c
Merge pull request #1821 from niacdoial/master
Improved quaternion and angle handling in logic nodes (+2bugfixes)
2020-08-30 20:34:05 +02:00
Alexander 607f4e7b33 Update to 0.3.2.0 2020-08-30 18:34:59 +02:00
niacdoial 17daabeb29 Improved quaternion and angle handling in logic nodes (+2bugfixes)
- Made so all nodes outputting a quaternion object also output it as a XYZ (vector) + W (float) combination
- Modernized the interface of the "Action/Rotate Object" node, to align on the newer "Action/Set Rotation" node interface  ("Action/Rotate Object Along Axis" is now depreciated, but still usable)
- Fixed a blender-side-only bug with the "Logic/Switch" node (...which technically could have lead to a compile-time problem if exploited the right way)
- Fixed a bug on the "Action/Set Rotation" node: now, quaternion input is automatically normalized in order to avoid accidental scaling
- Added a "Value/Separate Quaternion" node
- Made so the names of some sockets change in the "Set Rotation" and "Rotate Object" nodes, so they adapt to those nodes' input types.
  (Same thing with "Value/Vector From Transform"'s output type)
2020-08-30 15:50:06 +02:00
Lubos Lenco a4f7030ef8
Merge pull request #1817 from MoritzBrueckner/shaderdata-sampler2d
Add sampler2D access to ShaderData node
2020-08-28 17:38:47 +02:00
luboslenco 401ad3a69d Expose render target depth via uniform link 2020-08-28 17:34:22 +02:00
luboslenco a576872c72 Expose render targets via uniform link 2020-08-28 17:07:43 +02:00
Lubos Lenco b5292f34c8
Merge pull request #1819 from MoritzBrueckner/android_native
Fix android target options
2020-08-28 16:37:34 +02:00
Moritz Brückner f6cf1e4731 Rename f to khafile for better readability 2020-08-28 13:25:54 +02:00
Moritz Brückner b458438c70 Fix android target options 2020-08-28 13:09:23 +02:00
Lubos Lenco 37869cd6eb
Merge pull request #1818 from QuantumCoderQC/master
Upgrade Apply Force at location and Apply Impulse at location to include object rotation
2020-08-28 12:37:51 +02:00
QuantumCoderQC c54a5d2bed Upgrade Apply Force at location and Apply Impulse at location to include object rotation 2020-08-28 03:14:49 +02:00
Moritz Brückner 3bbceda485 Add sampler2D access to ShaderData node 2020-08-27 23:22:24 +02:00
Alexander 495d485f39 Add lightmapping props to object, register lightmapper 2020-08-24 22:12:31 +02:00
Alexander 5d914b3bf5 Merge lightmapper 0.3.1.2 2020-08-23 23:13:26 +02:00
Moritz Brückner e785ee020c Better lz4 error handling 2020-08-20 22:58:10 +02:00
Moritz Brückner 3c6f853605 Port lz4 compression from Armorpaint 2020-08-20 22:34:52 +02:00
Lubos Lenco 0d6422f77a
Merge pull request #1809 from Sanva/master
Fixes wrong `rsplit` usages trying to discard file extensions
2020-08-19 19:04:22 +02:00
Lubos Lenco db6c621ccc
Merge pull request #1810 from MoritzBrueckner/shaderdata-node
Add ShaderData node for easier uniform and input access
2020-08-19 19:04:08 +02:00
Moritz Brückner df5e35663a Add ShaderData node 2020-08-19 17:20:41 +02:00
Moritz Brückner e2e0fd74bf Remove uniform support from attribute node 2020-08-19 17:14:30 +02:00
Moritz Brückner 8d8526a389 Shader export: don't add duplicate ins/out/includes 2020-08-19 17:12:58 +02:00
Valentín Barros 61b2d008e3 Fixes wrong rsplit usages trying to discard file extensions [fixes #1805]
Otherwise would fail if path contained any other dot.
2020-08-19 09:28:07 +02:00
Lubos Lenco e8cd02e610
Merge pull request #1808 from MoritzBrueckner/attribute-node-uniforms
Add shader uniform support for the attribute node
2020-08-18 20:49:10 +02:00
Moritz Brückner 7c13f74454 Add shader uniform support for the attribute node 2020-08-18 20:28:12 +02:00
Lubos Lenco 0686fc687b
Merge pull request #1797 from MoritzBrueckner/copy-traits
Add CopyTraitsFromActive operator
2020-08-11 08:02:04 +02:00
Moritz Brückner baddcfaacc Add missing draw_view3d_object_menu 2020-08-10 14:42:42 +02:00
Moritz Brückner e8c67fcb46 Remove unused format string 2020-08-10 14:39:21 +02:00
Moritz Brückner eeb1d9e3ab Add CopyTraitsFromActive operator 2020-08-10 00:23:26 +02:00
Moritz Brückner 56f6d44651 props_traits.py: clean up imports 2020-08-10 00:19:15 +02:00
Moritz Brückner c373f53599 Fix update_trait_group() when object is already in trait collection 2020-08-10 00:18:27 +02:00
Moritz Brückner e193b3dae2 Proxy: fix sync_collection() for multiple same entries + add clear_dst option 2020-08-10 00:14:57 +02:00
Lubos Lenco ebce14419b
Merge pull request #1795 from MoritzBrueckner/copy-rigidbody
Copy Armory rigid body settings on Copy from Active
2020-08-09 21:06:23 +02:00
Moritz Brückner e8e07f4e41 on_operator_post: add warning to docstring 2020-08-09 02:22:13 +02:00
Moritz Brückner 11f3f6da62 Copy Armory rigid body settings on Copy from Active 2020-08-09 02:08:11 +02:00
Lubos Lenco 1503d10a30
Merge pull request #1794 from Sanva/master
Use `bullet.Bt.CollisionObjectActivationState`
2020-08-08 19:42:12 +02:00
Lubos Lenco cfc107c506
Merge pull request #1793 from knowledgenude/master
Set logic nodes icons to none
2020-08-08 19:41:26 +02:00
Valentín Barros 476ec0aa49 Use bullet.Bt.CollisionObjectActivationState [see #1731] 2020-08-08 10:50:24 +02:00
knowledgenude a89c2fbe44
Set logic nodes icons to none (5) 2020-08-07 14:07:51 -03:00
knowledgenude 6d9a766db6
Set logic nodes icons to none (4) 2020-08-07 14:05:48 -03:00
knowledgenude feb9598bd1
Set logic nodes icons to none (3) 2020-08-07 14:03:29 -03:00
knowledgenude f7c8b2212e
Set logic nodes icons to none (2) 2020-08-07 14:00:46 -03:00
knowledgenude d75238e95f
Set logic nodes icons to none (1) 2020-08-07 13:58:19 -03:00
Lubos Lenco f6bdcd0a65
Merge pull request #1788 from MoritzBrueckner/operator-search
Remove some operators from op search menu + code cleanup
2020-08-06 11:39:50 +02:00
Moritz Brückner e746941874 Add annotation 2020-08-04 14:30:05 +02:00
Moritz Brückner 2cde35b6ef Remove some operators from op search menu + code cleanup 2020-08-04 14:19:09 +02:00
luboslenco 286e7b7b4b Bump version 2020-08-02 18:23:20 +02:00
Lubos Lenco ef7ca82978
Merge pull request #1777 from Simonrazer/master
UI for quick Node variable access
2020-07-28 08:15:28 +02:00
Simonrazer fc0cce489b
remove unnecessary property 2020-07-25 20:49:41 +02:00
Simonrazer 06a6324002
typos 2020-07-25 15:13:44 +02:00
Simonrazer 66d7b1c954
Update nodes_logic.py 2020-07-25 15:09:22 +02:00
Lubos Lenco c7e458e9e2
Merge pull request #1775 from Sanva/master
Fixes `PhysicsConstraint.init` `Generic6DofConstraint` usage for Hashlink
2020-07-22 16:33:13 +02:00
Valentín Barros c5efe96f6f Fixes PhysicsConstraint.init Generic6DofConstraint usage for Hashlink. 2020-07-22 10:27:16 +02:00
luboslenco fbe144decc Fix material id access in deferred light 2020-07-20 23:15:36 +02:00
Lubos Lenco ded83d16a1
Merge pull request #1770 from MoritzBrueckner/receive-shadow
Implement "receive shadow" setting for mobile path + all light types
2020-07-15 14:09:07 +02:00
Moritz Brückner dac91efeb1 Fix indentation (spaces -> tabs) 2020-07-13 23:36:49 +02:00
Moritz Brückner 3654d34997 Update more shaders for receive shadow option 2020-07-13 23:28:43 +02:00
Moritz Brückner 9a47d77594 Implement receive shadow setting for mobile path + all light types 2020-07-13 23:20:58 +02:00
Lubos Lenco c765561ca6
Merge pull request #1768 from MoritzBrueckner/fix-subpkg
Fix fetching scripts from sub-packages
2020-07-12 22:00:01 +02:00
Lubos Lenco 8bb94253d0
Merge pull request #1767 from MoritzBrueckner/fix-on-contact
Fix OnContactNode
2020-07-12 21:59:07 +02:00
Moritz Brückner d18a9917aa Fix sub-package export 2020-07-12 16:08:52 +02:00
Moritz Brückner 26bdba9092 Fix fetching scripts from sub-packages 2020-07-12 15:36:18 +02:00
Moritz Brückner 8e60ff4851 Fix OnContactNode 2020-07-12 00:17:29 +02:00
Lubos Lenco 3f6ed7ed5c
Merge pull request #1763 from MoritzBrueckner/fix-set-scene-node
Fix SetSceneNode when using json export
2020-07-10 09:41:48 +02:00
Lubos Lenco 18f685deb0
Merge pull request #1764 from MoritzBrueckner/fix-log
log.py fixes
2020-07-10 09:33:22 +02:00
Lubos Lenco 7eb122b2b3
Merge pull request #1766 from MoritzBrueckner/fix-probes
Fix write_probes() on Windows
2020-07-10 09:32:03 +02:00
Moritz Brückner c666b965b9 Fix write_probes() on Windows
Thanks to @Simonrazer for reporting this
2020-07-09 18:46:42 +02:00
Moritz Brückner e7d28ba1c6 log.py: don't override user console settings 2020-07-08 13:48:19 +02:00
Moritz Brückner 4ca340024a Fix logger usage 2020-07-07 22:43:51 +02:00
Moritz Brückner a3223ee455 Cleanup log.py 2020-07-07 22:43:20 +02:00
Moritz Brückner 0c9752a89a Fix logging colors on Windows
See:
- https://docs.microsoft.com/en-us/windows/console/setconsolemode
- https://docs.microsoft.com/en-us/windows/console/getstdhandle
2020-07-07 22:42:54 +02:00
Lubos Lenco 83f881878f
Merge pull request #1762 from MoritzBrueckner/compo-flags
Print compositor flags on export
2020-07-07 22:37:23 +02:00
Moritz Brückner 156030075a Fix SetSceneNode when using json export 2020-07-07 21:06:24 +02:00
Moritz Brückner 29a0b5632b Print compositor flags on export 2020-07-07 17:03:07 +02:00
Lubos Lenco 78aec97c95
Merge pull request #1744 from MoritzBrueckner/world-export
Multi-world support
2020-07-07 11:07:25 +02:00
Lubos Lenco 065ef68f3a
Merge pull request #1759 from tong/fix-starter-null-var
Fix initialize var to null
2020-07-07 07:27:37 +02:00
tong 1f0a27bae0 Initialize 0 2020-07-06 23:44:04 +02:00
Moritz Brückner 27b3aa5f49 Fix renderpaths for scenes without a world 2020-07-06 22:53:31 +02:00
Moritz Brückner 22371ec37e Remove unused import 2020-07-06 18:16:58 +02:00
Moritz Brückner d06f07f2cf Update renderpath skydome drawing to Iron changes 2020-07-06 18:14:58 +02:00
Moritz Brückner b994b1d575 Remove cloud constants from compiled.inc 2020-07-06 18:14:15 +02:00
Moritz Brückner 01e3395d18 Implement irradiance for static background images 2020-07-06 18:04:35 +02:00
Moritz Brückner 60b4f5b42d Cleanup probe export 2020-07-06 18:04:18 +02:00
Moritz Brückner 068fe0fada Remove replaced world_pass 2020-07-06 17:10:29 +02:00
Moritz Brückner 8afc3c43e3 Fix world export when another blend file was opened before 2020-07-06 16:58:52 +02:00
Moritz Brückner ae07dab862 Renderpaths: load new world shaders 2020-07-05 23:30:55 +02:00
Moritz Brückner 5be18db472 Reset wrd.world_defs for each export 2020-07-05 18:13:17 +02:00
tong 313bbbfa84 Initialize var to null 2020-07-05 13:25:10 +02:00
Lubos Lenco be6dad2682
Merge pull request #1758 from tong/fix-object-prop-not-set
Fix unset object prop
2020-07-05 10:35:38 +02:00
tong 9389c5f44d Fix unset object prop 2020-07-04 23:02:33 +02:00
Lubos Lenco bf96cd5f1c
Merge pull request #1755 from tong/fix-softbody-export
Fix softbody export
2020-07-03 09:10:07 +02:00
Moritz Brückner 128622c96d Remove unused argument 2020-07-03 01:08:50 +02:00
tong 8d07d6290e Fix param name 2020-07-02 18:37:29 +02:00
Moritz Brückner 0bb4bfd11a Reimplement _EnvTransp 2020-07-01 21:36:15 +02:00
Moritz Brückner 73bbc3cf20 Cleanup world shader generation 2020-07-01 21:36:03 +02:00
Moritz Brückner fb5ac23f7e Revert "Remove not used world generation callback"
This reverts commit d9231f6f9a.
2020-07-01 21:13:40 +02:00
Moritz Brückner d9231f6f9a Remove not used world generation callback 2020-07-01 21:11:25 +02:00
Moritz Brückner 70b0219a05 Reorganize imports and remove unused ones 2020-07-01 21:06:02 +02:00
Moritz Brückner d0e9369947 Revert water/fog UI and remove now unused properties 2020-07-01 20:57:01 +02:00
Moritz Brückner 2ff0496908 Per world environment maps + LDR support 2020-07-01 20:19:07 +02:00
Moritz Brückner 8e66ade354 Fix and reimplement static background images 2020-07-01 20:09:49 +02:00
Lubos Lenco 1aded8a9f9
Merge pull request #1752 from Sanva/master
Fixed `armory.trait.PhysicsDrag.update` for Hashlink [fixes #1730]
2020-07-01 09:32:39 +02:00
Valentín Barros 34a6a428d2 Fixed armory.trait.PhysicsDrag.update for Hashlink [fixes #1730]
Just enabling the same code used for JavaScript.
2020-07-01 09:26:05 +02:00
luboslenco 7f4a2788cc Bump version 2020-06-30 22:49:15 +02:00
Lubos Lenco 024568d675
Merge pull request #1750 from tong/cmft-silent-param
CMFT: add --silent param if arm_verbose_output is not set
2020-06-30 22:20:08 +02:00
tong 7dec8e004c CMFT: add --silent param if not arm_verbose_output 2020-06-30 17:02:57 +02:00
Lubos Lenco e9bd442386
Merge pull request #1747 from Sanva/master
Fixed `armory.trait.physics.bullet.PhysicsWorld.rayCast` for Hashlink.
2020-06-29 16:19:13 +02:00
Valentín Barros f89ac4ba7d Fixed armory.trait.physics.bullet.PhysicsWorld.rayCast for Hashlink.
Just enabling the same code used for C++.
2020-06-29 12:44:21 +02:00
Moritz Brückner 89fa3e8314 Reimplement clouds 2020-06-28 22:45:54 +02:00
Lubos Lenco 9b80b426e5
Merge pull request #1746 from tong/cmft-threads-cpu
CMFT use all available cpus
2020-06-28 21:53:58 +02:00
Moritz Brückner 1d0c96db11 Code cleanup and other small improvements 2020-06-28 20:47:40 +02:00
tong 702588b0c4 CMFT use available cpus 2020-06-28 20:32:08 +02:00
Moritz Brückner 1aef57581a Reimplement hosek wilkie sky generation 2020-06-28 20:27:09 +02:00
Moritz Brückner 32613312b3 Add newline after shader functions 2020-06-28 20:26:05 +02:00
Moritz Brückner e6cca30b53 Get background colors working 2020-06-28 20:08:05 +02:00
Moritz Brückner 180c6065a6 Fix shader names 2020-06-28 20:07:48 +02:00
Moritz Brückner 620cb1f26e Custom shader names in shader make functions 2020-06-28 20:06:38 +02:00
Moritz Brückner 0f99b4a627 Fix world shader export so that drawing finally works 2020-06-28 19:36:14 +02:00
Lubos Lenco 323e40059b
Merge pull request #1745 from tong/optimize-pp-callback
Replace if conditions with switch
2020-06-27 16:20:23 +02:00
tong 11a3358879 Replace if conditions with switch 2020-06-27 15:59:53 +02:00
Moritz Brückner d2a2023480 Make world shader data export working 2020-06-26 22:27:46 +02:00
Lubos Lenco effd982afa
Merge pull request #1742 from tong/fix-verbose-mode
Add haxe --times flag on verbose not debug_console
2020-06-25 14:22:31 +02:00
tong c89a40da85 Add haxe --times flag on verbose not debug_console 2020-06-25 13:02:56 +02:00
Lubos Lenco 48e0ca9d2e
Merge pull request #1741 from tong/fix-node-item-import
Fix NodeItem import
2020-06-25 12:32:47 +02:00
tong a91cf665e7 Add missing import 2020-06-25 12:14:57 +02:00
Moritz Brückner 1a12ee280a Export world shader data file 2020-06-24 00:18:39 +02:00
Moritz Brückner 729c2ddc13 Begin with world shader generation 2020-06-22 22:37:21 +02:00
Moritz Brückner 569d139e4e Replace some wrd defs by individual word defs 2020-06-22 22:03:02 +02:00
Moritz Brückner 1152b99e10 Fix non-material shader export by swapping evaluation order 2020-06-22 21:56:21 +02:00
Lubos Lenco 0c9f65ee0b
Merge pull request #1735 from MoritzBrueckner/layout-nodes
Add reroutes and frames to add node menu
2020-06-19 12:14:32 +02:00
Moritz Brückner e691e8b5f2 Cleanup make_world.py 2020-06-18 15:38:14 +02:00
Moritz Brückner 42393e34a8 Cleanup world export 2020-06-18 15:36:34 +02:00
Moritz Brückner 85a9340764 Add reroutes and frames to add node menu 2020-06-18 14:15:34 +02:00
Lubos Lenco d81a2eacd1
Merge pull request #1733 from tong/static-analyzer-compat
Fix building with analyzer-optimize enabled
2020-06-18 13:39:50 +02:00
tong 0401033362 Fix ammo lib loading 2020-06-17 19:13:43 +02:00
Lubos Lenco bb8a92bc4a
Merge pull request #1732 from tong/improve-fetch-script-names
Improve fetch script names
2020-06-15 10:04:03 +02:00
tong a7f9acd606 Use regexp to validate haxe module name 2020-06-14 23:04:49 +02:00
tong 5ff56e6464 Filter haxe modules with invalid names 2020-06-14 21:08:06 +02:00
Lubos Lenco 11de7a8062
Merge pull request #1729 from MoritzBrueckner/bool-socket-fix
Fix boolean node sockets
2020-06-11 23:29:33 +02:00
Moritz Brückner 4f5d8a83d3 Fix boolean node sockets 2020-06-11 22:51:38 +02:00
Lubos Lenco 9b0836559f
Merge pull request #1728 from MoritzBrueckner/custom-sockets
Implement custom default values for custom node sockets
2020-06-11 11:31:54 +02:00
Moritz Brückner 740b84db41 Cleanup build_default_node() 2020-06-10 14:39:21 +02:00
Moritz Brückner 85411312d7 Implement custom default values for custom node sockets 2020-06-10 14:25:01 +02:00
Lubos Lenco 057fbdb05d
Merge pull request #1727 from tong/term-colors
Colored terminal output
2020-06-09 09:18:20 +02:00
tong b75e19e88a Disable terminal colors on windows < 10 2020-06-08 13:32:06 +02:00
tong 107c61ad3e Colored terminal output 2020-06-08 12:26:17 +02:00
Lubos Lenco 2b921fa616
Merge pull request #1726 from MoritzBrueckner/nodes
Node socket improvements
2020-06-08 12:12:27 +02:00
Moritz Brückner 1dfc777f2b Add CustomSocket node socket type 2020-06-08 08:49:21 +02:00
Moritz Brückner 3cd6ab1331 Escape '"' in logic node strings 2020-06-07 20:02:07 +02:00
Lubos Lenco bc2ecab27c
Merge pull request #1724 from tong/js-syntax
Replace __js__ with Syntax.code
2020-06-06 12:20:42 +02:00
tong 807497daf3 Replace __js__ with Syntax.code 2020-06-05 10:53:57 +02:00
Lubos Lenco e82c9250cd
Merge pull request #1723 from MoritzBrueckner/vector-reflect
Implement "reflect" operation for VectorMathNode
2020-06-05 10:45:03 +02:00
Lubos Lenco a83360fd1d
Merge pull request #1722 from MoritzBrueckner/fix-particles
Fix multi-usage of particle systems
2020-06-05 10:44:48 +02:00
Moritz Brückner 2e398c96ba Implement "reflect" operation for VectorMathNode 2020-06-04 22:19:02 +02:00
Moritz Brückner dd72b2dd18 Fix multi-usage of particle systems 2020-06-04 22:15:41 +02:00
luboslenco 12cdd57748 Bump version 2020-05-30 22:50:41 +02:00
Lubos Lenco 068abc3464
Merge pull request #1715 from tong/debug-console-format-output
Proper debug console log output formatting
2020-05-24 19:04:38 +02:00
tong 6c94354da6 Proper debug console log output formatting 2020-05-24 18:28:53 +02:00
Lubos Lenco 7f6592ef39
Merge pull request #1712 from tong/custom-play-scene
Allow to set custom play scene
2020-05-23 13:37:07 +02:00
tong bba3b924c0 Allow to set custom play scene 2020-05-23 12:18:07 +02:00
Lubos Lenco ad3d3c63e6
Merge pull request #1711 from MoritzBrueckner/background-mode
Fix for running blender in background mode
2020-05-21 21:26:35 +02:00
Moritz Brückner 2b5ca912fb Fix for running blender in background mode 2020-05-21 12:01:21 +02:00
Lubos Lenco 86e07cf9c0
Merge pull request #1705 from MoritzBrueckner/master
Big PlaySoundRawNode update
2020-05-16 12:15:00 +02:00
Moritz Brückner 03490e44e3 Play Sound node: run "done" on stop 2020-05-16 00:42:12 +02:00
Moritz Brückner 5382399b70 Add retrigger option to Play Sound node 2020-05-16 00:28:52 +02:00
Moritz Brückner 18ebd3444f PlaySoundRawNode: add pause/stop functionality 2020-05-16 00:21:10 +02:00
Moritz Brückner 49c5b1b129 Change PlaySoundRawNode icon
Does this even show up in the UI?
2020-05-15 23:37:18 +02:00
Moritz Brückner 55ce26c02f PlaySoundRawNode: add loop option 2020-05-15 23:32:48 +02:00
Moritz Brückner 4fa9d8b980 Add optional sample rate setting to PlaySoundRawNode 2020-05-15 23:22:41 +02:00
Moritz Brückner 9f4a0344fe Fix boolean type node properties 2020-05-15 23:22:04 +02:00
Lubos Lenco 4a856fbeea
Merge pull request #1702 from MoritzBrueckner/canvas-element-node
Refactor OnCanvasElementNode and add hover listener
2020-05-15 16:47:04 +02:00
Moritz Brückner 1d82747fbc onCanvasElementNodes can now listen to hover events 2020-05-14 17:34:39 +02:00
Moritz Brückner c820b4ddc2 onCanvasElementNode: massive performance improvement + better variable names 2020-05-14 17:29:02 +02:00
Moritz Brückner 8cc5d07ad6 Fix onCanvasElement node when Zui is disabled 2020-05-14 17:23:36 +02:00
Lubos Lenco a5aa5a13f2
Merge pull request #1694 from QuantumCoderQC/master
Fixed issue where element is not visible
2020-05-13 08:45:53 +02:00
QuantumCoderQC c056e996f1 Fixed issue where element is not visible 2020-05-13 02:31:41 +02:00
Lubos Lenco 8b202a7d51
Merge pull request #1691 from MoritzBrueckner/particles
Particles: implement render emitter option & fix linked instance objects
2020-05-12 08:47:06 +02:00
Moritz Brückner 133dfe1510 Cleanup particle system export 2020-05-11 17:35:21 +02:00
Moritz Brückner 0d55749f1f Fix linked particle instances 2020-05-11 17:30:00 +02:00
Moritz Brückner 5aede77e23 Implement render emitter option 2020-05-11 17:29:46 +02:00
Lubos Lenco 9325edbe34
Merge pull request #1548 from ForestCSharp/master
lights wouldn't render at all if use_shadow / cast_shadow was unchecked
2020-05-11 09:31:00 +02:00
Lubos Lenco e30a8c7f46 Metal fixes 2020-05-11 09:03:13 +02:00
Lubos Lenco a05ab6d855
Merge pull request #1690 from tong/write-mainhx
Generate Main.projectVersion
2020-05-11 09:02:29 +02:00
tong 413406f3d3 Generate Main.projectVersion 2020-05-10 21:25:01 +02:00
Lubos Lenco c970c5db6c Pass irradiance uniform as argument 2020-05-10 19:43:02 +02:00
luboslenco a68a050ed6 Set shader version 2020-05-10 10:52:44 +02:00
luboslenco b0cd02d68e Allow multiple color attachment formats 2020-05-10 10:46:12 +02:00
Lubos Lenco df6346c1d1 Color attachment format 2020-05-06 21:30:59 +02:00
Lubos Lenco 967f69b24a Color attachment format 2020-05-06 18:11:02 +02:00
Lubos Lenco 9a71b5b664 World pass cleanup 2020-05-05 21:33:15 +02:00
Lubos Lenco ede8a0f2d3 Improve metal gapi detect 2020-05-05 09:54:24 +02:00
Lubos Lenco 66e9572554 Add clear pass for metal 2020-05-04 23:08:47 +02:00
Lubos Lenco 61ff96786f Metal fixes 2020-05-04 00:19:11 +02:00
Lubos Lenco baac97fb17
Merge pull request #1685 from kennylerma/master
Corrected missing 'tex' and 'tex1' for custom materials/shaders
2020-05-03 17:03:26 +02:00
Kenny Lerma 0cb0720b2a Corrected missing 'tex' and 'tex1' for custom materials/shaders 2020-05-02 08:23:15 -05:00
luboslenco 8cb8722546 Bump version 2020-05-02 14:35:43 +02:00
Lubos Lenco 495e480d1a
Merge pull request #1682 from MoritzBrueckner/irradiance-export
Fix irradiance export
2020-05-02 13:58:45 +02:00
Moritz Brückner 3aaf792871 Whitespace cleanup 2020-04-28 21:45:02 +02:00
Moritz Brückner 89c2290c15 Fix irradiance export when arm_minimize is false 2020-04-28 21:44:48 +02:00
Lubos Lenco f991a814cd
Merge pull request #1679 from Sanva/master
Added `CanvasScript.setUiScale` method.
2020-04-28 09:11:29 +02:00
Lubos Lenco 1671a88104
Merge pull request #1678 from MoritzBrueckner/mapping-node
Fix compiling for multiple mapping nodes
2020-04-28 09:10:01 +02:00
Valentín Barros 9cb88c111a Added CanvasScript.setUiScale method.
It sets the scale factor for the UI elements.
2020-04-27 12:00:59 +02:00
Moritz Brückner fbf3ce813b Fix compilation for multiple mapping nodes 2020-04-27 09:23:02 +02:00
Lubos Lenco 5575ea5f12
Merge pull request #1675 from MoritzBrueckner/value-node
Fix value node when used with material params
2020-04-24 16:02:19 +02:00
Moritz Brückner b58fab598c Fix value node when used with material params 2020-04-23 11:43:01 +02:00
Lubos Lenco e42279b737
Merge pull request #1672 from MoritzBrueckner/rotation-node
Fix SetRotation Node when vector input is null
2020-04-20 17:02:47 +02:00
Moritz Brückner 9ebf4577ca Fix SetRotation Node when vector input is null 2020-04-19 17:25:08 +02:00
Lubos Lenco dadbace806
Merge pull request #1671 from MoritzBrueckner/colorramp
Fix and refactor the colorramp node (+ more)
2020-04-19 12:09:03 +02:00
Moritz Brückner 1e4d94a77e Fix docstring 2020-04-18 22:18:38 +02:00
Moritz Brückner e3d4854546 Some code cleanup 2020-04-18 21:52:56 +02:00
Moritz Brückner c4b6d835f7 Fix and refactor colorramp node 2020-04-18 21:52:38 +02:00
Moritz Brückner 546eea9f27 Automatically convert color/vector inputs to BW when connected to a float input 2020-04-18 21:50:07 +02:00
Moritz Brückner 4859034375 Fix uncommited import 2020-04-18 21:46:56 +02:00
Moritz Brückner 34d23dc42e Store Value node outputs as const 2020-04-18 21:39:06 +02:00
Moritz Brückner ce245d3ec8 PEP8 + type annotations for write_result() and res_var_name() 2020-04-18 21:38:35 +02:00
Moritz Brückner 146c890349 New Shader.add_const() method to add global constants 2020-04-18 21:26:45 +02:00
Lubos Lenco 2002414f7a
Merge pull request #1668 from MoritzBrueckner/fix-canvas-visible-node
CanvasSetVisibleNode: Fix exception when the element doesn't exist
2020-04-18 16:58:24 +02:00
Lubos Lenco dceeb55519
Merge pull request #1667 from MoritzBrueckner/walk-navigation
WalkNavigation: set flying speed via mouse wheel
2020-04-18 16:57:55 +02:00
Lubos Lenco 78caf8be20
Merge pull request #1665 from MoritzBrueckner/refactor-exporter
Refactor exporter + huge cleanup
2020-04-18 16:55:18 +02:00
Moritz Brückner 4e8b99637a Fix exception when the element cannot be found
Related to https://github.com/armory3d/armory/issues/1659
2020-04-18 01:20:25 +02:00
Moritz Brückner 275784fd76 WalkNavigation: set flying speed via mouse wheel 2020-04-18 01:02:45 +02:00
Lubos Lenco b206c4e0ad
Merge pull request #1663 from QuantumCoderQC/master
OnCanvasElement node now takes into account anchoring points.
2020-04-17 09:41:36 +02:00
Moritz Brückner be8a1b49b1 Fix missing import 2020-04-17 00:58:26 +02:00
Moritz Brückner 930e371419 Fix animation export 2020-04-17 00:37:25 +02:00
Moritz Brückner f848ec4ffc Fix scene trait export 2020-04-17 00:32:39 +02:00
Moritz Brückner ce96f19be1
Merge branch 'master' into refactor-exporter 2020-04-16 23:48:32 +02:00
Moritz Brückner e288f328e7 More type annotations 2020-04-16 23:14:49 +02:00
Moritz Brückner 94efb17b15 Cleanup softbody/hook export 2020-04-16 23:09:48 +02:00
Moritz Brückner fcf1928002 Cleanup scene trait export 2020-04-16 22:51:22 +02:00
Moritz Brückner fac393bed8 Refactor/Cleanup animation export 2020-04-16 22:35:29 +02:00
Moritz Brückner 3d1513d09d Remove unused method 2020-04-16 22:28:41 +02:00
Moritz Brückner 70f1d992de Performance improvement by direct list initialization 2020-04-16 00:50:03 +02:00
Moritz Brückner f50feb5042 Cleanup export_traits() 2020-04-16 00:39:28 +02:00
Moritz Brückner c6bfad710c utils.py: add docstring + annotations to safestr() 2020-04-16 00:34:03 +02:00
Moritz Brückner 2e8250263a Smaller improvements 2020-04-16 00:11:09 +02:00
Moritz Brückner 3d27723ab8 Cleanup create_default_camera() 2020-04-16 00:10:44 +02:00
Moritz Brückner a51c508e84 Better output data variable names 2020-04-16 00:01:46 +02:00
Moritz Brückner 995d1595e5 Refactor export_light() 2020-04-15 23:53:19 +02:00
Moritz Brückner 182c076001 Cleanup export_skin() 2020-04-15 23:46:34 +02:00
Moritz Brückner 5cf8792871 Cleanup mesh export 2020-04-15 23:40:05 +02:00
Moritz Brückner 849b29a644 Cleanup export_object() 2020-04-15 23:34:30 +02:00
Moritz Brückner 2e0af4bd4f More type annotations 2020-04-15 23:18:40 +02:00
QuantumCoderQC 91988372fd OnCanvasElement node now takes into account anchoring points 2020-04-15 20:15:36 +02:00
QuantumCoderQC d815a5fc98 OnCanvasElement node now takes into account anchoring point 2020-04-14 20:07:44 +02:00
Lubos Lenco e4102c9c50
Merge pull request #1654 from MoritzBrueckner/misc
A bunch of really small improvements
2020-04-13 16:08:30 +02:00
Lubos Lenco 7f1fa97207
Merge pull request #1653 from MoritzBrueckner/array-add
Refactor ArrayAdd node + fix Vector node
2020-04-13 16:08:11 +02:00
Moritz Brückner 42a458bbac Cleanup terrain export 2020-04-12 21:46:21 +02:00
Moritz Brückner eba49ef2f7 Refactor material variant generation 2020-04-12 21:36:10 +02:00
Moritz Brückner c7ea971ffb Fix find_bone annotations 2020-04-12 21:27:01 +02:00
Moritz Brückner deba93d3da Refactor bone processing 2020-04-12 21:16:16 +02:00
Moritz Brückner c631676dcd Fix exporter again 2020-04-12 20:59:52 +02:00
Moritz Brückner a5b6a2308e Refactor process_bobject(), process_bone() and parts of execute() 2020-04-12 20:44:49 +02:00
Moritz Brückner 2d309c042e Fix exporter (editor mistake) 2020-04-12 20:09:15 +02:00
Moritz Brückner 22faa147b2 Fix possible error with sublime text project generation 2020-04-12 20:05:03 +02:00
Moritz Brückner da07e72127 Add icon for "Open Editor" operator 2020-04-12 20:04:28 +02:00
Moritz Brückner 3b1437aca5 Fix debug console look (again) 2020-04-12 20:04:16 +02:00
Moritz Brückner 9f99f05db4 Smaller improvements and more type annotations 2020-04-12 20:03:27 +02:00
Moritz Brückner 247e0b4c3b Refactor ArrayAddNode + combine it with ArrayAddUnique 2020-04-12 17:33:27 +02:00
Moritz Brückner a4dba65a7a "Fix" vector node 2020-04-12 17:32:52 +02:00
Lubos Lenco 290493a4f7
Merge pull request #1649 from MoritzBrueckner/mapping-node
Refactor and fix mapping node
2020-04-12 11:34:10 +02:00
Lubos Lenco f446c0a009
Merge pull request #1650 from MoritzBrueckner/array-loop
Fix ArrayLoopNode socket (dynamic value) + add "Index" output
2020-04-12 11:33:19 +02:00
Lubos Lenco 6abaacd907
Merge pull request #1651 from QuantumCoderQC/master
Added set checkbox and OnCanvasElement Node
2020-04-12 11:30:36 +02:00
Lubos Lenco 26aa9956a2
Merge pull request #1652 from RLP9GHR60I/iss1256
Add "Has contact (Array)" node
2020-04-12 11:29:17 +02:00
Daniel B. Bruno 4a3d3a58d6 Add "Has contact (Array)" node
This node was requested on issue #1256.
2020-04-11 17:57:21 -03:00
Moritz Brückner f5c624895a Cherry Pick "Add "fake user" setting for traits"
# Resolved Conflicts:
#	blender/arm/exporter.py
2020-04-11 21:01:39 +02:00
QuantumCoderQC dda2396313 Added set checkbox and OnCanvasElement Node 2020-04-11 18:33:53 +02:00
Moritz Brückner a9d2a10d0b Fix ArrayLoopNode socket (dynamic value) + add "Index" output 2020-04-11 17:49:17 +02:00
Moritz Brückner 6a16cebadf Refactor mapping node 2020-04-11 16:44:06 +02:00
Lubos Lenco 0ac46b3bb5
Merge pull request #1648 from MoritzBrueckner/proxy-traits
Proxy: Add option to keep local trait properties when syncing
2020-04-11 16:21:15 +02:00
Lubos Lenco 736ec92592
Merge pull request #1647 from MoritzBrueckner/lod
Fix lod deletion
2020-04-11 16:19:08 +02:00
Lubos Lenco 82cee159f4
Merge pull request #1646 from MoritzBrueckner/trait-fake-user
Add "Fake User" setting for traits + reorder trait UI
2020-04-11 16:17:43 +02:00
Moritz Brückner c3eac025b3 Small improvements + fix for multiple traits per object 2020-04-11 14:22:22 +02:00
Moritz Brückner df30e9b681 Set arm_proxy_sync_trait_props to False by default 2020-04-10 23:10:01 +02:00
Moritz Brückner b1572e316e Proxy: Add option to keep local trait properties when syncing 2020-04-10 23:06:37 +02:00
Moritz Brückner af8a7615b3 Fix lod deletion 2020-04-10 21:46:28 +02:00
Moritz Brückner c9b89e6036 Reorder trait UI 2020-04-10 20:44:35 +02:00
Moritz Brückner 403e52109c Add "fake user" setting for traits 2020-04-10 20:43:59 +02:00
Moritz Brückner eefcefbf91 Static initialization for some variables 2020-04-10 19:38:28 +02:00
Moritz Brückner 3882c56fc4 Replace "==/!= None" with "is/is not None" 2020-04-10 19:25:34 +02:00
Moritz Brückner b5b8c4f993 Fix last commit 2020-04-10 19:22:56 +02:00
Moritz Brückner 3593092c59 Remove "== True" and replace "== False" with "not" 2020-04-10 19:21:52 +02:00
Lubos Lenco f3fabd7d7c
Merge pull request #1645 from Sandy10000/master
fix https://github.com/armory3d/armory/issues/1576
2020-04-10 15:54:59 +02:00
Sandy 7541ca86a2
fix https://github.com/armory3d/armory/issues/1576 2020-04-10 21:22:04 +09:00
Moritz Brückner d4974d1340 Change methods to staticmethods or classmethods if possible
+ some small style improvements
2020-04-10 01:56:12 +02:00
Moritz Brückner 3d1f65071c Fix type hint (again) 2020-04-10 01:26:54 +02:00
Moritz Brückner 7e5342ef8d Replace Python 3.5 annotations with Python 3.6 annotations 2020-04-10 01:20:08 +02:00
Moritz Brückner 754cb501ca snake_case for ArmoryExporter member variables
Also removed some unused variables
2020-04-10 01:18:10 +02:00
Moritz Brückner caee1a87a2 Small performance improvement 2020-04-10 01:09:34 +02:00
Moritz Brückner 0e4c9f9f18 Improve docstring 2020-04-10 01:03:41 +02:00
Moritz Brückner 5859b11c2e Fix type annotation 2020-04-10 00:57:54 +02:00
Moritz Brückner f5b37f99aa Transform exporter into class (one instance per scene)
This has two big advantages:
- One place for variable initialization (and less warnings from pylint etc.)
- No errors due to forgotten cleanups because every scene export now has its own class instance
2020-04-10 00:56:16 +02:00
Moritz Brückner d7e6ec1a79 Fix write_matrix() 2020-04-10 00:48:49 +02:00
Moritz Brückner 6e3f3dca98 More type annotations 2020-04-10 00:30:16 +02:00
Moritz Brückner a18c87c392 Make write_matrix static 2020-04-10 00:23:03 +02:00
Moritz Brückner 37e4bc9f85 Some smaller style improvements 2020-04-09 23:53:03 +02:00
Moritz Brückner 4a2ed852b5 Rename struct_identifier + change it to tuple to make it clear it is a constant 2020-04-09 23:52:29 +02:00
Moritz Brückner 6daf501eeb Move get_bobject_type() into NodeTyp enum 2020-04-09 23:51:33 +02:00
Moritz Brückner 0a23241735 Remove unused constants 2020-04-09 23:50:36 +02:00
Moritz Brückner 8d23458f92 Fix process_bone() 2020-04-09 23:42:52 +02:00
Moritz Brückner eae4747bce Replace NodeType[...] with enum 2020-04-09 23:40:18 +02:00
Moritz Brückner f836e9a1a4 export_object(): pep8 cleanup 2020-04-09 23:25:26 +02:00
Moritz Brückner 6deedd7b35 Add type annotations to export_object() 2020-04-09 23:19:07 +02:00
Lubos Lenco 3edccefddf
Merge pull request #1639 from Sandy10000/master
Mark return value for CanvasGetPosition nodes
2020-04-09 15:31:13 +02:00
Lubos Lenco 177f1f59a7
Merge pull request #1642 from MoritzBrueckner/fix-camera
Fix camera export when multiple scenes are exported
2020-04-09 15:30:45 +02:00
Lubos Lenco 66bfce79a1
Merge pull request #1643 from MoritzBrueckner/fix-asset-export
Better asset name conflict detection + use log.warn() for warnings
2020-04-09 15:30:15 +02:00
Lubos Lenco b5c0154062
Merge pull request #1644 from MoritzBrueckner/debug-console
Fix debug console
2020-04-09 15:29:56 +02:00
Moritz Brückner 08b690adf8 DebugConsole: Fix outliner look 2020-04-09 00:21:35 +02:00
Moritz Brückner f242e0316e Fix debug console for scenes with no world 2020-04-09 00:20:54 +02:00
Moritz Brückner 2f3bcbf8c6 Better asset name conflict detection + use log.warn() for warnings 2020-04-09 00:03:22 +02:00
Moritz Brückner 829aa20f08 Fix camera export when multiple scenes are exported 2020-04-08 23:24:43 +02:00
Sandy f035b3aaba
Mark return value for CanvasGetPosition nodes 2020-04-08 23:41:01 +09:00
luboslenco 4c3332858e Mark return value for CanvasGetCheckbox and CanvasGetSlider nodes 2020-04-07 10:31:32 +02:00
Lubos Lenco 7ef450d276
Merge pull request #1633 from QuantumCoderQC/master
Fixed Bullet Rigid Body C target issue
2020-04-04 11:32:33 +02:00
QuantumCoderQC f3b58c0f31 Fixed Bullet Rigid Body C target issue 2020-04-03 17:05:13 +02:00
luboslenco 4bd1d40a9c Bump version 2020-04-01 10:44:47 +02:00
Lubos Lenco 0e77094a71
Merge pull request #1623 from Sanva/master
Fixed memory problem in `ArmoryExporter.execute` [fixes #1604]
2020-03-21 23:49:26 +01:00
Lubos Lenco 77c8f9b41e
Merge pull request #1624 from Simonrazer/master
Optimise Voronoi texture
2020-03-21 23:29:56 +01:00
Simonrazer 8f04e18e07
Fix for Fragment 2020-03-21 13:02:12 +01:00
Simonrazer 8b5d000748
Optimise some more 2020-03-21 12:59:02 +01:00
Simonrazer 648d2b1bda
Optimize Voronoi 2020-03-21 11:30:56 +01:00
Valentín Barros 64ed9d8d9e Fixed memory problem in ArmoryExporter.execute [fixes #1604]
The Blender crash referenced in the issue happened always
when starting 2nd iteration of the loop in line 2041. I'm not
really sure, but I bet it had to do with
`export_object` modifying `bpy.context.collection.objects`
(line 818), wich in turn could invalidate the reference
obtained in line 1926, if I understand a bit of Blender
internals — wich I didn't some days ago, so this could be
completely wrong.

It no longer happens with this change.
2020-03-21 11:07:58 +01:00
Lubos Lenco 973462e643
Merge pull request #1622 from Simonrazer/master
Upgrade Voronoi Texture
2020-03-20 17:47:18 +01:00
Simonrazer 08b86e7eb9
Fix typo 2020-03-20 15:44:17 +01:00
Simonrazer d9d6c3e1d9
Update cycles_functions.py 2020-03-20 15:19:08 +01:00
Simonrazer b2946ec87d
Update cycles.py 2020-03-20 15:16:08 +01:00
Lubos Lenco fccd0997c0
Merge pull request #1621 from Simonrazer/master
Make procd textures 3d again, fix broken Z coord in bposition
2020-03-19 13:49:08 +01:00
Simonrazer 97896c9fb2
Fix for other dimensions as well 2020-03-19 12:08:56 +01:00
Simonrazer a0ad5061d0
Back to using 3d textures 2020-03-19 11:29:04 +01:00
Simonrazer 222ccd50d1
Fix div by 0 when mesh is flat 2020-03-19 11:24:17 +01:00
Lubos Lenco ca664e3c2e
Merge pull request #1620 from Simonrazer/master
Fix Procedural nodes not working on Forward path
2020-03-18 11:34:51 +01:00
Simonrazer a544194d4a
Separate procedural functions 2020-03-18 09:38:18 +01:00
Simonrazer e1ecccf69f
Update cycles.py 2020-03-18 09:35:23 +01:00
Lubos Lenco b950776fe9
Merge pull request #1619 from Simonrazer/master
Upgrade noise texture
2020-03-17 10:48:23 +01:00
Simonrazer 93492ea692
Upgrade noise texture 2020-03-17 09:53:21 +01:00
Simonrazer c33d886caa
Update cycles.py 2020-03-17 09:51:34 +01:00
Lubos Lenco 3991ec7d47
Merge pull request #1617 from Simonrazer/master
Upgrade Wave Texture node + Fix noise texture Value output
2020-03-16 19:48:06 +01:00
Lubos Lenco 263bd248d4
Merge pull request #1618 from Sandy10000/master
Delete Distance Node
2020-03-16 19:47:19 +01:00
Sandy 7d90101448
Delete Distance Node
Remove this because the same can be achieved with "Vector Math"
2020-03-16 22:24:42 +09:00
Sandy 37e04689d5
Delete Distance Node
Remove this because the same can be achieved with "Vector Math"
2020-03-16 22:22:47 +09:00
Simonrazer 2df762e3db
Upgrade Wave texture shader 2020-03-16 11:53:12 +01:00
Simonrazer 2e529deb19
Upgrade Wave texture node + Fix noise Value output 2020-03-16 11:51:41 +01:00
Lubos Lenco af284b8937
Merge pull request #1616 from Simonrazer/master
Keep Canvas dimensions the same as the game dimensions
2020-03-16 10:27:05 +01:00
Simonrazer 5cde1487ca
Update CanvasScript.hx 2020-03-16 09:05:42 +01:00
Lubos Lenco 252e0dc7f3
Merge pull request #1613 from N8n5h/box-projection
Fix support for box/triplanar mapping
2020-03-15 09:10:28 +01:00
Lubos Lenco a41c6b2d09
Merge pull request #1614 from QuantumCoderQC/master
Added node to start animation from a particular frame index
2020-03-15 09:09:11 +01:00
N8n5h decf89305c Fix support for box/triplanar mapping
I modified the shader parser so that triplanar mapping of textures is supported.
Normals are supported.
Currently tested with Armory PBR and Principled BSDF.
2020-03-14 23:44:15 -03:00
QuantumCoderQC 1770aeb002 Added nodes to start animation from a partivular frame index 2020-03-14 23:30:09 +01:00
Lubos Lenco 1534f2565c
Merge pull request #1612 from Sandy10000/master
Addressing issues reported in the Armory forum
2020-03-14 13:45:18 +01:00
Sandy 30d22a264b
Add new
Input of "Get Distance" is Object, but input of "Distance" is Vector.
2020-03-14 21:04:51 +09:00
Sandy 3f77ff397d
Add new
Input of "Get Distance" is Object, but input of "Distance" is Vector.
2020-03-14 21:03:07 +09:00
Sandy d1a0fc69c8
Addressing issues reported in the Armory forum
https://forums.armory3d.org/t/something-wrong-with-translate-on-local-axis/2772
https://forums.armory3d.org/t/how-to-avoid-camera-going-through-rigid-bodies/3945
2020-03-14 20:58:56 +09:00
Lubos Lenco 71796f4fab
Merge pull request #1610 from N8n5h/fix-geom-export
Fix geometry not working in published projects
2020-03-14 10:32:55 +01:00
Lubos Lenco 89e0d14c58
Merge pull request #1611 from Simonrazer/master
Fix noise texture
2020-03-14 10:32:23 +01:00
Simonrazer 3aaba5fe62
Don't use the Z coordinate in the shader 2020-03-13 16:30:42 +01:00
Simonrazer d1765ab206
Update cycles.py 2020-03-13 16:28:55 +01:00
N8n5h e40ae5ac4e Fix geometry in published projects
Updated the opt_exporter to fit new vertex format
2020-03-12 20:02:37 -03:00
Lubos Lenco c3f8cca15a
Merge pull request #1606 from QuantumCoderQC/master
Fixed Bullet RigidBody memory leak
2020-03-09 15:56:28 +01:00
QuantumCoderQC 2d282c9582 Fixed Bullet RigidBody memory leak 2020-03-08 21:34:35 +01:00
Forest Collins Sharp 8958668215
Merge pull request #2 from armory3d/master
merging latest from armory3d/armory
2020-03-07 08:44:02 -06:00
luboslenco 620e15db8e Fix wrd access 2020-03-07 15:00:51 +01:00
Lubos Lenco 815184d6ab
Merge pull request #1603 from MoritzBrueckner/console-output
De-clutter console output and show warnings
2020-03-07 14:46:58 +01:00
Moritz Brückner fe367518cc
Merge branch 'master' into console-output 2020-03-07 00:04:30 +01:00
Moritz Brückner 1da4b02cef Count compilation warnings and show them in the UI and console 2020-03-06 23:49:14 +01:00
Moritz Brückner 6e9dfd8504 Change khamake silent switch to quiet to still print error messages 2020-03-06 23:47:42 +01:00
Lubos Lenco baa329e0a7
Merge pull request #1600 from philipmduarte/autobake_instanced
Support for collection instance with autobaking armatures
2020-03-05 19:38:03 +01:00
Lubos Lenco 963b6ed980
Merge pull request #1598 from Naxela/master
Merge PPM
2020-03-05 19:36:10 +01:00
Philip Michel Duarte 4adbc3cbb0 instanced autobake done 2020-03-05 13:40:15 -03:00
Philip Michel Duarte 4e633c736a pending stuff 2020-03-04 19:42:38 -03:00
philip 57a052b25d towards instanced autobake 2020-03-04 17:34:21 -03:00
Alexander Kleemann 3dce053aa3
Update Postprocess.hx
Accidentally deleted the return value when removing comments
2020-03-04 20:11:37 +01:00
Alexander 60f72e7e0e Merge in PPM
Redone and ready to be merged with Armory
2020-03-04 17:45:19 +01:00
luboslenco ac60af17eb Bump version 2020-03-04 13:30:36 +01:00
Lubos Lenco fec9abd4bd
Merge pull request #1597 from philipmduarte/colinst
Same-file collection instance bug
2020-03-04 09:29:02 +01:00
Philip Michel Duarte 02bc76f9d5 same-file collection instance bug fixed 2020-03-03 23:38:37 -03:00
Philip Michel Duarte 675211c66a Merge branch 'master' of https://github.com/armory3d/armory 2020-03-03 21:49:31 -03:00
Moritz Brückner 086810849e De-clutter console output (new "Verbose Output" switch) 2020-03-04 00:14:14 +01:00
luboslenco cfbe3a7dce Some more position access fixes 2020-03-03 22:50:20 +01:00
luboslenco 23d649fe32 Fix RigidBody compile 2020-03-03 22:41:39 +01:00
Lubos Lenco fe5be464c2
Merge pull request #1596 from MoritzBrueckner/fix-project-folder
Fix ResourceWarning for open_folder()
2020-03-03 22:23:54 +01:00
Moritz Brückner 0cac8fa987 Fix ResourceWarning for open_folder() 2020-03-03 22:13:44 +01:00
Lubos Lenco f3bffa27e5
Merge pull request #1595 from MoritzBrueckner/fix-object-names
Exporter: better handling of duplicate object names
2020-03-03 22:10:33 +01:00
Lubos Lenco d1e50ac2c3
Merge pull request #1594 from N8n5h/project-geom
Update exporter to fit expected new vertex array data
2020-03-03 22:05:45 +01:00
Moritz Brückner 6f906c5863 Exporter: better handling of duplicate object names 2020-03-03 21:34:19 +01:00
philip 364c09ab3a Merge branch 'master' of https://github.com/armory3d/armory 2020-03-03 07:55:20 -03:00
N8n5h 06af6d30d4 Update exporter to fit expected vertex array data 2020-03-03 03:07:56 -03:00
Lubos Lenco 75ca3aa44b
Merge pull request #1592 from philipmduarte/autobake
Action autobaking
2020-03-02 19:20:24 +01:00
philip c75c227a82 Merge branch 'master' of http://github.com/philipmduarte/armory 2020-03-02 13:13:31 -03:00
Lubos Lenco 0713585f28
Merge pull request #1590 from N8n5h/fix-vcol
Fix Vertex Color and Tangent not exporting sometimes
2020-03-02 16:30:54 +01:00
Lubos Lenco 5d173993de
Merge pull request #1591 from Sanva/master
Fix `armory.logicnode.SetRotationNode` vector type for input
2020-03-02 16:28:54 +01:00
Lubos Lenco 4369de36aa
Merge pull request #1589 from MoritzBrueckner/master
Deactivate "Debug Console" checkbox when Zui is not enabled
2020-03-02 16:26:20 +01:00
Philip Michel Duarte 8921afd155 autobake done 2020-03-02 11:03:42 -03:00
Valentín Barros a9521846a2 Fix armory.logicnode.SetRotationNode vector type for input [fixes #1572]
Fixes for example the `virtual_gamepad` demo crashing on startup
in Android.
2020-03-02 11:11:15 +01:00
N8n5h c04dbe4993 Fix Vertex Color and Tangent not exporting
Applied the same fix that is used for uvs, since it seems to solve the issue of not updating correctly for exporting of materials too.
Also added support for the Vertex Color node.
2020-03-02 02:04:54 -03:00
Moritz Brückner 7b9fb161fe Deactivate "Debug Console" checkbox when Zui is not enabled 2020-03-02 00:00:56 +01:00
Lubos Lenco 083f9981b8
Merge pull request #1588 from MoritzBrueckner/master
Fix TransformExtension.hx
2020-03-01 10:18:18 +01:00
Moritz Brückner 110a068605 Fix TransformExtension.hx 2020-02-29 21:26:24 +01:00
Lubos Lenco b3491dd462
Merge pull request #1585 from MoritzBrueckner/navmesh
Expose NavAgent turn speed to the UI
2020-02-23 11:00:08 +01:00
Moritz Brückner 16ad030f41 Rename variable (more intuitive)
Thanks to nubleet on Discord for mentioning this
2020-02-22 23:57:16 +01:00
Moritz Brückner c60f41186d Expose NavAgent turn speed to the UI 2020-02-22 23:08:33 +01:00
Lubos Lenco feab37b456
Merge pull request #1584 from MoritzBrueckner/navmesh
Fix Navmesh generation + few code style improvements (pep8)
2020-02-22 21:50:40 +01:00
Moritz Brückner d6275b8a07 More future-proof navmesh generation 2020-02-22 17:57:29 +01:00
Moritz Brückner 7566b53340 Fix Navmesh generation + few code style improvements (pep8) 2020-02-22 17:41:51 +01:00
Lubos Lenco becda78736
Merge pull request #1578 from MoritzBrueckner/fixes
Some smaller fixes
2020-02-19 21:40:53 +01:00
Lubos Lenco ce16c194a5
Merge pull request #1579 from MoritzBrueckner/canvas
CanvasScript: add getCanvas() function and improve docstrings
2020-02-19 21:40:01 +01:00
Moritz Brückner f5f9d8c13b CanvasScript: add getCanvas() function and improve docstrings 2020-02-19 14:28:27 +01:00
Moritz Brückner d2b26925c2 Fix AddGroupNode 2020-02-19 14:24:44 +01:00
Moritz Brückner 486b462153 Fix math package and improve docstrings 2020-02-19 14:24:31 +01:00
Lubos Lenco ee0b948961
Merge pull request #1575 from blackno666/master
Fixed adding objects to collection 'export_coll' more than once
2020-02-15 13:30:40 +01:00
blackno666 9517f805de Fixed adding objects to collection 'export_coll' more than once 2020-02-14 22:12:56 +01:00
Lubos Lenco 1c2b147592
Merge pull request #1569 from MoritzBrueckner/trait-names
Print warning if logic node tree and generated trait names differ
2020-02-13 21:16:30 +01:00
Moritz Brückner 351f908178 Print warning if logic node tree and generated trait names differ 2020-02-12 13:51:31 +01:00
Lubos Lenco 2afe51b44f Merge pull request #1565 from Sandy10000/master
Handling issues posted on the Armory forum
2020-02-10 11:09:34 +01:00
Sandy 6fab32b613
Handling issues posted on the Armory forum 2020-02-09 23:45:04 +09:00
Sandy b504e00f96
Handling issues posted on the Armory forum 2020-02-09 23:43:48 +09:00
Lubos Lenco 3ef7683dfd
Merge pull request #1563 from MoritzBrueckner/fix-trait-props
Fix bool type trait properties
2020-02-08 17:06:17 +01:00
Moritz Brückner ac544889ab Fix bool type trait properties 2020-02-07 19:29:55 +01:00
Forest Collins Sharp c3e25e6c3a
Merge pull request #1 from armory3d/master
Merging with Latest Armory
2020-02-03 15:30:45 -06:00
luboslenco 2c4172dabe Merge branch 'master' of https://github.com/armory3d/armory 2020-02-03 12:44:34 +01:00
luboslenco a81338fa7f Bump version 2020-02-03 12:44:18 +01:00
Lubos Lenco c568a65e21
Merge pull request #1555 from MoritzBrueckner/trait-prop-export
Fix object type trait property export for linked objects
2020-02-03 11:47:36 +01:00
Moritz Brückner 141e7e71df Export asset name for object trait properties 2020-01-27 17:13:43 +01:00
Forest Sharp 57cd481731 lights wouldn't render at all if use_shadow / cast_shadow was disabled 2020-01-19 18:49:30 -06:00
Lubos Lenco 2972db8cd7
Merge pull request #1543 from MoritzBrueckner/themes
Fix annoying error message at first Armory2D start from Blender
2020-01-14 09:18:39 +01:00
Moritz Brückner f5a40efec4 Fix annoying error message at first Armory2D start from Blender 2020-01-13 11:04:39 +01:00
Lubos Lenco d530dc16ad
Merge pull request #1540 from MoritzBrueckner/trait-props
Major refactor of trait properties
2020-01-12 12:27:48 +01:00
Lubos Lenco 19f7cff9c7
Merge pull request #1539 from N8n5h/debug-draw-fix
Fixed DebugDraw line drawing method
2020-01-10 00:44:40 +01:00
Moritz Brückner 2d8c86ac98 Improved warnings 2020-01-08 17:17:18 +01:00
Moritz Brückner 2c13f0c78c Fix unused @prop recognition 2020-01-08 17:06:32 +01:00
Moritz Brückner 23eea495f9 Improve UI 2020-01-08 16:37:48 +01:00
Moritz Brückner 7245c83313 Better vector recognition 2020-01-08 16:37:33 +01:00
Moritz Brückner c4b3d82fbb Add warning for static properties 2020-01-07 22:06:32 +01:00
Moritz Brückner 05baf7b39f Support for different object types 2020-01-07 22:00:45 +01:00
Moritz Brückner 0ccd336a4b Less scrolling 2020-01-07 21:38:23 +01:00
Moritz Brückner e7d631f9da Support object prop type 2020-01-07 21:09:39 +01:00
Moritz Brückner f76c903614 Improved vector recognition 2020-01-07 20:45:45 +01:00
Moritz Brückner ab76f31346 Add support for vector properties 2020-01-07 20:26:12 +01:00
Moritz Brückner da16b0e0ac Show warnings caused by invalid trait props 2020-01-07 13:15:21 +01:00
Moritz Brückner 5b60533251 Fix property type change 2020-01-07 13:12:35 +01:00
Moritz Brückner 60914da401 Fix String recognition 2020-01-07 13:06:18 +01:00
Moritz Brückner 891d099c8a Small UI tweaks 2020-01-07 12:35:53 +01:00
Moritz Brückner 049911504c Refactor trait prop system and support different prop types 2020-01-07 12:35:38 +01:00
Moritz Brückner 71ba39f653 Reorganize (PEP8) and remove unused imports 2020-01-07 11:44:33 +01:00
N8n5h afdc54bc35 Fixed DebugDraw line drawing method
Now lines should always face the camera.
2020-01-05 11:48:29 -03:00
Lubos Lenco 7f3a119d26
Merge pull request #1534 from MoritzBrueckner/debug-traits
DebugConsole: add trait detail view
2020-01-03 15:41:14 +01:00
Lubos Lenco ab412123f7
Merge pull request #1537 from BlackGoku36/master
Add setCanvasFontSize
2020-01-03 14:17:21 +01:00
BlackGoku36 aaed3592d2 Add setCanvasFontSize 2020-01-03 17:40:13 +05:30
Moritz Brückner d36c8a4176 DebugConsole: implement trait detail view 2020-01-02 18:48:02 +01:00
luboslenco dfda5f9dbb Bump version 2020-01-02 14:00:30 +01:00
luboslenco 31161e7242 Fix Object Info material node 2020-01-02 13:53:54 +01:00
luboslenco 3c058568f7 Add TransformExtension 2020-01-02 13:47:06 +01:00
luboslenco bde87cea9e Include math pack 2020-01-02 12:51:29 +01:00
Lubos Lenco 1481771b0c
Merge pull request #1533 from MoritzBrueckner/collection-offset
Export collection instance offsets
2020-01-02 10:32:11 +01:00
Lubos Lenco c7b641cc77
Merge pull request #1530 from MoritzBrueckner/debug-console
Debug console rework
2019-12-30 22:30:25 +01:00
Moritz Brückner edc6bee204 DebugConsole: Fix handles for multiple lights or cameras 2019-12-27 16:44:11 +01:00
Moritz Brückner f33729ed69 Indent trait list in debug console 2019-12-27 16:43:39 +01:00
Moritz Brückner 0d6b72b7bb Improve transform view in debug console 2019-12-27 16:43:08 +01:00
Moritz Brückner 9b90398e8d DebugConsole: Refactor outliner 2019-12-27 16:40:59 +01:00
Moritz Brückner 3615566b0e Export collection instance offset and move coll. export into own method 2019-12-27 15:40:40 +01:00
Moritz Brückner a17384e318 exporter.py: Some style improvements and added some docstrings 2019-12-27 15:39:20 +01:00
Lubos Lenco 2d61a06f78
Merge pull request #1525 from MoritzBrueckner/gen-tex-export
Add support for generated image textures
2019-12-22 12:44:17 +01:00
luboslenco 7742c4c2b7 Clone kha from armory3d 2019-12-22 12:41:41 +01:00
Lubos Lenco c6cd194f59
Merge pull request #1522 from MoritzBrueckner/prop
Allow @prop for `final` keyword too
2019-12-22 12:29:29 +01:00
Moritz Brückner 1f9a4eaa0a Save generated images as jpg 2019-12-21 20:51:16 +01:00
Moritz Brückner 8c28019f36 Add support for generated image textures 2019-12-21 20:30:49 +01:00
Moritz Brückner 99d7e12375 cycles.py: cleanup and use os.path.join() instead of string operations 2019-12-21 20:28:41 +01:00
Moritz Brückner c035f15896 Small utils.py improvements 2019-12-21 20:25:58 +01:00
Moritz Brückner 2f1cf3f53e utils convert_image(): get image quality from UI setting 2019-12-21 20:23:30 +01:00
Moritz Brückner 71287e442f Allow @prop for final keyword too 2019-12-21 14:21:19 +01:00
luboslenco db4f0cc107 Apply checkstyle 2019-12-19 23:54:08 +01:00
luboslenco fe3fa62a97 Fix Kinematic Character Controller compile 2019-12-19 16:52:53 +01:00
luboslenco 8a4e39599b Fix macro return 2019-12-19 16:52:17 +01:00
luboslenco 655b9252de Fix MergedSurface logic node 2019-12-19 16:44:20 +01:00
luboslenco b39a5af8bd Merge branch 'master' of https://github.com/armory3d/armory 2019-12-19 16:24:58 +01:00
luboslenco ea75669161 Fix package 2019-12-19 16:24:44 +01:00
Lubos Lenco 57cdce61b1
Merge pull request #1520 from Sandy10000/master
#1500 Function addition
2019-12-18 18:16:10 +01:00
Sandy 64a18db096
https://github.com/armory3d/armory/issues/1500 2019-12-18 22:20:07 +09:00
Sandy 4d54f6d2dc
https://github.com/armory3d/armory/issues/1500 2019-12-18 22:19:14 +09:00
Lubos Lenco 7d58f27550
Merge pull request #1514 from N8n5h/fix-alpha
Attempt to fix noise in opacity map
2019-12-17 13:54:41 +01:00
luboslenco 1f8aed23bf Print output from armory2d into console 2019-12-15 15:33:37 +01:00
Lubos Lenco d6f32d1bc5
Merge pull request #1513 from MoritzBrueckner/themes
Load themes from canvas
2019-12-14 13:33:13 +01:00
Moritz Brückner 3d59e6b4d6 Fix export error when no canvas is used at all 2019-12-13 19:21:59 +01:00
N8n5h 35274c8673 fix alpha 2019-12-13 11:27:10 -03:00
Lubos Lenco b3dab3c1b5
Merge pull request #1512 from Naxela/master
Add blackbody node functionality
2019-12-13 00:20:12 +01:00
Alexander e72c997a11 Add blackbody node functionality 2019-12-12 18:13:39 +01:00
luboslenco 928bec4232 Add checkstyle 2019-12-09 10:46:48 +01:00
Lubos Lenco 24ec5cf79b
Merge pull request #1507 from QuantumCoderQC/master
Moved kinematic and static flags from Bt.hx to RigidBody.hx
2019-12-08 10:04:49 +01:00
Lubos Lenco 8a6ad653e6
Merge pull request #1503 from N8n5h/fix-export-uv
Fix for faulty "missing uv maps"
2019-12-08 10:01:16 +01:00
luboslenco 6237c9e699 Include transformMath 2019-12-08 09:59:58 +01:00
Lubos Lenco 8a55211506
Merge pull request #1505 from Sandy10000/master
Calculate transform data directly
2019-12-08 09:51:31 +01:00
QuantumCoderQC 8c80b94b4a Moved kinematic and static flags from Bt.hx to RigidBody.hx 2019-12-07 21:41:08 +01:00
Sandy 99f5d4c756
Calculate transform data directly 2019-12-07 22:08:31 +09:00
Sandy 3531551288
Calculate transform data directly 2019-12-07 22:07:31 +09:00
Moritz Brückner be43f35ee2 Don't show _themes.json in trait list 2019-12-06 22:10:25 +01:00
Moritz Brückner 071291992d Load canvas theme at game start 2019-12-06 21:42:11 +01:00
Moritz Brückner b4bca6f364 Export themes for canvas 2019-12-06 21:41:19 +01:00
N8n5h 4216d327a3 Fix for faulty "missing uv maps"
Ask for export_uvs to the original object instead of the evaluated copy. Reason is, it seems the dependency graph fails to update
whenever custom properties are set. So for that I think asking the original object in this case could be sufficient to fix it.

The same could be applied to the other functions that are in that chunk of code.
2019-12-05 17:17:51 -03:00
Lubos Lenco 528524d861
Merge pull request #1498 from N8n5h/fix-export-3
fix export with a 'zoo collection'
2019-12-02 14:37:48 +01:00
luboslenco 1c4df223cc Add denoise shader 2019-12-02 14:34:56 +01:00
N8n5h b1a25548a9 fix export with a 'zoo collection'
Add a temporary collection to the scene that links all the foreign objects meshes and collections with meshes to the current scene, have the dependency graph see it and then destroy it.
2019-12-02 09:01:46 -03:00
Lubos Lenco c97c5ff36b
Merge pull request #1494 from QuantumCoderQC/master
Implemented Kinematic and Static flags for better control.
2019-12-01 10:15:40 +01:00
QuantumCoderQC 5099580885 Implemented Kinematic and Static flags for better control. Mass of Animated(Kinematic) and Static objects will be set to zero. Implemented btMotionState for kinematic rigid bodies. And btSetWorldTransform for Dynamic and static rigid bodies. Kinematic rigid bodies can now be fully contolled through animation timeline inside blender. 2019-12-01 00:59:16 +01:00
luboslenco ad8ce6d16d Merge branch 'master' of https://github.com/armory3d/armory 2019-11-29 13:41:25 +01:00
luboslenco 2cf0ac3c58 Bump version 2019-11-29 13:41:10 +01:00
Lubos Lenco c1731f0187
Merge pull request #1489 from N8n5h/patch-2
add initial support to Mapping dynamic inputs
2019-11-27 10:00:20 +01:00
N8n5h 2b572db3d1
add initial support to Mapping dynamic inputs
This is to help transition to Blender 2.81.
I tried to tackle obtaining the input value if something was connected but it turned more complicated than I thought, so for starters I added support to the dynamic inputs default values so it compiles with no errors when a mapping node is present.

Please point out any ugly code.
2019-11-22 11:53:07 -03:00
luboslenco 51ab281a21 Fix starter for kha_node 2019-11-20 16:50:54 +01:00
luboslenco 7c0f25ee8c Merge branch 'master' of https://github.com/armory3d/armory 2019-11-16 14:11:53 +01:00
luboslenco f310776985 Use webassembly for ammo+krom 2019-11-16 14:11:32 +01:00
Lubos Lenco a6b7a50bca
Merge pull request #1474 from zaethan/master
corrected indices in getRotation node
2019-11-14 10:18:22 +01:00
luboslenco 405da0e10e Fix debug console compile 2019-11-13 09:09:06 +01:00
luboslenco 574f6ab96d Use material input for SetMaterialParam nodes 2019-11-12 13:50:29 +01:00
Yannik Böttcher b809cec5e6 corrected indices 2019-11-12 11:15:09 +01:00
luboslenco 3e57614e12 Update readme 2019-11-05 19:11:47 +01:00
Lubos Lenco b942a964f5
Merge pull request #1464 from Sandy10000/master
Fixed issue reported in Armory Forum
2019-11-05 19:08:28 +01:00
Sandy 47f5b4b78e
Fixed issue reported in Armory Forum
http://forums.armory3d.org/t/helper-text-in-logic-nodes/3673
2019-11-05 21:59:51 +09:00
luboslenco 8091193058 Fix comma and period keys 2019-11-04 21:35:18 +01:00
luboslenco 1d84a66893 Cleanup 2019-11-03 12:12:52 +01:00
luboslenco 3332dd7923 Update krom.yml 2019-11-03 12:10:11 +01:00
luboslenco 2640e0c1b1 Update krom.yml 2019-11-03 11:52:12 +01:00
Lubos Lenco 9eace7db61
Create krom.yml 2019-11-03 11:46:35 +01:00
luboslenco d87d4a7b58 Bump version 2019-11-01 13:47:01 +01:00
luboslenco b17fe028b6 Re-apply ced8cd8 2019-10-30 15:33:14 +01:00
Lubos Lenco dcb4b5fc6c
Merge pull request #1455 from QuantumCoderQC/master
Implemented Physics constraints: Generic, Generic-Spring, Slider...
2019-10-30 15:29:55 +01:00
QuantumCoderQC 8beb8ef061 Implemented Physics constraints: Generic, Generic-Spring, Slider, Piston and Hinge. Point constraint now uses Bullet Physics btPoint2Point constraint. Hinge constraint now obeys orientation inputs. Generic constraint can now be fully configured within Blender. Constraint behaviour matches that of Blender physics constraints. 2019-10-29 23:12:40 +01:00
Lubos Lenco 00f5946bb4
Merge pull request #1446 from BlackGoku36/patch-2
Option to use other fonts and set make canvas visibility
2019-10-26 21:19:20 +02:00
Urjasvi Suthar 965f2ed0e7
Option to use other fonts and set make canvas visibility 2019-10-26 15:48:43 +05:30
luboslenco ced8cd845f Fix Principled BSDF node lookup for empty material 2019-10-25 14:20:22 +02:00
Lubos Lenco 636a16df28
Merge pull request #1439 from Sandy10000/master
fix https://github.com/armory3d/armory/issues/1438
2019-10-19 00:08:30 +02:00
Sandy 92f6321f03
Correct socket position 2019-10-18 21:38:04 +09:00
Sandy 5a9f14ea20
Correct socket position 2019-10-18 21:37:04 +09:00
Sandy 488031e7d8
Correct socket position 2019-10-18 21:35:08 +09:00
Sandy 39114e9fd2
Correct socket position 2019-10-18 21:33:26 +09:00
Sandy 5d521e8101
fix https://github.com/armory3d/armory/issues/1438 2019-10-17 22:04:14 +09:00
Sandy a138baea67
fix https://github.com/armory3d/armory/issues/1438 2019-10-17 22:03:06 +09:00
Lubos Lenco 0420d32673
Merge pull request #1436 from N8n5h/patch-3
Revert offset to the y value when adding a path navmesh
2019-10-15 00:17:44 +02:00
N8n5h b06c665676
Revert offset to the y value when adding a path
This is to revert it to the original without the offset because it has inconsistent results with meshes with no height, something that I need to investigate why. 

So for now to keep it consistent it stays without the offset.
2019-10-14 19:13:18 -03:00
1259 changed files with 50042 additions and 12945 deletions

22
.github/workflows/krom.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: Krom
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get Submodules
run: |
git clone https://github.com/armory3d/armory_ci
git clone --recursive https://github.com/armory3d/Kha.git armory_ci/Kha
git clone https://github.com/armory3d/iron.git armory_ci/Libraries/iron
git clone https://github.com/armory3d/armory.git armory_ci/Libraries/armory
git clone https://github.com/armory3d/nodejs_bin.git armory_ci/nodejs_bin
- name: Compile
run: |
cd armory_ci
nodejs_bin/node-linux64 Kha/make.js krom --shaderversion 330

View file

@ -1,8 +1,6 @@
armory
==============
[![Build Status](https://dev.azure.com/luboslenco/armory/_apis/build/status/armory3d.armory?branchName=master)](https://dev.azure.com/luboslenco/armory/_build/latest?definitionId=4&branchName=master)
[armory3d.org](https://armory3d.org) - [Manual](https://github.com/armory3d/armory/wiki) - [Roadmap](https://github.com/armory3d/armory/projects) - [Community](https://armory3d.org/community)
In development! Armory is an open-source 3D game engine with full Blender integration. The engine is currently available in a form of [early preview](http://armory3d.org/download.html).

View file

@ -4,16 +4,29 @@
uniform sampler2D tex;
#ifdef _CPostprocess
uniform vec3 PPComp10;
#endif
in vec2 texCoord;
out vec4 fragColor;
void main() {
vec3 col = textureLod(tex, texCoord, 0.0).rgb;
float brightness = dot(col, vec3(0.2126, 0.7152, 0.0722));
if (brightness > bloomThreshold) {
fragColor.rgb = col;
}
else {
fragColor.rgb = vec3(0.0);
}
#ifdef _CPostprocess
if (brightness > PPComp10.z) {
fragColor.rgb = col;
}
else {
fragColor.rgb = vec3(0.0);
}
#else
if (brightness > bloomThreshold) {
fragColor.rgb = col;
}
else {
fragColor.rgb = vec3(0.0);
}
#endif
}

View file

@ -5,7 +5,13 @@
"depth_write": false,
"compare_mode": "always",
"cull_mode": "none",
"links": [],
"links": [
{
"name": "PPComp10",
"link": "_PPComp10",
"ifdef": ["_CPostprocess"]
}
],
"texture_params": [],
"vertex_shader": "../include/pass.vert.glsl",
"fragment_shader": "bloom_pass.frag.glsl"

View file

@ -7,20 +7,32 @@ uniform sampler2D tex;
uniform vec2 dir;
uniform vec2 screenSize;
#ifdef _CPostprocess
uniform vec3 PPComp11;
#endif
in vec2 texCoord;
out vec4 fragColor;
const float weight[10] = float[] (0.132572, 0.125472, 0.106373, 0.08078, 0.05495, 0.033482, 0.018275, 0.008934, 0.003912, 0.001535);
void main() {
vec2 step = (dir / screenSize.xy) * bloomRadius;
#ifdef _CPostprocess
vec2 step = (dir / screenSize.xy) * PPComp11.y;
#else
vec2 step = (dir / screenSize.xy) * bloomRadius;
#endif
fragColor.rgb = textureLod(tex, texCoord, 0.0).rgb * weight[0];
for (int i = 1; i < 10; i++) {
vec2 s = step * (float(i) + 0.5);
fragColor.rgb += textureLod(tex, texCoord + s, 0.0).rgb * weight[i];
fragColor.rgb += textureLod(tex, texCoord - s, 0.0).rgb * weight[i];
}
fragColor.rgb *= bloomStrength / 5;
#ifdef _CPostprocess
fragColor.rgb *= PPComp11.x / 5;
#else
fragColor.rgb *= bloomStrength / 5;
#endif
fragColor.rgb = min(fragColor.rgb, 64.0);
}

View file

@ -13,6 +13,11 @@
{
"name": "screenSize",
"link": "_windowSize"
},
{
"name": "PPComp11",
"link": "_PPComp11",
"ifdef": ["_CPostprocess"]
}
],
"texture_params": [],
@ -32,6 +37,11 @@
{
"name": "screenSize",
"link": "_windowSize"
},
{
"name": "PPComp11",
"link": "_PPComp11",
"ifdef": ["_CPostprocess"]
}
],
"texture_params": [],
@ -54,6 +64,11 @@
{
"name": "screenSize",
"link": "_windowSize"
},
{
"name": "PPComp11",
"link": "_PPComp11",
"ifdef": ["_CPostprocess"]
}
],
"texture_params": [],

View file

@ -4,6 +4,10 @@
uniform sampler2D tex;
#ifdef _CPostprocess
uniform vec3 PPComp13;
#endif
in vec2 texCoord;
out vec4 fragColor;
@ -36,16 +40,22 @@ vec4 spectrum_offset(float t) {
void main() {
float max_distort = compoChromaticStrength;
int num_iter = compoChromaticSamples;
float reci_num_iter_f = 1.0 / float(num_iter);
#ifdef _CPostprocess
float max_distort = PPComp13.x;
int num_iter = int(PPComp13.y);
#else
float max_distort = compoChromaticStrength;
int num_iter = compoChromaticSamples;
#endif
// Spectral
if (compoChromaticType == 1) {
float reci_num_iter_f = 1.0 / float(num_iter);
vec2 resolution = vec2(1,1);
vec2 uv = (texCoord.xy/resolution.xy);
vec4 sumcol = vec4(0.0);
vec4 sumw = vec4(0.0);
vec4 sumw = vec4(0.0);
for (int i=0; i < num_iter; ++i)
{
float t = float(i) * reci_num_iter_f;
@ -53,17 +63,16 @@ void main() {
sumw += w;
sumcol += w * texture(tex, barrelDistortion(uv, 0.6 * max_distort * t));
}
fragColor = sumcol / sumw;
} else {
fragColor = sumcol / sumw;
}
// Simple
else {
vec3 col = vec3(0.0);
col.x = texture(tex, texCoord + ((vec2(0.0, 1.0) * max_distort) / vec2(1000.0))).x;
col.y = texture(tex, texCoord + ((vec2(-0.85, -0.5) * max_distort) / vec2(1000.0))).y;
col.z = texture(tex, texCoord + ((vec2(0.85, -0.5) * max_distort) / vec2(1000.0))).z;
fragColor = vec4(col.x, col.y, col.z, fragColor.w);
}
}
}

View file

@ -6,7 +6,13 @@
"color_write_alpha": false,
"compare_mode": "always",
"cull_mode": "none",
"links": [],
"links": [
{
"name": "PPComp13",
"link": "_PPComp13",
"ifdef": ["_CPostprocess"]
}
],
"texture_params": [],
"vertex_shader": "../include/pass.vert.glsl",
"fragment_shader": "chromatic_aberration_pass.frag.glsl"

View file

@ -0,0 +1,9 @@
#version 450
in vec2 texCoord;
out vec4 fragColor;
void main() {
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
gl_FragDepth = 1.0;
}

View file

@ -0,0 +1,15 @@
{
"contexts": [
{
"name": "clear_color_depth_pass",
"depth_write": true,
"compare_mode": "always",
"cull_mode": "none",
"links": [],
"texture_params": [],
"vertex_shader": "../include/pass.vert.glsl",
"fragment_shader": "clear_color_depth_pass.frag.glsl",
"color_attachments": ["_HDR"]
}
]
}

View file

@ -0,0 +1,8 @@
#version 450
in vec2 texCoord;
out vec4 fragColor;
void main() {
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
}

View file

@ -0,0 +1,15 @@
{
"contexts": [
{
"name": "clear_color_pass",
"depth_write": false,
"compare_mode": "always",
"cull_mode": "none",
"links": [],
"texture_params": [],
"vertex_shader": "../include/pass.vert.glsl",
"fragment_shader": "clear_color_pass.frag.glsl",
"color_attachments": ["_HDR"]
}
]
}

View file

@ -0,0 +1,8 @@
#version 450
in vec2 texCoord;
out vec4 fragColor;
void main() {
gl_FragDepth = 1.0;
}

View file

@ -0,0 +1,19 @@
{
"contexts": [
{
"name": "clear_depth_pass",
"depth_write": true,
"color_write_red": false,
"color_write_green": false,
"color_write_blue": false,
"color_write_alpha": false,
"compare_mode": "always",
"cull_mode": "none",
"links": [],
"texture_params": [],
"vertex_shader": "../include/pass.vert.glsl",
"fragment_shader": "clear_depth_pass.frag.glsl",
"color_attachments": ["_HDR"]
}
]
}

View file

@ -6,6 +6,9 @@
#ifdef _CDOF
#include "std/dof.glsl"
#endif
#ifdef _CPostprocess
#include "std/colorgrading.glsl"
#endif
uniform sampler2D tex;
#ifdef _CDepth
@ -24,6 +27,43 @@ uniform sampler2D lutTexture;
uniform sampler2D histogram;
#endif
#ifdef _CPostprocess
uniform vec3 globalWeight;
uniform vec3 globalTint;
uniform vec3 globalSaturation;
uniform vec3 globalContrast;
uniform vec3 globalGamma;
uniform vec3 globalGain;
uniform vec3 globalOffset;
uniform vec3 shadowSaturation;
uniform vec3 shadowContrast;
uniform vec3 shadowGamma;
uniform vec3 shadowGain;
uniform vec3 shadowOffset;
uniform vec3 midtoneSaturation;
uniform vec3 midtoneContrast;
uniform vec3 midtoneGamma;
uniform vec3 midtoneGain;
uniform vec3 midtoneOffset;
uniform vec3 highlightSaturation;
uniform vec3 highlightContrast;
uniform vec3 highlightGamma;
uniform vec3 highlightGain;
uniform vec3 highlightOffset;
uniform vec3 PPComp1;
uniform vec3 PPComp2;
uniform vec3 PPComp3;
uniform vec3 PPComp4;
uniform vec3 PPComp5;
uniform vec3 PPComp6;
uniform vec3 PPComp7;
uniform vec3 PPComp8;
#endif
// #ifdef _CPos
// uniform vec3 eye;
// uniform vec3 eyeLook;
@ -77,6 +117,25 @@ vec3 applyFog(vec3 rgb, float distance) {
}
#endif
#ifdef _CPostprocess
float ComputeEV100(const float aperture2, const float shutterTime, const float ISO) {
return log2(aperture2 / shutterTime * 100.0 / ISO);
}
float ConvertEV100ToExposure(float EV100) {
return 1/0.8 * exp2(-EV100);
}
float ComputeEV(float avgLuminance) {
const float sqAperture = PPComp1[0].x * PPComp1.x;
const float shutterTime = 1.0 / PPComp1.y;
const float ISO = PPComp1.z;
const float EC = PPComp2.x;
float EV100 = ComputeEV100(sqAperture, shutterTime, ISO);
return ConvertEV100ToExposure(EV100 - EC) * PI;
}
#endif
vec4 LUTlookup(in vec4 textureColor, in sampler2D lookupTable) {
//Clamp to prevent weird results
@ -154,7 +213,11 @@ void main() {
#endif
#ifdef _CFishEye
const float fishEyeStrength = -0.01;
#ifdef _CPostprocess
const float fishEyeStrength = -(PPComp2.y);
#else
const float fishEyeStrength = -0.01;
#endif
const vec2 m = vec2(0.5, 0.5);
vec2 d = texCo - m;
float r = sqrt(dot(d, d));
@ -225,7 +288,23 @@ void main() {
#else
#ifdef _CDOF
fragColor = vec4(dof(texCo, depth, tex, gbufferD, texStep, cameraProj), 1.0);
#ifdef _CPostprocess
bool compoAutoFocus = false;
float compoDistance = PPComp3.x;
float compoLength = PPComp3.y;
float compoStop = PPComp3.z;
if (PPComp2.z == 1){
compoAutoFocus = true;
} else {
compoAutoFocus = false;
}
fragColor.rgb = dof(texCo, depth, tex, gbufferD, texStep, cameraProj, compoAutoFocus, compoDistance, compoLength, compoStop);
#else
fragColor.rgb = dof(texCo, depth, tex, gbufferD, texStep, cameraProj, true, compoDOFDistance, compoDOFLength, compoDOFFstop);
#endif
#else
fragColor = textureLod(tex, texCo, 0.0);
#endif
@ -271,7 +350,11 @@ void main() {
#ifdef _CGrain
// const float compoGrainStrength = 4.0;
float x = (texCo.x + 4.0) * (texCo.y + 4.0) * (time * 10.0);
fragColor.rgb += vec3(mod((mod(x, 13.0) + 1.0) * (mod(x, 123.0) + 1.0), 0.01) - 0.005) * compoGrainStrength;
#ifdef _CPostprocess
fragColor.rgb += vec3(mod((mod(x, 13.0) + 1.0) * (mod(x, 123.0) + 1.0), 0.01) - 0.005) * PPComp4.y;
#else
fragColor.rgb += vec3(mod((mod(x, 13.0) + 1.0) * (mod(x, 123.0) + 1.0), 0.01) - 0.005) * compoGrainStrength;
#endif
#endif
#ifdef _CGrainStatic
@ -287,28 +370,96 @@ void main() {
fragColor.rgb += fragColor.rgb * compoExposureStrength;
#endif
#ifdef _CPostprocess
fragColor.rgb *= ComputeEV(0.0);
#endif
#ifdef _AutoExposure
float expo = 2.0 - clamp(length(textureLod(histogram, vec2(0.5, 0.5), 0).rgb), 0.0, 1.0);
fragColor.rgb *= pow(expo, autoExposureStrength * 2.0);
#endif
#ifdef _CToneFilmic
fragColor.rgb = tonemapFilmic(fragColor.rgb); // With gamma
#endif
#ifdef _CToneFilmic2
fragColor.rgb = acesFilm(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));
#endif
#ifdef _CToneReinhard
fragColor.rgb = tonemapReinhard(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));
#endif
#ifdef _CToneUncharted
fragColor.rgb = tonemapUncharted2(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
#endif
#ifdef _CToneNone
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
#ifdef _CPostprocess
#ifdef _CToneCustom
fragColor.rgb = clamp((fragColor.rgb * (PPComp4.z * fragColor.rgb + PPComp5.x)) / (fragColor.rgb * (PPComp5.y * fragColor.rgb + PPComp5.z) + PPComp6.x), 0.0, 1.0);
#else
if(PPComp4.x == 0){ //Filmic 1
fragColor.rgb = tonemapFilmic(fragColor.rgb); // With gamma
} else if (PPComp4.x == 1){ //Filmic 2
fragColor.rgb = acesFilm(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));
} else if (PPComp4.x == 2){ //Reinhard
fragColor.rgb = tonemapReinhard(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));
} else if (PPComp4.x == 3){ //Uncharted2
fragColor.rgb = tonemapUncharted2(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
fragColor.rgb = clamp(fragColor.rgb, 0.0, 1.0);
} else if (PPComp4.x == 4){ //None
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
} else if (PPComp4.x == 5){ //Non-Gamma / Linear
fragColor.rgb = fragColor.rgb;
} else if (PPComp4.x == 6){ //HDP
vec3 x = fragColor.rgb - 0.004;
//vec3 x = max(0, fragColor.rgb - 0.004);
fragColor.rgb = (x*(6.2*x+.5))/(x*(6.2*x+1.7)+0.06);
} else if (PPComp4.x == 7){ //Raw
vec4 vh = vec4(fragColor.rgb, 1);
vec4 va = (1.425 * vh) + 0.05;
vec4 vf = ((vh * va + 0.004) / ((vh * (va + 0.55) + 0.0491))) - 0.0821;
fragColor.rgb = vf.rgb / vf.www;
} else if (PPComp4.x == 8){ //False Colors for luminance control
vec4 c = vec4(fragColor.r,fragColor.g,fragColor.b,0); //Linear without gamma
vec3 luminanceVector = vec3(0.2125, 0.7154, 0.0721); //Relative Luminance Vector
float luminance = dot(luminanceVector, c.xyz);
vec3 maxLumColor = vec3(1,0,0); //High values (> 1.0)
//float maxLum = 2.0; Needs to read the highest pixel, but I don't know how to yet
//Probably easier with a histogram too, once it's it in place?
vec3 midLumColor = vec3(0,1,0); //Mid values (< 1.0)
float midLum = 1.0;
vec3 minLumColor = vec3(0,0,1); //Low values (< 1.0)
float minLum = 0.0;
if(luminance < midLum){
fragColor.rgb = mix(minLumColor, midLumColor, luminance);
} else {
fragColor.rgb = mix(midLumColor, maxLumColor, luminance);
}
} else {
fragColor.rgb = vec3(0,1,0); //ERROR
}
#endif
#else
#ifdef _CToneFilmic
fragColor.rgb = tonemapFilmic(fragColor.rgb); // With gamma
#endif
#ifdef _CToneFilmic2
fragColor.rgb = acesFilm(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));
#endif
#ifdef _CToneReinhard
fragColor.rgb = tonemapReinhard(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));
#endif
#ifdef _CToneUncharted
fragColor.rgb = tonemapUncharted2(fragColor.rgb);
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
fragColor.rgb = clamp(fragColor.rgb, 0.0, 2.2);
#endif
#ifdef _CToneNone
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2)); // To gamma
#endif
#ifdef _CToneCustom
fragColor.rgb = clamp((fragColor.rgb * (1 * fragColor.rgb + 1)) / (fragColor.rgb * (1 * fragColor.rgb + 1 ) + 1), 0.0, 1.0);
#endif
#endif
#ifdef _CBW
@ -326,16 +477,83 @@ void main() {
// fragColor.rgb += compoBrightness;
// #endif
#ifdef _CPostprocess
//Global Values
float factor = 1;
float colorTempK = globalWeight.x;
vec3 ColorTempRGB = ColorTemperatureToRGB(colorTempK);
float originalLuminance = Luminance(fragColor.rgb);
vec3 blended = mix(fragColor.rgb, fragColor.rgb * ColorTempRGB, factor);
vec3 resultHSL = RGBtoHSL(blended);
vec3 luminancePreservedRGB = HSLtoRGB(vec3(resultHSL.x, resultHSL.y, originalLuminance));
fragColor = vec4(mix(blended, luminancePreservedRGB, LUMINANCE_PRESERVATION), 1.0);
mat3 CCSaturation = mat3 ( //Saturation
globalSaturation.r * shadowSaturation.r, globalSaturation.g * shadowSaturation.g, globalSaturation.b * shadowSaturation.b, //Shadows + Global
globalSaturation.r * midtoneSaturation.r, globalSaturation.g * midtoneSaturation.g, globalSaturation.b * midtoneSaturation.b, //Midtones + Global
globalSaturation.r * highlightSaturation.r, globalSaturation.g * highlightSaturation.g, globalSaturation.b * highlightSaturation.b //Highlights + Global
);
mat3 CCContrast = mat3 (
globalContrast.r * shadowContrast.r, globalContrast.g * shadowContrast.g, globalContrast.b * shadowContrast.b, //Shadows + Global
globalContrast.r * midtoneContrast.r, globalContrast.g * midtoneContrast.g, globalContrast.b * midtoneContrast.b, //Midtones + Global
globalContrast.r * highlightContrast.r, globalContrast.g * highlightContrast.g, globalContrast.b * highlightContrast.b //Highlights + Global
);
mat3 CCGamma = mat3 (
globalGamma.r * shadowGamma.r, globalGamma.g * shadowGamma.g, globalGamma.b * shadowGamma.b, //Shadows + Global
globalGamma.r * midtoneGamma.r, globalGamma.g * midtoneGamma.g, globalGamma.b * midtoneGamma.b, //Midtones + Global
globalGamma.r * highlightGamma.r, globalGamma.g * highlightGamma.g, globalGamma.b * highlightGamma.b //Highlights + Global
);
mat3 CCGain = mat3 (
globalGain.r * shadowGain.r, globalGain.g * shadowGain.g, globalGain.b * shadowGain.b, //Shadows + Global
globalGain.r * midtoneGain.r, globalGain.g * midtoneGain.g, globalGain.b * midtoneGain.b, //Midtones + Global
globalGain.r * highlightGain.r, globalGain.g * highlightGain.g, globalGain.b * highlightGain.b //Highlights + Global
);
mat3 CCOffset = mat3 (
globalOffset.r * shadowOffset.r, globalOffset.g * shadowOffset.g, globalOffset.b * shadowOffset.b, //Shadows + Global
globalOffset.r * midtoneOffset.r, globalOffset.g * midtoneOffset.g, globalOffset.b * midtoneOffset.b, //Midtones + Global
globalOffset.r * highlightOffset.r, globalOffset.g * highlightOffset.g, globalOffset.b * highlightOffset.b //Highlights + Global
);
vec2 ToneWeights = vec2(globalWeight.y, globalWeight.z);
fragColor.rgb = FinalizeColorCorrection(
fragColor.rgb,
CCSaturation,
CCContrast,
CCGamma,
CCGain,
CCOffset,
ToneWeights
);
//Tint
fragColor.rgb *= vec3(globalTint.r,globalTint.g,globalTint.b);
#endif
#ifdef _CLensTex
#ifdef _CLensTexMasking
vec4 scratches = texture(lensTexture, texCo);
vec3 scratchBlend = fragColor.rgb + scratches.rgb;
float centerMaxClip = compoCenterMaxClip;
float centerMinClip = compoCenterMinClip;
float luminanceMax = compoLuminanceMax;
float luminanceMin = compoLuminanceMin;
float brightnessExp = compoBrightnessExponent;
#ifdef _CPostprocess
float centerMaxClip = PPComp6.y;
float centerMinClip = PPComp6.z;
float luminanceMax = PPComp7.x;
float luminanceMin = PPComp7.y;
float brightnessExp = PPComp7.z;
#else
float centerMaxClip = compoCenterMaxClip;
float centerMinClip = compoCenterMinClip;
float luminanceMax = compoLuminanceMax;
float luminanceMin = compoLuminanceMin;
float brightnessExp = compoBrightnessExponent;
#endif
float center = smoothstep(centerMaxClip, centerMinClip, length(texCo - 0.5));
float luminance = dot(fragColor.rgb, vec3(0.299, 0.587, 0.114));

View file

@ -75,6 +75,156 @@
"name": "lutTexture",
"link": "$luttexture.jpg",
"ifdef": ["_CLUT"]
},
{
"name": "globalWeight",
"link": "_globalWeight",
"ifdef": ["_CPostprocess"]
},
{
"name": "globalTint",
"link": "_globalTint",
"ifdef": ["_CPostprocess"]
},
{
"name": "globalSaturation",
"link": "_globalSaturation",
"ifdef": ["_CPostprocess"]
},
{
"name": "globalContrast",
"link": "_globalContrast",
"ifdef": ["_CPostprocess"]
},
{
"name": "globalGamma",
"link": "_globalGamma",
"ifdef": ["_CPostprocess"]
},
{
"name": "globalGain",
"link": "_globalGain",
"ifdef": ["_CPostprocess"]
},
{
"name": "globalOffset",
"link": "_globalOffset",
"ifdef": ["_CPostprocess"]
},
{
"name": "shadowSaturation",
"link": "_shadowSaturation",
"ifdef": ["_CPostprocess"]
},
{
"name": "shadowContrast",
"link": "_shadowContrast",
"ifdef": ["_CPostprocess"]
},
{
"name": "shadowGamma",
"link": "_shadowGamma",
"ifdef": ["_CPostprocess"]
},
{
"name": "shadowGain",
"link": "_shadowGain",
"ifdef": ["_CPostprocess"]
},
{
"name": "shadowOffset",
"link": "_shadowOffset",
"ifdef": ["_CPostprocess"]
},
{
"name": "midtoneSaturation",
"link": "_midtoneSaturation",
"ifdef": ["_CPostprocess"]
},
{
"name": "midtoneContrast",
"link": "_midtoneContrast",
"ifdef": ["_CPostprocess"]
},
{
"name": "midtoneGamma",
"link": "_midtoneGamma",
"ifdef": ["_CPostprocess"]
},
{
"name": "midtoneGain",
"link": "_midtoneGain",
"ifdef": ["_CPostprocess"]
},
{
"name": "midtoneOffset",
"link": "_midtoneOffset",
"ifdef": ["_CPostprocess"]
},
{
"name": "highlightSaturation",
"link": "_highlightSaturation",
"ifdef": ["_CPostprocess"]
},
{
"name": "highlightContrast",
"link": "_highlightContrast",
"ifdef": ["_CPostprocess"]
},
{
"name": "highlightGamma",
"link": "_highlightGamma",
"ifdef": ["_CPostprocess"]
},
{
"name": "highlightGain",
"link": "_highlightGain",
"ifdef": ["_CPostprocess"]
},
{
"name": "highlightOffset",
"link": "_highlightOffset",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp1",
"link": "_PPComp1",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp2",
"link": "_PPComp2",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp3",
"link": "_PPComp3",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp4",
"link": "_PPComp4",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp5",
"link": "_PPComp5",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp6",
"link": "_PPComp6",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp7",
"link": "_PPComp7",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp8",
"link": "_PPComp8",
"ifdef": ["_CPostprocess"]
}
],
"texture_params": [],

View file

@ -18,7 +18,7 @@ void main() {
// Scale vertex attribute to [0-1] range
const vec2 madd = vec2(0.5, 0.5);
texCoord = pos.xy * madd + madd;
#ifdef HLSL
#ifdef _InvY
texCoord.y = 1.0 - texCoord.y;
#endif
@ -26,7 +26,7 @@ void main() {
// #ifdef _CPos
// NDC (at the back of cube)
// vec4 v = vec4(pos.xy, 1.0, 1.0);
// vec4 v = vec4(pos.xy, 1.0, 1.0);
// v = vec4(invVP * v);
// v.xyz /= v.w;
// viewRay = v.xyz - eye;

View file

@ -0,0 +1,31 @@
#version 450
// Include functions for gbuffer operations (packFloat2() etc.)
#include "../std/gbuffer.glsl"
// World-space normal from the vertex shader stage
in vec3 wnormal;
// Gbuffer output. Deferred rendering uses the following layout:
// [0]: normal x normal y roughness metallic/matID
// [1]: base color r base color g base color b occlusion/specular
out vec4 fragColor[2];
void main() {
// Pack normals into 2 components to fit into the gbuffer
vec3 n = normalize(wnormal);
n /= (abs(n.x) + abs(n.y) + abs(n.z));
n.xy = n.z >= 0.0 ? n.xy : octahedronWrap(n.xy);
// Define PBR material values
vec3 basecol = vec3(1.0);
float roughness = 0.0;
float metallic = 0.0;
float occlusion = 1.0;
float specular = 1.0;
uint materialId = 0;
// Store in gbuffer (see layout table above)
fragColor[0] = vec4(n.xy, roughness, packFloatInt16(metallic, materialId));
fragColor[1] = vec4(basecol.rgb, packFloat2(occlusion, specular));
}

View file

@ -0,0 +1,20 @@
#version 450
// World to view projection matrix to correctly position the vertex on screen
uniform mat4 WVP;
// Matrix to transform normals from local into world space
uniform mat3 N;
// Position and normal vectors of the current vertex in local space
// Armory packs the vertex data to preserve memory, so nor.z values are
// saved in pos.w
in vec4 pos; // pos.xyz, nor.w
in vec2 nor; // nor.xy
// Normal vector in world space
out vec3 wnormal;
void main() {
wnormal = normalize(N * vec3(nor.xy, pos.w));
gl_Position = WVP * vec4(pos.xyz, 1.0);
}

View file

@ -0,0 +1,9 @@
#version 450
// Color of each fragment on the screen
out vec4 fragColor;
void main() {
// Shadeless white color
fragColor = vec4(1.0);
}

View file

@ -0,0 +1,11 @@
#version 450
// World to view projection matrix to correctly position the vertex on screen
uniform mat4 WVP;
// Position vector of the current vertex in local space
in vec3 pos;
void main() {
gl_Position = WVP * vec4(pos, 1.0);
}

View file

@ -3,10 +3,10 @@
in vec3 pos;
in vec3 col;
uniform mat4 VP;
uniform mat4 ViewProjection;
out vec3 color;
void main() {
color = col;
gl_Position = VP * vec4(pos, 1.0);
gl_Position = ViewProjection * vec4(pos, 1.0);
}

View file

@ -2,7 +2,6 @@
#include "compiled.inc"
#include "std/gbuffer.glsl"
#include "std/light.glsl"
#ifdef _Clusters
#include "std/clusters.glsl"
#endif
@ -22,6 +21,9 @@
uniform sampler2D gbufferD;
uniform sampler2D gbuffer0;
uniform sampler2D gbuffer1;
#ifdef _gbuffer2
uniform sampler2D gbuffer2;
#endif
#ifdef _VoxelAOvar
uniform sampler3D voxels;
@ -36,7 +38,7 @@ uniform vec3 eyeSnap;
uniform float envmapStrength;
#ifdef _Irr
//!uniform vec4 shirr[7];
uniform vec4 shirr[7];
#endif
#ifdef _Brdf
uniform sampler2D senvmapBrdf;
@ -80,14 +82,11 @@ uniform mat4 invVP;
#ifdef _ShadowMap
#ifdef _SinglePoint
//!uniform sampler2DShadow shadowMapSpot[1];
//!uniform mat4 LWVPSpot0;
//!uniform mat4 LWVPSpot[1];
#endif
#ifdef _Clusters
//!uniform sampler2DShadow shadowMapSpot[4];
//!uniform mat4 LWVPSpot0;
//!uniform mat4 LWVPSpot1;
//!uniform mat4 LWVPSpot2;
//!uniform mat4 LWVPSpot3;
//!uniform mat4 LWVPSpotArray[4];
#endif
#endif
#endif
@ -97,7 +96,7 @@ uniform vec3 eye;
uniform vec3 eyeLook;
#ifdef _Clusters
uniform vec4 lightsArray[maxLights * 2];
uniform vec4 lightsArray[maxLights * 3];
#ifdef _Spot
uniform vec4 lightsArraySpot[maxLights];
#endif
@ -109,21 +108,36 @@ uniform vec2 cameraPlane;
#ifdef _SinglePoint
#ifdef _Spot
//!uniform sampler2DShadow shadowMapSpot[1];
//!uniform mat4 LWVPSpot0;
//!uniform mat4 LWVPSpot[1];
#else
//!uniform samplerCubeShadow shadowMapPoint[1];
//!uniform vec2 lightProj;
#endif
#endif
#ifdef _Clusters
//!uniform samplerCubeShadow shadowMapPoint[4];
#ifdef _ShadowMapAtlas
#ifdef _SingleAtlas
uniform sampler2DShadow shadowMapAtlas;
#endif
#endif
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
//!uniform sampler2DShadow shadowMapAtlasPoint;
#endif
//!uniform vec4 pointLightDataArray[4];
#else
//!uniform samplerCubeShadow shadowMapPoint[4];
#endif
//!uniform vec2 lightProj;
#ifdef _Spot
//!uniform sampler2DShadow shadowMapSpot[4];
//!uniform mat4 LWVPSpot0;
//!uniform mat4 LWVPSpot1;
//!uniform mat4 LWVPSpot2;
//!uniform mat4 LWVPSpot3;
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
//!uniform sampler2DShadow shadowMapAtlasSpot;
#endif
#else
//!uniform sampler2DShadow shadowMapSpot[4];
#endif
//!uniform mat4 LWVPSpotArray[4];
#endif
#endif
#endif
@ -132,7 +146,13 @@ uniform vec2 cameraPlane;
uniform vec3 sunDir;
uniform vec3 sunCol;
#ifdef _ShadowMap
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
uniform sampler2DShadow shadowMapAtlasSun;
#endif
#else
uniform sampler2DShadow shadowMap;
#endif
uniform float shadowsBias;
#ifdef _CSM
//!uniform vec4 casData[shadowmapCascades * 4 + 4];
@ -159,13 +179,15 @@ uniform sampler2D texClouds;
uniform float time;
#endif
#include "std/light.glsl"
in vec2 texCoord;
in vec3 viewRay;
out vec4 fragColor;
void main() {
vec4 g0 = textureLod(gbuffer0, texCoord, 0.0); // Normal.xy, metallic/roughness, matid
vec3 n;
n.z = 1.0 - abs(g0.x) - abs(g0.y);
n.xy = n.z >= 0.0 ? g0.xy : octahedronWrap(g0.xy);
@ -186,6 +208,10 @@ void main() {
vec3 v = normalize(eye - p);
float dotNV = max(dot(n, v), 0.0);
#ifdef _gbuffer2
vec4 g2 = textureLod(gbuffer2, texCoord, 0.0);
#endif
#ifdef _MicroShadowing
occspec.x = mix(1.0, occspec.x, dotNV); // AO Fresnel
#endif
@ -196,9 +222,19 @@ void main() {
// Envmap
#ifdef _Irr
vec3 envl = shIrradiance(n);
vec3 envl = shIrradiance(n, shirr);
#ifdef _gbuffer2
if (g2.b < 0.5) {
envl = envl;
} else {
envl = vec3(1.0);
}
#endif
#ifdef _EnvTex
envl /= PI;
envl /= PI;
#endif
#else
vec3 envl = vec3(1.0);
@ -218,7 +254,7 @@ void main() {
#endif
envl.rgb *= albedo;
#ifdef _Rad // Indirect specular
envl.rgb += prefilteredColor * (f0 * envBRDF.x + envBRDF.y) * 1.5 * occspec.y;
#else
@ -236,7 +272,7 @@ void main() {
#else
vec3 voxpos = p / voxelgiHalfExtents;
#endif
#ifndef _VoxelAONoTrace
#ifdef _VoxelGITemporal
envl.rgb *= 1.0 - (traceAO(voxpos, n, voxels) * voxelBlend +
@ -245,7 +281,7 @@ void main() {
envl.rgb *= 1.0 - traceAO(voxpos, n, voxels);
#endif
#endif
#endif
fragColor.rgb = envl;
@ -259,7 +295,7 @@ void main() {
#endif
#ifdef _Emission
if (g0.a == 1.0) {
if (matid == 1) {
fragColor.rgb += g1.rgb; // materialid
albedo = vec3(0.0);
}
@ -272,7 +308,7 @@ void main() {
// for(uint step = 0; step < 400 && color.a < 0.99f; ++step) {
// vec3 point = origin + 0.005 * step * direction;
// color += (1.0f - color.a) * textureLod(voxels, point * 0.5 + 0.5, 0);
// }
// }
// fragColor.rgb += color.rgb;
// Show SSAO
@ -289,10 +325,32 @@ void main() {
#ifdef _ShadowMap
#ifdef _CSM
svisibility = shadowTestCascade(shadowMap, eye, p + n * shadowsBias * 10, shadowsBias);
svisibility = shadowTestCascade(
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
shadowMapAtlasSun
#else
shadowMapAtlas
#endif
#else
shadowMap
#endif
, eye, p + n * shadowsBias * 10, shadowsBias
);
#else
vec4 lPos = LWVP * vec4(p + n * shadowsBias * 100, 1.0);
if (lPos.w > 0.0) svisibility = shadowTest(shadowMap, lPos.xyz / lPos.w, shadowsBias);
vec4 lPos = LWVP * vec4(p + n * shadowsBias * 100, 1.0);
if (lPos.w > 0.0) svisibility = shadowTest(
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
shadowMapAtlasSun
#else
shadowMapAtlas
#endif
#else
shadowMap
#endif
, lPos.xyz / lPos.w, shadowsBias
);
#endif
#endif
@ -320,7 +378,7 @@ void main() {
fragColor.rgb += sdirect * svisibility * sunCol;
// #ifdef _Hair // Aniso
// if (g0.a == 2.0) {
// if (matid == 2) {
// const float shinyParallel = roughness;
// const float shinyPerpendicular = 0.1;
// const vec3 v = vec3(0.99146, 0.11664, 0.05832);
@ -330,12 +388,23 @@ void main() {
// #endif
#ifdef _SSS
if (g0.a == 2.0) {
if (matid == 2) {
#ifdef _CSM
int casi, casindex;
mat4 LWVP = getCascadeMat(distance(eye, p), casi, casindex);
#endif
fragColor.rgb += fragColor.rgb * SSSSTransmittance(LWVP, p, n, sunDir, lightPlane.y, shadowMap);
fragColor.rgb += fragColor.rgb * SSSSTransmittance(
LWVP, p, n, sunDir, lightPlane.y,
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
shadowMapAtlasSun
#else
shadowMapAtlas
#endif
#else
shadowMap
#endif
);
}
#endif
@ -346,7 +415,7 @@ void main() {
fragColor.rgb += sampleLight(
p, n, v, dotNV, pointPos, pointCol, albedo, roughness, occspec.y, f0
#ifdef _ShadowMap
, 0, pointBias
, 0, pointBias, true
#endif
#ifdef _Spot
, true, spotData.x, spotData.y, spotDir
@ -363,12 +432,12 @@ void main() {
, gbufferD, invVP, eye
#endif
);
#ifdef _Spot
#ifdef _SSS
if (g0.a == 2.0) fragColor.rgb += fragColor.rgb * SSSSTransmittance(LWVPSpot0, p, n, normalize(pointPos - p), lightPlane.y, shadowMapSpot[0]);
if (matid == 2) fragColor.rgb += fragColor.rgb * SSSSTransmittance(LWVPSpot0, p, n, normalize(pointPos - p), lightPlane.y, shadowMapSpot[0]);
#endif
#endif
#endif
#endif
@ -393,18 +462,19 @@ void main() {
n,
v,
dotNV,
lightsArray[li * 2].xyz, // lp
lightsArray[li * 2 + 1].xyz, // lightCol
lightsArray[li * 3].xyz, // lp
lightsArray[li * 3 + 1].xyz, // lightCol
albedo,
roughness,
occspec.y,
f0
#ifdef _ShadowMap
, li, lightsArray[li * 2].w // bias
// light index, shadow bias, cast_shadows
, li, lightsArray[li * 3 + 2].x, lightsArray[li * 3 + 2].z != 0.0
#endif
#ifdef _Spot
, li > numPoints - 1
, lightsArray[li * 2 + 1].w // cutoff
, lightsArray[li * 3 + 2].y != 0.0
, lightsArray[li * 3 + 2].y // cutoff
, lightsArraySpot[li].w // cutoff - exponent
, lightsArraySpot[li].xyz // spotDir
#endif

View file

@ -99,7 +99,7 @@
},
{
"name": "LWVP",
"link": "_biasLightWorldViewProjectionMatrix",
"link": "_biasLightWorldViewProjectionMatrixSun",
"ifndef": ["_CSM"],
"ifdef": ["_Sun", "_ShadowMap"]
},
@ -199,48 +199,43 @@
"ifdef": ["_SinglePoint", "_Spot"]
},
{
"name": "LWVPSpot0",
"name": "LWVPSpotArray",
"link": "_biasLightWorldViewProjectionMatrixSpotArray",
"ifdef": ["_Clusters", "_ShadowMap", "_Spot"]
},
{
"name": "pointLightDataArray",
"link": "_pointLightsAtlasArray",
"ifdef": ["_Clusters", "_ShadowMap", "_ShadowMapAtlas"]
},
{
"name": "LWVPSpot[0]",
"link": "_biasLightWorldViewProjectionMatrixSpot0",
"ifdef": ["_Spot", "_ShadowMap"]
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot1",
"name": "LWVPSpot[1]",
"link": "_biasLightWorldViewProjectionMatrixSpot1",
"ifdef": ["_Spot", "_ShadowMap"]
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot2",
"name": "LWVPSpot[2]",
"link": "_biasLightWorldViewProjectionMatrixSpot2",
"ifdef": ["_Spot", "_ShadowMap"]
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot3",
"link": "_biasLightWorldViewProjectionMatrixSpot3",
"ifdef": ["_Spot", "_ShadowMap"]
},
{
"name": "LWVPSpot0",
"link": "_biasLightWorldViewProjectionMatrixSpot0",
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot1",
"link": "_biasLightWorldViewProjectionMatrixSpot1",
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot2",
"link": "_biasLightWorldViewProjectionMatrixSpot2",
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot3",
"name": "LWVPSpot[3]",
"link": "_biasLightWorldViewProjectionMatrixSpot3",
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_LTC", "_ShadowMap"]
}
],
"vertex_shader": "../include/pass_viewray.vert.glsl",
"fragment_shader": "deferred_light.frag.glsl"
"fragment_shader": "deferred_light.frag.glsl",
"color_attachments": ["RGBA64"]
}
]
}

View file

@ -3,7 +3,6 @@
#include "compiled.inc"
#include "std/gbuffer.glsl"
#include "std/math.glsl"
#include "std/light_mobile.glsl"
#ifdef _Clusters
#include "std/clusters.glsl"
#endif
@ -17,7 +16,7 @@ uniform sampler2D gbuffer1;
uniform float envmapStrength;
#ifdef _Irr
//!uniform vec4 shirr[7];
uniform vec4 shirr[7];
#endif
#ifdef _Brdf
uniform sampler2D senvmapBrdf;
@ -30,12 +29,15 @@ uniform int envmapNumMipmaps;
uniform vec3 backgroundCol;
#endif
#ifdef _SMSizeUniform
//!uniform vec2 smSizeUniform;
#endif
uniform vec2 cameraProj;
uniform vec3 eye;
uniform vec3 eyeLook;
#ifdef _Clusters
uniform vec4 lightsArray[maxLights * 2];
uniform vec4 lightsArray[maxLights * 3];
#ifdef _Spot
uniform vec4 lightsArraySpot[maxLights];
#endif
@ -47,21 +49,36 @@ uniform vec2 cameraPlane;
#ifdef _SinglePoint
#ifdef _Spot
//!uniform sampler2DShadow shadowMapSpot[1];
//!uniform mat4 LWVPSpot0;
//!uniform mat4 LWVPSpot[1];
#else
//!uniform samplerCubeShadow shadowMapPoint[1];
//!uniform vec2 lightProj;
#endif
#endif
#ifdef _Clusters
//!uniform samplerCubeShadow shadowMapPoint[4];
#ifdef _ShadowMapAtlas
#ifdef _SingleAtlas
uniform sampler2DShadow shadowMapAtlas;
#endif
#endif
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
//!uniform sampler2DShadow shadowMapAtlasPoint;
#endif
//!uniform vec4 pointLightDataArray[4];
#else
//!uniform samplerCubeShadow shadowMapPoint[4];
#endif
//!uniform vec2 lightProj;
#ifdef _Spot
//!uniform sampler2DShadow shadowMapSpot[4];
//!uniform mat4 LWVPSpot0;
//!uniform mat4 LWVPSpot1;
//!uniform mat4 LWVPSpot2;
//!uniform mat4 LWVPSpot3;
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
//!uniform sampler2DShadow shadowMapAtlasSpot;
#endif
#else
//!uniform sampler2DShadow shadowMapSpot[4];
#endif
//!uniform mat4 LWVPSpotArray[4];
#endif
#endif
#endif
@ -70,7 +87,13 @@ uniform vec2 cameraPlane;
uniform vec3 sunDir;
uniform vec3 sunCol;
#ifdef _ShadowMap
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
uniform sampler2DShadow shadowMapAtlasSun;
#endif
#else
uniform sampler2DShadow shadowMap;
#endif
uniform float shadowsBias;
#ifdef _CSM
//!uniform vec4 casData[shadowmapCascades * 4 + 4];
@ -90,13 +113,15 @@ uniform float pointBias;
#endif
#endif
#include "std/light_mobile.glsl"
in vec2 texCoord;
in vec3 viewRay;
out vec4 fragColor;
void main() {
vec4 g0 = textureLod(gbuffer0, texCoord, 0.0); // Normal.xy, metallic/roughness, depth
vec3 n;
n.z = 1.0 - abs(g0.x) - abs(g0.y);
n.xy = n.z >= 0.0 ? g0.xy : octahedronWrap(g0.xy);
@ -123,7 +148,7 @@ void main() {
// Envmap
#ifdef _Irr
vec3 envl = shIrradiance(n);
vec3 envl = shIrradiance(n, shirr);
#ifdef _EnvTex
envl /= PI;
#endif
@ -145,7 +170,7 @@ void main() {
#endif
envl.rgb *= albedo;
#ifdef _Rad // Indirect specular
envl.rgb += prefilteredColor * (f0 * envBRDF.x + envBRDF.y) * 1.5 * occspec.y;
#else
@ -168,10 +193,32 @@ void main() {
#ifdef _ShadowMap
#ifdef _CSM
svisibility = shadowTestCascade(shadowMap, eye, p + n * shadowsBias * 10, shadowsBias, shadowmapSize * vec2(shadowmapCascades, 1.0));
svisibility = shadowTestCascade(
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
shadowMapAtlasSun
#else
shadowMapAtlas
#endif
#else
shadowMap
#endif
, eye, p + n * shadowsBias * 10, shadowsBias
);
#else
vec4 lPos = LWVP * vec4(p + n * shadowsBias * 100, 1.0);
if (lPos.w > 0.0) svisibility = shadowTest(shadowMap, lPos.xyz / lPos.w, shadowsBias, shadowmapSize);
vec4 lPos = LWVP * vec4(p + n * shadowsBias * 100, 1.0);
if (lPos.w > 0.0) svisibility = shadowTest(
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
shadowMapAtlasSun
#else
shadowMapAtlas
#endif
#else
shadowMap
#endif
, lPos.xyz / lPos.w, shadowsBias
);
#endif
#endif
@ -182,7 +229,7 @@ void main() {
fragColor.rgb += sampleLight(
p, n, v, dotNV, pointPos, pointCol, albedo, roughness, occspec.y, f0
#ifdef _ShadowMap
, 0, pointBias
, 0, pointBias, true
#endif
#ifdef _Spot
, true, spotData.x, spotData.y, spotDir
@ -211,18 +258,19 @@ void main() {
n,
v,
dotNV,
lightsArray[li * 2].xyz, // lp
lightsArray[li * 2 + 1].xyz, // lightCol
lightsArray[li * 3].xyz, // lp
lightsArray[li * 3 + 1].xyz, // lightCol
albedo,
roughness,
occspec.y,
f0
#ifdef _ShadowMap
, li, lightsArray[li * 2].w // bias
// light index, shadow bias, cast_shadows
, li, lightsArray[li * 3 + 2].x, lightsArray[li * 3 + 2].z != 0.0
#endif
#ifdef _Spot
, li > numPoints - 1
, lightsArray[li * 2 + 1].w // cutoff
, lightsArray[li * 3 + 2].y != 0.0
, lightsArray[li * 3 + 2].y // cutoff
, lightsArraySpot[li].w // cutoff - exponent
, lightsArraySpot[li].xyz // spotDir
#endif

View file

@ -88,7 +88,7 @@
},
{
"name": "LWVP",
"link": "_biasLightWorldViewProjectionMatrix",
"link": "_biasLightWorldViewProjectionMatrixSun",
"ifndef": ["_CSM"],
"ifdef": ["_Sun", "_ShadowMap"]
},
@ -107,6 +107,11 @@
"link": "_viewProjectionMatrix",
"ifdef": ["_SSRS"]
},
{
"name": "smSizeUniform",
"link": "_shadowMapSize",
"ifdef": ["_SMSizeUniform"]
},
{
"name": "lightProj",
"link": "_lightPlaneProj",
@ -138,28 +143,43 @@
"ifdef": ["_SinglePoint", "_Spot"]
},
{
"name": "LWVPSpot0",
"name": "LWVPSpotArray",
"link": "_biasLightWorldViewProjectionMatrixSpotArray",
"ifdef": ["_Clusters", "_ShadowMap", "_Spot"]
},
{
"name": "pointLightDataArray",
"link": "_pointLightsAtlasArray",
"ifdef": ["_Clusters", "_ShadowMap", "_ShadowMapAtlas"]
},
{
"name": "LWVPSpot[0]",
"link": "_biasLightWorldViewProjectionMatrixSpot0",
"ifdef": ["_Spot", "_ShadowMap"]
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot1",
"name": "LWVPSpot[1]",
"link": "_biasLightWorldViewProjectionMatrixSpot1",
"ifdef": ["_Spot", "_ShadowMap"]
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot2",
"name": "LWVPSpot[2]",
"link": "_biasLightWorldViewProjectionMatrixSpot2",
"ifdef": ["_Spot", "_ShadowMap"]
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_LTC", "_ShadowMap"]
},
{
"name": "LWVPSpot3",
"name": "LWVPSpot[3]",
"link": "_biasLightWorldViewProjectionMatrixSpot3",
"ifdef": ["_Spot", "_ShadowMap"]
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_LTC", "_ShadowMap"]
}
],
"vertex_shader": "../include/pass_viewray.vert.glsl",
"fragment_shader": "deferred_light.frag.glsl"
"fragment_shader": "deferred_light.frag.glsl",
"color_attachments": ["RGBA64"]
}
]
}

View file

@ -7,7 +7,8 @@
"cull_mode": "none",
"links": [],
"vertex_shader": "../include/pass.vert.glsl",
"fragment_shader": "deferred_light.frag.glsl"
"fragment_shader": "deferred_light.frag.glsl",
"color_attachments": ["RGBA64"]
}
]
}

View file

@ -10,7 +10,7 @@ void main() {
// Scale vertex attribute to 0-1 range
const vec2 madd = vec2(0.5, 0.5);
texCoord = pos.xy * madd + madd;
#ifdef HLSL
#ifdef _InvY
texCoord.y = 1.0 - texCoord.y;
#endif

View file

@ -14,7 +14,7 @@ void main() {
// Scale vertex attribute to [0-1] range
const vec2 madd = vec2(0.5, 0.5);
texCoord = pos.xy * madd + madd;
#ifdef HLSL
#ifdef _InvY
texCoord.y = 1.0 - texCoord.y;
#endif

View file

@ -13,14 +13,14 @@ void main() {
// Scale vertex attribute to [0-1] range
const vec2 madd = vec2(0.5, 0.5);
texCoord = pos.xy * madd + madd;
#ifdef HLSL
#ifdef _InvY
texCoord.y = 1.0 - texCoord.y;
#endif
gl_Position = vec4(pos.xy, 0.0, 1.0);
// NDC (at the back of cube)
vec4 v = vec4(pos.x, pos.y, 1.0, 1.0);
vec4 v = vec4(pos.x, pos.y, 1.0, 1.0);
v = vec4(invP * v);
viewRay = vec3(v.xy / v.z, 1.0);
}

View file

@ -18,7 +18,7 @@ in vec3 viewRay;
out vec4 fragColor;
vec2 getVelocity(vec2 coord, float depth) {
#ifdef HLSL
#ifdef _InvY
coord.y = 1.0 - coord.y;
#endif
vec4 currentPos = vec4(coord.xy * 2.0 - 1.0, depth, 1.0);
@ -26,7 +26,7 @@ vec2 getVelocity(vec2 coord, float depth) {
vec4 previousPos = prevVP * worldPos;
previousPos /= previousPos.w;
vec2 velocity = (currentPos - previousPos).xy / 40.0;
#ifdef HLSL
#ifdef _InvY
velocity.y = -velocity.y;
#endif
return velocity;
@ -34,7 +34,7 @@ vec2 getVelocity(vec2 coord, float depth) {
void main() {
fragColor.rgb = textureLod(tex, texCoord, 0.0).rgb;
float depth = textureLod(gbufferD, texCoord, 0.0).r * 2.0 - 1.0;
if (depth == 1.0) {
return;
@ -42,7 +42,7 @@ void main() {
float blurScale = motionBlurIntensity * frameScale;
vec2 velocity = getVelocity(texCoord, depth) * blurScale;
vec2 offset = texCoord;
int processed = 1;
for(int i = 0; i < 8; ++i) {

View file

@ -14,11 +14,11 @@ out vec4 fragColor;
void main() {
vec2 velocity = textureLod(sveloc, texCoord, 0.0).rg * motionBlurIntensity * frameScale;
#ifdef HLSL
#ifdef _InvY
velocity.y = -velocity.y;
#endif
fragColor.rgb = textureLod(tex, texCoord, 0.0).rgb;
// float speed = length(velocity / texStep);

View file

@ -17,7 +17,7 @@ out vec4 fragColor;
void main() {
vec2 texCoord = wvpposition.xy / wvpposition.w;
texCoord = texCoord * 0.5 + 0.5;
#ifdef HLSL
#ifdef _InvY
texCoord.y = 1.0 - texCoord.y;
#endif
@ -46,7 +46,7 @@ void main() {
vec3 v = wp - eye;
vec3 r = reflect(v, n);
#ifdef HLSL
#ifdef _InvY
r.y = -r.y;
#endif
float intensity = clamp((1.0 - roughness) * dot(wp - probep, n), 0.0, 1.0);

View file

@ -17,7 +17,7 @@ out vec4 fragColor;
void main() {
vec2 texCoord = wvpposition.xy / wvpposition.w;
texCoord = texCoord * 0.5 + 0.5;
#ifdef HLSL
#ifdef _InvY
texCoord.y = 1.0 - texCoord.y;
#endif
@ -39,7 +39,7 @@ void main() {
vec3 wp = getPos2(invVP, depth, texCoord);
vec4 pp = probeVP * vec4(wp.xyz, 1.0);
vec2 tc = (pp.xy / pp.w) * 0.5 + 0.5;
#ifdef HLSL
#ifdef _InvY
tc.y = 1.0 - tc.y;
#endif

View file

@ -1,5 +1,6 @@
#version 450
#include "compiled.inc"
#define SMAA_MAX_SEARCH_STEPS_DIAG 8
#define SMAA_AREATEX_MAX_DISTANCE 16
#define SMAA_AREATEX_MAX_DISTANCE_DIAG 20
@ -33,7 +34,7 @@ out vec4 fragColor;
vec2 cdw_end;
vec4 textureLodA(sampler2D tex, vec2 coord, float lod) {
#ifdef HLSL
#ifdef _InvY
coord.y = 1.0 - coord.y;
#endif
return textureLod(tex, coord, lod);
@ -104,7 +105,7 @@ vec2 SMAASearchDiag2(vec2 texcoord, vec2 dir) {
return coord.zw;
}
/**
/**
* Similar to SMAAArea, this calculates the area corresponding to a certain
* diagonal distance and crossing edges 'e'.
*/
@ -147,7 +148,7 @@ vec2 SMAACalculateDiagWeights(vec2 texcoord, vec2 e, vec4 subsampleIndices) {
// Fetch the crossing edges:
vec4 coords = mad(vec4(-d.x + 0.25, d.x, d.y, -d.y - 0.25), screenSizeInv.xyxy, texcoord.xyxy);
vec4 c;
c.xy = SMAASampleLevelZeroOffset(edgesTex, coords.xy, ivec2(-1, 0)).rg;
c.zw = SMAASampleLevelZeroOffset(edgesTex, coords.zw, ivec2( 1, 0)).rg;
c.yxwz = SMAADecodeDiagBilinearAccess(c.xyzw);
@ -172,7 +173,7 @@ vec2 SMAACalculateDiagWeights(vec2 texcoord, vec2 e, vec4 subsampleIndices) {
d.yw = SMAASearchDiag2(texcoord, vec2(1.0, 1.0)/*, cdw_end*/);
float dadd = cdw_end.y > 0.9 ? 1.0 : 0.0;
d.y += dadd;
}
}
else {
d.yw = vec2(0.0, 0.0);
}
@ -207,7 +208,7 @@ vec2 SMAACalculateDiagWeights(vec2 texcoord, vec2 e, vec4 subsampleIndices) {
/**
* This allows to determine how much length should we add in the last step
* of the searches. It takes the bilinearly interpolated edge (see
* of the searches. It takes the bilinearly interpolated edge (see
* @PSEUDO_GATHER4), and adds 0, 1 or 2, depending on which edges and
* crossing edges are active.
*/
@ -244,7 +245,7 @@ float SMAASearchXLeft(vec2 texcoord, float end) {
* which edges are active from the four fetched ones.
*/
vec2 e = vec2(0.0, 1.0);
while (texcoord.x > end &&
while (texcoord.x > end &&
e.g > 0.8281 && // Is there some edge not activated?
e.r == 0.0) { // Or is there a crossing edge that breaks the line?
e = textureLodA(edgesTex, texcoord, 0.0).rg;
@ -257,20 +258,20 @@ float SMAASearchXLeft(vec2 texcoord, float end) {
float SMAASearchXRight(vec2 texcoord, float end) {
vec2 e = vec2(0.0, 1.0);
while (texcoord.x < end &&
while (texcoord.x < end &&
e.g > 0.8281 && // Is there some edge not activated?
e.r == 0.0) { // Or is there a crossing edge that breaks the line?
e = textureLodA(edgesTex, texcoord, 0.0).rg;
texcoord = mad(vec2(2.0, 0.0), screenSizeInv.xy, texcoord);
}
float offset = mad(-(255.0 / 127.0), SMAASearchLength(e, 0.5), 3.25);
return mad(-screenSizeInv.x, offset, texcoord.x);
}
float SMAASearchYUp(vec2 texcoord, float end) {
vec2 e = vec2(1.0, 0.0);
while (texcoord.y > end &&
while (texcoord.y > end &&
e.r > 0.8281 && // Is there some edge not activated?
e.g == 0.0) { // Or is there a crossing edge that breaks the line?
e = textureLodA(edgesTex, texcoord, 0.0).rg;
@ -282,7 +283,7 @@ float SMAASearchYUp(vec2 texcoord, float end) {
float SMAASearchYDown(vec2 texcoord, float end) {
vec2 e = vec2(1.0, 0.0);
while (texcoord.y < end &&
while (texcoord.y < end &&
e.r > 0.8281 && // Is there some edge not activated?
e.g == 0.0) { // Or is there a crossing edge that breaks the line?
e = textureLodA(edgesTex, texcoord, 0.0).rg;
@ -292,14 +293,14 @@ float SMAASearchYDown(vec2 texcoord, float end) {
return mad(-screenSizeInv.y, offset, texcoord.y);
}
/**
/**
* Ok, we have the distance and both crossing edges. So, what are the areas
* at each side of current edge?
*/
vec2 SMAAArea(vec2 dist, float e1, float e2, float offset) {
// Rounding prevents precision errors of bilinear filtering:
vec2 texcoord = mad(vec2(SMAA_AREATEX_MAX_DISTANCE, SMAA_AREATEX_MAX_DISTANCE), round(4.0 * vec2(e1, e2)), dist);
// We do a scale and bias for mapping to texel space:
texcoord = mad(SMAA_AREATEX_PIXEL_SIZE, texcoord, 0.5 * SMAA_AREATEX_PIXEL_SIZE);
@ -363,7 +364,7 @@ vec4 SMAABlendingWeightCalculationPS(vec2 texcoord, vec2 pixcoord,
// one of the boundaries is enough.
weights.rg = SMAACalculateDiagWeights(texcoord, e, subsampleIndices);
// We give priority to diagonals, so if we find a diagonal we skip
// We give priority to diagonals, so if we find a diagonal we skip
// horizontal/vertical processing.
//SMAA_BRANCH
if (weights.r == -weights.g) { // weights.r + weights.g == 0.0
@ -433,7 +434,7 @@ vec4 SMAABlendingWeightCalculationPS(vec2 texcoord, vec2 pixcoord,
// We want the distances to be in pixel units:
d = abs(round(mad(screenSize.yy, d, -pixcoord.yy)));
// SMAAArea below needs a sqrt, as the areas texture is compressed
// SMAAArea below needs a sqrt, as the areas texture is compressed
// quadratically:
vec2 sqrt_d = sqrt(d);

View file

@ -11,7 +11,7 @@ out vec4 offset0;
out vec4 offset1;
out vec4 offset2;
#ifdef HLSL
#ifdef _InvY
#define V_DIR(v) -(v)
#else
#define V_DIR(v) v
@ -21,7 +21,7 @@ void main() {
// Scale vertex attribute to [0-1] range
const vec2 madd = vec2(0.5, 0.5);
texCoord = pos.xy * madd + madd;
#ifdef HLSL
#ifdef _InvY
texCoord.y = 1.0 - texCoord.y;
#endif

View file

@ -18,7 +18,7 @@ out vec4 fragColor;
// Neighborhood Blending Pixel Shader (Third Pass)
vec4 textureLodA(sampler2D tex, vec2 coords, float lod) {
#ifdef HLSL
#ifdef _InvY
coords.y = 1.0 - coords.y;
#endif
return textureLod(tex, coords, lod);
@ -49,7 +49,7 @@ vec4 SMAANeighborhoodBlendingPS(vec2 texcoord, vec4 offset) {
// Calculate the blending offsets:
vec4 blendingOffset = vec4(0.0, a.y, 0.0, a.w);
vec2 blendingWeight = a.yw;
if (h) {
blendingOffset.x = a.x;
blendingOffset.y = 0.0;
@ -58,11 +58,11 @@ vec4 SMAANeighborhoodBlendingPS(vec2 texcoord, vec4 offset) {
blendingWeight.x = a.x;
blendingWeight.y = a.z;
}
blendingWeight /= dot(blendingWeight, vec2(1.0, 1.0));
// Calculate the texture coordinates:
#ifdef HLSL
#ifdef _InvY
vec2 tc = vec2(texcoord.x, 1.0 - texcoord.y);
#else
vec2 tc = texcoord;

View file

@ -9,7 +9,7 @@ uniform vec2 screenSizeInv;
out vec2 texCoord;
out vec4 offset;
#ifdef HLSL
#ifdef _InvY
#define V_DIR(v) -(v)
#else
#define V_DIR(v) v
@ -19,7 +19,7 @@ void main() {
// Scale vertex attribute to [0-1] range
const vec2 madd = vec2(0.5, 0.5);
texCoord = pos.xy * madd + madd;
#ifdef HLSL
#ifdef _InvY
texCoord.y = 1.0 - texCoord.y;
#endif

View file

@ -12,6 +12,11 @@ uniform vec3 eyeLook;
uniform vec2 screenSize;
uniform mat4 invVP;
#ifdef _CPostprocess
uniform vec3 PPComp11;
uniform vec3 PPComp12;
#endif
in vec2 texCoord;
in vec3 viewRay;
out float fragColor;
@ -20,17 +25,21 @@ void main() {
float depth = textureLod(gbufferD, texCoord, 0.0).r * 2.0 - 1.0;
if (depth == 1.0) { fragColor = 1.0; return; }
vec2 enc = textureLod(gbuffer0, texCoord, 0.0).rg;
vec2 enc = textureLod(gbuffer0, texCoord, 0.0).rg;
vec3 n;
n.z = 1.0 - abs(enc.x) - abs(enc.y);
n.xy = n.z >= 0.0 ? enc.xy : octahedronWrap(enc.xy);
n = normalize(n);
vec3 vray = normalize(viewRay);
vec3 currentPos = getPosNoEye(eyeLook, vray, depth, cameraProj);
// vec3 currentPos = getPos2NoEye(eye, invVP, depth, texCoord);
float currentDistance = length(currentPos);
float currentDistanceA = currentDistance * ssaoScale * (1.0 / ssaoRadius);
#ifdef _CPostprocess
float currentDistanceA = currentDistance * PPComp12.y * (1.0 / PPComp11.z);
#else
float currentDistanceA = currentDistance * ssaoScale * (1.0 / ssaoRadius);
#endif
float currentDistanceB = currentDistance * 0.0005;
ivec2 px = ivec2(texCoord * screenSize);
float phi = (3 * px.x ^ px.y + px.x * px.y) * 10;
@ -46,7 +55,11 @@ void main() {
vec3 pos = getPos2NoEye(eye, invVP, depth, texCoord + k) - currentPos;
fragColor += max(0, dot(pos, n) - currentDistanceB) / (dot(pos, pos) + 0.015);
}
fragColor *= (ssaoStrength * 0.3) / samples;
#ifdef _CPostprocess
fragColor *= (PPComp12.x * 0.3) / samples;
#else
fragColor *= (ssaoStrength * 0.3) / samples;
#endif
fragColor = 1.0 - fragColor;
}

View file

@ -25,6 +25,16 @@
{
"name": "screenSize",
"link": "_screenSize"
},
{
"name": "PPComp11",
"link": "_PPComp11",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp12",
"link": "_PPComp12",
"ifdef": ["_CPostprocess"]
}
],
"texture_params": [],

View file

@ -37,7 +37,7 @@ vec2 getProjectedCoord(vec3 hitCoord) {
vec4 projectedCoord = P * vec4(hitCoord, 1.0);
projectedCoord.xy /= projectedCoord.w;
projectedCoord.xy = projectedCoord.xy * 0.5 + 0.5;
#ifdef HLSL
#ifdef _InvY
projectedCoord.y = 1.0 - projectedCoord.y;
#endif
return projectedCoord.xy;

View file

@ -12,6 +12,11 @@ uniform mat4 P;
uniform mat3 V3;
uniform vec2 cameraProj;
#ifdef _CPostprocess
uniform vec3 PPComp9;
uniform vec3 PPComp10;
#endif
in vec3 viewRay;
in vec2 texCoord;
out vec4 fragColor;
@ -26,13 +31,13 @@ vec2 getProjectedCoord(const vec3 hit) {
vec4 projectedCoord = P * vec4(hit, 1.0);
projectedCoord.xy /= projectedCoord.w;
projectedCoord.xy = projectedCoord.xy * 0.5 + 0.5;
#ifdef HLSL
#ifdef _InvY
projectedCoord.y = 1.0 - projectedCoord.y;
#endif
return projectedCoord.xy;
}
float getDeltaDepth(const vec3 hit) {
float getDeltaDepth(const vec3 hit) {
depth = textureLod(gbufferD, getProjectedCoord(hit), 0.0).r * 2.0 - 1.0;
vec3 viewPos = getPosView(viewRay, depth, cameraProj);
return viewPos.z - hit.z;
@ -48,12 +53,20 @@ vec4 binarySearch(vec3 dir) {
if (ddepth < 0.0) hitCoord += dir;
}
// Ugly discard of hits too far away
if (abs(ddepth) > ssrSearchDist / 500) return vec4(0.0);
#ifdef _CPostprocess
if (abs(ddepth) > PPComp9.z / 500) return vec4(0.0);
#else
if (abs(ddepth) > ssrSearchDist / 500) return vec4(0.0);
#endif
return vec4(getProjectedCoord(hitCoord), 0.0, 1.0);
}
vec4 rayCast(vec3 dir) {
dir *= ssrRayStep;
#ifdef _CPostprocess
dir *= PPComp9.x;
#else
dir *= ssrRayStep;
#endif
for (int i = 0; i < maxSteps; i++) {
hitCoord += dir;
if (getDeltaDepth(hitCoord) > 0.0) return binarySearch(dir);
@ -63,12 +76,12 @@ vec4 rayCast(vec3 dir) {
void main() {
vec4 g0 = textureLod(gbuffer0, texCoord, 0.0);
float roughness = g0.b;
float roughness = unpackFloat(g0.b).y;
if (roughness == 1.0) { fragColor.rgb = vec3(0.0); return; }
float spec = fract(textureLod(gbuffer1, texCoord, 0.0).a);
if (spec == 0.0) { fragColor.rgb = vec3(0.0); return; }
float d = textureLod(gbufferD, texCoord, 0.0).r * 2.0 - 1.0;
if (d == 1.0) { fragColor.rgb = vec3(0.0); return; }
@ -77,13 +90,18 @@ void main() {
n.z = 1.0 - abs(enc.x) - abs(enc.y);
n.xy = n.z >= 0.0 ? enc.xy : octahedronWrap(enc.xy);
n = normalize(n);
vec3 viewNormal = V3 * n;
vec3 viewPos = getPosView(viewRay, d, cameraProj);
vec3 reflected = normalize(reflect(viewPos, viewNormal));
hitCoord = viewPos;
vec3 dir = reflected * (1.0 - rand(texCoord) * ssrJitter * roughness) * 2.0;
#ifdef _CPostprocess
vec3 dir = reflected * (1.0 - rand(texCoord) * PPComp10.y * roughness) * 2.0;
#else
vec3 dir = reflected * (1.0 - rand(texCoord) * ssrJitter * roughness) * 2.0;
#endif
// * max(ssrMinRayStep, -viewPos.z)
vec4 coords = rayCast(dir);
@ -91,12 +109,11 @@ void main() {
float screenEdgeFactor = clamp(1.0 - (deltaCoords.x + deltaCoords.y), 0.0, 1.0);
float reflectivity = 1.0 - roughness;
float intensity = pow(reflectivity, ssrFalloffExp) *
screenEdgeFactor *
clamp(-reflected.z, 0.0, 1.0) *
clamp((ssrSearchDist - length(viewPos - hitCoord)) *
(1.0 / ssrSearchDist), 0.0, 1.0) *
coords.w;
#ifdef _CPostprocess
float intensity = pow(reflectivity, PPComp10.x) * screenEdgeFactor * clamp(-reflected.z, 0.0, 1.0) * clamp((PPComp9.z - length(viewPos - hitCoord)) * (1.0 / PPComp9.z), 0.0, 1.0) * coords.w;
#else
float intensity = pow(reflectivity, ssrFalloffExp) * screenEdgeFactor * clamp(-reflected.z, 0.0, 1.0) * clamp((ssrSearchDist - length(viewPos - hitCoord)) * (1.0 / ssrSearchDist), 0.0, 1.0) * coords.w;
#endif
intensity = clamp(intensity, 0.0, 1.0);
vec3 reflCol = textureLod(tex, coords.xy, 0.0).rgb;

View file

@ -21,6 +21,16 @@
{
"name": "cameraProj",
"link": "_cameraPlaneProj"
},
{
"name": "PPComp9",
"link": "_PPComp9",
"ifdef": ["_CPostprocess"]
},
{
"name": "PPComp10",
"link": "_PPComp10",
"ifdef": ["_CPostprocess"]
}
],
"texture_params": [],

View file

@ -1,7 +1,4 @@
const int maxLights = 16;
const int maxLightsCluster = 4; // Ensure fast loop unroll before going higher
const float clusterNear = 3.0;
const vec3 clusterSlices = vec3(16, 16, 16);
int getClusterI(vec2 tc, float viewz, vec2 cameraPlane) {
@ -11,6 +8,10 @@ int getClusterI(vec2 tc, float viewz, vec2 cameraPlane) {
float z = log(viewz - cnear + 1.0) / log(cameraPlane.y - cnear + 1.0);
sliceZ = int(z * (clusterSlices.z - 1)) + 1;
}
// address gap between near plane and cluster near offset
else if (viewz >= cameraPlane.x) {
sliceZ = 1;
}
return int(tc.x * clusterSlices.x) +
int(int(tc.y * clusterSlices.y) * clusterSlices.x) +
int(sliceZ * clusterSlices.x * clusterSlices.y);

View file

@ -0,0 +1,144 @@
// Colorgrading library functions - Inspired by UE4
//No specific license (maybe zlib), but just do whatever
#define LUMINANCE_PRESERVATION 0.75
#define EPSILON 1e-10
#define LUMA1 0.2722287168
#define LUMA2 0.6740817658
#define LUMA3 0.0536895174
float saturate(float v) { return clamp(v, 0.0, 1.0); }
vec2 saturate(vec2 v) { return clamp(v, vec2(0.0), vec2(1.0)); }
vec3 saturate(vec3 v) { return clamp(v, vec3(0.0), vec3(1.0)); }
vec4 saturate(vec4 v) { return clamp(v, vec4(0.0), vec4(1.0)); }
float LumaKey (vec3 color) {
return dot(color, vec3(LUMA1, LUMA2, LUMA3));
}
vec3 ColorTemperatureToRGB(float temperatureInKelvins)
{
vec3 retColor;
temperatureInKelvins = clamp(temperatureInKelvins, 1000.0, 40000.0) / 100.0;
if (temperatureInKelvins <= 66.0)
{
retColor.r = 1.0;
retColor.g = saturate(0.39008157876901960784 * log(temperatureInKelvins) - 0.63184144378862745098);
}
else
{
float t = temperatureInKelvins - 60.0;
retColor.r = saturate(1.29293618606274509804 * pow(t, -0.1332047592));
retColor.g = saturate(1.12989086089529411765 * pow(t, -0.0755148492));
}
if (temperatureInKelvins >= 66.0)
retColor.b = 1.0;
else if(temperatureInKelvins <= 19.0)
retColor.b = 0.0;
else
retColor.b = saturate(0.54320678911019607843 * log(temperatureInKelvins - 10.0) - 1.19625408914);
return retColor;
}
float Luminance(vec3 color)
{
float fmin = min(min(color.r, color.g), color.b);
float fmax = max(max(color.r, color.g), color.b);
return (fmax + fmin) / 2.0;
}
vec3 HUEtoRGB(float H)
{
float R = abs(H * 6.0 - 3.0) - 1.0;
float G = 2.0 - abs(H * 6.0 - 2.0);
float B = 2.0 - abs(H * 6.0 - 4.0);
return saturate(vec3(R,G,B));
}
vec3 HSLtoRGB(in vec3 HSL)
{
vec3 RGB = HUEtoRGB(HSL.x);
float C = (1.0 - abs(2.0 * HSL.z - 1.0)) * HSL.y;
return (RGB - 0.5) * C + vec3(HSL.z);
}
vec3 RGBtoHCV(vec3 RGB)
{
vec4 P = (RGB.g < RGB.b) ? vec4(RGB.bg, -1.0, 2.0/3.0) : vec4(RGB.gb, 0.0, -1.0/3.0);
vec4 Q = (RGB.r < P.x) ? vec4(P.xyw, RGB.r) : vec4(RGB.r, P.yzx);
float C = Q.x - min(Q.w, Q.y);
float H = abs((Q.w - Q.y) / (6.0 * C + EPSILON) + Q.z);
return vec3(H, C, Q.x);
}
vec3 RGBtoHSL(vec3 RGB)
{
vec3 HCV = RGBtoHCV(RGB);
float L = HCV.z - HCV.y * 0.5;
float S = HCV.y / (1.0 - abs(L * 2.0 - 1.0) + EPSILON);
return vec3(HCV.x, S, L);
}
vec3 ToneColorCorrection(vec3 Color, vec3 ColorSaturation, vec3 ColorContrast, vec3 ColorGamma, vec3 ColorGain, vec3 ColorOffset) {
//First initialize the colorluma key
float ColorLuma = LumaKey(Color);
//Add the saturation with the above key
Color = max(vec3(0,0,0), mix(ColorLuma.xxx, Color, ColorSaturation));
//Contrast with slight color correction (0.18 coefficient)
float ContrastCorrectionCoefficient = 0.18;
Color = pow(Color * (1.0 / ContrastCorrectionCoefficient), ColorContrast) * ContrastCorrectionCoefficient;
//Gamma
Color = pow(Color, 1.0 / ColorGamma);
//Gain and Offset
Color = Color.rgb * ColorGain + (ColorOffset - 1);
//Return the color corrected profile
return Color;
}
vec3 FinalizeColorCorrection(vec3 Color, mat3 ColorSaturation, mat3 ColorContrast, mat3 ColorGamma, mat3 ColorGain, mat3 ColorOffset, vec2 Toneweights) {
float CCShadowsMax = Toneweights.x;
float CCHighlightsMin = Toneweights.y;
//First initialize the colorluma key and set color correction weights
float ColorLuma = LumaKey(Color);
float CCWeightShadows = 1 - smoothstep(0, CCShadowsMax, ColorLuma);
float CCWeightHighlights = smoothstep(CCHighlightsMin, 1, ColorLuma);
float CCWeightMidtones = 1 - CCWeightShadows - CCWeightHighlights;
vec3 CCColorShadows = ToneColorCorrection (
Color,
ColorSaturation[0],
ColorContrast[0],
ColorGamma[0],
ColorGain[0],
ColorOffset[0]
);
vec3 CCColorMidtones = ToneColorCorrection (
Color,
ColorSaturation[1],
ColorContrast[1],
ColorGamma[1],
ColorGain[1],
ColorOffset[1]
);
vec3 CCColorHighlights = ToneColorCorrection (
Color,
ColorSaturation[2],
ColorContrast[2],
ColorGamma[2],
ColorGain[2],
ColorOffset[2]
);
vec3 CombinedCCProfile = CCColorShadows * CCWeightShadows + CCColorMidtones * CCWeightMidtones + CCColorHighlights * CCWeightHighlights;
return vec3(CombinedCCProfile);
}

56
Shaders/std/denoise.glsl Normal file
View file

@ -0,0 +1,56 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Copyright (c) 2018-2019 Michele Morrone
// All rights reserved.
//
// https://michelemorrone.eu - https://BrutPitt.com
//
// me@michelemorrone.eu - brutpitt@gmail.com
// twitter: @BrutPitt - github: BrutPitt
//
// https://github.com/BrutPitt/glslSmartDeNoise/
//
// This software is distributed under the terms of the BSD 2-Clause license
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#ifndef _DENOISE_GLSL_
#define _DENOISE_GLSL_
#define INV_SQRT_OF_2PI 0.39894228040143267793994605993439
#define INV_PI 0.31830988618379067153776752674503
vec4 smartDeNoise(sampler2D tex, vec2 uv, float sigma, float kSigma, float threshold) {
float radius = round(kSigma*sigma);
float radQ = radius * radius;
float invSigmaQx2 = .5 / (sigma * sigma); // 1.0 / (sigma^2 * 2.0)
float invSigmaQx2PI = INV_PI * invSigmaQx2; // 1.0 / (sqrt(PI) * sigma)
float invThresholdSqx2 = .5 / (threshold * threshold); // 1.0 / (sigma^2 * 2.0)
float invThresholdSqrt2PI = INV_SQRT_OF_2PI / threshold; // 1.0 / (sqrt(2*PI) * sigma)
vec4 centrPx = texture(tex,uv);
float zBuff = 0.0;
vec4 aBuff = vec4(0.0);
vec2 size = vec2(textureSize(tex, 0));
for(float x=-radius; x <= radius; x++) {
float pt = sqrt(radQ-x*x); // pt = yRadius: have circular trend
for(float y=-pt; y <= pt; y++) {
vec2 d = vec2(x,y)/size;
float blurFactor = exp( -dot(d , d) * invSigmaQx2 ) * invSigmaQx2;
vec4 walkPx = texture(tex,uv+d);
vec4 dC = walkPx-centrPx;
float deltaFactor = exp( -dot(dC, dC) * invThresholdSqx2) * invThresholdSqrt2PI * blurFactor;
zBuff += deltaFactor;
aBuff += deltaFactor*walkPx;
}
}
return aBuff/zBuff;
}
#endif

View file

@ -31,17 +31,33 @@ vec3 color(vec2 coords, const float blur, const sampler2D tex, const vec2 texSte
return col + mix(vec3(0.0), col, thresh * blur);
}
vec3 dof(const vec2 texCoord, const float gdepth, const sampler2D tex, const sampler2D gbufferD, const vec2 texStep, const vec2 cameraProj) {
vec3 dof(
const vec2 texCoord,
const float gdepth,
const sampler2D tex,
const sampler2D gbufferD,
const vec2 texStep,
const vec2 cameraProj,
const bool autoFocus,
const float DOFDistance,
const float DOFLength,
const float DOFFStop) {
float depth = linearize(gdepth, cameraProj);
// const float fDepth = compoDOFDistance;
float fDepth = linearize(textureLod(gbufferD, focus, 0.0).r * 2.0 - 1.0, cameraProj); // Autofocus
const float f = compoDOFLength; // Focal length in mm
const float d = fDepth * 1000.0; // Focal plane in mm
float fDepth = 0.0;
if(autoFocus) {
fDepth = linearize(textureLod(gbufferD, focus, 0.0).r * 2.0 - 1.0, cameraProj);
} else {
fDepth = DOFDistance;
}
float f = DOFLength; // Focal length in mm
float d = fDepth * 1000.0; // Focal plane in mm
float o = depth * 1000.0; // Depth in mm
float a = (o * f) / (o - f);
float b = (d * f) / (d - f);
float c = (d - f) / (d * compoDOFFstop * coc);
float c = (d - f) / (d * DOFFStop * coc);
float blur = abs(a - b) * c;
blur = clamp(blur, 0.0, 1.0);

View file

@ -19,7 +19,7 @@ vec3 getPosView(const vec3 viewRay, const float depth, const vec2 cameraProj) {
return viewRay * linearDepth;
}
vec3 getPos(const vec3 eye, const vec3 eyeLook, const vec3 viewRay, const float depth, const vec2 cameraProj) {
vec3 getPos(const vec3 eye, const vec3 eyeLook, const vec3 viewRay, const float depth, const vec2 cameraProj) {
// eyeLook, viewRay should be normalized
float linearDepth = cameraProj.y / ((depth * 0.5 + 0.5) - cameraProj.x);
float viewZDist = dot(eyeLook, viewRay);
@ -27,7 +27,7 @@ vec3 getPos(const vec3 eye, const vec3 eyeLook, const vec3 viewRay, const float
return wposition;
}
vec3 getPosNoEye(const vec3 eyeLook, const vec3 viewRay, const float depth, const vec2 cameraProj) {
vec3 getPosNoEye(const vec3 eyeLook, const vec3 viewRay, const float depth, const vec2 cameraProj) {
// eyeLook, viewRay should be normalized
float linearDepth = cameraProj.y / ((depth * 0.5 + 0.5) - cameraProj.x);
float viewZDist = dot(eyeLook, viewRay);
@ -35,7 +35,7 @@ vec3 getPosNoEye(const vec3 eyeLook, const vec3 viewRay, const float depth, cons
return wposition;
}
#ifdef HLSL
#if defined(HLSL) || defined(METAL)
vec3 getPos2(const mat4 invVP, const float depth, vec2 coord) {
coord.y = 1.0 - coord.y;
#else
@ -47,7 +47,7 @@ vec3 getPos2(const mat4 invVP, const float depth, const vec2 coord) {
return pos.xyz;
}
#ifdef HLSL
#if defined(HLSL) || defined(METAL)
vec3 getPosView2(const mat4 invP, const float depth, vec2 coord) {
coord.y = 1.0 - coord.y;
#else
@ -59,7 +59,7 @@ vec3 getPosView2(const mat4 invP, const float depth, const vec2 coord) {
return pos.xyz;
}
#ifdef HLSL
#if defined(HLSL) || defined(METAL)
vec3 getPos2NoEye(const vec3 eye, const mat4 invVP, const float depth, vec2 coord) {
coord.y = 1.0 - coord.y;
#else

View file

@ -21,27 +21,41 @@
#endif
#ifdef _ShadowMap
#ifdef _SinglePoint
#ifdef _Spot
uniform sampler2DShadow shadowMapSpot[1];
uniform mat4 LWVPSpot0;
#else
uniform samplerCubeShadow shadowMapPoint[1];
uniform vec2 lightProj;
#ifdef _SinglePoint
#ifdef _Spot
#ifndef _LTC
uniform sampler2DShadow shadowMapSpot[1];
uniform mat4 LWVPSpot[1];
#endif
#else
uniform samplerCubeShadow shadowMapPoint[1];
uniform vec2 lightProj;
#endif
#endif
#endif
#ifdef _Clusters
uniform samplerCubeShadow shadowMapPoint[4];
uniform vec2 lightProj;
#ifdef _Spot
uniform sampler2DShadow shadowMapSpot[4];
uniform mat4 LWVPSpot0;
uniform mat4 LWVPSpot1;
uniform mat4 LWVPSpot2;
uniform mat4 LWVPSpot3;
#ifdef _Clusters
#ifdef _SingleAtlas
//!uniform sampler2DShadow shadowMapAtlas;
#endif
uniform vec2 lightProj;
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
uniform sampler2DShadow shadowMapAtlasPoint;
#endif
#else
uniform samplerCubeShadow shadowMapPoint[4];
#endif
#ifdef _Spot
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
uniform sampler2DShadow shadowMapAtlasSpot;
#endif
#else
uniform sampler2DShadow shadowMapSpot[maxLightsCluster];
#endif
uniform mat4 LWVPSpotArray[maxLightsCluster];
#endif
#endif
#endif
#endif
#ifdef _LTC
uniform vec3 lightArea0;
@ -51,17 +65,14 @@ uniform vec3 lightArea3;
uniform sampler2D sltcMat;
uniform sampler2D sltcMag;
#ifdef _ShadowMap
#ifndef _Spot
#ifndef _Spot
#ifdef _SinglePoint
uniform sampler2DShadow shadowMapSpot[1];
uniform mat4 LWVPSpot0;
uniform sampler2DShadow shadowMapSpot[1];
uniform mat4 LWVPSpot[1];
#endif
#ifdef _Clusters
uniform sampler2DShadow shadowMapSpot[4];
uniform mat4 LWVPSpot0;
uniform mat4 LWVPSpot1;
uniform mat4 LWVPSpot2;
uniform mat4 LWVPSpot3;
uniform sampler2DShadow shadowMapSpot[maxLightsCluster];
uniform mat4 LWVPSpotArray[maxLightsCluster];
#endif
#endif
#endif
@ -70,7 +81,7 @@ uniform sampler2D sltcMag;
vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, const vec3 lp, const vec3 lightCol,
const vec3 albedo, const float rough, const float spec, const vec3 f0
#ifdef _ShadowMap
, int index, float bias
, int index, float bias, bool receiveShadow
#endif
#ifdef _Spot
, bool isSpot, float spotA, float spotB, vec3 spotDir
@ -130,28 +141,30 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
#ifdef _LTC
#ifdef _ShadowMap
#ifdef _SinglePoint
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
#endif
#ifdef _Clusters
if (index == 0) {
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
if (receiveShadow) {
#ifdef _SinglePoint
vec4 lPos = LWVPSpot[0] * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
#endif
#ifdef _Clusters
if (index == 0) {
vec4 lPos = LWVPSpot[0] * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
}
else if (index == 1) {
vec4 lPos = LWVPSpot[1] * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
}
else if (index == 2) {
vec4 lPos = LWVPSpot[2] * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
}
else if (index == 3) {
vec4 lPos = LWVPSpot[3] * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
}
#endif
}
else if (index == 1) {
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
}
else if (index == 2) {
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
}
else if (index == 3) {
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
}
#endif
#endif
return direct;
#endif
@ -164,28 +177,30 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
direct *= smoothstep(spotB, spotA, spotEffect);
}
#ifdef _ShadowMap
#ifdef _SinglePoint
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
#endif
#ifdef _Clusters
if (index == 0) {
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
if (receiveShadow) {
#ifdef _SinglePoint
vec4 lPos = LWVPSpot[0] * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
#endif
#ifdef _Clusters
vec4 lPos = LWVPSpotArray[index] * vec4(p + n * bias * 10, 1.0);
#ifdef _ShadowMapAtlas
direct *= shadowTest(
#ifndef _SingleAtlas
shadowMapAtlasSpot
#else
shadowMapAtlas
#endif
, lPos.xyz / lPos.w, bias
);
#else
if (index == 0) direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
else if (index == 1) direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
else if (index == 2) direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
else if (index == 3) direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
#endif
#endif
}
else if (index == 1) {
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
}
else if (index == 2) {
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
}
else if (index == 3) {
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
}
#endif
#endif
return direct;
}
@ -196,17 +211,30 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
#endif
#ifdef _ShadowMap
#ifdef _SinglePoint
#ifndef _Spot
direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
#endif
#endif
#ifdef _Clusters
if (index == 0) direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
else if (index == 1) direct *= PCFCube(shadowMapPoint[1], ld, -l, bias, lightProj, n);
else if (index == 2) direct *= PCFCube(shadowMapPoint[2], ld, -l, bias, lightProj, n);
else if (index == 3) direct *= PCFCube(shadowMapPoint[3], ld, -l, bias, lightProj, n);
#endif
if (receiveShadow) {
#ifdef _SinglePoint
#ifndef _Spot
direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
#endif
#endif
#ifdef _Clusters
#ifdef _ShadowMapAtlas
direct *= PCFFakeCube(
#ifndef _SingleAtlas
shadowMapAtlasPoint
#else
shadowMapAtlas
#endif
, ld, -l, bias, lightProj, n, index
);
#else
if (index == 0) direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
else if (index == 1) direct *= PCFCube(shadowMapPoint[1], ld, -l, bias, lightProj, n);
else if (index == 2) direct *= PCFCube(shadowMapPoint[2], ld, -l, bias, lightProj, n);
else if (index == 3) direct *= PCFCube(shadowMapPoint[3], ld, -l, bias, lightProj, n);
#endif
#endif
}
#endif
return direct;

View file

@ -8,32 +8,44 @@
#endif
#ifdef _ShadowMap
#ifdef _SinglePoint
#ifdef _Spot
uniform sampler2DShadow shadowMapSpot[1];
uniform mat4 LWVPSpot0;
#else
uniform samplerCubeShadow shadowMapPoint[1];
uniform vec2 lightProj;
#ifdef _SinglePoint
#ifdef _Spot
uniform sampler2DShadow shadowMapSpot[1];
uniform mat4 LWVPSpot[1];
#else
uniform samplerCubeShadow shadowMapPoint[1];
uniform vec2 lightProj;
#endif
#endif
#endif
#ifdef _Clusters
uniform samplerCubeShadow shadowMapPoint[4];
uniform vec2 lightProj;
#ifdef _Spot
uniform sampler2DShadow shadowMapSpot[4];
uniform mat4 LWVPSpot0;
uniform mat4 LWVPSpot1;
uniform mat4 LWVPSpot2;
uniform mat4 LWVPSpot3;
#ifdef _Clusters
#ifdef _SingleAtlas
//!uniform sampler2DShadow shadowMapAtlas;
#endif
uniform vec2 lightProj;
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
uniform sampler2DShadow shadowMapAtlasPoint;
#endif
#else
uniform samplerCubeShadow shadowMapPoint[4];
#endif
#ifdef _Spot
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
uniform sampler2DShadow shadowMapAtlasSpot;
#endif
#else
uniform sampler2DShadow shadowMapSpot[maxLightsCluster];
#endif
uniform mat4 LWVPSpotArray[maxLightsCluster];
#endif
#endif
#endif
#endif
vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, const vec3 lp, const vec3 lightCol,
const vec3 albedo, const float rough, const float spec, const vec3 f0
#ifdef _ShadowMap
, int index, float bias
, int index, float bias, bool receiveShadow
#endif
#ifdef _Spot
, bool isSpot, float spotA, float spotB, vec3 spotDir
@ -60,45 +72,61 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
direct *= smoothstep(spotB, spotA, spotEffect);
}
#ifdef _ShadowMap
#ifdef _SinglePoint
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
#endif
#ifdef _Clusters
if (index == 0) {
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
if (receiveShadow) {
#ifdef _SinglePoint
vec4 lPos = LWVPSpot[0] * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
#endif
#ifdef _Clusters
vec4 lPos = LWVPSpotArray[index] * vec4(p + n * bias * 10, 1.0);
#ifdef _ShadowMapAtlas
direct *= shadowTest(
#ifndef _SingleAtlas
shadowMapAtlasSpot
#else
shadowMapAtlas
#endif
, lPos.xyz / lPos.w, bias
);
#else
if (index == 0) direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
else if (index == 1) direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
else if (index == 2) direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
else if (index == 3) direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
#endif
#endif
}
else if (index == 1) {
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
}
else if (index == 2) {
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
}
else if (index == 3) {
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
}
#endif
#endif
return direct;
}
#endif
#ifdef _ShadowMap
#ifndef _Spot
#ifdef _SinglePoint
direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
#endif
#ifdef _Clusters
if (index == 0) direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
else if (index == 1) direct *= PCFCube(shadowMapPoint[1], ld, -l, bias, lightProj, n);
else if (index == 2) direct *= PCFCube(shadowMapPoint[2], ld, -l, bias, lightProj, n);
else if (index == 3) direct *= PCFCube(shadowMapPoint[3], ld, -l, bias, lightProj, n);
#endif
#endif
if (receiveShadow) {
#ifdef _SinglePoint
#ifndef _Spot
direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
#endif
#endif
#ifdef _Clusters
#ifdef _ShadowMapAtlas
direct *= PCFFakeCube(
#ifndef _SingleAtlas
shadowMapAtlasPoint
#else
shadowMapAtlas
#endif
, ld, -l, bias, lightProj, n, index
);
#else
if (index == 0) direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
else if (index == 1) direct *= PCFCube(shadowMapPoint[1], ld, -l, bias, lightProj, n);
else if (index == 2) direct *= PCFCube(shadowMapPoint[2], ld, -l, bias, lightProj, n);
else if (index == 3) direct *= PCFCube(shadowMapPoint[3], ld, -l, bias, lightProj, n);
#endif
#endif
}
#endif
return direct;

41
Shaders/std/mapping.glsl Normal file
View file

@ -0,0 +1,41 @@
/*
https://github.com/JonasFolletete/glsl-triplanar-mapping
MIT License
Copyright (c) 2018 Jonas Folletête
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
vec3 blendNormal(vec3 normal) {
vec3 blending = abs(normal);
blending = normalize(max(blending, 0.00001));
blending /= vec3(blending.x + blending.y + blending.z);
return blending;
}
vec3 triplanarMapping (sampler2D ImageTexture, vec3 normal, vec3 position) {
vec3 normalBlend = blendNormal(normal);
vec3 xColor = texture(ImageTexture, position.yz).rgb;
vec3 yColor = texture(ImageTexture, position.xz).rgb;
vec3 zColor = texture(ImageTexture, position.xy).rgb;
return (xColor * normalBlend.x + yColor * normalBlend.y + zColor * normalBlend.z);
}

View file

@ -20,10 +20,10 @@ float rand(const vec2 co) { // Unreliable
}
vec2 rand2(const vec2 coord) {
const float width = 1100;
const float height = 500;
const float width = 1100.0;
const float height = 500.0;
float noiseX = ((fract(1.0 - coord.s * (width / 2.0)) * 0.25) + (fract(coord.t * (height / 2.0)) * 0.75)) * 2.0 - 1.0;
float noiseY = ((fract(1.0 - coord.s * (width / 2.0)) * 0.75) + (fract(coord.t * (height / 2.0)) * 0.25)) * 2.0 - 1.0;
float noiseY = ((fract(1.0 - coord.s * (width / 2.0)) * 0.75) + (fract(coord.t * (height / 2.0)) * 0.25)) * 2.0 - 1.0;
return vec2(noiseX, noiseY);
}
@ -40,4 +40,9 @@ float attenuate(const float dist) {
// 1.0 / (quadratic * dist * dist);
}
float safe_acos(const float x) {
// acos is undefined if |x| > 1
return acos(clamp(x, -1.0, 1.0));
}
#endif

View file

@ -0,0 +1,53 @@
uniform sampler2D morphDataPos;
uniform sampler2D morphDataNor;
uniform vec2 morphScaleOffset;
uniform vec2 morphDataDim;
uniform vec4 morphWeights[8];
void getMorphedVertex(vec2 uvCoord, inout vec3 A){
for(int i = 0; i<8; i++ )
{
vec4 tempCoordY = vec4( uvCoord.y - (i * 4) * morphDataDim.y,
uvCoord.y - (i * 4 + 1) * morphDataDim.y,
uvCoord.y - (i * 4 + 2) * morphDataDim.y,
uvCoord.y - (i * 4 + 3) * morphDataDim.y);
vec3 morph = texture(morphDataPos, vec2(uvCoord.x, tempCoordY.x)).rgb * morphScaleOffset.x + morphScaleOffset.y;
A += morphWeights[i].x * morph;
morph = texture(morphDataPos, vec2(uvCoord.x, tempCoordY.y)).rgb * morphScaleOffset.x + morphScaleOffset.y;
A += morphWeights[i].y * morph;
morph = texture(morphDataPos, vec2(uvCoord.x, tempCoordY.z)).rgb * morphScaleOffset.x + morphScaleOffset.y;
A += morphWeights[i].z * morph;
morph = texture(morphDataPos, vec2(uvCoord.x, tempCoordY.w)).rgb * morphScaleOffset.x + morphScaleOffset.y;
A += morphWeights[i].w * morph;
}
}
void getMorphedNormal(vec2 uvCoord, vec3 oldNor, inout vec3 morphNor){
for(int i = 0; i<8; i++ )
{
vec4 tempCoordY = vec4( uvCoord.y - (i * 4) * morphDataDim.y,
uvCoord.y - (i * 4 + 1) * morphDataDim.y,
uvCoord.y - (i * 4 + 2) * morphDataDim.y,
uvCoord.y - (i * 4 + 3) * morphDataDim.y);
vec3 norm = oldNor + morphWeights[i].x * (texture(morphDataNor, vec2(uvCoord.x, tempCoordY.x)).rgb * 2.0 - 1.0);
morphNor += norm;
norm = oldNor + morphWeights[i].y * (texture(morphDataNor, vec2(uvCoord.x, tempCoordY.y)).rgb * 2.0 - 1.0);
morphNor += norm;
norm = oldNor + morphWeights[i].z * (texture(morphDataNor, vec2(uvCoord.x, tempCoordY.z)).rgb * 2.0 - 1.0);
morphNor += norm;
norm = oldNor + morphWeights[i].w * (texture(morphDataNor, vec2(uvCoord.x, tempCoordY.w)).rgb * 2.0 - 1.0);
morphNor += norm;
}
morphNor = normalize(morphNor);
}

View file

@ -11,6 +11,50 @@ uniform vec4 casData[shadowmapCascades * 4 + 4];
uniform vec2 smSizeUniform;
#endif
#ifdef _ShadowMap
#ifdef _Clusters
#ifdef _ShadowMapAtlas
uniform vec4 pointLightDataArray[maxLightsCluster * 6];
#endif
#endif
#endif
#ifdef _ShadowMapAtlas
// https://www.khronos.org/registry/OpenGL/specs/gl/glspec20.pdf // p:168
// https://www.gamedev.net/forums/topic/687535-implementing-a-cube-map-lookup-function/5337472/
vec2 sampleCube(vec3 dir, out int faceIndex) {
vec3 dirAbs = abs(dir);
float ma;
vec2 uv;
if(dirAbs.z >= dirAbs.x && dirAbs.z >= dirAbs.y) {
faceIndex = dir.z < 0.0 ? 5 : 4;
ma = 0.5 / dirAbs.z;
uv = vec2(dir.z < 0.0 ? -dir.x : dir.x, -dir.y);
}
else if(dirAbs.y >= dirAbs.x) {
faceIndex = dir.y < 0.0 ? 3 : 2;
ma = 0.5 / dirAbs.y;
uv = vec2(dir.x, dir.y < 0.0 ? -dir.z : dir.z);
}
else {
faceIndex = dir.x < 0.0 ? 1 : 0;
ma = 0.5 / dirAbs.x;
uv = vec2(dir.x < 0.0 ? dir.z : -dir.z, -dir.y);
}
// downscale uv a little to hide seams
// transform coordinates from clip space to texture space
#ifndef _FlipY
return uv * 0.9976 * ma + 0.5;
#else
#ifdef HLSL
return uv * 0.9976 * ma + 0.5;
#else
return vec2(uv.x * ma, uv.y * -ma) * 0.9976 + 0.5;
#endif
#endif
}
#endif
float PCF(sampler2DShadow shadowMap, const vec2 uv, const float compare, const vec2 smSize) {
float result = texture(shadowMap, vec3(uv + (vec2(-1.0, -1.0) / smSize), compare));
result += texture(shadowMap, vec3(uv + (vec2(-1.0, 0.0) / smSize), compare));
@ -35,7 +79,7 @@ float PCFCube(samplerCubeShadow shadowMapCube, const vec3 lp, vec3 ml, const flo
const float s = shadowmapCubePcfSize; // TODO: incorrect...
float compare = lpToDepth(lp, lightProj) - bias * 1.5;
ml = ml + n * bias * 20;
#ifdef HLSL
#ifdef _InvY
ml.y = -ml.y;
#endif
float result = texture(shadowMapCube, vec4(ml, compare));
@ -50,6 +94,186 @@ float PCFCube(samplerCubeShadow shadowMapCube, const vec3 lp, vec3 ml, const flo
return result / 9.0;
}
#ifdef _ShadowMapAtlas
// transform "out-of-bounds" coordinates to the correct face/coordinate system
// https://www.khronos.org/opengl/wiki/File:CubeMapAxes.png
vec2 transformOffsetedUV(const int faceIndex, out int newFaceIndex, vec2 uv) {
if (uv.x < 0.0) {
if (faceIndex == 0) { // X+
newFaceIndex = 4; // Z+
}
else if (faceIndex == 1) { // X-
newFaceIndex = 5; // Z-
}
else if (faceIndex == 2) { // Y+
newFaceIndex = 1; // X-
}
else if (faceIndex == 3) { // Y-
newFaceIndex = 1; // X-
}
else if (faceIndex == 4) { // Z+
newFaceIndex = 1; // X-
}
else { // Z-
newFaceIndex = 0; // X+
}
uv = vec2(1.0 + uv.x, uv.y);
}
else if (uv.x > 1.0) {
if (faceIndex == 0) { // X+
newFaceIndex = 5; // Z-
}
else if (faceIndex == 1) { // X-
newFaceIndex = 4; // Z+
}
else if (faceIndex == 2) { // Y+
newFaceIndex = 0; // X+
}
else if (faceIndex == 3) { // Y-
newFaceIndex = 0; // X+
}
else if (faceIndex == 4) { // Z+
newFaceIndex = 0; // X+
}
else { // Z-
newFaceIndex = 1; // X-
}
uv = vec2(1.0 - uv.x, uv.y);
}
else if (uv.y < 0.0) {
if (faceIndex == 0) { // X+
newFaceIndex = 2; // Y+
}
else if (faceIndex == 1) { // X-
newFaceIndex = 2; // Y+
}
else if (faceIndex == 2) { // Y+
newFaceIndex = 5; // Z-
}
else if (faceIndex == 3) { // Y-
newFaceIndex = 4; // Z+
}
else if (faceIndex == 4) { // Z+
newFaceIndex = 2; // Y+
}
else { // Z-
newFaceIndex = 2; // Y+
}
uv = vec2(uv.x, 1.0 + uv.y);
}
else if (uv.y > 1.0) {
if (faceIndex == 0) { // X+
newFaceIndex = 3; // Y-
}
else if (faceIndex == 1) { // X-
newFaceIndex = 3; // Y-
}
else if (faceIndex == 2) { // Y+
newFaceIndex = 4; // Z+
}
else if (faceIndex == 3) { // Y-
newFaceIndex = 5; // Z-
}
else if (faceIndex == 4) { // Z+
newFaceIndex = 3; // Y-
}
else { // Z-
newFaceIndex = 3; // Y-
}
uv = vec2(uv.x, 1.0 - uv.y);
} else {
newFaceIndex = faceIndex;
}
// cover corner cases too
return uv;
}
float PCFFakeCube(sampler2DShadow shadowMap, const vec3 lp, vec3 ml, const float bias, const vec2 lightProj, const vec3 n, const int index) {
const vec2 smSize = smSizeUniform; // TODO: incorrect...
const float compare = lpToDepth(lp, lightProj) - bias * 1.5;
ml = ml + n * bias * 20;
int faceIndex = 0;
const int lightIndex = index * 6;
const vec2 uv = sampleCube(ml, faceIndex);
vec4 pointLightTile = pointLightDataArray[lightIndex + faceIndex]; // x: tile X offset, y: tile Y offset, z: tile size relative to atlas
vec2 uvtiled = pointLightTile.z * uv + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
float result = texture(shadowMap, vec3(uvtiled, compare));
// soft shadowing
int newFaceIndex = 0;
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(-1.0, 0.0) / smSize)));
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex];
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
result += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(-1.0, 1.0) / smSize)));
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex];
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
result += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(0.0, -1.0) / smSize)));
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex];
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
result += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(-1.0, -1.0) / smSize)));
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex];
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
result += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(0.0, 1.0) / smSize)));
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex];
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
result += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(1.0, -1.0) / smSize)));
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex];
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
result += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(1.0, 0.0) / smSize)));
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex];
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
result += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(1.0, 1.0) / smSize)));
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex];
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy;
#ifdef _FlipY
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system
#endif
result += texture(shadowMap, vec3(uvtiled, compare));
return result / 9.0;
}
#endif
float shadowTest(sampler2DShadow shadowMap, const vec3 lPos, const float shadowsBias) {
#ifdef _SMSizeUniform
vec2 smSize = smSizeUniform;
@ -95,7 +319,7 @@ mat4 getCascadeMat(const float d, out int casi, out int casIndex) {
float shadowTestCascade(sampler2DShadow shadowMap, const vec3 eye, const vec3 p, const float shadowsBias) {
#ifdef _SMSizeUniform
vec2 smSize = smSizeUniform * vec2(shadowmapCascades, 1.0);
vec2 smSize = smSizeUniform;
#else
const vec2 smSize = shadowmapSize * vec2(shadowmapCascades, 1.0);
#endif
@ -105,7 +329,7 @@ float shadowTestCascade(sampler2DShadow shadowMap, const vec3 eye, const vec3 p,
int casi;
int casIndex;
mat4 LWVP = getCascadeMat(d, casi, casIndex);
vec4 lPos = LWVP * vec4(p, 1.0);
lPos.xyz /= lPos.w;

View file

@ -1,6 +1,5 @@
uniform vec4 shirr[7];
vec3 shIrradiance(const vec3 nor) {
vec3 shIrradiance(const vec3 nor, const vec4 shirr[7]) {
const float c1 = 0.429043;
const float c2 = 0.511664;
const float c3 = 0.743125;

155
Shaders/std/sky.glsl Normal file
View file

@ -0,0 +1,155 @@
/* Various sky functions
* =====================
*
* Nishita model is based on https://github.com/wwwtyro/glsl-atmosphere (Unlicense License)
*
* Changes to the original implementation:
* - r and pSun parameters of nishita_atmosphere() are already normalized
* - Some original parameters of nishita_atmosphere() are replaced with pre-defined values
* - Implemented air, dust and ozone density node parameters (see Blender source)
* - Replaced the inner integral calculation with a LUT lookup
*
* Reference for the sun's limb darkening and ozone calculations:
* [Hill] Sebastien Hillaire. Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite
* (https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/s2016-pbs-frostbite-sky-clouds-new.pdf)
*
* Cycles code used for reference: blender/intern/sky/source/sky_nishita.cpp
* (https://github.com/blender/blender/blob/4429b4b77ef6754739a3c2b4fabd0537999e9bdc/intern/sky/source/sky_nishita.cpp)
*/
#ifndef _SKY_GLSL_
#define _SKY_GLSL_
#include "std/math.glsl"
uniform sampler2D nishitaLUT;
uniform vec2 nishitaDensity;
#ifndef PI
#define PI 3.141592
#endif
#ifndef HALF_PI
#define HALF_PI 1.570796
#endif
#define nishita_iSteps 16
// These values are taken from Cycles code if they
// exist there, otherwise they are taken from the example
// in the glsl-atmosphere repo
#define nishita_sun_intensity 22.0
#define nishita_atmo_radius 6420e3
#define nishita_rayleigh_scale 8e3
#define nishita_rayleigh_coeff vec3(5.5e-6, 13.0e-6, 22.4e-6)
#define nishita_mie_scale 1.2e3
#define nishita_mie_coeff 2e-5
#define nishita_mie_dir 0.76 // Aerosols anisotropy ("direction")
#define nishita_mie_dir_sq 0.5776 // Squared aerosols anisotropy
// Values from [Hill: 60]
#define sun_limb_darkening_col vec3(0.397, 0.503, 0.652)
vec3 nishita_lookupLUT(const float height, const float sunTheta) {
vec2 coords = vec2(
sqrt(height * (1 / nishita_atmo_radius)),
0.5 + 0.5 * sign(sunTheta - HALF_PI) * sqrt(abs(sunTheta * (1 / HALF_PI) - 1))
);
return textureLod(nishitaLUT, coords, 0.0).rgb;
}
/* See raySphereIntersection() in armory/Sources/renderpath/Nishita.hx */
vec2 nishita_rsi(const vec3 r0, const vec3 rd, const float sr) {
float a = dot(rd, rd);
float b = 2.0 * dot(rd, r0);
float c = dot(r0, r0) - (sr * sr);
float d = (b*b) - 4.0*a*c;
// If d < 0.0 the ray does not intersect the sphere
return (d < 0.0) ? vec2(1e5,-1e5) : vec2((-b - sqrt(d))/(2.0*a), (-b + sqrt(d))/(2.0*a));
}
/*
* r: normalized ray direction
* r0: ray origin
* pSun: normalized sun direction
* rPlanet: planet radius
*/
vec3 nishita_atmosphere(const vec3 r, const vec3 r0, const vec3 pSun, const float rPlanet) {
// Calculate the step size of the primary ray
vec2 p = nishita_rsi(r0, r, nishita_atmo_radius);
if (p.x > p.y) return vec3(0.0);
p.y = min(p.y, nishita_rsi(r0, r, rPlanet).x);
float iStepSize = (p.y - p.x) / float(nishita_iSteps);
// Primary ray time
float iTime = 0.0;
// Accumulators for Rayleigh and Mie scattering.
vec3 totalRlh = vec3(0,0,0);
vec3 totalMie = vec3(0,0,0);
// Optical depth accumulators for the primary ray
float iOdRlh = 0.0;
float iOdMie = 0.0;
// Calculate the Rayleigh and Mie phases
float mu = dot(r, pSun);
float mumu = mu * mu;
float pRlh = 3.0 / (16.0 * PI) * (1.0 + mumu);
float pMie = 3.0 / (8.0 * PI) * ((1.0 - nishita_mie_dir_sq) * (mumu + 1.0)) / (pow(1.0 + nishita_mie_dir_sq - 2.0 * mu * nishita_mie_dir, 1.5) * (2.0 + nishita_mie_dir_sq));
// Sample the primary ray
for (int i = 0; i < nishita_iSteps; i++) {
// Calculate the primary ray sample position and height
vec3 iPos = r0 + r * (iTime + iStepSize * 0.5);
float iHeight = length(iPos) - rPlanet;
// Calculate the optical depth of the Rayleigh and Mie scattering for this step
float odStepRlh = exp(-iHeight / nishita_rayleigh_scale) * nishitaDensity.x * iStepSize;
float odStepMie = exp(-iHeight / nishita_mie_scale) * nishitaDensity.y * iStepSize;
// Accumulate optical depth
iOdRlh += odStepRlh;
iOdMie += odStepMie;
// Idea behind this: "Rotate" everything by iPos (-> iPos is the new zenith) and then all calculations for the
// inner integral only depend on the sample height (iHeight) and sunTheta (angle between sun and new zenith).
float sunTheta = safe_acos(dot(normalize(iPos), normalize(pSun)));
vec3 jAttn = nishita_lookupLUT(iHeight, sunTheta);
// Calculate attenuation
vec3 iAttn = exp(-(
nishita_mie_coeff * iOdMie
+ nishita_rayleigh_coeff * iOdRlh
// + 0 for ozone
));
vec3 attn = iAttn * jAttn;
// Apply dithering to reduce visible banding
attn *= 0.98 + rand(r.xy) * 0.04;
// Accumulate scattering
totalRlh += odStepRlh * attn;
totalMie += odStepMie * attn;
iTime += iStepSize;
}
return nishita_sun_intensity * (pRlh * nishita_rayleigh_coeff * totalRlh + pMie * nishita_mie_coeff * totalMie);
}
vec3 sun_disk(const vec3 n, const vec3 light_dir, const float disk_size, const float intensity) {
// Normalized SDF
float dist = distance(n, light_dir) / disk_size;
// Darken the edges of the sun
// [Hill: 28, 60] (according to [Nec96])
float invDist = 1.0 - dist;
float mu = sqrt(invDist * invDist);
vec3 limb_darkening = 1.0 - (1.0 - pow(vec3(mu), sun_limb_darkening_col));
return 1 + (1.0 - step(1.0, dist)) * nishita_sun_intensity * intensity * limb_darkening;
}
#endif

View file

@ -9,7 +9,7 @@ vec2 getProjectedCoord(vec3 hitCoord) {
vec4 projectedCoord = VP * vec4(hitCoord, 1.0);
projectedCoord.xy /= projectedCoord.w;
projectedCoord.xy = projectedCoord.xy * 0.5 + 0.5;
#ifdef HLSL
#if defined(HLSL) || defined(METAL)
projectedCoord.y = 1.0 - projectedCoord.y;
#endif
return projectedCoord.xy;

View file

@ -15,12 +15,12 @@ const float SMAA_REPROJECTION_WEIGHT_SCALE = 30.0;
void main() {
vec4 current = textureLod(tex, texCoord, 0.0);
#ifdef _Veloc
// Velocity is assumed to be calculated for motion blur, so we need to inverse it for reprojection
vec2 velocity = -textureLod(sveloc, texCoord, 0.0).rg;
#ifdef HLSL
#ifdef _InvY
velocity.y = -velocity.y;
#endif

View file

@ -12,7 +12,7 @@ uniform sampler2D gbufferD;
uniform sampler2D snoise;
#ifdef _Clusters
uniform vec4 lightsArray[maxLights * 2];
uniform vec4 lightsArray[maxLights * 3];
#ifdef _Spot
uniform vec4 lightsArraySpot[maxLights];
#endif
@ -24,7 +24,7 @@ uniform vec2 cameraPlane;
#ifdef _SinglePoint
#ifdef _Spot
uniform sampler2DShadow shadowMapSpot[1];
uniform mat4 LWVPSpot0;
uniform mat4 LWVPSpot[1];
#else
uniform samplerCubeShadow shadowMapPoint[1];
uniform vec2 lightProj;
@ -35,10 +35,7 @@ uniform vec2 cameraPlane;
uniform vec2 lightProj;
#ifdef _Spot
uniform sampler2DShadow shadowMapSpot[4];
uniform mat4 LWVPSpot0;
uniform mat4 LWVPSpot1;
uniform mat4 LWVPSpot2;
uniform mat4 LWVPSpot3;
uniform mat4 LWVPSpot[maxLightsCluster];
#endif
#endif
#endif
@ -47,7 +44,15 @@ uniform vec2 cameraPlane;
uniform vec3 sunDir;
uniform vec3 sunCol;
#ifdef _ShadowMap
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
uniform sampler2DShadow shadowMapAtlasSun;
#else
uniform sampler2DShadow shadowMapAtlas;
#endif
#else
uniform sampler2DShadow shadowMap;
#endif
uniform float shadowsBias;
#ifdef _CSM
//!uniform vec4 casData[shadowmapCascades * 4 + 4];
@ -86,30 +91,42 @@ const float lighting = 0.4;
void rayStep(inout vec3 curPos, inout float curOpticalDepth, inout float scatteredLightAmount, float stepLenWorld, vec3 viewVecNorm) {
curPos += stepLenWorld * viewVecNorm;
const float density = 1.0;
float l1 = lighting * stepLenWorld * tScat * density;
curOpticalDepth *= exp(-tExt * stepLenWorld * density);
float visibility = 0.0;
#ifdef _Sun
#ifdef _CSM
mat4 LWVP = mat4(casData[4], casData[4 + 1], casData[4 + 2], casData[4 + 3]);
mat4 LWVP = mat4(casData[4], casData[4 + 1], casData[4 + 2], casData[4 + 3]);
#endif
vec4 lPos = LWVP * vec4(curPos, 1.0);
lPos.xyz /= lPos.w;
float visibility = texture(shadowMap, vec3(lPos.xy, lPos.z - shadowsBias));
visibility = texture(
#ifdef _ShadowMapAtlas
#ifndef _SingleAtlas
shadowMapAtlasSun
#else
shadowMapAtlas
#endif
#else
shadowMap
#endif
, vec3(lPos.xy, lPos.z - shadowsBias));
#endif
#ifdef _SinglePoint
#ifdef _Spot
vec4 lPos = LWVPSpot0 * vec4(curPos, 1.0);
float visibility = shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, pointBias);
vec4 lPos = LWVPSpot[0] * vec4(curPos, 1.0);
visibility = shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, pointBias);
float spotEffect = dot(spotDir, normalize(pointPos - curPos)); // lightDir
if (spotEffect < spotData.x) { // x - cutoff, y - cutoff - exponent
visibility *= smoothstep(spotData.y, spotData.x, spotEffect);
}
#else
vec3 ld = pointPos - curPos;
float visibility = PCFCube(shadowMapPoint[0], ld, -normalize(ld), pointBias, lightProj, vec3(0.0));
visibility = PCFCube(shadowMapPoint[0], ld, -normalize(ld), pointBias, lightProj, vec3(0.0));
#endif
#endif

View file

@ -63,7 +63,7 @@
},
{
"name": "LWVP",
"link": "_biasLightWorldViewProjectionMatrix",
"link": "_biasLightWorldViewProjectionMatrixSun",
"ifndef": ["_CSM"],
"ifdef": ["_Sun", "_ShadowMap"]
},
@ -108,23 +108,32 @@
"ifdef": ["_SinglePoint", "_Spot"]
},
{
"name": "LWVPSpot0",
"name": "LWVPSpotArray",
"link": "_biasLightWorldViewProjectionMatrixSpotArray",
"ifdef": ["_Clusters", "_ShadowMap", "_Spot"]
},
{
"name": "LWVPSpot[0]",
"link": "_biasLightWorldViewProjectionMatrixSpot0",
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_Spot", "_ShadowMap"]
},
{
"name": "LWVPSpot1",
"name": "LWVPSpot[1]",
"link": "_biasLightWorldViewProjectionMatrixSpot1",
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_Spot", "_ShadowMap"]
},
{
"name": "LWVPSpot2",
"name": "LWVPSpot[2]",
"link": "_biasLightWorldViewProjectionMatrixSpot2",
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_Spot", "_ShadowMap"]
},
{
"name": "LWVPSpot3",
"name": "LWVPSpot[3]",
"link": "_biasLightWorldViewProjectionMatrixSpot3",
"ifndef": ["_ShadowMapAtlas"],
"ifdef": ["_Spot", "_ShadowMap"]
}
],

View file

@ -1,172 +0,0 @@
#version 450
#include "compiled.inc"
#ifdef _EnvTex
#include "std/math.glsl"
#endif
#ifdef _EnvCol
uniform vec3 backgroundCol;
#endif
#ifdef _EnvSky
uniform vec3 A;
uniform vec3 B;
uniform vec3 C;
uniform vec3 D;
uniform vec3 E;
uniform vec3 F;
uniform vec3 G;
uniform vec3 H;
uniform vec3 I;
uniform vec3 Z;
uniform vec3 hosekSunDirection;
#endif
#ifdef _EnvClouds
uniform sampler3D scloudsBase;
uniform sampler3D scloudsDetail;
uniform sampler2D scloudsMap;
uniform float time;
#endif
#ifdef _EnvTex
uniform sampler2D envmap;
#endif
#ifdef _EnvImg // Static background
uniform vec2 screenSize;
uniform sampler2D envmap;
#endif
#ifdef _EnvStr
uniform float envmapStrength;
#endif
in vec3 normal;
out vec4 fragColor;
#ifdef _EnvSky
vec3 hosekWilkie(float cos_theta, float gamma, float cos_gamma) {
vec3 chi = (1 + cos_gamma * cos_gamma) / pow(1 + H * H - 2 * cos_gamma * H, vec3(1.5));
return (1 + A * exp(B / (cos_theta + 0.01))) * (C + D * exp(E * gamma) + F * (cos_gamma * cos_gamma) + G * chi + I * sqrt(cos_theta));
}
#endif
#ifdef _EnvClouds
// GPU PRO 7 - Real-time Volumetric Cloudscapes
// https://www.guerrilla-games.com/read/the-real-time-volumetric-cloudscapes-of-horizon-zero-dawn
// https://github.com/sebh/TileableVolumeNoise
float remap(float old_val, float old_min, float old_max, float new_min, float new_max) {
return new_min + (((old_val - old_min) / (old_max - old_min)) * (new_max - new_min));
}
float getDensityHeightGradientForPoint(float height, float cloud_type) {
const vec4 stratusGrad = vec4(0.02f, 0.05f, 0.09f, 0.11f);
const vec4 stratocumulusGrad = vec4(0.02f, 0.2f, 0.48f, 0.625f);
const vec4 cumulusGrad = vec4(0.01f, 0.0625f, 0.78f, 1.0f);
float stratus = 1.0f - clamp(cloud_type * 2.0f, 0, 1);
float stratocumulus = 1.0f - abs(cloud_type - 0.5f) * 2.0f;
float cumulus = clamp(cloud_type - 0.5f, 0, 1) * 2.0f;
vec4 cloudGradient = stratusGrad * stratus + stratocumulusGrad * stratocumulus + cumulusGrad * cumulus;
return smoothstep(cloudGradient.x, cloudGradient.y, height) - smoothstep(cloudGradient.z, cloudGradient.w, height);
}
float sampleCloudDensity(vec3 p) {
float cloud_base = textureLod(scloudsBase, p, 0).r * 40; // Base noise
vec3 weather_data = textureLod(scloudsMap, p.xy, 0).rgb; // Weather map
cloud_base *= getDensityHeightGradientForPoint(p.z, weather_data.b); // Cloud type
cloud_base = remap(cloud_base, weather_data.r, 1.0, 0.0, 1.0); // Coverage
cloud_base *= weather_data.r;
float cloud_detail = textureLod(scloudsDetail, p, 0).r * 2; // Detail noise
float cloud_detail_mod = mix(cloud_detail, 1.0 - cloud_detail, clamp(p.z * 10.0, 0, 1));
cloud_base = remap(cloud_base, cloud_detail_mod * 0.2, 1.0, 0.0, 1.0);
return cloud_base;
}
float cloudRadiance(vec3 p, vec3 dir){
#ifdef _EnvSky
vec3 sun_dir = hosekSunDirection;
#else
vec3 sun_dir = vec3(0, 0, -1);
#endif
const int steps = 8;
float step_size = 0.5 / float(steps);
float d = 0.0;
p += sun_dir * step_size;
for(int i = 0; i < steps; ++i) {
d += sampleCloudDensity(p + sun_dir * float(i) * step_size);
}
return 1.0 - d;
}
vec3 traceClouds(vec3 sky, vec3 dir) {
const float step_size = 0.5 / float(cloudsSteps);
float T = 1.0;
float C = 0.0;
vec2 uv = dir.xy / dir.z * 0.4 * cloudsLower + cloudsWind * time * 0.02;
for (int i = 0; i < cloudsSteps; ++i) {
float h = float(i) / float(cloudsSteps);
vec3 p = vec3(uv * 0.04, h);
float d = sampleCloudDensity(p);
if (d > 0) {
// float radiance = cloudRadiance(p, dir);
C += T * exp(h) * d * step_size * 0.6 * cloudsPrecipitation;
T *= exp(-d * step_size);
if (T < 0.01) break;
}
uv += (dir.xy / dir.z) * step_size * cloudsUpper;
}
return vec3(C) + sky * T;
}
#endif // _EnvClouds
void main() {
#ifdef _EnvCol
fragColor.rgb = backgroundCol;
#ifdef _EnvTransp
return;
#endif
#ifdef _EnvClouds
vec3 n = normalize(normal);
#endif
#endif
#ifndef _EnvSky // Prevent case when sky radiance is enabled
#ifdef _EnvTex
vec3 n = normalize(normal);
fragColor.rgb = texture(envmap, envMapEquirect(n)).rgb * envmapStrength;
#ifdef _EnvLDR
fragColor.rgb = pow(fragColor.rgb, vec3(2.2));
#endif
#endif
#endif
#ifdef _EnvImg // Static background
// Will have to get rid of gl_FragCoord, pass tc from VS
vec2 texco = gl_FragCoord.xy / screenSize;
fragColor.rgb = texture(envmap, vec2(texco.x, 1.0 - texco.y)).rgb * envmapStrength;
#endif
#ifdef _EnvSky
vec3 n = normalize(normal);
float phi = acos(n.z);
float theta = atan(-n.y, n.x) + PI;
float cos_theta = clamp(n.z, 0.0, 1.0);
float cos_gamma = dot(n, hosekSunDirection);
float gamma_val = acos(cos_gamma);
fragColor.rgb = Z * hosekWilkie(cos_theta, gamma_val, cos_gamma) * envmapStrength;
#endif
#ifdef _EnvClouds
if (n.z > 0.0) fragColor.rgb = mix(fragColor.rgb, traceClouds(fragColor.rgb, n), clamp(n.z * 5.0, 0, 1));
#endif
#ifdef _LDR
fragColor.rgb = pow(fragColor.rgb, vec3(1.0 / 2.2));
#endif
fragColor.a = 0.0; // Mark as non-opaque
}

View file

@ -1,114 +0,0 @@
{
"contexts": [
{
"name": "world_pass",
"depth_write": false,
"compare_mode": "less",
"cull_mode": "clockwise",
"links": [
{
"name": "SMVP",
"link": "_skydomeMatrix"
},
{
"name": "backgroundCol",
"link": "_backgroundCol",
"ifdef": ["_EnvCol"]
},
{
"name": "A",
"link": "_hosekA",
"ifdef": ["_EnvSky"]
},
{
"name": "B",
"link": "_hosekB",
"ifdef": ["_EnvSky"]
},
{
"name": "C",
"link": "_hosekC",
"ifdef": ["_EnvSky"]
},
{
"name": "D",
"link": "_hosekD",
"ifdef": ["_EnvSky"]
},
{
"name": "E",
"link": "_hosekE",
"ifdef": ["_EnvSky"]
},
{
"name": "F",
"link": "_hosekF",
"ifdef": ["_EnvSky"]
},
{
"name": "G",
"link": "_hosekG",
"ifdef": ["_EnvSky"]
},
{
"name": "H",
"link": "_hosekH",
"ifdef": ["_EnvSky"]
},
{
"name": "I",
"link": "_hosekI",
"ifdef": ["_EnvSky"]
},
{
"name": "Z",
"link": "_hosekZ",
"ifdef": ["_EnvSky"]
},
{
"name": "hosekSunDirection",
"link": "_hosekSunDirection",
"ifdef": ["_EnvSky"]
},
{
"name": "time",
"link": "_time",
"ifdef": ["_EnvClouds"]
},
{
"name": "scloudsBase",
"link": "$clouds_base.raw",
"ifdef": ["_EnvClouds"]
},
{
"name": "scloudsDetail",
"link": "$clouds_detail.raw",
"ifdef": ["_EnvClouds"]
},
{
"name": "scloudsMap",
"link": "$clouds_map.png",
"ifdef": ["_EnvClouds"]
},
{
"name": "screenSize",
"link": "_screenSize",
"ifdef": ["_EnvImg"]
},
{
"name": "envmap",
"link": "_envmap",
"ifdef": ["_EnvTex", "_EnvImg"]
},
{
"name": "envmapStrength",
"link": "_envmapStrength",
"ifdef": ["_EnvStr"]
}
],
"texture_params": [],
"vertex_shader": "world_pass.vert.glsl",
"fragment_shader": "world_pass.frag.glsl"
}
]
}

View file

@ -1,14 +0,0 @@
#version 450
in vec3 pos;
in vec3 nor;
out vec3 normal;
uniform mat4 SMVP;
void main() {
normal = nor;
vec4 position = SMVP * vec4(pos, 1.0);
gl_Position = vec4(position);
}

View file

@ -2,22 +2,22 @@ package armory.data;
class Config {
public static var raw:TConfig = null;
public static var raw: TConfig = null;
public static var configLoaded = false;
public static function load(done:Void->Void) {
public static function load(done: Void->Void) {
try {
iron.data.Data.getBlob('config.arm', function(blob:kha.Blob) {
iron.data.Data.getBlob("config.arm", function(blob: kha.Blob) {
configLoaded = true;
raw = haxe.Json.parse(blob.toString());
done();
});
}
catch(e:Dynamic) { done(); }
catch (e: Dynamic) { done(); }
}
public static function save() {
var path = iron.data.Data.dataPath + 'config.arm';
var path = iron.data.Data.dataPath + "config.arm";
var bytes = haxe.io.Bytes.ofString(haxe.Json.stringify(raw));
#if kha_krom
Krom.fileSaveBytes(path, bytes.getData());
@ -30,23 +30,23 @@ class Config {
}
typedef TConfig = {
@:optional var debug_console:Null<Bool>;
@:optional var window_mode:Null<Int>; // window, fullscreen
@:optional var window_w:Null<Int>;
@:optional var window_h:Null<Int>;
@:optional var window_resizable:Null<Bool>;
@:optional var window_maximizable:Null<Bool>;
@:optional var window_minimizable:Null<Bool>;
@:optional var window_vsync:Null<Bool>;
@:optional var window_msaa:Null<Int>;
@:optional var window_scale:Null<Float>;
@:optional var rp_supersample:Null<Float>;
@:optional var rp_shadowmap_cube:Null<Int>; // size
@:optional var rp_shadowmap_cascade:Null<Int>; // size for single cascade
@:optional var rp_ssgi:Null<Bool>;
@:optional var rp_ssr:Null<Bool>;
@:optional var rp_bloom:Null<Bool>;
@:optional var rp_motionblur:Null<Bool>;
@:optional var rp_gi:Null<Bool>; // voxelao
@:optional var rp_dynres:Null<Bool>; // dynamic resolution scaling
@:optional var debug_console: Null<Bool>;
@:optional var window_mode: Null<Int>; // window, fullscreen
@:optional var window_w: Null<Int>;
@:optional var window_h: Null<Int>;
@:optional var window_resizable: Null<Bool>;
@:optional var window_maximizable: Null<Bool>;
@:optional var window_minimizable: Null<Bool>;
@:optional var window_vsync: Null<Bool>;
@:optional var window_msaa: Null<Int>;
@:optional var window_scale: Null<Float>;
@:optional var rp_supersample: Null<Float>;
@:optional var rp_shadowmap_cube: Null<Int>; // size
@:optional var rp_shadowmap_cascade: Null<Int>; // size for single cascade
@:optional var rp_ssgi: Null<Bool>;
@:optional var rp_ssr: Null<Bool>;
@:optional var rp_bloom: Null<Bool>;
@:optional var rp_motionblur: Null<Bool>;
@:optional var rp_gi: Null<Bool>; // voxelao
@:optional var rp_dynres: Null<Bool>; // dynamic resolution scaling
}

1
Sources/armory/import.hx Normal file
View file

@ -0,0 +1 @@
import armory.system.Assert.*;

View file

@ -2,9 +2,9 @@ package armory.logicnode;
class ActiveCameraNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic { return iron.Scene.active.camera; }
override function get(from: Int): Dynamic { return iron.Scene.active.camera; }
}

View file

@ -2,9 +2,9 @@ package armory.logicnode;
class ActiveSceneNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic { return iron.Scene.active.raw.name; }
override function get(from: Int): Dynamic { return iron.Scene.active.raw.name; }
}

View file

@ -1,15 +1,17 @@
package armory.logicnode;
import kha.arrays.Float32Array;
class AddGroupNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var groupName:String = inputs[1].get();
override function run(from: Int) {
var groupName: String = inputs[1].get();
var raw = iron.Scene.active.raw;
// Already exists
for (g in raw.groups) {
if (g.name == groupName) {
@ -18,7 +20,7 @@ class AddGroupNode extends LogicNode {
}
}
raw.groups.push({ name: groupName, object_refs: [] });
raw.groups.push({ name: groupName, object_refs: [], instance_offset: new Float32Array(3)});
runOutput(0);
}
}

View file

@ -0,0 +1,114 @@
package armory.logicnode;
import iron.object.Object;
#if arm_physics
import armory.trait.physics.PhysicsConstraint;
import armory.trait.physics.bullet.PhysicsConstraint.ConstraintType;
#end
class AddPhysicsConstraintNode extends LogicNode {
public var property0: String;//Type
public var object: Object;
public var rb1: Object;
public var rb2: Object;
public function new(tree: LogicTree) {
super(tree);
}
override function run(from: Int) {
var pivotObject: Object = inputs[1].get();
rb1 = inputs[2].get();
rb2 = inputs[3].get();
if (pivotObject == null || rb1 == null || rb2 == null) return;
#if arm_physics
var disableCollisions: Bool = inputs[4].get();
var breakable: Bool = inputs[5].get();
var breakingThreshold: Float = inputs[6].get();
var type: ConstraintType = 0;
var con: PhysicsConstraint = pivotObject.getTrait(PhysicsConstraint);
if (con == null) {
switch (property0) {
case "Fixed": type = Fixed;
case "Point": type = Point;
case "Hinge": type = Hinge;
case "Slider": type = Slider;
case "Piston": type = Piston;
case "Generic Spring": type = Generic;
}
if (!breakable) breakingThreshold = 0.0;
if (type != Generic) {
con = new PhysicsConstraint(rb1, rb2, type, disableCollisions, breakingThreshold);
switch (type) {
case Hinge:
var setLimit: Bool = inputs[7].get();
var low: Float = inputs[8].get();
var up: Float = inputs[9].get();
con.setHingeConstraintLimits(setLimit, low, up);
case Slider:
var setLimit: Bool = inputs[7].get();
var low: Float = inputs[8].get();
var up: Float = inputs[9].get();
con.setSliderConstraintLimits(setLimit, low, up);
case Piston:
var setLinLimit: Bool = inputs[7].get();
var linLow: Float = inputs[8].get();
var linUp: Float = inputs[9].get();
var setAngLimit: Bool = inputs[10].get();
var angLow: Float = inputs[11].get();
var angUp: Float = inputs[12].get();
con.setPistonConstraintLimits(setLinLimit, linLow, linUp, setAngLimit, angLow, angUp);
default:
}
}
else {
var spring: Bool = false;
var prop: PhysicsConstraintNode;
for (inp in 7...inputs.length) {
prop = inputs[inp].get();
if (prop == null) continue;
if (prop.isSpring) {
spring = true;
break;
}
}
if (spring) {
con = new PhysicsConstraint(rb1, rb2, GenericSpring, disableCollisions, breakingThreshold);
}
else {
con = new PhysicsConstraint(rb1, rb2, Generic, disableCollisions, breakingThreshold);
}
for (inp in 7...inputs.length) {
prop = inputs[inp].get();
if (prop == null) continue;
if (prop.isSpring) {
con.setSpringParams(prop.isSpring, prop.value1, prop.value2, prop.axis, prop.isAngular);
}
else {
con.setGenericConstraintLimits(true, prop.value1, prop.value2, prop.axis, prop.isAngular);
}
}
}
pivotObject.addTrait(con);
}
#end
runOutput(0);
}
}

View file

@ -0,0 +1,97 @@
package armory.logicnode;
import iron.object.Object;
#if arm_physics
import armory.trait.physics.RigidBody;
import armory.trait.physics.bullet.RigidBody.Shape;
#end
class AddRigidBodyNode extends LogicNode {
public var property0: String; //Shape
public var property1: Bool; //Advanced
public var object: Object;
public function new(tree: LogicTree) {
super(tree);
}
override function run(from: Int) {
object = inputs[1].get();
if (object == null) return;
#if arm_physics
var mass: Float = inputs[2].get();
var active: Bool = inputs[3].get();
var animated: Bool = inputs[4].get();
var trigger: Bool = inputs[5].get();
var friction: Float = inputs[6].get();
var bounciness: Float = inputs[7].get();
var ccd: Bool = inputs[8].get();
var margin: Bool = false;
var marginLen: Float = 0.0;
var linDamp: Float = 0.0;
var angDamp: Float = 0.0;
var useDeactiv: Bool = false;
var linearVelThreshold: Float = 0.0;
var angVelThreshold: Float = 0.0;
var group: Int = 1;
var mask: Int = 1;
var shape: Shape = 1;
if (property1) {
margin = inputs[9].get();
marginLen = inputs[10].get();
linDamp = inputs[11].get();
angDamp = inputs[12].get();
useDeactiv = inputs[13].get();
linearVelThreshold = inputs[14].get();
angVelThreshold = inputs[15].get();
group = inputs[16].get();
mask = inputs[17].get();
}
var rb: RigidBody = object.getTrait(RigidBody);
if ((group < 0) || (group > 32)) group = 1; //Limiting max groups to 32
if ((mask < 0) || (mask > 32)) mask = 1; //Limiting max masks to 32
if (rb == null) {
switch (property0) {
case "Box": shape = Box;
case "Sphere": shape = Sphere;
case "Capsule": shape = Capsule;
case "Cone": shape = Cone;
case "Cylinder": shape = Cylinder;
case "Convex Hull": shape = ConvexHull;
case "Mesh": shape = Mesh;
}
rb = new RigidBody(shape, mass, friction, bounciness, group, mask);
rb.animated = animated;
rb.staticObj = !active;
rb.isTriggerObject(trigger);
if (property1) {
rb.linearDamping = linDamp;
rb.angularDamping = angDamp;
if (margin) rb.collisionMargin = marginLen;
if (useDeactiv) {
rb.setUpDeactivation(true, linearVelThreshold, angVelThreshold, 0.0);
}
}
object.addTrait(rb);
}
#end
runOutput(0);
}
override function get(from: Int): Object {
return object;
}
}

View file

@ -4,16 +4,23 @@ import iron.object.Object;
class AddTraitNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var object:Object = inputs[1].get();
var trait:Dynamic = inputs[2].get();
if (object == null || trait == null) return;
override function run(from: Int) {
var object: Object = inputs[1].get();
var traitName: String = inputs[2].get();
assert(Error, object != null, "Object should not be null");
assert(Error, traitName != null, "Trait name should not be null");
var cname = Type.resolveClass(Main.projectPackage + "." + traitName);
if (cname == null) cname = Type.resolveClass(Main.projectPackage + ".node." + traitName);
assert(Error, cname != null, 'No trait with the name "$traitName" found, make sure that the trait is exported!');
assert(Warning, object.getTrait(cname) == null, 'Object already has the trait "$traitName" applied');
var trait = Type.createInstance(cname, []);
object.addTrait(trait);
runOutput(0);

View file

@ -4,11 +4,11 @@ class AlternateNode extends LogicNode {
var b = true;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
override function run(from: Int) {
b ? runOutput(0) : runOutput(1);
b = !b;
}

View file

@ -2,19 +2,19 @@ package armory.logicnode;
class AnimActionNode extends LogicNode {
public var value:String;
public var value: String;
public function new(tree:LogicTree, value = "") {
public function new(tree: LogicTree, value = "") {
super(tree);
this.value = value;
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
if (inputs.length > 0) return inputs[0].get();
return value;
}
override function set(value:Dynamic) {
override function set(value: Dynamic) {
if (inputs.length > 0) inputs[0].set(value);
else this.value = value;
}

View file

@ -4,19 +4,24 @@ import iron.object.Object;
class AnimationStateNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
var object:Object = inputs[0].get();
override function get(from: Int): Dynamic {
var object: Object = inputs[0].get();
if (object == null) return null;
var animation = object.animation;
if (animation == null) animation = object.getParentArmature(object.name);
if (from == 0) return !animation.paused; // is playing
else if (from == 1) return animation.action;
else return animation.currentFrame();
return switch (from) {
case 0: animation.action;
case 1: animation.currentFrame();
case 2: animation.paused;
default: null;
}
}
}

View file

@ -8,13 +8,13 @@ import armory.trait.physics.RigidBody;
class AppendTransformNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var object:Object = inputs[1].get();
var matrix:Mat4 = inputs[2].get();
override function run(from: Int) {
var object: Object = inputs[1].get();
var matrix: Mat4 = inputs[2].get();
if (object == null || matrix == null) return;

View file

@ -4,35 +4,34 @@ import iron.object.Object;
import iron.math.Vec4;
import armory.trait.physics.RigidBody;
using armory.object.TransformExtension;
class ApplyForceAtLocationNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var object:Object = inputs[1].get();
var force:Vec4 = inputs[2].get();
var location:Vec4 = inputs[3].get();
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
override function run(from: Int) {
var object: Object = inputs[1].get();
var force: Vec4 = inputs[2].get();
var localForce: Bool = inputs.length > 3 ? inputs[3].get() : false;
var location: Vec4 = inputs[4].get();
var localLoc: Bool = inputs.length > 5 ? inputs[5].get() : false;
if (object == null || force == null || location == null) return;
#if arm_physics
var rb:RigidBody = object.getTrait(RigidBody);
if (!local) {
rb.applyForce(force, location);
}
else {
var look = object.transform.world.look().mult(force.y);
var right = object.transform.world.right().mult(force.x);
var up = object.transform.world.up().mult(force.z);
rb.applyForce(look, location);
rb.applyForce(right, location);
rb.applyForce(up, location);
var rb: RigidBody = object.getTrait(RigidBody);
if (localLoc) {
location.applyQuat(object.transform.rot);
}
!localForce ? rb.applyForce(force, location) : rb.applyForce(object.transform.worldVecToOrientation(force), location);
#end
runOutput(0);
}
}

View file

@ -4,34 +4,28 @@ import iron.object.Object;
import iron.math.Vec4;
import armory.trait.physics.RigidBody;
using armory.object.TransformExtension;
class ApplyForceNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var object:Object = inputs[1].get();
var force:Vec4 = inputs[2].get();
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
override function run(from: Int) {
var object: Object = inputs[1].get();
var force: Vec4 = inputs[2].get();
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
if (object == null || force == null) return;
#if arm_physics
var rb:RigidBody = object.getTrait(RigidBody);
if (!local) {
rb.applyForce(force);
}
else {
var look = object.transform.world.look().mult(force.y);
var right = object.transform.world.right().mult(force.x);
var up = object.transform.world.up().mult(force.z);
rb.applyForce(look);
rb.applyForce(right);
rb.applyForce(up);
}
var rb: RigidBody = object.getTrait(RigidBody);
!local ? rb.applyForce(force) : rb.applyForce(object.transform.worldVecToOrientation(force));
#end
runOutput(0);
}
}

View file

@ -4,34 +4,34 @@ import iron.object.Object;
import iron.math.Vec4;
import armory.trait.physics.RigidBody;
using armory.object.TransformExtension;
class ApplyImpulseAtLocationNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var object:Object = inputs[1].get();
var impulse:Vec4 = inputs[2].get();
var location:Vec4 = inputs[3].get();
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
override function run(from: Int) {
var object: Object = inputs[1].get();
var impulse: Vec4 = inputs[2].get();
var localImpulse: Bool = inputs.length > 3 ? inputs[3].get() : false;
var location: Vec4 = inputs[4].get();
var localLoc: Bool = inputs.length > 5 ? inputs[5].get() : false;
if (object == null || impulse == null || location == null) return;
#if arm_physics
var rb:RigidBody = object.getTrait(RigidBody);
if (!local) {
rb.applyImpulse(impulse, location); }
else {
var look = object.transform.world.look().mult(impulse.y);
var right = object.transform.world.right().mult(impulse.x);
var up = object.transform.world.up().mult(impulse.z);
rb.applyImpulse(look, location);
rb.applyImpulse(right, location);
rb.applyImpulse(up, location);
var rb: RigidBody = object.getTrait(RigidBody);
if (localLoc) {
location.applyQuat(object.transform.rot);
}
!localImpulse ? rb.applyImpulse(impulse, location) : rb.applyImpulse(object.transform.worldVecToOrientation(impulse), location);
#end
runOutput(0);
}
}

View file

@ -4,34 +4,28 @@ import iron.object.Object;
import iron.math.Vec4;
import armory.trait.physics.RigidBody;
using armory.object.TransformExtension;
class ApplyImpulseNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var object:Object = inputs[1].get();
var impulse:Vec4 = inputs[2].get();
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
override function run(from: Int) {
var object: Object = inputs[1].get();
var impulse: Vec4 = inputs[2].get();
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
if (object == null || impulse == null) return;
#if arm_physics
var rb:RigidBody = object.getTrait(RigidBody);
if (!local) {
rb.applyImpulse(impulse);
}
else {
var look = object.transform.world.look().mult(impulse.y);
var right = object.transform.world.right().mult(impulse.x);
var up = object.transform.world.up().mult(impulse.z);
rb.applyImpulse(look);
rb.applyImpulse(right);
rb.applyImpulse(up);
}
var rb: RigidBody = object.getTrait(RigidBody);
!local ? rb.applyImpulse(impulse) : rb.applyImpulse(object.transform.worldVecToOrientation(impulse));
#end
runOutput(0);
}
}

View file

@ -4,23 +4,28 @@ import iron.object.Object;
import iron.math.Vec4;
import armory.trait.physics.RigidBody;
using armory.object.TransformExtension;
class ApplyTorqueImpulseNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var object:Object = inputs[1].get();
var torque:Vec4 = inputs[2].get();
override function run(from: Int) {
var object: Object = inputs[1].get();
var torque: Vec4 = inputs[2].get();
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
if (object == null || torque == null) return;
#if arm_physics
var rb:RigidBody = object.getTrait(RigidBody);
rb.applyTorqueImpulse(torque);
var rb: RigidBody = object.getTrait(RigidBody);
!local ? rb.applyTorqueImpulse(torque) : rb.applyTorqueImpulse(object.transform.worldVecToOrientation(torque));
#end
runOutput(0);
}
}

View file

@ -4,23 +4,28 @@ import iron.object.Object;
import iron.math.Vec4;
import armory.trait.physics.RigidBody;
using armory.object.TransformExtension;
class ApplyTorqueNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var object:Object = inputs[1].get();
var torque:Vec4 = inputs[2].get();
override function run(from: Int) {
var object: Object = inputs[1].get();
var torque: Vec4 = inputs[2].get();
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
if (object == null || torque == null) return;
#if arm_physics
var rb:RigidBody = object.getTrait(RigidBody);
rb.applyTorque(torque);
var rb: RigidBody = object.getTrait(RigidBody);
!local ? rb.applyTorque(torque) : rb.applyTorque(object.transform.worldVecToOrientation(torque));
#end
runOutput(0);
}
}

View file

@ -2,21 +2,38 @@ package armory.logicnode;
class ArrayAddNode extends LogicNode {
public function new(tree:LogicTree) {
var ar: Array<Dynamic>;
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var ar:Array<Dynamic> = inputs[1].get();
override function run(from: Int) {
ar = inputs[1].get();
if (ar == null) return;
if (inputs.length > 2) {
for (i in 2...inputs.length) {
var value:Dynamic = inputs[i].get();
ar.push(value);
// "Modify Original" == `false` -> Copy the input array
if (!inputs[2].get()) {
ar = ar.copy();
}
if (inputs.length > 4) {
for (i in 4...inputs.length) {
var value: Dynamic = inputs[i].get();
// "Unique Values" options only supports primitive data types
// for now, a custom indexOf() or contains() method would be
// required to compare values of other types
if (!inputs[3].get() || ar.indexOf(value) == -1) {
ar.push(value);
}
}
}
runOutput(0);
}
override function get(from: Int): Dynamic {
return ar;
}
}

View file

@ -1,22 +0,0 @@
package armory.logicnode;
class ArrayAddUniqueNode extends LogicNode {
public function new(tree:LogicTree) {
super(tree);
}
override function run(from:Int) {
var ar:Array<Dynamic> = inputs[1].get();
if (ar == null) return;
if (inputs.length > 2) {
for (i in 2...inputs.length) {
var value:Dynamic = inputs[i].get();
if (ar.indexOf(value) == -1) ar.push(value);
}
}
runOutput(0);
}
}

View file

@ -2,18 +2,18 @@ package armory.logicnode;
class ArrayBooleanNode extends LogicNode {
public var value:Array<Bool> = [];
public var value: Array<Bool> = [];
var initialized = false;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
if (!initialized) {
initialized = true;
for (inp in inputs) {
var val:Bool = inp.get();
var val: Bool = inp.get();
value.push(val);
}
}
@ -21,7 +21,7 @@ class ArrayBooleanNode extends LogicNode {
return from == 0 ? value : value.length;
}
override function set(value:Dynamic) {
override function set(value: Dynamic) {
this.value = value;
}
}

View file

@ -4,18 +4,18 @@ import iron.math.Vec4;
class ArrayColorNode extends LogicNode {
public var value:Array<Vec4> = [];
public var value: Array<Vec4> = [];
var initialized = false;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
if (!initialized) {
initialized = true;
for (inp in inputs) {
var val:Vec4 = inp.get();
var val: Vec4 = inp.get();
value.push(val);
}
}
@ -23,7 +23,7 @@ class ArrayColorNode extends LogicNode {
return from == 0 ? value : value.length;
}
override function set(value:Dynamic) {
override function set(value: Dynamic) {
this.value = value;
}
}

View file

@ -2,18 +2,18 @@ package armory.logicnode;
class ArrayFloatNode extends LogicNode {
public var value:Array<Float> = [];
public var value: Array<Float> = [];
var initialized = false;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
if (!initialized) {
initialized = true;
for (inp in inputs) {
var val:Float = inp.get();
var val: Float = inp.get();
value.push(val);
}
}
@ -21,7 +21,7 @@ class ArrayFloatNode extends LogicNode {
return from == 0 ? value : value.length;
}
override function set(value:Dynamic) {
override function set(value: Dynamic) {
this.value = value;
}
}

View file

@ -2,21 +2,26 @@ package armory.logicnode;
class ArrayGetNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
var ar:Array<Dynamic> = inputs[0].get();
override function get(from: Int): Dynamic {
var ar: Array<Dynamic> = inputs[0].get();
if (ar == null) return null;
var i:Int = inputs[1].get();
var i: Int = inputs[1].get();
if (i < 0) i = ar.length + i;
if (i < 0 || i > ar.length - 1) {
var className = Type.getClassName(Type.getClass(tree));
var traitName = className.substring(className.lastIndexOf(".") + 1);
var objectName = tree.object.name;
trace('Logic error (object: $objectName, trait: $traitName): Array Get - index out of range');
return null;
}
return ar[i];

View file

@ -2,14 +2,14 @@ package armory.logicnode;
class ArrayInArrayNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
var array:Array<Dynamic> = inputs[0].get();
var value:Dynamic = inputs[1].get();
override function get(from: Int): Dynamic {
var array: Array<Dynamic> = inputs[0].get();
var value: Dynamic = inputs[1].get();
return ! (array.indexOf(value) == -1);
return array.indexOf(value) != -1;
}
}

View file

@ -2,18 +2,18 @@ package armory.logicnode;
class ArrayIntegerNode extends LogicNode {
public var value:Array<Int> = [];
public var value: Array<Int> = [];
var initialized = false;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
if (!initialized) {
initialized = true;
for (inp in inputs) {
var val:Int = inp.get();
var val: Int = inp.get();
value.push(val);
}
}
@ -21,7 +21,7 @@ class ArrayIntegerNode extends LogicNode {
return from == 0 ? value : value.length;
}
override function set(value:Dynamic) {
override function set(value: Dynamic) {
this.value = value;
}
}

View file

@ -2,12 +2,12 @@ package armory.logicnode;
class ArrayLengthNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
var ar:Array<Dynamic> = inputs[0].get();
override function get(from: Int): Dynamic {
var ar: Array<Dynamic> = inputs[0].get();
return ar != null ? ar.length : 0;
}
}

View file

@ -2,18 +2,21 @@ package armory.logicnode;
class ArrayLoopNode extends LogicNode {
var value:Dynamic;
var value: Dynamic;
var index: Int;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var ar:Array<Dynamic> = inputs[1].get();
override function run(from: Int) {
var ar: Array<Dynamic> = inputs[1].get();
if (ar == null) return;
index = -1;
for (val in ar) {
value = val;
index++;
runOutput(0);
if (tree.loopBreak) {
@ -21,10 +24,12 @@ class ArrayLoopNode extends LogicNode {
break;
}
}
runOutput(2);
runOutput(3);
}
override function get(from:Int):Dynamic {
return value;
override function get(from: Int): Dynamic {
if (from == 1)
return value;
return index;
}
}

View file

@ -2,18 +2,18 @@ package armory.logicnode;
class ArrayNode extends LogicNode {
public var value:Array<Dynamic> = [];
public var value: Array<Dynamic> = [];
var initialized = false;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
if (!initialized) {
initialized = true;
for (inp in inputs) {
var val:Dynamic = inp.get();
var val: Dynamic = inp.get();
value.push(val);
}
}
@ -21,7 +21,7 @@ class ArrayNode extends LogicNode {
return from == 0 ? value : value.length;
}
override function set(value:Dynamic) {
override function set(value: Dynamic) {
this.value = value;
}
}

View file

@ -4,18 +4,18 @@ import iron.object.Object;
class ArrayObjectNode extends LogicNode {
public var value:Array<Object> = [];
public var value: Array<Object> = [];
var initialized = false;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
if (!initialized) {
initialized = true;
for (inp in inputs) {
var val:Object = inp.get();
var val: Object = inp.get();
value.push(val);
}
}
@ -23,7 +23,7 @@ class ArrayObjectNode extends LogicNode {
return from == 0 ? value : value.length;
}
override function set(value:Dynamic) {
override function set(value: Dynamic) {
this.value = value;
}
}

View file

@ -2,14 +2,14 @@ package armory.logicnode;
class ArrayPopNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
var ar:Array<Dynamic> = inputs[0].get();
override function get(from: Int): Dynamic {
var ar: Array<Dynamic> = inputs[0].get();
if (ar == null) return null;
return ar.pop();
}
}

View file

@ -2,17 +2,17 @@ package armory.logicnode;
class ArrayRemoveNode extends LogicNode {
var removedValue:Dynamic = null;
var removedValue: Dynamic = null;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var ar:Array<Dynamic> = inputs[1].get();
override function run(from: Int) {
var ar: Array<Dynamic> = inputs[1].get();
if (ar == null) return;
var i:Int = inputs[2].get();
var i: Int = inputs[2].get();
if (i < 0) i = ar.length + i;
removedValue = ar[i];
@ -21,7 +21,7 @@ class ArrayRemoveNode extends LogicNode {
runOutput(0);
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
return removedValue;
}
}

View file

@ -2,17 +2,17 @@ package armory.logicnode;
class ArrayRemoveValueNode extends LogicNode {
var removedValue:Dynamic = null;
var removedValue: Dynamic = null;
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var ar:Array<Dynamic> = inputs[1].get();
override function run(from: Int) {
var ar: Array<Dynamic> = inputs[1].get();
if (ar == null) return;
var val:Dynamic = inputs[2].get();
var val: Dynamic = inputs[2].get();
removedValue = val;
ar.remove(val);
@ -20,7 +20,7 @@ class ArrayRemoveValueNode extends LogicNode {
runOutput(0);
}
override function get(from:Int):Dynamic {
override function get(from: Int): Dynamic {
return removedValue;
}
}

View file

@ -2,16 +2,16 @@ package armory.logicnode;
class ArraySetNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var ar:Array<Dynamic> = inputs[1].get();
override function run(from: Int) {
var ar: Array<Dynamic> = inputs[1].get();
if (ar == null) return;
var i:Int = inputs[2].get();
var value:Dynamic = inputs[3].get();
var i: Int = inputs[2].get();
var value: Dynamic = inputs[3].get();
if (i < 0) ar[ar.length + i] = value;
else ar[i] = value;

View file

@ -2,12 +2,12 @@ package armory.logicnode;
class ArrayShiftNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
var ar:Array<Dynamic> = inputs[0].get();
override function get(from: Int): Dynamic {
var ar: Array<Dynamic> = inputs[0].get();
if (ar == null) return null;
return ar.shift();

View file

@ -2,16 +2,16 @@ package armory.logicnode;
class ArraySliceNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from:Int):Dynamic {
var ar:Array<Dynamic> = inputs[0].get();
override function get(from: Int): Dynamic {
var ar: Array<Dynamic> = inputs[0].get();
if (ar == null) return null;
var i:Int = inputs[1].get();
var end:Int = inputs[2].get();
var i: Int = inputs[1].get();
var end: Int = inputs[2].get();
if (i < 0) i = ar.length + i;
if (i < 0 || i > ar.length - 1) {

View file

@ -2,12 +2,12 @@ package armory.logicnode;
class ArraySpliceNode extends LogicNode {
public function new(tree:LogicTree) {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from:Int) {
var ar:Array<Dynamic> = inputs[1].get();
override function run(from: Int) {
var ar: Array<Dynamic> = inputs[1].get();
if (ar == null) return;
var i = inputs[2].get();

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