Commit graph

3349 commits

Author SHA1 Message Date
lawnjelly 7ea35da462 Portals - Fix RoomManager PVS enum
The PVS mode enum had been declared using scope operator, which does not seem to work correctly from GDScript with the BIND_ENUM_CONSTANT macro.

This PR removes the scope operator in the declaration.
2021-08-28 07:27:50 +01:00
Hugo Locurcio d717eb537b
Add an Array.pop_at() method to pop an element at an arbitrary index
Negative indices are supported to pop an element relative from the end.
2021-08-27 01:27:07 +02: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
Clay John 46ad2560a1
Merge pull request #51780 from BastiaanOlij/output_linear_gles2
Convert output of GLES2 to linear color space
2021-08-25 22:22:05 -03: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
Wilson E. Alvarez fb5417a17b
[3.x] Expose String.simplify_path 2021-08-24 00:48:20 -04: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
Bastiaan Olij 73722f3c65 Convert output of GLES2 to linear color space if keep_3d_linear is enabled 2021-08-23 15:59:56 +10:00
Hugo Locurcio 2370fe5c26
Merge pull request #51973 from Calinou/define-minimum-window-size-3.x
Define a default minimum window size to workaround rendering issues (3.x)
2021-08-23 04:10:55 +02:00
Hugo Locurcio 59f24d8867
Define a default minimum window size to workaround rendering issues
The minimum window size can still be set to `Vector2(0, 0)` in a script
if needed.
2021-08-23 04:10:24 +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
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
kobewi 6eb52b0768
Fix renaming directories
(cherry picked from commit 0dde3e5b59)
2021-08-18 23:19:44 +02:00
Aaron Franke 02a94ee977
[3.x] Improve the docs for the float type 2021-08-18 13:27:43 -05: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
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
Rémi Verschelde 028a2a7205
Merge pull request #50359 from m4gr3d/address_external_dir_access
[3.x] Add support for Android scoped storage
2021-08-16 09:48:34 +02:00
Yuri Sizov ab25266213 Add support for partial custom editor themes 2021-08-14 02:11:54 +03:00
Rémi Verschelde 632844e464
Merge pull request #51320 from pycbouh/docs-extract-theme-items-3.x
[3.x] Add theme item descriptions to the online documentation
2021-08-13 22:39:09 +02:00
ne0fhyk c88d1608ab Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-13 11:04:17 -07:00
Hugo Locurcio f77b228b2c
Fix incorrect descriptions for EditorFileSystem's get_file_type()
(cherry picked from commit 1942e0c117)
2021-08-13 09:55:18 +02: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
Rémi Verschelde ffc372b002
Merge pull request #42220 from RandomShaper/agile_input_3.2
[3.x] Improve responsiveness on underpowered Android devices
2021-08-12 22:46:17 +02:00
Hendrik Brucker 6d05ef9ccb StyleBox fake AA improvements (aa_size float property) 2021-08-12 22:21:34 +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 f0b37b1519
doc: Point URLs to 3.4 version of the online docs 2021-08-12 17:08:10 +02:00
Iced Quinn c5f01173a4
doc: Add documentation for JSONRPC class
(cherry picked from commit 3fc5646b98)
2021-08-12 16:43:45 +02:00
Max Hilbrunner 235fec4316
Docs: Add warnings about no SSL/(D)TLS revocation
(cherry picked from commit 4eb427afb8)
2021-08-12 16:42:17 +02:00
follower abc18e9a4f
Fix Unicode URL link tags to render correctly.
Change incorrect `[/code]` closing tags to `[/url]` tags.

The `url` tags for the links to the Unicode code points information use `[/code]` rather than `[/url]` to close them.

This results in the links being rendered incorrectly in the IDE--the entire rest of the documentation for each method gets turned into a giant underlined link.

This issue was introduced in a2271ba3bd.

(cherry picked from commit b85688ac7d)
2021-08-12 16:42:16 +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 a9b585dd1a
Fixup doc formatting after #47416 2021-08-10 12:11:30 +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
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
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
Pedro J. Estébanez 31a0ca2cac Add project setting for agile input event flushing
If enabled, key/touch/joystick events will be flushed just before every idle and physics frame.

