Commit graph

6954 commits

Author SHA1 Message Date
Max Hilbrunner 17e61fa0af
Merge pull request #52095 from kleonc/tree-item-drag-drop-drawing-3x
[3.x] Tree Fix line rendering when drag and dropping TreeItem
2021-08-27 20:55:58 +02:00
LeaoLuciano 9cecabb186 LinkButton's text now is automatically translated 2021-08-26 17:56:34 -03:00
Haoyu Qiu 5183c473f7 Backport new methods for KinematicBody and KinematicCollision
For both 2D and 3D, three methods are added:

- `get_floor_angle` on `KinematicBody` to get the floor angle.
- `get_angle` on `KinematicCollision` to get the collision angle.
- `get_last_slide_collision` to quickly get the latest collision of `move_and_slide`.
2021-08-26 12:16:40 +08:00
kleonc 92ea0f7dd9 Tree Fix line rendering when drag and dropping TreeItem 2021-08-25 12:03:05 +02:00
Hugo Locurcio f5e83e7305
Merge pull request #52052 from Calinou/dynamicfont-allow-woff
Allow using WOFF fonts in DynamicFont
2021-08-25 10:37:15 +02:00
Hugo Locurcio 1ab3ddf94a
Allow using WOFF fonts in DynamicFont
This is already supported by FreeType, but it wasn't exposed.

