Commit Graph

814 Commits

Author SHA1 Message Date
Rémi Verschelde 13e20fed99
Merge pull request #68627 from Sauermann/fix-tooltip-position
Fix position of Tooltips
2023-01-26 16:00:14 +01:00
Markus Sauermann 83fa14a5a9 Include the Window-transform into Viewport::get_final_transform 2023-01-26 15:30:44 +01:00
Markus Sauermann c4ed247f5f Fix position of Tooltips
CanvasItem::get_screen_transform returns a transform from the CanvasItem
to the coordinate system, where a Popup - created as a child of the
CanvasItem - should be opened.
get_screen_transform makes some simplifications, that work well, when used
in the editor, but not in general cases.

Since Popups like Tooltips are now used more commonly in projects,
it becomes necessary to correct these simplifications.

This solution introduces Viewport::get_popup_base_transform, which makes
the necessary calculations.
2023-01-26 15:15:14 +01:00
Rémi Verschelde a83093fa80
Merge pull request #71692 from HalcyonGarside/viewport-debug-draw-fix
Fix incorrect Viewport Debug Draw effects
2023-01-20 08:49:21 +01:00
HalcyonGarside ef35c4002c Add 'Lighting' to list of Debug Draw viewport options 2023-01-19 15:23:59 -05:00
Mai Lavelle a058cedb53 Fix crash on touch release 2023-01-17 19:12:55 -05:00
Rémi Verschelde ae3ca04aba
Merge pull request #69598 from Sauermann/fix-focus-inverse
Calculate the mouse focus inverse transform only when needed
2023-01-16 22:11:23 +01:00
bruvzg 34b34b104c
Add `WINDOW_FLAG_MOUSE_PASSTHROUGH` flag and enabled it for tooltips. Expose `window_set_mouse_passthrough` to `Window`. 2023-01-16 11:42:49 +02:00
Markus Sauermann 0d6d5e6421 Calculate the mouse focus inverse transform only when needed
Revival of #49158

Co-authored-by: Marcel Admiraal <madmiraal@users.noreply.github.com>
2023-01-09 21:35:38 +01:00
Juan Linietsky 2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
bruvzg 2718a7b7d3
Add support for the custom initial screen for the main window, fix primary screen detection. 2023-01-07 11:14:35 +02:00
Rémi Verschelde 163f6f5fe8
Merge pull request #68429 from KoBeWi/PropertySettings
Add PropertyInfo overload for GLOBAL_DEF
2023-01-06 22:59:29 +01:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Adam Scott ea33001b95 Add safety-checks before some servers `free()` 2022-12-29 16:23:38 -05:00
Rémi Verschelde f29f3db419
Merge pull request #59682 from Sauermann/fix-following-viewport-transform
Include the follow-viewport-transform into CanvasLayer transform calculations
2022-12-19 16:26:19 +01:00
Markus Sauermann 2da2220da7 Include the following-viewport-transform into CanvasLayer transforms
The following-viewport-transform was missing from several calculations
2022-12-18 22:44:34 +01:00
kobewi 7c6b659bd7 Add PropertyInfo overload for GLOBAL_DEF 2022-12-11 21:36:48 +01:00
kobewi 7e2a8afb57 Rework how current Camera2D is determined 2022-12-02 00:05:02 +01:00
Fredia Huya-Kouadio 3ff7dd2aa4 Fix routing of InputEventScreenDrag events to Control nodes 2022-11-30 14:06:41 -08:00
Rémi Verschelde 438b2e2d02
Merge pull request #59801 from Sauermann/fix-node2d-viewport-root-order
Fix Viewport root order after Node2D raise
2022-11-28 08:21:10 +01:00
Rémi Verschelde 986a4279fa
Merge pull request #68447 from Grimmr/clean-tooltips-on-WM-focus-off
Viewport cancels existing tooltip when window looses focus
2022-11-25 14:04:40 +01:00
grimmr aa9b5b917f Viewport cancels existing tooltip when window looses focus
fixes #68197

when NOTIFICATION_WM_WINDOW_FOCUS_OUT is recieved by a viewport it will now call
_gui_cancel_tooltip() to avoid it hanging around after the mouse events stop
coming in
2022-11-25 09:44:04 +00:00
Markus Sauermann f8df18ef47 Fix CanvasTransform on RenderingServer when Viewport enters Tree
Previously the Viewport didn't initialize its canvas transform in the
RenderingServer.
2022-11-22 23:04:23 +01:00
Uxeron 721e51ac28 Fixed _get_drag_data getting incorrect position on scaled controls 2022-11-18 19:10:57 +02:00
Markus Sauermann 3b14f0334c Remove redundant Variant-types initializations 2022-11-14 19:35:19 +01:00
Rémi Verschelde d639bb87a7
Merge pull request #68272 from Sauermann/fix-windowfocus-on-resize
Fix Windowfocus on resizing
2022-11-14 16:38:00 +01:00
Markus Sauermann 5cf6ebce63 Drop physics mouseover as soon as the mouse moves over a Control 2022-11-14 12:07:26 +01:00
Rémi Verschelde 5c7af7f391
Merge pull request #68418 from Sauermann/fix-escape-dnd
Allow canceling Drag and Drop with the Escape-Key
2022-11-11 16:49:09 +01:00
Markus Sauermann 226044b944 Allow canceling Drag and Drop with the Escape-Key
This patch implements the functionality to cancel Drag and Drop
by using the escape key or more general, the ui_cancel action.