Enabling this can greatly improve the responsiveness to input, specially in devices that need to run multiple physics frames per each idle frame, because of not being powerful enough to run at the target frame rate.

This will only work for platforms using input buffering (regardless event accumulation). Currenly, only Android does so, but could be implemented for iOS in an upcoming PR.
2021-08-08 12:37:55 +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
Yuri Sizov 71ec6dba67 Improve Control's theme item methods documentation 2021-08-06 22:31:58 +03:00
Yuri Sizov 974e76a082 Improve the inspector plugin documentation and remove a confusing statement 2021-08-06 21:01:48 +03:00
Yuri Sizov fcbe5a3fde Add theme item descriptions to the online documentation 2021-08-06 18:20:51 +03:00
Rémi Verschelde b3c555504f
Improve documentation and simplifies code for File::get_csv_line()
Also forbids using double quotes as a delimiter.

(cherry picked from commit b8c08ba5ad)
2021-08-06 11:13:43 +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
Bastiaan Olij cc1f7f2edc Revert "Combined the DOF far and DOF near passes"
This reverts commit 39658b4e07.
2021-08-05 23:22:31 +10:00
kobewi 5692bc8dd0
Improve ConfigFile example
(cherry picked from commit 1721f0143e)
2021-08-03 14:56:51 +02:00
merumelu ffec0799cb
makerst: use link titles for external tutorials
(cherry picked from commit b8752d91dc)
2021-08-03 10:20:19 +02:00
Rémi Verschelde f5836b40d4
doc: Use self-closing tags for return and argument
For the time being we don't support writing a description for those, preferring
having all details in the method's description.

Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.

(cherry picked from commit 7adf4cc9b5)
2021-08-03 10:20:19 +02:00
Kevin Sanders 88ad05c5dc
Grammar fix.
(cherry picked from commit 6db57b9da2)
2021-08-03 09:33:25 +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
Hugo Locurcio 93f4f9e076
Link to the Random number generation tutorial in RandomNumberGenerator
This was done in `master` already, but not in `3.x`.
2021-07-31 22:54:30 +02: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
EricEzaM 0e5c6e0d55 Allow checking for exact matches with Action events.
Added additional param to action related methods to test for exactness.
If "p_exact_match" is true, then the action will only be "matched" if the provided input event *exactly* matches with the action event.

Before:
* Action Event = KEY_S
* Input Event = KEY_CONTROL + KEY_S
* Is Action Pressed = True

Now:
You can still do the above, however you can optionally check that the input is exactly what the action event is:
* Action Event = KEY_S
* Input Event = KEY_CONTROL + KEY_S
* p_exact_match = True
* Is Action Pressed = False
* If the Input Event was only KEY_S, then the result would be true.

Usage:

```gdscript
Input.is_action_pressed(action_name: String, exact_match: bool)
Input.is_action_pressed("my_action", true)

InputMap.event_is_action(p_event, "my_action", true)

func _input(event: InputEvent):
  event.is_action_pressed("my_action", false, true) # false = "allow_echo", true = "exact_match"
  event.is_action("my_action", true)
```

Co-authored-by: Eric M <itsjusteza@gmail.com>
2021-07-30 15:35:39 +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
Hugo Locurcio 7e3c0a0c1f
Document Image.save_exr() only being available in editor builds
(cherry picked from commit a1784c64b4)
2021-07-28 15:35:52 +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
Rémi Verschelde a71169c0e0
Merge pull request #50788 from aaronfranke/3.x-input-get-axis 2021-07-26 16:30:44 +02:00
Hugo Locurcio 94f79fa474
Document caveats with Control's mouse_entered/mouse_exited signals
(cherry picked from commit 37c1cbdcb2)
2021-07-26 13:36:37 +02:00
Raul Santos f20ace5cd2
Fix typo in CollisionObject documentation
(cherry picked from commit f8374b021e)
2021-07-26 13:31:19 +02:00
Hugo Locurcio af3f83407f
Expose an ImportOrder enum in ResourceImporter
This avoids using magic numbers in code.