Adding support for WOFF2 would require linking a Brotli decompression
library in Godot, so only WOFF1 is exposed here.
2021-08-25 08:09:23 +02:00
Camille Mohr-Daurat 5ce734c073
Merge pull request #52056 from jmb462/fix-raycast3D-color-update
[3.x] Fix Raycast3D color update when not colliding anymore (Fix #52051)
2021-08-24 08:11:05 -07:00
Camille Mohr-Daurat 9c893d3c78
Merge pull request #52057 from fabriceci/fix-transmission-velocity-on-wall
[3.x] Remove the transmission of the velocity when a body is on_wall Fix #51960
2021-08-24 08:02:29 -07:00
fabriceci 13d5fa2c43 Remove the transmission of velocity when a body is on_wall 2021-08-24 11:29:40 +02:00
jmb462 5de6376a22 Fix Raycast3D color update when not colliding anymore 2021-08-24 11:24:02 +02:00
Max Hilbrunner 8c98320f93
Merge pull request #51967 from Calinou/spatialmaterial-gles2-allow-more-features
Allow clearcoat, anisotropy and refraction in SpatialMaterial in GLES2
2021-08-23 16:01:55 +02:00
Hugo Locurcio 43da1790c8
Remove deprecation warning for BaseButton.enabled_focus_mode
There were too many instances of false positives that are difficult
to fix. The note in the class reference has been clarified instead.
2021-08-22 21:47:53 +02:00
Anas Saifi 4874270592
Removed unused variable 2021-08-22 15:58:45 +05:30
Anas Saifi 9b06355488
Update scene/gui/rich_text_label.cpp
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2021-08-22 15:18:52 +05:30
anazr9 b8bf2ec3cd fixed crash with RichTextLabel [fill] tag #51968 by using 3.3 as reference 2021-08-22 14:17:01 +05:30
Hugo Locurcio 33d23281cb
Allow clearcoat, anisotropy and refraction in SpatialMaterial in GLES2
These SpatialMaterial features work just fine in GLES2,
but they were not exposed in the inspector when GLES2 was used.
2021-08-22 02:18:36 +02:00
Rémi Verschelde 6a058cbf39
Merge pull request #51746 from Calinou/add-shader-comment-3.x
Add a comment at the top of generated shaders (3.x)
2021-08-19 00:16:29 +02:00
Rémi Verschelde a67eaa67b0
Merge pull request #51732 from codecat/fix-caret-selection-3.x
Move cursor to edge of selection when moving caret left/right
2021-08-18 20:12:19 +02:00
Yuri Sizov 29f0a0eebf Adjust the material key bit size for ParticlesMaterial 2021-08-18 17:53:24 +03:00
Melissa Geels 6bf6d18ee1 Move cursor to edge of selection when moving caret left/right
This is to mimic the behavior of many third party text editors.
The reasons it's not doing it when moving by word is due to that
behavior being mostly the same on other editors.

This was backported to 3.x from pull request #51502.
2021-08-18 14:28:57 +02:00
Rémi Verschelde 1de8f31448
CI: Upgrade Emscripten to 2.0.25
That's the version used by current containers for Godot 3.4.

Fixes a couple stray warnings that new Emscripten/LLVM catches.
2021-08-18 11:13:34 +02:00
Rémi Verschelde 92a7ae022d
Merge pull request #51769 from The-O-King/oct_split_stream_fix
Fix Octahedral/Split Stream Options
2021-08-18 08:01:56 +02:00
Omar El Sheikh a63028e172 Fix Octahedral/Split Stream Options
Update mesh_surface_get_format_stride and
mesh_surface_make_offsets_from_format to return an array of offsets and
an array of strides in order to support vertex stream splitting

Update _get_array_from_surface to also support vertex stream splitting

Add a condition on split stream usage to ensure it does not get used on
dynamic meshes

Handle case when Tangent is compressed but Normal is not compressed

Make stream splitting option require a restart in the settings

Update SoftBody and Sprite3D to support and use strides and offsets
returned by updated visual_server functions

Update Sprite3D to use the dynamic mesh flag
2021-08-17 16:11:47 -04:00
Haoyu Qiu 5f316aa216 Improve Undo/Redo menu items
* Make Undo/Redo menu items disabled when clicking it does nothing.
    * Context menu of `TextEdit`
    * Context menu of `LineEdit`
    * Editor's Scene menu
    * Script editor's Edit menu and context menu  (for Script and Text)
* Make editor undo/redo log messages translatable.
* Mark `UndoRedo`'s `has_{un,re}do()` methods as `const`.
* Expose `TextEdit`'s `has_{un,re}do()` to scripts since `{un,re}do()` are already available.
2021-08-18 00:46:51 +08:00
Rémi Verschelde c0fc475078
Merge pull request #51521 from lawnjelly/portals_occluders
Sphere occluders (portals and general use)
2021-08-17 13:55:34 +02:00
Rémi Verschelde 53cc7a9be9
Merge pull request #51648 from pycbouh/editor-merge-custom-theme-3.x
[3.x] Add support for partial custom editor themes
2021-08-17 13:12:49 +02:00
Rémi Verschelde e321b5c12f
Merge pull request #51489 from nekomatata/fix-moving-platform-3d-snap-3.x
[3.x] Fix 2D/3D character snap on moving platforms
2021-08-17 11:40:17 +02:00
lawnjelly 115f4dce55 Sphere occluders (portals and general use)
Add framework for supporting geometrical occluders within rooms, and add support for sphere occluders.
Includes gizmos for editing.

They also work outside the portal system.
2021-08-17 09:02:06 +01:00
Gordon MacPherson f038c6a926 Fix octahedral compression with Sprite3D
Needs a default which is not zero
2021-08-16 22:25:44 +01:00
PouleyKetchoupp be13538b71 Fix 3D character snap on moving platforms
Applying the platform velocity when leaving the platform floor should be
done after snapping to keep things consistent.

Now it's done in both 2D and 3D, as it's already done in 2D on master.
2021-08-16 11:30:28 -07:00
Rémi Verschelde dc1b18e832
Merge pull request #51743 from fabriceci/3x-avoid-useless-snap
[3.x] Avoid useless call to move and collide during snapping
2021-08-16 20:19:39 +02:00
Hugo Locurcio 8dae2f9f00
Add a comment at the top of generated shaders
This comment is useful to determine the origin of ShaderMaterials
converted from built-in material types (such as CanvasItemMaterial
or SpatialMaterial).

The Godot version is also included in case the shader needs to be
regenerated with a newer engine version.
2021-08-16 18:46:55 +02:00
fabriceci 2cb364bab1 Avoid to snap when the body is already on the floor. 2021-08-16 18:09:44 +02:00
Rémi Verschelde 7722eea613
Merge pull request #51252 from kleonc/tab_container-fix-disconnecting-errors-3x
[3.x] TabContainer: Fix error on removing top-level Control child, Remove _get_tab method
2021-08-16 10:35:45 +02:00
Rémi Verschelde 450f7fdc39
Merge pull request #51690 from QbieShay/rotate-y-fix
fixed rotate y flag causing the position to reset
2021-08-15 12:18:54 +02:00
QbieShay 32c287e01b fixed rotate y flag causing the position to reset 2021-08-15 11:35:22 +02:00
Yuri Sizov ab25266213 Add support for partial custom editor themes 2021-08-14 02:11:54 +03:00
Rémi Verschelde 54d14a912a
Merge pull request #51402 from tinmanjuggernaut/texture_array_anisotropic
[3.x] Add Anisotropic Filter option for TextureArrays
2021-08-13 08:46:22 +02:00
Rémi Verschelde f75d8d5c04
Merge pull request #51589 from Geometror/improve-stylebox-aa-3.x
StyleBox fake AA improvements (make anti aliasing size a float property) [3.x]
2021-08-13 01:33:01 +02:00
Rémi Verschelde 4b514bfdff
Merge pull request #51577 from m4gr3d/update_external_texture_config
Update external texture flag configuration.
2021-08-12 22:55:15 +02:00
Hendrik Brucker 6d05ef9ccb StyleBox fake AA improvements (aa_size float property) 2021-08-12 22:21:34 +02:00
Rémi Verschelde e2e34812fe
Merge pull request #51556 from fabriceci/fix-move-and-slide-regression-multiple-collision-3x
[3.x] Fix move and slide regression by allowing multiple collision direction
2021-08-12 20:37:48 +02:00
Fredia Huya-Kouadio 2cc1cdc27b Update external texture flag configuration. 2021-08-12 10:46:09 -07:00
Cory Petkovsek fb609b22e4 Add Anisotropic Filtering option for TextureArrays 2021-08-12 23:56:03 +08:00
Rémi Verschelde f3441fcff0
i18n: Sync translations with Weblate
And sync template with current 3.x codebase.
2021-08-12 17:08:10 +02:00
Anilforextra 081bc20d66
Remove unused swap template.
(cherry picked from commit e3872a244d)
2021-08-12 16:46:02 +02:00
Melissa Geels ac40f5bb75
Triple click in text editor now uses last mouse position for validity
Previously, you would be able to double click a word, followed by
single-clicking another word on the same line, which would select the
entire line. Now, it will only select the whole line if the mouse
position has remained the same after the double click. This mimicks the
behavior in most third party text editors.

Fixes #51312.

(cherry picked from commit 408401a642)
2021-08-12 16:43:22 +02:00
Paulb23 ea0456679a
Redraw on item list custom bg/fg colour change
(cherry picked from commit 738b0fdae5)
2021-08-12 16:42:16 +02:00
Jason Knight 955f2ba75e
Removed the alteration of status.hovering during Focus Enter and Focus Exit events.
This is incorrect and not fully implemented, and results in inconsistency in the UI and in the hovering variable.

(cherry-picked from commit edcbe88389)
2021-08-12 16:37:35 +02:00
Rémi Verschelde 1cd10461ca
Merge pull request #50351 from JestemStefan/node_2D_zero_scale_det_bug
[3.x] Limit scale of `Node2D` to EPSILON (0.00001) to prevent det==0 error
2021-08-12 15:41:04 +02:00
Rémi Verschelde 02541db309
Merge pull request #51565 from mortarroad/3.x-fix-cpu-particles-spread
[3.x] Fix CPU Particles spread
2021-08-12 14:23:22 +02:00
Morris Tabor a517ed7c6d Fix CPU Particles spread
Fixes https://github.com/godotengine/godot/issues/51162
This is the same change as for the GPU Particles in https://github.com/godotengine/godot/pull/47310, including the recent fix for zero direction vectors.
2021-08-12 14:00:02 +02:00
Rémi Verschelde 07c70efcbb
Merge pull request #51555 from mortarroad/3.x-fix-mipmap-loading
[3.x] Fix loading mipmaps, if the mipmap levels have different formats.
2021-08-12 13:17:10 +02:00
fabriceci 1d5a01d12d Fix regression by allowing multiple collision direction 2021-08-12 12:23:17 +02:00
Morris Tabor 0e26f1747b Fix loading mipmaps, if the mipmap levels have different formats.
Fixes https://github.com/godotengine/godot/issues/50647
2021-08-12 12:18:13 +02:00
Morris Tabor fb9685daaa Fix regressions caused by recent particle spread refactor
Caused by https://github.com/godotengine/godot/pull/47310
Fixes https://github.com/godotengine/godot/issues/51043
Fixes https://github.com/godotengine/godot/issues/51424
2021-08-12 11:47:05 +02:00
Hugo Locurcio 0e0af7fa83
Add high quality glow mode
This backports the high quality glow mode from the `master` branch.

Previously, during downsample, every second row was ignored.
Now, when high-quality is used, we sample two rows at once to ensure
that no pixel is missed. It is slower, but looks much better and has
a much high stability while moving.

High quality also takes an additional horizontal sample the width of the
horizontal blur matches the height of the vertical blur.
2021-08-11 17:00:41 +02:00
Haoyu Qiu f4a6737eed Improve NavigationMesh typing, parameter validation and documentation 2021-08-11 18:18:27 +08:00
Rémi Verschelde 03c41fa34c
Merge pull request #51458 from nekomatata/moving-platforms-3d-3.x
[3.x] Fix 3D moving platform logic
2021-08-10 14:12:47 +02:00
Rémi Verschelde 7c6bdea33c
Merge pull request #47416 from Calinou/add-contrast-adaptive-sharpening-3.x
Add support for contrast-adaptive sharpening in 3D (GLES3 only)
2021-08-10 10:08:24 +02:00
clayjohn f7dbcf95e1 Allow unclamped colors in Sprite3D 2021-08-09 21:44:21 -07:00
PouleyKetchoupp da159cd258 Fix 3D moving platform logic
Same thing that was already done in 2D, applies moving platform motion
by using a call to move_and_collide that excludes the platform itself,
instead of making it part of the body motion.

Helps with handling walls and slopes correctly when the character walks
on the moving platform.

Also made some minor adjustments to the 2D version and documentation.

Co-authored-by: fabriceci <fabricecipolla@gmail.com>
2021-08-09 18:55:49 -07:00
Rémi Verschelde 0403cb8ad5
Merge pull request #51447 from nekomatata/fix-moving-platform-rotation-3.x
[3.x] Fix applied rotation from moving platforms in move_and_slide
2021-08-09 23:20:35 +02:00
PouleyKetchoupp f101349225 Fix applied rotation from moving platforms in move_and_slide
When synchronizing KinematicBody motion with moving the platform using
direct body state, only the linear velocity was taken into account.

This change exposes velocity at local point in direct body state and
uses it in move_and_slide to get the proper velocity that includes
rotations.
2021-08-09 12:04:57 -07:00
Rémi Verschelde 89313b9ed1
Merge pull request #51403 from lawnjelly/portals_move_settings
Portals - fix PVS generation and move settings
2021-08-09 00:17:13 +02:00
lawnjelly f3e6547a99 Portals - fix PVS generation and move settings
Fixed a bug in the complex PVS generation which was causing recursive loop.
Move some of the settings out of RoomManager into Project Settings.
Allow PVS generation method to be selected from Project Settings, and control PVS logging.
2021-08-08 19:57:27 +01:00
Rémi Verschelde 0b461cbb01
Merge pull request #51218 from timothyqiu/more-i18n-3x
[3.x] Fix various i18n failures
2021-08-08 19:24:45 +02:00
Rémi Verschelde be22d7b013
Merge pull request #51396 from lawnjelly/portals_sprite3d
Portals - add support for Sprite3D
2021-08-08 17:47:32 +02:00
Rémi Verschelde 6149304c3a
Merge pull request #51394 from lawnjelly/portals_fix_log_crash
Portals - fix crash when logging link room names
2021-08-08 17:47:05 +02:00
Rémi Verschelde 52b3891b59
Merge pull request #51392 from lawnjelly/portals_autolink_internal
Portals - fix autolinking to internal rooms
2021-08-08 17:46:37 +02:00
lawnjelly fc3c01db0f Portals - add support for Sprite3D
Add support for Sprite3D and animated Sprite3D.
2021-08-08 15:43:24 +01:00
lawnjelly ef894c0966 Portals - fix crash when logging link room names
The checking for link room IDs was checking for less than size(), but was not correctly checking for -1,
and therefore reading outside the array range. This PR fixes this.
2021-08-08 15:00:39 +01:00
lawnjelly a339f6fc49 Portals - fix autolinking to internal rooms
Portal autolinking was previously agnostic to room priorities, which meant that portals would link to the first room they found (often outside rooms). This PR fixes this by making the autolinking priority aware, and will preferentially link to internal rooms.
2021-08-08 14:37:04 +01:00
lawnjelly cfe806a929 Portals - Fix secondary PVS bug
Fixes a bug whereby it read from the primary PVS in the gameplay monitor, using the size from the secondary PVS. This would read out of bounds and crash.

Removed debug code to update the gameplay monitor from the preview camera - this is no longer required.

Temporarily revert to the simple PVS generation method, because I've noticed a bug in the complex version, and the simple version is safer while I fix this.
2021-08-08 14:02:38 +01:00
Rémi Verschelde 41cf7f2760
Merge pull request #51358 from raulsntos/fix-51342-3.x
[3.x] Fix Path3D initial forward calculation
2021-08-07 13:30:11 +02:00
Rémi Verschelde b44f2126f6
Merge pull request #51334 from pycbouh/classref-get-theme-items-3.x
[3.x] Improve `Control`'s theme item methods documentation
2021-08-07 12:41:54 +02:00
Raul Santos 102ec1042b Fix Path3D initial forward calculation 2021-08-07 12:40:14 +02:00
Yuri Sizov 71ec6dba67 Improve Control's theme item methods documentation 2021-08-06 22:31:58 +03:00
kleonc 2eeed26d67 TileMap Fix trying to get data for tile not existing in attached TileSet 2021-08-06 18:52:04 +02:00
lawnjelly 770d9f8220 Portals - add gizmo handles for editing portals and rooms
Gizmo handles are added for much more user friendly editing of portals and room bounds.
2021-08-06 07:53:22 +01:00
Rémi Verschelde 28b5f07355
Merge pull request #51277 from lawnjelly/portals_debug_collision_shapes 2021-08-05 16:39:03 +02:00
lawnjelly 258831c12e Portals - fix showing debug collision shapes
Set the portal_mode to GLOBAL on creation.
2021-08-05 13:28:11 +01:00
lawnjelly f4c5092027 Portals - rooms_set_active needs Editor check
Calling rooms_set_active with TOOLS_ENABLED from a running project resulted in a crash because the Spatial Editor is not available. Wrapped it in an is_editor_hint.
2021-08-05 13:14:00 +01:00
kleonc 063d1a5d53 TabContainer: Fix error on removing top-level Control child, Remove _get_tab method 2021-08-04 22:10:06 +02:00
Yuri Sizov e7bd53b690 Make theme item overrides more obvious in the Inspector 2021-08-04 17:02:00 +03:00
Haoyu Qiu 87e49183bc Fix various i18n failures 2021-08-03 23:36:43 +08:00
kleonc 8274d18244
TabContainer Fix moving dropped tab at incorrect child index
(cherry picked from commit a5a4532378)
2021-08-03 10:20:18 +02:00
foxydevloper f807c7e569
Name nodes added from drag & drop by name_casing
(cherry picked from commit 07a8f0fe38)
2021-08-03 10:18:04 +02:00
Raul Santos d46d66020e
Fix forward calculation in PathFollow3D for the position at the end of the curve
(cherry picked from commit e23f6a5bba)
2021-08-03 10:18:04 +02:00
Rémi Verschelde 69c194736d
VariantParser: Fix uninitialized ResourceParser funcs
They could cause a segfault when parsing values with ID "Resource"
as apparently we never set a valid `func` for it.

Fixes crash part of #42115.

(cherry picked from commit f3aaa713d9)
2021-08-03 09:33:25 +02:00
vitika9 bea67d7763
Fixed Camera2D's reset_smoothing() does not work as described
(cherry picked from commit 22eaec6895)
2021-08-03 09:15:33 +02:00
Rémi Verschelde 08b67aabb8
Merge pull request #51193 from timothyqiu/atp-remove
memdelete the node in AnimationTreePlayer.remove_node
2021-08-03 08:08:22 +02:00
Rémi Verschelde 7b97243521
Merge pull request #51040 from nekomatata/layer-grid-32-3.x
[3.x] Refactor layer property editor grid
2021-08-02 21:14:43 +02:00
Haoyu Qiu 859922a5f0 Delete the node in AnimationTreePlayer.remove_node 2021-08-03 00:12:04 +08:00
Rémi Verschelde 73c6ab0215
Merge pull request #51152 from lawnjelly/portals_improve_ui 2021-08-02 14:40:18 +02:00
lawnjelly 2eae35693e Portals - change import naming convention to postfix
In response to user demand, the naming convention for importing levels from blender etc is changed from prefixes `Room_` and `Portal_` to postfixes `-room`, `-roomgroup`, `-portal`.
2021-08-02 11:04:02 +01:00
lawnjelly 8c4c6a93b0 Portals - Remove node naming restrictions
The use of special prefixes is only actually required during the import phase - the first conversion of rooms, roomgroups, and portals from Spatials and MeshInstances (based on the workflow of importing from blender).

Once converted to the native Godot nodes there is no longer a need for the naming requirements.

This PR removes the requirements except for the import. Manual portal linking after the initial conversion is now done exclusively using the `linked_room` nodepath property of the Portal.
2021-08-01 20:04:58 +01:00
lawnjelly 776623d56b Portals - Improve UI and add shortcuts
This PR makes the 'convert rooms' button permanently on the toolbar and accessible whichever node is selected, so you can convert rooms without having to select the RoomManager first.

It also adds a togglable item 'view portal culling' to the 'View' menu which is a simple way of setting the RoomManager 'active' setting without the RoomManager being the selected node.

Both of these have keyboard shortcuts, which should make it much faster to reconvert rooms and edit.

In addition there the string in the 'Perspective' Listbox is modified to show [portals active] when portal culling is operational, for visual feedback. This is updated when you change modes, and when the rooms are invalidated.
2021-08-01 19:54:16 +01:00
Marcel Admiraal e2d0dfe3c7 Ensure node's area tree signals are disconnected when clearing monitoring,
even if nodes are no longer in the tree.
2021-07-31 07:14:03 +01:00
PouleyKetchoupp e0e9f575ae Refactor layer property editor grid
- Now able to display up to 32 layers in physics (still 20 for render)
- Adjustable grid size to fit available space in dock
- Expansion icon to display more layers vertically
- Layer numbers in cells to help with selection
2021-07-30 11:43:04 -07:00
Rémi Verschelde 9735f2803c
Merge pull request #46800 from The-O-King/normal_compression
[3.x] Implement Octahedral Map Normal/Tangent Attribute Compression
2021-07-30 17:34:47 +02:00
Omar El Sheikh d274284069 Octahedral Normal/Tangent Compression
Implement Octahedral Compression for normal/tangent vectors
*Oct32 for uncompressed vectors
*Oct16 for compressed vectors

Reduces vertex size for each attribute by
*Uncompressed: 12 bytes, vec4<float32> -> vec2<unorm16>
*Compressed: 2 bytes, vec4<unorm8> -> vec2<unorm8>

Binormal sign is encoded in the y coordinate of the encoded tangent

Added conversion functions to go from octahedral mapping to cartesian
for normal and tangent vectors

sprite_3d and soft_body meshes write to their vertex buffer memory
directly and need to convert their normals and tangents to the new oct
format before writing

Created a new mesh flag to specify whether a mesh is using octahedral
compression or not
Updated documentation to discuss new flag/defaults

Created shader flags to specify whether octahedral or cartesian vectors
are being used

Updated importers to use octahedral representation as the default format
for importing meshes

Updated ShaderGLES2 to support 64 bit version codes as we hit the limit
of the 32-bit integer that was previously used as a bitset to store
enabled/disabled flags
2021-07-30 10:29:09 -04:00
Rémi Verschelde 7f4eafa6f2
Merge pull request #50983 from Calinou/editor-use-bullet-points-3.x
Use bullet points in the editor instead of dashes where relevant
2021-07-30 13:42:27 +02:00
Aaron Franke e47018ffa4
[3.x] Fix building with the FreeType module disabled 2021-07-29 21:47:40 -05:00
lawnjelly d578ea99b9 Portals - fix gizmo margin scaling
If the user changed the portal Z scale in the editor the portal margin display could become incorrectly sized.

This is because the portal margin is measured in world space units, and has to be back calculated into model space using the inverse global transform of the portal node. The model space size of the margin is thus tied to the current scale of the node.

This PR forces updating the gizmo each time the transform is changed. This isn't super efficient, but as this is an editor only feature it should be okay, and it is unlikely to be a performance problem.
2021-07-29 18:58:19 +01:00
Rémi Verschelde bab9c02f47
Merge pull request #51014 from pycbouh/core-texture-webp-crash-3.x
[3.x] Fix a crash when trying to load a WebP `StreamTexture`
2021-07-29 16:00:30 +02:00
Rémi Verschelde 7a35eec705
Merge pull request #50979 from lawnjelly/portals_autoplace_priority_setting 2021-07-29 15:46:01 +02:00
Yuri Sizov 62f7eb7b2f Fix a crash when trying to load a WebP StreamTexture 2021-07-29 16:00:04 +03:00
lawnjelly e06cd3042f Portals - Fix CSG updates on room conversion
Due to a quirk in CSG Shapes, updating is usually deferred to the next frame. This is problematic as we need to read back the geometry on the first frame when converting levels.

This PR adds a function to CSGShape to force immediate updating (if dirty), and calls it during room conversion.
2021-07-29 12:41:23 +01:00
Hugo Locurcio 10ef55ce23
Use bullet points in the editor instead of dashes where relevant 2021-07-28 19:47:11 +02:00
lawnjelly d0ba355520 Portals - add autoplace priority setting to CullInstance
The default autoplace algorithm places instances in the highest priority Room. It became apparent that there are some situations in which users will want to override this and force placement in a Room from a particular RoomGroup, especially an "outside" RoomGroup.

This setting allows the user to specify a preference for Room priority. When set to 0, the setting is ignored and the highest priority Room is chosen.
2021-07-28 17:23:20 +01:00
lawnjelly d7d7abf057 Portals - fix autolink portals to detect internal
Although explicit portals did a check to detect internal portals, this check was missing from autolinked portals. This meant they were incorrectly clipping the room bounds of the enclosing outer room.

This PR adds a check for internal rooms during the autolinking and sets the internal flag where needed.
2021-07-28 15:54:45 +01:00
Rémi Verschelde 56d7de2208
Merge pull request #50909 from fabriceci/fix-multiple-direction-collision-3x
[3.x] Allow multiple collision direction at the same time
2021-07-27 19:10:52 +02:00
Rémi Verschelde 717ba8f9d8
Merge pull request #50932 from lawnjelly/portals_fix_margin_loading
Portals - Fix default portal margin loading
2021-07-27 13:09:01 +02:00
lawnjelly d012a26e6a Portals - Fix default portal margin loading
The default portal margin is stored in the RoomManager. Previously this was propagated to Portals when the value was changed, and Portals each stored this default value.

This caused a bug during loading, if the RoomManager was loaded before Portals, the value was never propagated.

This PR makes the default margin a static value stored in the RoomManager, and the Portals now read directly from the static value when required, and do not store locally. This gets around the problem.
2021-07-27 11:48:34 +01:00
Haoyu Qiu eb31a39e82
Add check to internal methods to prevent crash
(cherry picked from commit 448295cd51)
2021-07-27 12:17:14 +02:00
Rémi Verschelde 6a6b6fa5cb
Merge pull request #50827 from Calinou/bakedlightmap-add-bounce-indirect-energy 2021-07-27 10:44:41 +02:00
Haoyu Qiu fb15adfad0 Fix crash when executing PopupMenu.new()._submenu_timeout() 2021-07-27 12:11:28 +08:00
fabriceci aaf09f864a Allow multiple collision direction at the same time 2021-07-26 20:11:22 +02:00
Haoyu Qiu 2131b3c61c Fix selection of spaced atlas tile when using priority 2021-07-26 20:05:59 +08:00
Hugo Locurcio 974d3aa9cd
Add a property to control the bounce indirect energy in BakedLightmap
Higher values will make indirect lighting brighter.
A value of 1.0 represents physically accurate behavior, but higher values
can be used to make indirect lighting propagate more visibly when using
a low number of bounces.

This can be used to speed up bake times by lowering the number of bounces
then increasing the bounce indirect energy. Unlike BakedLightmapData's
energy property, this property does not affect direct lighting
emitted by light nodes or emissive materials.
2021-07-25 03:04:40 +02:00
lawnjelly 5e59f7ce3a Portals - Config warning for Rooms with too many planes
Just a small addition, a config warning if the user creates a Room with a large number of bounding planes, letting them know to simplify it.
2021-07-23 10:19:09 +01:00
lawnjelly c2dd51a85e Portals - fix adding statics twice
Due to an oversight in the autoplace recursive search for static objects, static objects were getting added twice to the portal renderer, which meant they were being rendered twice, lowering performance.

This PR corrects this horrendous error.
2021-07-22 20:23:57 +01:00
Rémi Verschelde 86054e00bf
Merge pull request #50446 from AnilBK/graphnode-improv-3.x
[3.x]Add missing graphnode setters.
2021-07-22 16:41:20 +02:00
Rémi Verschelde e3c545668b
Merge pull request #50112 from lawnjelly/camera_2d_current
Most recently added current Camera2D takes precedence
2021-07-22 12:16:44 +02:00
lawnjelly 83f1377a8f Portals - lift roomlist restrictions and fix link bug
Allows users to have the RoomManager as the roomlist.

Fixes a couple of bugs dealing with situations where users attempt to link Portals to Rooms outside the roomlist.

Adds a PortalEditorPlugin allowing you to flip individual portals.
2021-07-20 19:05:16 +01:00
lawnjelly 06d66488c2 Portals - Add the ability to autoplace static objects
In order to make level building easier, the system can now support STATIC and DYNAMIC objects in the roomlist that are not placed in rooms. The system will automatically place them in the appropriate room.
2021-07-20 13:24:30 +01:00
Tomasz Chabora d966f00954
Calculate __focus_rect when TreeItem is focused
(cherry picked from commit 2035992a07)
2021-07-20 13:05:14 +02:00
Eric M 7b6b402a0c
Added Node name to print() when printing Nodes.
(cherry picked from commit 3ca25ffe8a)
2021-07-20 13:05:09 +02:00
Rémi Verschelde 2ee38416a4
Merge pull request #50507 from Calinou/light-tweak-property-hints
Tweak Light property hints for greater flexibility
2021-07-20 11:13:16 +02:00
Aaron Franke 7dc2edc430
[3.x] Allow reading shaders from .gdshader files 2021-07-19 23:34:23 -04:00
Rémi Verschelde 526447b86f
Merge pull request #50495 from nekomatata/move-and-slide-fixes-3.x
[3.x] Backport KinematicBody move_and_slide and move_and_collide fixes
2021-07-19 20:11:51 +02:00
PouleyKetchoupp beeebb4c2f More accurate unsafe motion calculation
* Safe and unsafe motion are calculated by dichotomy with a limited
number of steps. It's good for performance, but on long motions that
either collide near the beginning or near the end, the result can be
very imprecise.
* Now a factor 0.25 or 0.75 is used to converge faster when this case
happens, which allows longer motions to get more accurate collision
detection.
* Makes snap collision more precise, and helps with cases where diagonal collision on the border of a platform can lead to the character being stuck.

Additional improvements to move_and_slide:
* Handle slide canceling in move_and_collide with 0 velocity instead of
not applying it.
* Better handling of snap with custom logic to cancel sliding.
* Remove small jittering when using stop on slope, by canceling the
motion completely when the resulting motion is less than margin instead
of always projecting to the up direction (in both body motion and snap).

Co-authored-by: fabriceci <fabricecipolla@gmail.com>
2021-07-19 08:09:17 -07:00
PouleyKetchoupp 2fbb6fff4e Fix move_and_collide causing sliding on slopes
Make sure the direction of the motion is preserved, unless the depth is
higher than the margin, which means the body needs depenetration in any
direction.

Also changed move_and_slide to avoid sliding on the first motion, in
order to avoid issues with unstable position on ground when jumping.

Co-authored-by: fabriceci <fabricecipolla@gmail.com>
2021-07-19 08:09:16 -07:00
Yuri Sizov e05eb8a6ad Make zoom limits and step adjustable in GraphEdit 2021-07-16 22:43:28 +03:00
Rémi Verschelde 4d3c11e85e
Merge pull request #49446 from nekomatata/sync-to-physics-3d-3.x
[3.x] Support for 3D sync to physics
2021-07-16 07:15:17 +02:00
Hugo Locurcio 0fe771dfe5
Tweak Light property hints for greater flexibility
- Specular can now be set above 1.0.
- Some properties now allow more precise values.
- The Bake Mode property hint was changed to be more descriptive.
- The maximum shadow bias values were adjusted to follow the property
  hints in `master`.
2021-07-16 04:12:10 +02:00
kobewi 557a1f6232 [3.x] Update Tree when modified 2021-07-15 18:19:29 +02:00
Rémi Verschelde 26d0c90370
Merge pull request #50477 from lawnjelly/portals_autolink_order
Portals - fix autolink sprawling, refine logs
2021-07-15 15:22:53 +02:00
lawnjelly 44f9a0f961 Portals - fix autolink sprawling, refine logs
It turned out the new autolinking feature was linking portals AFTER the static meshes had been added to rooms in the PortalRenderer. This meant that large meshes weren't being sprawled across these portals. The fix involves doing the autolinking BEFORE adding the static meshes.

Fixes a bug in the warning for portals being in the wrong direction, they should have only been checkout for outgoing portals. This was resulting in erroneous warnings.

Also the room conversion logs are refined to be more compact and informative.

A warning icon is also added in the gizmo for portals where autolink fails.
2021-07-15 13:04:05 +01:00
kobewi dd62aa1bf9 [3.x] Fix valign with stylebox borders 2021-07-15 13:58:18 +02:00
Rémi Verschelde 231efe0c6d
Merge pull request #50166 from fabriceci/fix-2d-moving-platform
[3.x] Fixing 2D moving platform logic
2021-07-15 13:34:30 +02:00
Rémi Verschelde bc40546406
Merge pull request #50457 from lawnjelly/portals_config_warn 2021-07-15 12:30:33 +02:00
fabriceci fba4c9d552 Fixing 2D moving platform logic
Fixing by applying the movement in two steps, first the platform
movement, and then the body movement. Plus, add the platform movement
when we are on_wall.
2021-07-15 11:57:58 +02:00
kleonc 6d48b67f14
Node::add_child Check for cyclic dependency
Node Replace string addition with vformat()

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 81388db8a7)
2021-07-15 10:52:33 +02:00
kobewi 4941d2001c
Add set_pressed_no_signal method to BaseButton
(cherry picked from commit 50c63bdc4c)
2021-07-15 10:52:22 +02:00
Hendrik Brucker fe616d443a
Fix color properties of particle nodes/material
(cherry picked from commit 3a4a2198ed)
2021-07-15 10:25:35 +02:00
lawnjelly b663acef93 Portals - Add configuration warnings for nodes
Checks for invalid children / grandchildren etc.
2021-07-15 08:01:42 +01:00
Rémi Verschelde 041115ca41
RoomManager: Fix build with CSG module disabled
Fixes #50462.
2021-07-15 08:51:15 +02:00
Rémi Verschelde 875045adde
Use modules_enabled.gen.h to improve inter dependency checks
- Fix build with gdscript module disabled. Fixes #31011.
- Remove unused `gdscript` compile option.
- Fix build with regex module disabled.
- Fix ImageLoaderSVG to forward declare thirdparty structs.