Since this would be the third location, where the finalization of
Drag and Drop would have to be implemented, that functionality was
put into the private function _perform_drop.

Simplified gui.drag_data.get_type() != Variant::NIL to gui.dragging
because they are equivalent.
2022-11-08 19:10:16 +01:00
ktxyz 7601808455 Update sub_windows order with respect to FLAG_ALWAYS_ON_TOP 2022-11-08 13:20:45 +01:00
Markus Sauermann 7445ab95fc Fix SubViewport with default size being pink
A SubViewport with default-size doesn't display its content, but shows
pink color, until it is resized.
This patch makes sure, that the size gets set during initialization.
2022-11-07 09:23:32 +01:00
Markus Sauermann 65647e9c7d Fix Windowfocus on resizing
When resizing a non-focused window, the previously focused
Window got resized.
This patch grabs focus for the actually resized window, before
starting with the resizing.
2022-11-04 22:24:00 +01:00
Rémi Verschelde d4bf7f4458
Fixup Clang -Wtype-limits warnings introduced by #52350 2022-11-02 22:36:01 +01:00
Markus Sauermann 022d24a9ae Fix Viewport root order after Node2D raise 2022-11-02 21:45:00 +01:00
Rémi Verschelde 604abb434f
Merge pull request #52350 from BimDav/viewport_canvas_cull
Added Viewport canvas cull mask feature
2022-11-02 17:14:24 +01:00
BimDav fcb9be66a2 Viewport canvas cull mask feature
Co-authored-by: Valentin Zagura <puthre@gmail.com>
2022-10-31 14:09:49 +01:00
Rémi Verschelde 5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Rémi Verschelde dcd86f9848
Merge pull request #67046 from Cykyrios/fix-invalid-tooltip-position
Fix invalid tooltip position
2022-10-31 11:05:19 +01:00
Rémi Verschelde 420eb1aa34
Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
Markus Sauermann 35956d9128 Fix event-content and mouse-signals with 3D-capture-on-drag
Fix for 3D-physics processing:
- with enabled input_capture_on_drag now report correct position and
normals in _input_event
- mouse_enter and mouse_exit signals are emitted when the mouse cursor
leaves the visible area of the 3D-object, independently of pressed mouse
button or input_capture_on_drag
- make sure that collision input events are sent in the right order with
respect to mouse_enter and mouse_exit signals
2022-10-29 12:59:46 +02:00
Clay John 8fd92ed867
Merge pull request #64710 from MinusKube/window-size-crash
Prevent windows from having a size greater than device limit
2022-10-27 10:02:44 -07:00
Marc Gilleron 7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
Markus Sauermann 5ee449efec Remove unnecessary casts
button_add_item and button_add are both Button

p_parent is a Node3D

CanvasItem can never be cast to Viewport
2022-10-24 15:59:18 +02:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Markus Sauermann 39e49a8bdd Expose Viewport::get_screen_transform to GDScript 2022-10-15 23:37:59 +02:00
Markus Sauermann b1d6b34662 Always update Viewport's last_mosue_position
When the mouse cursor is over a embedded Window, the Viewport's
last_mouse_position did not get updated.
This patch makes sure that the update happens on every InputEventMouse.

Document canvas layer of embedded Windows.
2022-10-14 12:51:45 +02:00
Cykyrios f0d7934055 Fix invalid tooltip position 2022-10-07 22:43:49 +02:00
bruvzg 0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Markus Sauermann 90b01d79af Fix execution of physics picking events
Fix that physics picking can happen after the mouse has left the viewport
2022-10-06 13:58:54 +02:00
Rémi Verschelde 2b9a145158 Merge pull request #66869 from Sauermann/fix-transform-det-0-spam
Fix Transform2D det == 0 spam for SubViewports
2022-10-04 12:05:37 +02:00
Markus Sauermann 650cc16b05 Fix Transform2D det == 0 spam for SubViewports 2022-10-04 11:48:39 +02:00
Rindbee 9a05ea231a Make sure to reset the tooltip of its gui_parent when the viewport is removed 2022-10-04 11:58:02 +08:00
EricEzaM 2a7e61457a Allow shortcut input to be JoypadButton. 2022-10-02 17:11:18 +10:00
Markus Sauermann 2bf2217b1a Calculate window input event transform only on window change 2022-10-01 09:54:38 +02:00
Rémi Verschelde e3464c8fc8 Merge pull request #58995 from Sauermann/fix-mouse-cursor-change-2
Update mouse cursor shape after changes
2022-09-28 20:50:05 +02:00
Marc Gilleron aed3822a93 Change return type of `get_configuration_warnings` to `PackedStringArray` 2022-09-19 16:43:15 +01:00
Markus Sauermann 52da6f1a44 Update mouse cursor shape after changes
This fixes some cases where the mouse cursor shape did not change automatically, but instead required a MouseMove to update.
2022-09-18 17:15:38 +02:00
David Snopek e82cd46a74 Fix XR rendering in 'opengl3' driver and expose true size via the Viewport node 2022-09-14 20:55:56 -05:00
kobewi b218727599 Rename raise() to move_to_front() 2022-09-06 22:13:06 +02:00
MinusKube f5a808192b Prevent windows from having a size greater than device limit 2022-09-04 22:48:54 +02:00
Rémi Verschelde 6ccbc27093
Merge pull request #64735 from KoBeWi/viewportshifter 2022-09-02 15:42:42 +02:00
MinusKube 64cf943e07 Prevent subwindow_focused from pointing to a window that is not a subwindow 2022-08-30 21:57:03 +02:00
Rémi Verschelde 02d510bd07
Merge pull request #63003 from Geometror/msaa-2d 2022-08-30 14:54:20 +02:00
Micky e31bb5ffeb Rename `CanvasItem.update()` to `queue_redraw()`
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.

Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.