(cherry picked from commit 7f83977f37)
2021-07-26 13:26:58 +02: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
Aaron Franke 69fb14256b
[3.x] Allow getting Input axis/vector values from multiple actions
For get_vector, use raw values and handle deadzones appropriately
2021-07-23 19:17:55 -04:00
Nicholas Huelin 6d58ea6ce7
Fix doc typos
This pull request fixes an assortment of typos and improves conciseness in `Animation`, `Area2D`,  `Array`, `ArrayMesh`, `Control`, `Directory`, `EditorPlugin`, `Engine`, and `OS`.

(cherry picked from commit 9a72b0d3d0)
2021-07-24 01:06:38 +02:00
Nicholas Huelin bd8747f7f1
Fix miscellaneous doc typos and inconsistencies
This pull request fixes an assortment of typos, improves conciseness, and enhances clarity.

(cherry picked from commit 9787e631aa)
2021-07-24 01:00:37 +02:00
Distrikt64 1e49b6299a
Fix msec documentation description typo
(cherry picked from commit 44eb041d60)
2021-07-24 00:59:57 +02:00
Joseph Davies b98a06b259
Fix grammar in MultiMesh documentation.
(cherry picked from commit 136567ebcf)
2021-07-24 00:58:30 +02:00
Hugo Locurcio 244425998f
Document the RootMotionView class
(cherry picked from commit 6880829a9a)
2021-07-24 00:58:11 +02: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 0b4080ba4d
Merge pull request #48555 from lawnjelly/delta_sync
Add option to sync frame delta after draw
2021-07-22 13:33:57 +02:00
Rémi Verschelde 214106d6e3
Merge pull request #50723 from BastiaanOlij/combine_far_near_dof
Combined the DOF far and DOF near passes
2021-07-22 13:19:39 +02:00
lawnjelly 93557927e4 Add option to sync frame delta after draw
Investigations have showed that a lot of the random variation in frame deltas causing glitches may be due to sampling the time at the wrong place in the game loop.

Although sampling at the start of Main::Iteration makes logical sense, the most consistent deltas may be better measured after the location likely to block at vsync - either the OpenGL draw commands or the SwapBuffers.

Here we add an experimental setting to allow syncing after the OpenGL draw section of Main::Iteration.
2021-07-22 12:04:22 +01:00
Rémi Verschelde d3f500cf33
Merge pull request #48390 from lawnjelly/delta_smooth
Add frame delta smoothing option
2021-07-22 12:43:39 +02:00
Rémi Verschelde 801205b2c1
Merge pull request #48892 from lawnjelly/bvh_robust
BVH - thread safety option
2021-07-22 12:41:42 +02:00
Bastiaan Olij 39658b4e07 Combined the DOF far and DOF near passes 2021-07-22 13:45:57 +10:00
Rémi Verschelde 028bf846a8
Merge pull request #50640 from goostengine/add-engine-print-error-property-3.x
[3.x] Add `Engine.print_error_messages` property to disable printing errors
2021-07-20 13:31:04 +02:00
Andrii Doroshenko (Xrayez) 726111f38f Add Engine.print_error_messages property to disable printing errors
Backports #48359 to 3.x.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-07-20 13:58:07 +03:00
Rémi Verschelde f131a77f46
Merge pull request #46574 from The-O-King/split_stream_3.2
[3.4] Split Vertex Buffer Stream in Positions and Attributes
2021-07-20 10:48:37 +02:00
Aaron Franke 7dc2edc430
[3.x] Allow reading shaders from .gdshader files 2021-07-19 23:34:23 -04:00
Omar El Sheikh 7f8487a900 Split Vertex Position and Attribute Streams
Implemented splitting of vertex positions and attributes in the vertex
buffer

Positions are sequential at the start of the buffer, followed by the
additional attributes which are interleaved

Made a project setting which enables/disabled the buffer formatting
throughout the project

Implemented in both GLES2 and GLES3

This improves performance particularly on tile-based GPUs as well as
cache performance for something like shadow mapping which only needs
position data

Updated Docs and Project Setting
2021-07-19 13:23:46 -07: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 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
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
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
kobewi 4941d2001c
Add set_pressed_no_signal method to BaseButton
(cherry picked from commit 50c63bdc4c)
2021-07-15 10:52:22 +02:00
Tomasz Chabora 6021ab5b01
Document remaining Visual Script classes
(cherry picked from commit 1054956461)
2021-07-15 10:46:04 +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
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