(cherry picked from commit f3726ee994)
2021-07-14 23:36:38 +02:00
Rémi Verschelde a3310c1da2
Merge pull request #46130 from lawnjelly/portals
Portal occlusion culling [3.4]
2021-07-14 13:38:01 +02:00
lawnjelly eb6f98ec55 Portal occlusion culling
Adds support for occlusion culling via rooms and portals.
2021-07-14 11:43:23 +01:00
Rémi Verschelde aa3a5c9f6a
Merge pull request #50184 from JFonS/cpu_lightmapper_soft_shadows
[3.x] Add soft shadows to the CPU lightmapper
2021-07-14 12:18:08 +02:00
Anilforextra d9e48a9c58 Add missing graphnode setters.
Documentation Updates.
2021-07-14 15:37:59 +05:45
PouleyKetchoupp 788db5cf47 Clean convex hull decomposition code
Remove unnecessary conversion between triangle data and vertex data
whenever possible.
2021-07-13 11:13:25 -07:00
bowling-allie 86e5893755
Fixes BlendSpace2D BLEND_MODE_DISCRETE_CARRY.
When BlendSpace2D switches animations, it will now correctly
calculate the previous animation position and length and
apply is to the new animation.

(cherry picked from commit bcb1e2b79f)
2021-07-13 10:47:20 +02:00
Hugo Locurcio c0ccc34eeb
Tweak the GradientTexture property hint to follow CurveTexture
This prevents setting too large values and crashing the editor.

