Commit graph

257 commits

Author SHA1 Message Date
Yuri Roubinsky 8c2363922e Makes strings translatable on right-click menu in visual shader 2020-12-25 16:43:39 +03:00
Marcel Admiraal 4b8b803931 Rename Control margin to offset 2020-12-23 06:25:56 +00:00
Marcel Admiraal 8509c8c8fc Rename AcceptDialog get_ok() to get_ok_button()
Also renames:
- AcceptDialog add_cancel() to add_cancel_button()
- ConfirmationDiaglog get_cancel() to get_cancel_button()
2020-12-14 18:43:52 +00:00
Rafał Mikrut e1811b689b Initialize class/struct variables with default values in platform/ and editor/ 2020-12-02 16:09:11 +01:00
Yuri Roubinsky dd32d7b7ee Fixed some errors when changing port name in visual shader expressions 2020-12-02 13:27:37 +03:00
Yuri Roubinsky b74f1abd25 Fix few bugs in visual shader expressions
Fixed few bugs in visual shader expressions
2020-12-01 16:55:52 +03:00
Yuri Roubinsky a9e5701e2a Fixed crash in visual shader on changing input when preview is visible 2020-12-01 12:11:44 +03:00
Yuri Roubinsky 82d64ebd19 Fixed several visual shader inputs
Fixed several inputs in visual shaders
2020-11-29 16:10:05 +03:00
Yuri Roubinsky 07e752585c Fixed invalid visual shader outputs (TRANSMISSION, ALPHA_SCISSOR) 2020-11-28 20:42:59 +03:00
Rémi Verschelde a6751e6c58
Merge pull request #41100 from bruvzg/ctl_text_server_interface
[Complex Text Layouts] Implement TextServer interface.
2020-11-28 09:03:15 +01:00
bruvzg 99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +02:00
Yuri Roubinsky 3e1e01b7ab Added extra warning to VisualShaderNodeTexture + fix warning appearing 2020-11-26 14:53:47 +03:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Yuri Roubinsky f402e1e675 Added VisualShaderNodeCurve to easy gather data from a CurveTexture 2020-10-18 09:57:15 +03:00
Yuri Roubinsky 8351266117 Fix visual shader node expression undo/redo for set_size and expression 2020-10-15 16:11:38 +03:00
Yuri Roubinsky 1fee310a9a Fix copy/paste/duplicate for particle mode in visual shaders 2020-10-15 11:33:06 +03:00
Yuri Roubinsky 9b5d6f785b Refactor delete nodes functions in visual shader editor 2020-10-15 10:24:27 +03:00
Yuri Roubinsky f4eef287f9 Adds Metallic to spatial light input of visual shaders 2020-10-10 16:55:36 +03:00
Yuri Roubinsky fa35733b4c Updates size of float constant in visual shader if empty is selected 2020-10-01 18:19:36 +03:00
Yuri Roubinsky 50a80db50f Add an option to select a predifined constant in visual shader editor 2020-10-01 11:11:49 +03:00
Yuri Roubinsky 2652debde0 Drag & drop 3d/2d array/cubemap texture to visual shader 2020-09-29 15:27:36 +03:00
Rémi Verschelde bebf424c80
Merge pull request #42078 from Chaosus/vs_rename_type
Renames Type to OpType in VisualShaderNodeMultiplyAdd
2020-09-29 10:34:22 +02:00
Yuri Roubinsky 11043b1a8f Fix undo for moving multiple visual shader nodes 2020-09-27 14:05:19 +03:00
Yuri Roubinsky 81a44a4145 Fix expressions nodes in visual shaders 2020-09-22 23:07:55 +03:00
Yuri Roubinsky 477f6c880e Fix UniformRef invalid updating when LineEdit focus out 2020-09-22 09:56:24 +03:00
Yuri Roubinsky 07fb960a88 Fix some bugs in visual shader editor 2020-09-21 22:19:20 +03:00
Yuri Roubinsky f137f14e1c Renames Type to OpType in VisualShaderNodeMultiplyAdd
To prevent possible conflicts with C# and other languages.
2020-09-15 11:06:18 +03:00
Yuri Roubinsky 0fd9ad8801 Fix visual shader connection regression 2020-09-13 23:48:59 +03:00
Yuri Roubinsky f726ef1cd7 [VisualShader] Fixes default node's input port not hiding on connection 2020-09-13 19:59:01 +03:00
Yuri Roubinsky c24e2075cd Update shader graph if mode is changed 2020-09-12 12:44:01 +03:00
Yuri Roubinsky 8dbf3d7c44 Improve performance of Add/Remove/Connect/Change nodes in visual shader 2020-09-11 15:45:18 +03:00
Paulb23 1353ed5e44 Added Line numbers to CodeEdit 2020-09-10 20:35:28 +01:00
Paulb23 a0b409cb14 Add and convert editor to use CodeEdit 2020-09-10 20:35:27 +01:00
Yuri Roubinsky 5ba8246cfb Added Texture3D to visual shaders 2020-09-10 07:40:06 +03:00
Yuri Roubinsky da488ff041 Fix build warning in visual_shader_editor 2020-09-09 22:00:21 +03:00
Yuri Roubinsky 14a24fa19c Improve performance for Show/Hide port preview in visual shaders 2020-09-09 19:24:55 +03:00
Yuri Roubinsky ea49d8b9d5 Improve performance of Undo:change node position in visual shader 2020-09-09 11:29:40 +03:00
Yuri Roubinsky dc6685d28f Remakes particles in visual shaders 2020-09-07 13:33:51 +03:00
Yuri Roubinsky de097b9327 Removes redundant code & fix documentation for VisualShaderNodeCustom 2020-09-06 12:09:15 +03:00
Yuri Roubinsky 004d8e86a6 Use flags instead TYPE_ enum in visual shaders editor 2020-09-06 10:43:14 +03:00
Yuri Roubinsky c291b1d23c Restore Particles functionality in visual shader 2020-09-03 10:22:00 +03:00
Yuri Roubinsky 0594da324c Fix incorrect colors for member variables and numbers in visual shaders 2020-07-31 11:06:48 +03:00
Rémi Verschelde 7a31baf3b9
Merge pull request #40800 from briansemrau/fix-shader-comment-highlighting
Fixed Shader editor single-line comment highlight
2020-07-28 21:44:30 +02:00
Brian Semrau 69d1c48b73 Fixed shader editor comment highlighting 2020-07-28 15:16:24 -04:00
Yuri Roubinsky a33171ad23 Fix functions name color in visual shader code preview and expressions 2020-07-28 20:58:23 +03:00
Yuri Roubinsky 7ddaff47a3 Added UniformRef visual shader node 2020-07-28 14:44:53 +03:00
Paulb23 ccab210fb5 Fixed visual shader editor not clearing colour regions 2020-07-14 13:21:53 +01:00
Paulb23 bc4cee4458 Extract Syntax highlighting from TextEdit and add EditorSyntaxHighlighter
- Extacted all syntax highlighting code from text edit
- Removed enable syntax highlighting from text edit
- Added line_edited_from signal to text_edit
- Renamed get/set_syntax_highlighting to get/set_syntax_highlighter
- Added EditorSyntaxHighligher
2020-07-11 17:09:58 +01:00
Yuri Roubinsky ecb5f7ea23 Added 'fma' function to shader language 2020-07-10 19:58:03 +03:00
Yuri Roubinsky e19cdacbd7 Makes "Add new member" dialog non-exclusive for visual shaders 2020-07-04 13:20:30 +03:00
Hugo Locurcio 31b7f02a29
Remove ToolButton in favor of Button
ToolButton has no redeeming differences with Button;
it's just a Button with the Flat property enabled by default.
Removing it avoids some confusion when creating GUIs.