Just a few comments have also been changed to say "redraw".

In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-29 14:59:47 +02:00
Yuri Sizov 207bdc2b9f Remove Inspector tooltip hack that never actually worked 2022-08-26 17:22:13 +03:00
Rémi Verschelde ff612b6916
Merge pull request #64574 from Begah/fix_transient_window_wrap_mouse 2022-08-26 13:54:23 +02:00
Rémi Verschelde 060d0ce882
Merge pull request #53299 from Calinou/viewport-tweak-configuration-warning 2022-08-25 21:44:31 +02:00
MathieuRoux 5ac5c8bc06 Fix warp_mouse for transient windows, smoother mouse positioning when releasing mouse for spinbox 2022-08-25 11:30:49 +02:00
Pedro J. Estébanez 910efbff03 Avoid warnings about cursor shape change not supported 2022-08-23 11:14:07 +02:00
Yuri Sizov 1a24c9e14b Make `_validate_property` a multilevel method 2022-08-22 18:35:11 +03:00
kobewi 3a4a4aeade Fix Viewport size change not updating textures 2022-08-22 16:34:47 +02:00
Hendrik Brucker e96b1a2c0c Implement MSAA for 2D [Vulkan only] 2022-08-13 01:09:48 +02:00
Michael Alexsander 2b86c458bf Fix some bugs with `Window`s 2022-08-05 02:25:15 -03:00
Hugo Locurcio e24029edc3
Allow changing mipmap LOD bias when FSR 1.0 scaling is not used
Mipmap LOD bias can be useful to improve the appearance of distant
textures without increasing anisotropic filtering (or in situations
where anisotropic filtering is not effective).

`fsr_mipmap_bias` was renamed to `texture_mipmap_bias` accordingly.
The property hint now allows for greater precision as well.
2022-07-28 17:51:13 +02:00
Michael Alexsander 46346cfaa5 Make tooltips be shown at different directions if there's not enough space 2022-07-23 14:51:06 -03:00
FireForge 97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05:00
Bastiaan Olij d139131aab Adding Variable Rate Shading support to Godot
Improve GI renderer and add VRS support
Implement render device has_feature and move subgroup settings to limit_get
2022-07-17 15:42:24 +10:00
Hugo Locurcio 21ea1c3835
Rename soft shadow quality project settings for easier searching
`rendering/quality/shadows` is now `rendering/quality/positional_shadow`
to explicitly denote that the settings only affect positional light shadows,
not directional light shadows.

Shadow atlas settings now contain the word "atlas" for easier searching.

Soft shadow quality settings were renamed to contain the word "filter".
This makes the settings appear when searching for "filter" in the
project settings dialog, like in Godot 3.x.
2022-07-13 19:56:02 +02:00
bruvzg 344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
FireForge 4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
kobewi 9036fcbe5e Remove TooltipPanel and TooltipLabel 2022-06-09 22:23:11 +02:00
jfons ba832d83b2 Initial TAA implementation
Initial TAA support based on the implementation in Spartan Engine.

Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
2022-06-07 13:14:44 +02:00
Haoyu Qiu 83d931ad3c Fix `Viewport.own_world_3d` documentation
Also fixed the naming of the setter's parameter and made an `if` block
straightforward.
2022-06-06 21:34:40 +08:00
Aaron Record 900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
Rémi Verschelde 5c79782c7e
Merge pull request #61088 from groud/keep_unhandled_events_on_pass 2022-05-17 23:50:55 +02:00
Gilles Roudière 6db8b7616d Keep input event as unhandled if they go through a control set to MOUSE_FILTER_PASS 2022-05-17 15:41:58 +02:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Hugo Locurcio aabbb40009
Make `{call,set,notify}_group()` immediate by default
This results in less surprising behavior out of the box.