Very low values are also no longer allowed since they are generally
not detailed enough to represent complex gradients, leading to confusion.

(cherry picked from commit 2c7813385d)
2021-07-13 10:20:02 +02:00
Rémi Verschelde 32f5bee985
LineEdit: Respect max_length by truncating text to append
When appending text (either via `set_text()` or by pasting from clipboard),
if the input would make the `LineEdit` exceed its configured `max_length`,
the input text is truncated to fit. The discard part is passed as a parameter
in the `text_change_rejected` signal.

Fixes #33321.
Fixes #41278.

Also cleaned up unimplemented `max_chars` property in `TextEdit`.

Co-authored-by: Tony-Goat <70238376+Tony-Goat@users.noreply.github.com>
(cherry picked from commit 9a1ce8e6c3)
2021-07-13 10:20:02 +02:00
voxelv e6f420aabf
Avoid using a nullptr root in Tree._range_click_timeout().
Fixes #46648

(cherry picked from commit f17f3f8830)
2021-07-13 09:47:07 +02:00
Rémi Verschelde 9d2cbe2c02
Merge pull request #50328 from nekomatata/convex-hull-simplification-3.x
[3.x] Options to clean/simplify convex hull generated from mesh
2021-07-12 22:34:22 +02:00
JestemStefan b7817c7b59 Added minimum scale for node 2D 2021-07-12 12:15:33 +02:00
Rémi Verschelde 6ec2caf12c
Merge pull request #48763 from QbieShay/plane-offset
[3.x] Added a center_offset property to both plane primitive and quad primitive
2021-07-12 10:32:19 +02:00
PouleyKetchoupp 240c33708c Options to clean/simplify convex hull generated from mesh
Clean: remove duplicate and interior vertices (uses Bullet algorithm)
Simplify: modify the geometry for further simplification (uses VHACD
algorithm)

