Commit Graph

193 Commits

Author SHA1 Message Date
8351266117 Fix visual shader node expression undo/redo for set_size and expression 2020-10-15 16:11:38 +03:00
1fee310a9a Fix copy/paste/duplicate for particle mode in visual shaders 2020-10-15 11:33:06 +03:00
9b5d6f785b Refactor delete nodes functions in visual shader editor 2020-10-15 10:24:27 +03:00
f4eef287f9 Adds Metallic to spatial light input of visual shaders 2020-10-10 16:55:36 +03:00
fa35733b4c Updates size of float constant in visual shader if empty is selected 2020-10-01 18:19:36 +03:00
50a80db50f Add an option to select a predifined constant in visual shader editor 2020-10-01 11:11:49 +03:00
2652debde0 Drag & drop 3d/2d array/cubemap texture to visual shader 2020-09-29 15:27:36 +03:00
bebf424c80 Merge pull request #42078 from Chaosus/vs_rename_type
Renames Type to OpType in VisualShaderNodeMultiplyAdd
2020-09-29 10:34:22 +02:00
11043b1a8f Fix undo for moving multiple visual shader nodes 2020-09-27 14:05:19 +03:00
81a44a4145 Fix expressions nodes in visual shaders 2020-09-22 23:07:55 +03:00
477f6c880e Fix UniformRef invalid updating when LineEdit focus out 2020-09-22 09:56:24 +03:00
07fb960a88 Fix some bugs in visual shader editor 2020-09-21 22:19:20 +03:00
f137f14e1c Renames Type to OpType in VisualShaderNodeMultiplyAdd
To prevent possible conflicts with C# and other languages.
2020-09-15 11:06:18 +03:00
0fd9ad8801 Fix visual shader connection regression 2020-09-13 23:48:59 +03:00
f726ef1cd7 [VisualShader] Fixes default node's input port not hiding on connection 2020-09-13 19:59:01 +03:00
c24e2075cd Update shader graph if mode is changed 2020-09-12 12:44:01 +03:00
8dbf3d7c44 Improve performance of Add/Remove/Connect/Change nodes in visual shader 2020-09-11 15:45:18 +03:00
1353ed5e44 Added Line numbers to CodeEdit 2020-09-10 20:35:28 +01:00
a0b409cb14 Add and convert editor to use CodeEdit 2020-09-10 20:35:27 +01:00
5ba8246cfb Added Texture3D to visual shaders 2020-09-10 07:40:06 +03:00
da488ff041 Fix build warning in visual_shader_editor 2020-09-09 22:00:21 +03:00
14a24fa19c Improve performance for Show/Hide port preview in visual shaders 2020-09-09 19:24:55 +03:00
ea49d8b9d5 Improve performance of Undo:change node position in visual shader 2020-09-09 11:29:40 +03:00
dc6685d28f Remakes particles in visual shaders 2020-09-07 13:33:51 +03:00
de097b9327 Removes redundant code & fix documentation for VisualShaderNodeCustom 2020-09-06 12:09:15 +03:00
004d8e86a6 Use flags instead TYPE_ enum in visual shaders editor 2020-09-06 10:43:14 +03:00
c291b1d23c Restore Particles functionality in visual shader 2020-09-03 10:22:00 +03:00
0594da324c Fix incorrect colors for member variables and numbers in visual shaders 2020-07-31 11:06:48 +03:00
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
69d1c48b73 Fixed shader editor comment highlighting 2020-07-28 15:16:24 -04:00
a33171ad23 Fix functions name color in visual shader code preview and expressions 2020-07-28 20:58:23 +03:00
7ddaff47a3 Added UniformRef visual shader node 2020-07-28 14:44:53 +03:00
ccab210fb5 Fixed visual shader editor not clearing colour regions 2020-07-14 13:21:53 +01:00
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
ecb5f7ea23 Added 'fma' function to shader language 2020-07-10 19:58:03 +03:00
e19cdacbd7 Makes "Add new member" dialog non-exclusive for visual shaders 2020-07-04 13:20:30 +03:00
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
cb9cbf840d Added Texture2DArray support to visual shaders 2020-06-19 18:02:05 +03:00
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
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
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
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
42649565e9 Merge pull request #38475 from Chaosus/vs_quals
Added uniform qualifiers to visual shaders
2020-05-06 07:27:35 +02:00
463e4ad0f5 Some fixes for canvas item visual shader inputs 2020-05-05 13:19:36 +03:00
082542b525 Added uniform qualifiers to visual shaders 2020-05-05 11:25:48 +03:00
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
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
8dfe6716ec Adds warning to the uniform name in visual shader if its equal to keyword 2020-04-06 12:29:50 +03:00
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
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