Internal usages were modified to keep the existing behavior
identical there.
2022-05-05 16:59:37 +02:00
Hugo Locurcio d567369c8f
Tweak the Viewport configuration warning to mention 2×2 size requirement 2022-04-29 20:25:05 +02:00
Aaron Franke b831fb0a54
Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 -05:00
FireForge 3073b85de9 Rename theme properties to include underscores
- check_vadjust -> check_v_adjust
- close_h_ofs -> close_h_offset
- close_v_ofs -> close_v_offset
- commentfocus -> comment_focus
- hseparation -> h_separation
- ofs -> offset
- selectedframe -> selected_frame
- state_machine_selectedframe -> state_machine_selected_frame
- table_hseparation -> table_h_separation
- table_vseparation -> table_v_separation
- vseparation -> v_separation
2022-04-23 11:16:18 -05:00
Hugo Locurcio 52d6a7a7ff
Fix the Audio Listener 3D property not being grouped with 2D in Viewport 2022-04-16 02:22:58 +02:00
Hugo Locurcio d15b69118d
Fix 3D scaling enum size in the editor and improve descriptions 2022-04-09 17:53:45 +02:00
bruvzg d1207a0504
[Input] Add extra `shortcut_input` input processing step to process Unicode character input with Alt / Ctrl modifiers, after processing of shortcuts. 2022-04-05 13:46:45 +03:00
Markus Sauermann 529e2279e1 Fix Drag n Drop Transform in main embedding window 2022-03-31 00:43:52 +02:00
Rémi Verschelde 398d502cc7
Merge pull request #59308 from Sauermann/fix-viewport-warp-mouse 2022-03-30 11:41:31 +02:00
bruvzg 76174cb05a
Update sub-viewport canvas items to ensure oversampling is applied correctly. 2022-03-29 10:44:09 +03:00
Rémi Verschelde 7119d355eb String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
2022-03-28 20:26:35 +02:00
Rémi Verschelde 2e85105959
Merge pull request #59555 from Sauermann/fix-mouseover-drag 2022-03-28 20:21:28 +02:00
Markus Sauermann ffe42171a5 Fix using Viewport::warp_mouse within Viewports 2022-03-28 11:59:40 +02:00
Rémi Verschelde 7e5cd4bb48
Merge pull request #59118 from Sauermann/fix-window-input-event-coordinates 2022-03-28 09:54:59 +02:00
Rémi Verschelde 00e9170812
Merge pull request #59574 from Sauermann/proposal-rename-warp-mouse
Rename warp mouse functions to warp_mouse
2022-03-28 08:52:02 +02:00
Markus Sauermann d8a3d4b9da Send Mouse Enter/Exit Notifications independently of mouse focus 2022-03-27 14:20:03 +02:00
Markus Sauermann 0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
Univeous 383dc11965 Fix UI navigation with joysticks 2022-03-27 17:41:29 +08:00
Markus Sauermann 3f7770c453 Fix coordinate system for stretched viewports for subwindows. 2022-03-18 18:10:53 +01:00
Rémi Verschelde e4b9406313
Merge pull request #59099 from RandomShaper/mouse_drop_on_disable 2022-03-14 11:18:38 +01:00
Markus Sauermann 86574b91dd Cleanup internal GUI state, if event is accepted in _input. 2022-03-14 08:38:48 +01:00
kobewi 3c53752b4a Cleanup embed subwindows getters 2022-03-13 18:20:53 +01:00
Pedro J. Estébanez d083fb21c7 Drop mouse focus and over when gui input is globally disabled 2022-03-13 12:45:32 +01:00
Markus Sauermann 40c08e522f Revert "Update mouse cursor shape after changes"
This reverts commit 0fce98b4b5.
2022-03-10 09:43:06 +01:00
Markus Sauermann 0fce98b4b5 Update mouse cursor shape after changes
This fixes some cases where the mouse cursor shape did not change automatically, but instead required a MouseMove to update.
2022-03-09 07:54:03 +01:00
bruvzg 74ff5921d6 Improve popup window handling.
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
2022-02-25 09:33:27 +02:00
Markus Sauermann 27aab7f7ca Update variable name to reflect usage 2022-02-19 09:19:15 +01:00
Markus Sauermann 415042ac89 Connect notifications from Container to Viewport
mouse enter+exit
2022-02-15 22:41:30 +01:00
Rémi Verschelde 0f5455230c
Use `switch` consistently in `_notification` (`scene` folder) 2022-02-15 18:44:55 +01:00
Hendrik Brucker c30d161562 Fix tooltip flickering in some cases 2022-02-15 16:29:03 +01:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
bruvzg f4ea9cd9f3
[Windows] Add WS_BORDER flag to windows in WINDOW_MODE_FULLSCREEN mode to allow multi-window interface in full-screen.
[Windows] Add WINDOW_MODE_EXCLUSIVE_FULLSCREEN without WS_BORDER flag enabled (no multi-window support).
2022-02-04 12:08:46 +02:00
Rémi Verschelde 36880714e4
Merge pull request #57517 from groud/viewport_expose_gui_focus 2022-02-03 11:20:20 +01:00
Marcel Admiraal eaa70fd3f8 Fix mouse_over not dropped when mouse leaves window 2022-02-01 16:12:37 +00:00
Gilles Roudière 3521eecb4c Exposes gui_release_focus and gui_get_focus_owner to Viewport 2022-02-01 15:07:22 +01:00
rafallus 44f6fe4be4 Bring reusable variables out of while loop 2022-01-23 19:39:00 -06:00
Marcel Admiraal d009aa4d02 Fix mouse position not being scaled when window size is changed 2022-01-23 11:53:58 +00:00
Mario Liebisch a5a03b3a73
Allow embedded windows to be non-resizable
This fixes issue #56869.
2022-01-17 21:19:45 +01:00
Rémi Verschelde d40d86b959
Merge pull request #56667 from Ice-Cube69/fix_incorrect_property_types 2022-01-11 14:34:18 +01:00
Arnav Vijaywargiya 0c46f73b5e Fixed incorrect property types 2022-01-11 17:17:11 +05:30
Rémi Verschelde 46624388d4
Merge pull request #56322 from madmiraal/fix-42450 2022-01-11 11:33:59 +01:00
Rémi Verschelde 07d2dfef7b
Merge pull request #53419 from TechnoPorg/rework-subwindows 2022-01-07 16:15:09 +01:00
Tomasz Chabora e72adab511 Update the minimum size of ViewportContainer 2022-01-06 15:43:12 +01:00
Rémi Verschelde 851fb16350
Merge pull request #56305 from Calinou/rename-lod-threshold 2022-01-04 15:28:06 +01:00
Rémi Verschelde 7f66c16c03
Merge pull request #51206 from clayjohn/Vulkan-ASSGI 2022-01-04 10:00:17 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Marcel Admiraal 3105d9b1f3 Rename speed to velocity when it's a directional Vector 2021-12-29 15:35:26 +00:00
Hugo Locurcio df09bc38cb
Rename Lod Threshold to Mesh Lod Threshold
This makes it more obvious that the setting only affects mesh LOD,
not manual (H)LOD achieved using visibility ranges.
2021-12-29 00:11:50 +01:00
vitika9 51501dadcc Added check for SceneTree being null 2021-12-13 15:41:29 +05:30
jmb462 d44b33741b Fix bad mouse offset to show tooltips in Tree 2021-12-12 09:12:26 +01:00
jmb462 81efebb3a1
Fix bad popups offset in editor with single window off
Co-authored-by: Gil Arasa Verge <gilarasaverge@gmail.com>
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2021-12-06 14:29:48 +01:00
Haoyu Qiu 86a47c6540 Fix mouse cursor and notification for force dragging 2021-12-03 18:19:41 +08:00
Rémi Verschelde e223a9c129
Merge pull request #55486 from nekomatata/physics-contacts-debug 2021-11-30 20:21:54 +01:00
PouleyKetchoupp 1ce74c0273 Fix physics 2D/3D contact points rendering
Physics internal process was removed by mistake, it's needed for contact
points to be updated each frame.