In the editor, single convex hull now uses the clean option.
Added a new editor entry to create a simplified convex hull, can be
useful for creating convex hull from highly tessellated triangle meshes.

Specific change for 3.x:
Add support for Vector<Vector3> and PoolVector<Vector3> in the convex hull generator.
2021-07-09 17:45:59 -07:00
Rémi Verschelde 7f971089fb
FileDialog: Fix capitalization for overwrite prompt
Sorry I can't take it anymore, I wince every time I see it.
Already fixed in master :)
2021-07-08 01:05:45 +02:00
Francois Belair a4a2ab3ee0 Add cache to color picker for presets
This prevents loading from the project metadata more than once,
significantly saving performance with nodes that have color pickers.
2021-07-07 18:06:31 -04:00
kobewi ff7cae4c4c Allow to create a node at specific position 2021-07-07 13:19:59 +02:00
kleonc 23ad87cc92 Add AcceptDialog::remove_button method 2021-07-06 18:27:03 +02:00
Michael Alexsander d453b59cba
Make invisible SplitContainer nodes correctly calculate the minimal size of its children
(cherry picked from commit e4d56e4c62)
2021-07-06 11:10:46 +02:00
Eric 09b231e15f
Enable Camera2D smoothing on limit change
(cherry picked from commit 525ad7c37e)
2021-07-06 11:10:35 +02:00
JFonS a2ba7910ba Add soft shadows to the CPU lightmapper
Adds the "light_size" property to Lights. It's only considered in baked
lightmaps for soft shadowing purposes.
2021-07-05 19:02:35 +02:00
lawnjelly 21a24eb959 Most recently added current Camera2D takes precedence
The situation when multiple current Camera2Ds were in the scene was not dealt with. This could leave several cameras with their current bool set, and each competing to update the viewport scroll, in a random / accidental fashion.