Existing ToolButtons will be converted to Buttons, but the Flat
property won't be enabled automatically.

This closes https://github.com/godotengine/godot-proposals/issues/1081.
2020-06-19 20:49:49 +02:00
Yuri Roubinsky cb9cbf840d Added Texture2DArray support to visual shaders 2020-06-19 18:02:05 +03:00
Rémi Verschelde 0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
Rémi Verschelde 42649565e9
Merge pull request #38475 from Chaosus/vs_quals
Added uniform qualifiers to visual shaders
2020-05-06 07:27:35 +02:00
Yuri Roubinsky 463e4ad0f5 Some fixes for canvas item visual shader inputs 2020-05-05 13:19:36 +03:00
Yuri Roubinsky 082542b525 Added uniform qualifiers to visual shaders 2020-05-05 11:25:48 +03:00
Rémi Verschelde fdf58a5858 Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring
in #37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes #37319.
Fixes #37690.
2020-04-28 15:19:49 +02:00
Juan Linietsky 0e1c66d9fc Implement global and per instance shader uniforms.
Adds two keywords to shader language for uniforms:
-'global'
-'instance'

This allows them to reference values outside the material.
2020-04-17 12:35:41 -03:00
Yuri Roubinsky 8dfe6716ec Adds warning to the uniform name in visual shader if its equal to keyword 2020-04-06 12:29:50 +03:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Juan Linietsky a6f3bc7c69 Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D