Fixed some multimesh parameters to allow 3D contact points to be drawn,
although it's still not working well in 3D as only some of the contact
points are drawn, and some of them keep being drawn when the number
of visible instances drops to 0 instead of hiding them all.
2021-11-30 09:35:12 -07:00
TechnoPorg acb90ed020 Don't obtain a reference to a subwindow
Fixes the wrong location being accessed after changing the order of embedded windows.
This commit also removes an unused variable.
2021-11-29 16:52:19 -07:00
kobewi dc5f6ac4cf Don't show tooltips for paused controls 2021-11-29 13:23:28 +01:00
Rémi Verschelde 547c270777
Merge pull request #51679 from Je06jm/fsr
AMD FidelityFX Super Resolution
2021-11-24 22:34:48 +01:00
Lightning_A e078f970db Rename `remove()` to `remove_at()` when removing by index 2021-11-23 18:58:57 -07:00
Je06jm 20deb0917d Implemented AMD's FSR as a computer shader for upscaling 3D scenes 2021-11-23 14:16:03 -07:00
ConteZero 2b1787b446 Fix drag and drop on LineEdit 2021-11-15 17:10:56 +01:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
clayjohn 0eff109a21 Added SSIL post processing effect 2021-11-06 12:43:19 -07:00
PouleyKetchoupp acbd24ea84 Use parameter classes instead of arguments for all physics queries
Same as what is already done for shape queries, applied to point and ray
queries. Easier to document and more flexible to add more parameters.

Also expose intersect_point method to script in 3D.
Remove intersect_point_on_canvas in 2D, replaced with a parameter.
2021-11-04 11:44:39 -07:00
Rémi Verschelde 96ce806b2f
Merge pull request #54369 from S0yKaf/fix-hardcoded-ray-distance
Fix hardcoded raycast distance in viewport object picking
2021-11-01 21:01:44 +01:00
vdyotte 02b6bbc5df
fix hardcoded raycast distance with viewport object picking
having the raycast distance hardcoded to `10000` caused input events
to not be registered in very large 3D scenes.

This resolves the issue by using the cameras far distance instead.
Creating the more predictable behavior of if an object is visible,
it will be picked by the viewport.

resolves: #49735
2021-10-28 23:08:48 -04:00
Lyuma 97a4ae9e0f Fix off by one in Viewport.render_target_update_mode property enum 2021-10-28 19:42:31 -07:00
Rémi Verschelde 3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
PouleyKetchoupp d5847f1cb4 Fix errors in mouse detection when removing collision object from tree
Now behaves the same way as ui elements, mouse exit is skipped when the
object is removed from the tree.
2021-10-20 09:10:59 -07:00
Rémi Verschelde 56078cca90
Merge pull request #53630 from timothyqiu/viewport-recursion 2021-10-11 10:02:22 +02:00
Haoyu Qiu 7ecb133b22 Fix Viewport::handle_input_locally related infinite recursion 2021-10-10 18:10:28 +08:00
mashumafi 80dc1cc412 Executing AcceptDialog.push_input no longer crashes 2021-10-09 20:33:29 +00:00
Hugo Locurcio 73c6e19acc
Allow any floating-point value as a 3D rendering scale option
This allows for finer control over 3D rendering resolution.
Supersampling can also be performed by setting a 3D rendering
resolution above 1.0, which is useful for offline rendering or
for very high-end GPUs.
2021-10-08 18:22:10 +02:00
jitspoe 2ceba818c3
Fix ViewportTexture error when viewport is used from a child scene
Fix invalid errors when a separate child scene file contains a viewport and
that viewport is used for a texture in the current scene.