This PR standardises the rule that the most recent current Camera2D added to the scene tree takes over the current status, and sets all other current cameras in the scene tree to non-current. This makes the bools correct, and also prevents the competition over viewport scroll.
2021-07-03 08:58:20 +01:00
Rémi Verschelde ef3c346df2
Merge pull request #49835 from nekomatata/soft-body-disable-physics-3.x
[3.x] Support for disabling physics on SoftBody
2021-07-01 10:01:33 +02:00
trollodel 814e25d2d8
Fix GraphNode port position when the control has the Expand flag
(cherry picked from commit 07c3b40aa2)
2021-06-29 14:02:23 +02:00
Hugo Locurcio e7d6f8b8b8
Allow a top and bottom radius equal to 0 in CylinderMesh
The CylinderMesh generation code handles this special case and
avoids generating the top and bottom faces if their radius is equal
to 0. This improves performance by reducing the number of vertices
to draw.

If both values are set to 0, nothing will be visible but the mesh
generation will still succeed.

This also improves the CylinderMesh class documentation.

(cherry picked from commit b4ed84ba2b)
2021-06-29 14:02:22 +02:00
Pedro J. Estébanez cd96e30fee
Remove side effects of scene save
(cherry picked from commit 598fd51277)
2021-06-29 13:13:06 +02:00
PouleyKetchoupp cad2ba013a
Fix export var override in PackedScene at runtime
Regression fix: update_exports is tool only and should be used only in
the editor, otherwise it can cause export variable overrides from
instances to be discarded in favor of the parent's value.

