Commit graph

339 commits

Author SHA1 Message Date
Rémi Verschelde cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
Rémi Verschelde 2a49798c7b
Merge pull request #36970 from JFonS/fix_viewports_update
Update all editor viewports after settings changes
2020-03-14 23:46:58 +01:00
JFonS 55b478afd9 Update all editor viewports after settings changes 2020-03-14 20:47:12 +01:00
JFonS a0af3094b4 Fix rotation gizmo for empty Spatials
The AABB for an empty Spatial has 0 size, since the stored and
compared Transform was scaled by the AABB size, it would completely
destroy the rotation information. If there is no rotation
information, the gizmo doesn't update when the rotation changes.
2020-03-10 16:23:22 +01:00
Rémi Verschelde 478337c412
Merge pull request #36751 from Faless/debugger/threads_and_profilers
ScriptDebugger refactor, threading, profilers.
2020-03-09 19:08:07 +01:00
Rémi Verschelde af015f79d3
Merge pull request #36917 from volzhs/cancel-snap-setting
Update snap setting only with OK
2020-03-09 12:19:56 +01:00
Rémi Verschelde 1f37c8e048
Merge pull request #36914 from guilhermefelipecgs/fix_check_view_information
Fix the VIEW_INFORMATION checkbox not being selected (visually)
2020-03-09 12:17:07 +01:00
jfons 7055a926ff Add rotation widget to 3D viewport 2020-03-08 23:38:29 +01:00
volzhs 667a981d4d Update snap setting only with OK
restore previous values with cancel
2020-03-09 04:31:11 +09:00
Guilherme Felipe 126cec41e6 Fix the VIEW_INFORMATION checkbox not being selected
Generated id of "Display Advanced..." was in conflict with "View Information"
2020-03-08 15:34:41 -03:00
Fabio Alessandrelli 540ca05a80 Threaded networking for editor debugger. 2020-03-08 12:16:09 +01:00
Rémi Verschelde e2b66cacf7
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
2020-03-01 23:00:42 +01:00
Rémi Verschelde 01afc442c7 Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.

No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
2020-02-28 14:24:09 +01:00
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

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

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

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

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
bruvzg 1af06d3d46
Rename scancode to keycode.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-25 12:30:33 +02:00
Fabio Alessandrelli cbc450c0e5 Huge Debugger/EditorDebugger refactor. 2020-02-21 11:12:03 +01:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
janglee d3c580f0bc Make orthogonal view mode persistent in new scene
Fixes #36339.
2020-02-19 21:33:43 +05:30
Juan Linietsky 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Rémi Verschelde 386968ea97 Remove obsolete GLES3 backend
Due to the port to Vulkan and complete redesign of the rendering backend,
the `drivers/gles3` code is no longer usable in this state and is not
planned to be ported to the new architecture.

The GLES2 backend is kept (while still disabled and non-working) as it
will eventually be ported to serve as the low-end renderer for Godot 4.0.

Some GLES3 features might be selectively ported to the updated GLES2
backend if there's a need for them, and extensions we can use for that.

So long, OpenGL driver bugs!
2020-02-13 10:36:44 +01:00
Juan Linietsky cf8c679a23 ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits. 2020-02-12 14:24:54 -03:00
Juan Linietsky 2049dec79e Added normalmap guided roughness mipmap generator, and a global roughness limiter. 2020-02-11 12:16:01 +01:00
Juan Linietsky bed8980ca5 Re-implemented screen space ambient occlusion 2020-02-11 12:15:46 +01:00
Juan Linietsky bd364d1447 Auto exposure re-implemented in Vulkan 2020-02-11 12:14:23 +01:00
Juan Linietsky 6ee2f5e6b6 More GIProbe work and fixes 2020-02-11 12:03:49 +01:00
Juan Linietsky fb739f9da7 Fixed display menu visualizations. 2020-02-11 12:03:24 +01:00
Juan Linietsky acf0f6c8a7 GIProbes working. 2020-02-11 12:03:20 +01:00
Juan Linietsky dd3682e5fe Modernized default 3D material, fixes material bugs. 2020-02-11 12:01:24 +01:00
Juan Linietsky 449df8f688 Base 3D engine done, still untested, though. 2020-02-11 11:59:25 +01:00
Juan Linietsky e1b3444415 Bugfixes and ability to better specify filter and repeat modes everywhere.
Removes antialiased flag for draw_* methods.
2020-02-11 11:53:28 +01:00
Juan Linietsky 3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Tomasz Chabora de77bda605 Include locked nodes on selection list 2020-02-10 13:59:24 +01:00
lawnjelly eaf8e5ce52 Change CameraMatrix::get_viewport_size to get_viewport_half_extents
Fixes #26637.
Fixes #19900.