Fixes #27790.
2021-10-05 12:21:06 +02:00
Eric M caac2e1a87 Fix focus shortcuts triggering incorrectly 2021-09-21 12:24:07 +10:00
Wilson E. Alvarez f3a564f9a5
Rename Listener2D/Listener3D to AudioListener2D/AudioListener3D 2021-09-16 17:51:51 -04:00
Rémi Verschelde 70ba366743
Merge pull request #50375 from Paulb23/code_edit_unit_tests 2021-09-13 21:51:20 +02:00
Rémi Verschelde 8ecc571158
Merge pull request #49063 from Calinou/remove-16x-msaa
Remove 16× MSAA support due to driver bugs and low performance
2021-09-13 17:34:04 +02:00
kobewi 6b68445e4d Fix multiple definitions of Listener2D 2021-09-12 21:19:37 +02:00
Max Hilbrunner 06e2a02253 Clean up Viewport, remove dead code. 2021-09-10 16:58:33 +02:00
Max Hilbrunner 68563b5760
Merge pull request #52431 from dozingpip/patch-1
Remove dead code from Viewport::_gui_input_event
2021-09-10 16:34:28 +02:00
Pip d7a6f8990a
Remove dead code from Viewport::_gui_input_event 2021-09-06 03:11:02 -04:00
Paulb23 cd6b11222c Prevent crash on startup if no audio server 2021-09-01 16:46:04 +01:00
kobewi f2cb0a8d4b Add Listener2D 2021-08-31 16:53:14 +02:00
Michael Alexsander 565ba91d28
Merge pull request #51906 from requizm/fix/49077
Fix tooltips don't appear for PopupMenus
2021-08-28 15:43:02 +00:00
Ellen Poe 3598d300cb Do all audio mixing in the AudioServer 2021-08-27 10:41:57 -07:00
Bastiaan Olij 64626cc435 Optionally scale 3D render content 2021-08-26 20:48:40 +10:00
Hugo Locurcio 7192852da3
Remove 16× MSAA support due to driver bugs and low performance
In the `master` branch, 16× MSAA caused the entire system to freeze
on NVIDIA GPUs. This is likely caused by graphics drivers not actually
implementing 16× MSAA, but combining 8× MSAA with 2× SSAA instead.

On top of that, modern shader complexity makes 16× MSAA very difficult
to use while keeping a good framerate. 8× MSAA is hard enough to use
as it is.
2021-08-25 07:56:27 +02:00
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
requizm 6f3d8fa228 Fix tooltip message working incorrectly in PopupMenu
fix
2021-08-20 23:06:00 +03:00
Aaron Franke 7094ccfbe9
Disable Node3D when compiling without 3D and fix disable_3d option 2021-08-13 08:59:48 -05:00
Rémi Verschelde 85e315d6e8
Merge pull request #51607 from aaronfranke/includes
Fix some unnecessary includes
2021-08-13 14:38:56 +02:00
Aaron Franke eb4902a455
Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
Hugo Locurcio 7612cff432
Use the Unicode multiplication symbol where relevant 2021-08-12 21:45:33 +02:00
Rémi Verschelde dce488d8f7
Merge pull request #49417 from Bhu1-V/gsoc-cmd-plt
Command Palette For Godot
2021-08-10 18:55:22 +02:00
Aaron Franke 339687e04f
Organize methods in Viewport and explicitly name 3D methods with 3D 2021-08-10 09:10:34 -05:00
Bhuvan Vemula a0a019a998 Added EditorCommandPalette 2021-08-09 17:41:50 +05:30
Michael Alexsander 94a64d557e Add `auto_translate` toggle for automatic translation 2021-07-29 18:30:34 -03:00
Michael Alexsander 79fc188fc4 Multiple cosmetic fixes for embedded windows 2021-07-27 23:55:06 -03:00
Rémi Verschelde 92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
kobewi 8793ec4564 Show tooltips even when paused or time_scale is 0 2021-07-23 17:49:30 +02:00
Michael Alexsander a690cd9251 Make `MenuButton`'s `switch_on_hover` work again 2021-07-22 14:27:30 -03:00
Rémi Verschelde c82daaed48
Merge pull request #38317 from verdog/get-cam-2d-4.0
add viewport.get_camera_2d()
2021-07-20 22:19:06 +02:00
Joan Fons a6adb58493 Editor StringName and Viewport optimizations
* Added explicit return type to the SNAME macro.
* Add some extra SNAME usages.
* Change some ClassDB methods to use const StringName & arguments.
* Cache the Window parent in Control because it's used in
  is_layout_rtl(), which is called often.
* Only enable internal processing for viewports that need it.
* Change CanvasItem::group to be a StringName because it's only used as
  that.