(cherry picked from commit f1587c8a7d)
2021-06-29 13:12:52 +02:00
floppyhammer fa77e501f7
Improve nine patch behavior of TextureProgressBar
(cherry picked from commit b08dc1ea35)
2021-06-29 12:59:23 +02:00
Rémi Verschelde c550033420
Merge pull request #49955 from Calinou/prevent-setting-big-small-collision-mask-layer-3.x
Prevent setting too big or too small Collision Mask and Layer (3.x)
2021-06-28 14:08:54 +02:00
Rafał Mikrut cb5faca39a
Prevent setting too big or too small Collision Mask and Layer 2021-06-27 17:40:07 +02:00
Hugo Locurcio 11033be5c6
Fix flipped binormal in SpatialMaterial triplanar mapping
This made normal maps on triplanar materials use an inverted Y direction
compared to non-triplanar materials.
2021-06-27 16:32:03 +02:00
PouleyKetchoupp 4694b2b3e4 Support for disabling physics on SoftBody
New property physics_enabled, can be useful for optimization purpose.
2021-06-22 11:38:17 -07:00
Yuri Sizov b91e3237c6 Make relationship lines draw on top of TreeItems 2021-06-21 16:54:59 +03:00
Hugo Locurcio a9c0c5484f
Add support for contrast-adaptive sharpening in 3D (GLES3 only)
This is an older, easier to implement variant of CAS as a pure
fragment shader. It doesn't support upscaling, but we won't make
use of it (at least for now).