Also renamed corresponding files.
2020-03-27 15:21:27 -03:00
Juan Linietsky 441f1a5fe9 Popups are now windows also (broken!) 2020-03-26 15:49:42 +01:00
Juan Linietsky 4758057f20 Working multiple window support, including editor 2020-03-26 15:49:40 +01:00
Juan Linietsky 8e6960a69e Refactored input, goes all via windows now.
Also renamed Input to InputFilter because all it does is filter events.
2020-03-26 15:49:39 +01:00
Juan Linietsky 9e08742de8 Added a Window node, and made it the scene root.
Still a lot of work to do.
2020-03-26 15:49:38 +01:00
Juan Linietsky f8a79a97c7 Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
Juan Linietsky 4396e98834 Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
Yuri Roubinsky 898b843718 Added sky shader mode to visual shaders 2020-03-25 19:04:42 +03:00
Rémi Verschelde fdda39a506 Signals: Don't pass default binds to EditorProperty property_changed
This was done by mistake in #36758, but it's not necessary and actual
causes a bug.

`property_changed` is only emitted via `emit_changed()`, which already
has default values for `p_field` and `p_changing`.

Also reverted to using `String` for now to be on the safe side, even if
it's inconsistent with `emit_changed()`. I had only changed it
partially in #36758 so it was inconsistent. It probably does make sense
to port `EditorInspector` and related property editors to use
`StringName` where relevant, but that's for a dedicated PR.

Fixes #36799.
2020-03-05 15:35:44 +01:00
Rémi Verschelde 48ed841dd0 Signals: Fix some regressions from #36426
- Fix `callable_mp` bindings to methods which used to have default
  arguments passed to `bind_method`. We now have to re-specify them
  manually when connecting.
- Re-add `GroupsEditor::update_tree` binding.
- Misc code quality changes along the way.
2020-03-03 11:44:06 +01:00
Rémi Verschelde e2b66cacf7
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
2020-03-01 23:00:42 +01:00
Rémi Verschelde f742dabafe Signals: Manually port most of remaining connect_compat uses
It's tedious work...

Some can't be ported as they depend on private or protected methods
of different classes, which is not supported by callable_mp (even if
it's a class inherited by the current one).
2020-02-28 14:24:09 +01:00
Rémi Verschelde 01afc442c7 Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.

No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
2020-02-28 14:24:09 +01:00
Yuri Roubinsky 7aaad99afb Place paste after copy in new popup menu in visual shader
+ renamed _on_nodes_delete to _delete_nodes
2020-02-27 13:55:41 +03:00
Yuri Roubinsky 2d548b4d1a Added popup menu for some actions in visual shaders 2020-02-27 12:54:26 +03:00
Yuri Roubinsky 9cfd2ed564 Fix resizer icon color in VisualScripts/Shaders when graph headers is on 2020-02-26 17:48:58 +03:00
Yuri Roubinsky 1e8108310a Changed float type to int for INDEX visual shader input 2020-02-26 16:39:42 +03:00
Yuri Roubinsky 4a3d277623 Add support for integer type in visual shaders 2020-02-26 10:12:06 +03:00
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
bruvzg 1af06d3d46
Rename scancode to keycode.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-25 12:30:33 +02:00
Yuri Roubinsky b78b37ed3f Refactor node processing in visual shader member dialog 2020-02-21 18:34:31 +03:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Juan Linietsky 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Juan Linietsky 867d073b98 Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr. 2020-02-15 08:36:04 -03:00
Yuri Roubinsky b798e26e28 Restore cubemaps in visual shaders 2020-02-14 12:51:46 +03:00
Yuri Roubinsky 7aad7df574 Restore drag&drop textures in visual shaders 2020-02-13 19:19:41 +03:00
Yuri Roubinsky bc647393ba Added virtual method to VisualShaderNodeCustom to enable high-end mark 2020-02-13 09:43:43 +03:00
Yuri Roubinsky 516cd821c0 Added high-end (Vulkan) label to some functions in visual shader 2020-02-12 23:17:00 +03:00
Juan Linietsky 3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Yuri Roubinsky 22ad83edae Implemented hint_range for VisualShaderNodeScalarUniform 2020-02-07 17:04:24 +03:00
Haoyu Qiu 65e2230f6e Fixes min size of various editor plugins on HiDPI
* AnimationTree
* AudioStream
* ResourcePreloader
* ShaderEditor
* VisualShaderEditor
2020-01-12 15:24:15 +08:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Haoyu Qiu 078c0d75f2 Cleans up headers included in editor_node.h 2019-12-24 21:46:05 +08:00
Tomasz Chabora 2bde99f790 Fix some small text mistakes 2019-11-08 23:31:29 +01:00
Yuri Roubinsky 8243afb0e9 Added sampler inputs for visual shaders 2019-11-03 17:59:15 +03:00
Yuri Roubinsky 84a0ad36b6 Sort custom vshader nodes+prevents them from divide to different folders 2019-11-02 12:04:48 +03:00
Yuri Roubinsky b76ae23392 Prevents folding of member tree on drag&drop in visual shader 2019-10-10 14:19:48 +03:00