2021-07-20 20:35:41 +02:00
Rémi Verschelde 855c7c7414
Merge pull request #50566 from reduz/optimize-stringname-usage
Optimize StringName usage
2021-07-19 15:20:25 +02:00
Rémi Verschelde 95def293a6
Merge pull request #48186 from EricEzaM/PR/tooltip-improvements
Made default tooltips (non-custom ones) disappear on mouse enter.
2021-07-19 09:02:06 +02:00
reduz 6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Hugo Locurcio 523d6b2ae8
Merge pull request #47395 from sygi/shape_idx_collision
Add shape_idx to CollisionObject2D mouse_entered signal
2021-07-16 19:05:08 +02:00
Josh Chandler 879f84d8f8 add viewport.get_camera_2d()
* there is now a more clear distinction between camera_2d and camera_3d functions in the engine code
* simplified camera2d's exported interface - now everything happens directly with the 'current' variable and make_current and clear_current are no longer exposed- there were some situations where calling one instead of set_current would result in incomplete results
* rebased to current godot master
2021-07-03 15:08:17 -04:00
reduz 6c55d2aad2 Fix Render Info
* Fixed and redone the process to obtain render information from a viewport
* Some stats, such as material changes are too difficult to guess on Vulkan, were removed.
* Separated visible and shadow stats, which causes confusion.
* Texture, buffer and general video memory can be queried now.
* Fixed the performance metrics too.
2021-07-03 10:15:04 -03:00
sygi 6f3e7f7cb0 Add mouse_shape_entered and mouse_shape_exited signals to CollisionObject2D.
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-07-02 20:50:27 +01:00
reduz d07f7c8d25 Fixes to 2D viewport
* Editor 2D viewport now uses embedded subwindows (windows no longer pop up)
* Restored the ability to disable 3D on the 2D viewport (makes 3D not display on 2D when there is a camera on the scene)
2021-06-29 17:40:45 -03:00
Rémi Verschelde 8fb7a9f023
Merge pull request #49719 from LightningAA/rename-node-is-ancestor-of
Rename `is_a_parent_of()` to `is_ancestor_of()`
2021-06-29 12:07:25 +02:00
kobewi 452e10ba7b Remove clips_input() method and use clip_content 2021-06-25 15:46:37 +02:00
Lightning_A 899e5f8685 Rename `is_a_parent_of()` to `is_ancestor_of()` 2021-06-21 08:39:28 -06:00
Aaron Franke 0ce49800ac
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
2021-06-20 11:54:24 -04:00
Lightning_A e28fd07b2b Rename `instance()`->`instantiate()` when it's a verb 2021-06-19 20:49:18 -06:00
Aaron Franke 8b692e8872
Add PROPERTY_USAGE_NONE and use it 2021-06-17 19:10:26 -04:00
reduz 6e98c4cd50 Refactor VisibilityNotifier3D
* This is the 3D counterpart to #49632
* Implemented a bit different as 3D works using instancing

After merged, both 2D and 3D classes will most likely be renamed in a separate PR to DisplayNotifier2D/3D.
2021-06-16 18:50:39 -03:00
reduz 38d164c74b Refactor VisibilityNotifier
* Works from RenderinServer
* Accurately tells when on or off-scren, its no longer approximate.
* VisibilityEnabler also simplified to use the process mode instead.
2021-06-16 10:48:57 -03:00
Haoyu Qiu 80927b7a81 Fix Viewport crashes when not in tree 2021-06-13 12:51:26 +08:00
reduz 32625145c8 Rename GI Classes
* GIProbe is now VoxelGI
* BakedLightmap is now LightmapGI

As godot adds more ways to provide GI (as an example, SDFGI in 4.0), the different techniques (which have different pros/cons) need to be properly named to avoid confusion.
2021-06-05 09:28:56 -03:00
Aaron Franke de3f6699a5
Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
Hugo Locurcio 87f503310b
Tweak dozens of editor property hints for consistency
- Update Viewport MSAA property hints to match the currently
  exposed values.
- Add some performance hints to property hints.
2021-05-25 02:50:35 +02:00
Lightning_A 97fecd1b69 Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods 2021-05-07 14:00:50 -06:00
Hugo Locurcio cf1e30a2ed
Tweak CanvasItem/material sampling property hints for readability
The "Anisotropic" term is abbreviated as spelling it out would cause
the PopupMenu to overflow the editor window when using the default
inspector width.
2021-05-06 03:05:37 +02:00
Rémi Verschelde 3fea170772
Merge pull request #48182 from EricEzaM/PR/fix-viewport-not-updating-mouse-pos-on-click 2021-05-04 09:25:58 +02:00
Bastiaan Olij e0bdf40d15 Move XR flag from subviewport into viewport 2021-05-01 19:58:11 +10:00
EricEzaM 5346bb043a Made default tooltips (non-custom ones) disappear on mouse enter.
Matches 3.X behaviour, but does not break custom tooltips where mouse interaction is needed.
2021-04-26 00:55:12 +10:00
EricEzaM 7c9bd81578 Fix viewport not updating mouse pos on click.
Closes #47594. See further discussion there. Thanks to @Bhu1-V for the investigation which led to this fix.
2021-04-25 22:44:10 +10:00
jfons 4d9d99bb82 Implement occlusion culling
Added an occlusion culling system with support for static occluder meshes.
It can be enabled via `Project Settings > Rendering > Occlusion Culling > Use Occlusion Culling`.