The sharpening intensity can be adjusted on a per-Viewport basis.
For the root viewport, it can be adjusted in the Project Settings.

Since `textureLodOffset()` isn't available in GLES2, there is no
way to support contrast-adaptive sharpening in GLES2.
2021-06-21 15:37:31 +02:00
Yuri Sizov 7120be9ff5 Overhaul the theme editor and improve user experience
Backport of #49388, #49772.
2021-06-21 01:37:54 +03:00
Yuri Sizov 014cb0c33a Refactor Theme item management in the theme editor
Backport of #46593, #46808, #49227
2021-06-20 20:34:37 +03:00
Rémi Verschelde 03f275e66f
Merge pull request #49167 from amoriqbal/3.3-inspector-patch
Fixed inspector not updating anchor
2021-06-20 12:42:21 +02:00
Rémi Verschelde 6fecaddbec
Merge pull request #49731 from Calinou/cylindermesh-allow-zero-rings-3.x
Tweak CylinderMesh `rings` property hint to allow a value of 0
2021-06-20 00:44:08 +02:00
Hugo Locurcio 3143f5fcc5
Use double-sided material for RayCast
This makes RayCasts visible if the camera is fully inside one
(e.g. a RayCast parented to the current Camera).
2021-06-19 09:16:42 +02:00
Hugo Locurcio a82c90ca55
Tweak CylinderMesh rings property hint to allow a value of 0
A value of 0 rings is valid and results in a non-subdivided cylinder.

Compared to the previous lowest allowed value (1), a value of 0 halves
the triangle count in any cylinder.
2021-06-19 08:52:24 +02:00
Hugo Locurcio a6a6ad5c08
Add custom debug shape thickness and color options to RayCast
This backports the improved RayCast debug drawing functionality
from the `master` branch.

`ArrayMesh.clear_surfaces()` was also backported from the `master`
branch and exposed because the new debug drawing code requires it.
2021-06-19 06:01:25 +02:00
Marcel Admiraal 7e03bd1671 Remove duplicate WARN_PRINTS macro 2021-06-18 12:57:59 +01:00
Rémi Verschelde fc95c4d84c
Merge pull request #49476 from nekomatata/kinematic-collision-rid-3.x
[3.x] Expose collider RID in 2D/3D kinematic collision
2021-06-18 12:32:42 +02:00
Rémi Verschelde c7f27f1d9d
Merge pull request #48651 from tavurth/3.x
Port HTTPRequest gzip compression to 3.4
2021-06-18 02:01:11 +02:00
kleonc ce763fe402
TextureButton Update min size on any texture change
(cherry picked from commit 6c3c269f24)
2021-06-17 12:47:54 +02:00
Hugo Locurcio 28aacbfe85
Allow higher and lower maximum zoom values in GraphEdit
Low zoom values result in unreadable text, but it can still be
useful for previewing purposes.

Eventually, characters could be replaced by rectangles at very low
zoom levels to improve the visual appearance.

(cherry picked from commit 74c584472c)
2021-06-17 12:47:54 +02:00
Jason Knight 7510e1c24b
Emit button_up signal after setting pressed to false.
(cherry picked from commit 4c6ad8abcd)
2021-06-17 12:47:53 +02:00
PouleyKetchoupp c957035320 Fix external resource cache regression 2021-06-16 16:07:04 -07:00
Rémi Verschelde 465ab36ddf
Merge pull request #49653 from madmiraal/remove-err_prints-3.x
[3.x] Remove duplicate ERR_PRINTS macro
2021-06-16 17:33:22 +02:00
Marcel Admiraal 5a58516231 Remove duplicate ERR_PRINTS macro 2021-06-16 11:56:25 +01:00
Hugo Locurcio f36c90b82f
Add a soft line length guideline to the script editor
The default value is 80. The hard line length guideline's default column
has been moved to 100 to account for the new soft line length guideline.

It can be disabled by setting its value to the same column as the
hard line length guideline.
2021-06-16 06:00:02 +02:00