The viewport_size returned by get_viewport_size was previously incorrect, being half the correct value. The function is renamed to get_viewport_half_extents, and now returns a Vector2.

Code which called this function has also been modified accordingly.

This PR also fixes shadow culling when using ortho cameras, because the correct input for CameraMatrix::set_orthogonal should be the full HEIGHT from get_viewport_half_extents, and not half the width.

It also fixes state.ubo_data.viewport_size in rasterizer_scene_gles3.cpp to be the width and the height of the viewport in pixels as stated in the documentation, rather than the current value which is half the viewport extents in worldspace, presumed to be a bug.
2020-01-22 18:22:00 +00:00
Hugo Locurcio 8bce0b6176
Mark alternate editor display modes as disabled in the GLES2 renderer
This partially addresses #27018.
2020-01-17 16:06:47 +01:00
Hugo Locurcio 2b9f34b867
Add a crosshair to the 3D viewport
The crosshair makes freelook navigation a bit easier, while making it
clearer that it's possible to select nodes by clicking while in
freelook mode.

The crosshair is only displayed while in freelook mode.
It uses an icon designed to be visible on any background.
2020-01-13 22:30:34 +01:00
Rémi Verschelde c0ece451e3
Merge pull request #34720 from Calinou/light-gizmo-color-by-light
Tint 3D light gizmos using the light's color
2020-01-02 13:59:10 +01:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

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

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Hugo Locurcio ac18665c88
Tint 3D light gizmos using the light's color
This makes navigation more convenient in the 3D viewport, especially
when using the unshaded display mode.
2020-01-01 00:54:25 +01:00
Haoyu Qiu 078c0d75f2 Cleans up headers included in editor_node.h 2019-12-24 21:46:05 +08:00
JFonS 8da8518ba3 Fix selection on 3D viewport with half resolution 2019-12-19 12:53:20 +01:00
Aaron Franke 4af218f9e3
Don't cast item to Spatial when checking if it's locked
Not a necessary cast, and causes a crash any time it's not a Spatial.
2019-11-28 05:34:54 -05:00
Hugo Locurcio 1e28571d82
Always allow Alt as an orbit modifier in the 3D editor
This makes it easier to navigate in 3D when using a graphics tablet.
This fallback modifier will only be available if no other modifier
is using Alt.

This partially addresses
https://github.com/godotengine/godot-proposals/issues/196.
2019-11-14 17:40:15 +01:00
Michael Alexsander c77ce40c3b Minor adjustment in the "Game Camera Override" button's tooltip. 2019-11-11 11:46:23 -03:00
PouleyKetchoupp 311ab52b6c Fixed Camera preview when creating new scenes
Fixes #33490
2019-11-09 17:24:40 +01:00
Rémi Verschelde 621dc7022f
Merge pull request #27742 from rxlecky/camera-replication
Game camera override
2019-11-08 10:02:18 +01:00
volzhs 4b53a86ce3 Fix error when opening or closing scene with camera preview on 2019-10-27 21:04:29 +09:00
Erik 8b0546d93b Implement game camera override
Implemented uniform API in Viewport class to override 2D and/or
3D camera.

Added buttons in 2D and 3D editor viewport toolbars that override
the running game camera transform with the editor viewport camera
transform. Implemented via remote debugger protocol and camera
override API.

Removed LiveEditFuncs function pointers from ScriptDebugger class.
Since the debugger got access to the SceneTree instance (if one
exists), there is no need to store the function pointers. The live
edit functions in SceneTree are used directly instead. Also removed
the static version of live edit functions in SceneTree for the same
reason. This reduced the SceneTree -> Debugger coupling too since
the function pointers don't need to be set from SceneTree anymore.

Moved script_debugger_remote.h/cpp from 'core/' to 'scene/debugger/'.
This is because the remote debugger is now using SceneTree directly
and 'core/' classes should not depend on 'scene/' classes.
2019-10-23 02:51:32 +01:00
Hugo Locurcio af89a87075
Add a "slow" modifier to freelook
This makes precise adjustments easier, without having to
touch the mouse wheel. This modifier is also available in
Blender, so this makes the freelook behavior more consistent
with it :)

In the interest of simplifying the Editor Settings, this also
removes the freelook modifier speed factor setting
(the value is now hardcoded to its default).
2019-10-14 22:50:02 +02:00
jfons c1de7cb22e Fix calculate_spatial_bounds for selection display
Fixes `SpatialEditorPlugin::_calculate_spatial_bounds` so the displayed
selection doesn't break with transformed scenes.
2019-10-04 15:47:15 +02:00
Emmanuel Barroga 10d0bc920b Fixes scene instances not displaying bounds when selected
When selecting instances of a scene file, it doesn't display the bounding box which makes it difficult to visually see that it is selected.
2019-10-03 22:46:29 -07:00