Occluders are defined via the new `Occluder3D` resource and instanced using the new
`OccluderInstance3D` node. The occluders can also be automatically baked from a
scene using the built-in editor plugin.
2021-04-23 21:45:23 +02:00
Nathan Franke 2a8c59c171
Use Array for node configuration warnings
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
2021-04-11 23:25:38 -05:00
Rémi Verschelde 0283bc8fd5
Merge pull request #44456 from univeous/allow_input_echo_in_ui_focus
allow input echo when changing ui focus
2021-04-08 13:28:43 +02:00
Rémi Verschelde d83761ba80
Style: Apply clang-tidy's `readability-braces-around-statements` 2021-04-05 14:09:59 +02:00
Rafał Mikrut 504bc5cc67 Fix crashes in *_input functions 2021-04-05 08:52:21 +02:00
Marcel Admiraal fd30c36985 Rename Texture.get_data() to get_image() 2021-03-28 13:00:46 +01:00
Aaron Franke 10d7fccb54
Rename ButtonList enum and members to MouseButton 2021-03-23 07:13:23 -04:00
Gilles Roudière ac7073f586 Allow Navigation to be more flexible 2021-03-15 15:58:59 +01:00
Anshul7sp1 91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
Delf Neumärker eaa04c1a22
Fix crash during drag if user freed the drag preview 2021-02-24 20:59:17 +01:00
bruvzg d78336c65e
[CTL] Add missing font outline drawing routines and theme constants. 2021-02-14 14:11:44 +02:00
Rémi Verschelde e8f73124a7
Merge pull request #45845 from qarmin/cppcheck_scene_2
Initialize class variables with default values in scene/ [2/2]
2021-02-10 20:06:12 +01:00
reduz 8b19ffd810 Make Servers truly Thread Safe
-Rendering server now uses a split RID allocate/initialize internally, this allows generating RIDs immediately but initialization to happen later on the proper thread (as rendering APIs generally requiere to call on the right thread).
-RenderingServerWrapMT is no more, multithreading is done in RenderingServerDefault.
-Some functions like texture or mesh creation, when renderer supports it, can register and return immediately (so no waiting for server API to flush, and saving staging and command buffer memory).
-3D physics server changed to be made multithread friendly.
-Added PhysicsServer3DWrapMT to use 3D physics server from multiple threads.
-Disablet Bullet (too much effort to make multithread friendly, this needs to be fixed eventually).
2021-02-10 13:21:46 -03:00
PouleyKetchoupp e5e9be8355 Fix contact points debug for 3D Physics
Setting each point's position was missing for 3D. Now enabling collision
render debug will display contact points for 3D physics, the same way it
does for 2D physics.

Note: Multimesh rendering seems not to work in this scenario on master,
but it's working fine on 3.2.
2021-02-09 18:36:38 -07:00
Rafał Mikrut 7961a1dea3 Initialize class variables with default values in scene/ [2/2] 2021-02-09 18:24:36 +01:00
Pedro J. Estébanez a63996ac95 Implement pause-aware picking
This changes the way 2D & 3D physics picking behaves in relation to pause:
- When pause is set, every collision object that is hovered or captured (3D only) is released from that condition, getting the relevant mouse-exit callback., unless its pause mode makes it immune from pause.
- During the pause. picking only considers collision objects immune from pause, sending input events and enter/exit callbacks to them as expected.
- When pause is left, nothing happens. This is a big difference with the classic behavior, which at this point would process all the input events that have been queued against the current state of the 2D/3D world (in other words, checking them against the current position of the objects instead of those at the time of the events).
2021-02-07 00:50:16 +01:00
univeous f5b506763e allow input echo when changing ui focus 2021-01-27 11:47:56 +08:00
reduz a9beb7aa8c Shadow map rendering optimization
-All shadow rendering is done with raster now (no compute)
-All shadow rendering is done by rendering directly to the shadow atlas
-Improved how buffer clearing is done to optimize the above.
-Ability to set shadows as 16 bits.
2021-01-24 20:17:28 -03:00
reduz 099dee35f4 Added GPU based cluster builder
Clustering is now GPU based, uses an implementation based on the Activision algorithm.
2021-01-19 23:31:06 +01:00
AberrantWolf cff0352b3d Make tooltips appear on the same display as the editor
The `current_screen` field was never being set on tooptip windows, leading to scenarios where, if the editor wasn't on screen 0, tooltips may not appear in the right place, especially when your screens have different resolutions.
2021-01-07 12:16:55 +03:00
Rémi Verschelde a4af94068a
Tooltips: Fix unassigned strip_edges() call on text
Fixes #43940, was a regression from #43280.
2021-01-05 15:14:27 +01:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Rémi Verschelde a6b869988f
Merge pull request #44276 from YeldhamDev/tooltip_position_embedded_fix
Fix tooltip position in main embedded window
2021-01-01 16:28:59 +01:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Marcel Admiraal 4b8b803931 Rename Control margin to offset 2020-12-23 06:25:56 +00:00
reduz d2302f53d6 Implement automatic LOD (Level of Detail)
-Happens on import by default for all models
-Just works (tm)
-Biasing can be later adjusted per node or per viewport (as well as globally)
-Disabled AABB.get_support test because its broken
2020-12-18 15:48:03 +01:00
Daniel Ting aea7fde241 Rename neighbour in Control to neighbor
This keeps things consistent with the rest of Godot, which uses the
American English spelling of Color.
2020-12-15 16:42:21 -06:00
Michael Alexsander 48027448bf Fix tooltip position in embedded window 2020-12-10 16:11:57 -03:00
Marcel Admiraal 284642be01 Rename Viewport::ClearMode::CLEAR_MODE_ONLY_NEXT_FRAME to CLEAR_MODE_ONCE 2020-12-10 12:24:49 +00:00
Rémi Verschelde a09846e015
Merge pull request #42109 from EricEzaM/PR/input-and-shortcuts-rework
Shortcuts rework - fixed issues with input propagation and triggering of unwanted shortcuts.
2020-11-28 09:04:25 +01: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
reduz 1bcf3c305b Implement signed distance fields for 2D shaders 2020-11-26 10:49:50 -03: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