Commit graph

29291 commits

Author SHA1 Message Date
Fabio Alessandrelli 82b900bdda [HTML5] Properly set canvas size during setup.
It used to be updated before the first iteration, causing the
window/viewport size values to be incorrect during the initialization
phase (e.g. during the first `_ready` notification).

(cherry picked from commit 3f059b90d6)
2021-03-12 10:13:08 +01:00
bruvzg 8feb53e509 Move caller_id init to Thread constructor to fix UWP build.
(cherry picked from commit 741e1cf672)
2021-03-12 10:12:52 +01:00
Bhuvan Vemula f695e7b4d9 Added Additional Description for PhysicsServer2D->area_create() method.
(cherry picked from commit e3fed7bde8)
2021-03-12 10:12:36 +01:00
Rafał Mikrut 1435e2c0f9 Fix crashes when manipulating nodes in editor
(cherry picked from commit f81ecb498b)
2021-03-12 10:12:16 +01:00
sps1112 f8ee8b1b73 Fix Control._edit_set_state crash
(cherry picked from commit 05f5a43cad)
2021-03-12 10:11:54 +01:00
O01eg 18eca32761 Fix visibility for GCC
(cherry picked from commit 1393ededfd)
2021-03-12 10:07:48 +01:00
Rémi Verschelde a550260404
Merge pull request #46865 from lawnjelly/ninepatch_shader_option
Support ninepatch mode in GLES3 shader
2021-03-12 10:05:44 +01:00
Rémi Verschelde b3e605ab13
Merge pull request #46901 from lawnjelly/ewok_large_fvf_soft_xform
Batching - large FVF forces non-hardware transform
2021-03-12 10:04:57 +01:00
Rémi Verschelde 043cea8928
Merge pull request #46914 from Faless/js/3.x_vk
[3.2] [HTML5] Experimental (opt-in) virtual keyboard support.
2021-03-12 09:49:11 +01:00
Rémi Verschelde db246f8edb
Merge pull request #46909 from akien-mga/3.2-fix-noisetexture-thread
NoiseTexture: Fix regression in starting thread
2021-03-11 22:19:29 +01:00
Rémi Verschelde 0d8182d2b1 NoiseTexture: Fix regression in starting thread
Was a regression from #45618.

Fixes #46907.
2021-03-11 21:58:53 +01:00
Rémi Verschelde 80d75b966c
Merge pull request #46904 from lawnjelly/ewok_diagnose_more
Batching - more frame diagnose information
2021-03-11 21:13:09 +01:00
Rémi Verschelde d3dd28ba57
Merge pull request #46896 from lawnjelly/ewok_read_modulate_attribute
Batching - use FINAL_MODULATE_ALIAS in shaders
2021-03-11 21:11:50 +01:00
Rémi Verschelde 8e1c92a365
Merge pull request #46892 from lawnjelly/ewok_scissor_boost
Batching - fix off by one error in light scissoring
2021-03-11 21:11:06 +01:00
Fabio Alessandrelli 4b38aefd33 [HTML5] Opt-in virtual keyboard support.
Added as an export option "Experimental Virtual Keyboard".
There is no zoom, so text/line edit must be in the top part of the
screen, or it will get hidden by the virtual keyboard.
UTF8/Latin-1 only (I think regular UTF-8 should work out of the box in
4.0 but I can't test it).
It uses an hidden textarea or input, based on the multiline variable,
and only gets activated if the device has a touchscreen.
This could cause problems on devices with both touchscreen and a real
keyboard (although input should still work in general with some minor
focus issues). I'm thinking of a system to detect the first physical
keystroke and disable it in case, but it might do more harm then good,
so it must be well thought.
2021-03-11 20:58:09 +01:00
lawnjelly 5ed0fd067d Batching - use FINAL_MODULATE_ALIAS in shaders
As part of the improvements to batch more cases, batching can store final_modulate as an attribute in the vertex format rather than sending as a uniform. This allows draw calls with different final_modulate to be batched together.

However custom shader code was reading from only the final_modulate uniform, and not the attribute when it was in use. This was leading to visual errors.

This is tricky to solve, because we cannot use the same name for the attribute in the vertex and fragment shaders, because one is an attribute and one a varying, whereas a uniform is accessible anywhere. To get around this, a macro is used which can translate to the most appropriate variable depending on whether uniform or attribute or varying is required.
2021-03-11 17:07:19 +00:00
lawnjelly d226cf83d1 Batching - more frame diagnose information
Added slightly more detail to diagnose_frame option. This is helpful for debugging issues.
2021-03-11 16:32:59 +00:00
lawnjelly b590f5ff52 Batching - large FVF forces non-hardware transform
This is something that I missed from the initial implementation of large FVF. In large FVF the transform is sent per vertex in an attribute, and the vertex position is the original vertex position. This is so that the original vertex position can be read and modified in a custom shader.

This whole system is therefore incompatible with the legacy hardware transform method, whereby the transform is sent in a uniform. The shader already correctly ignores the uniform transform, but there are some parts of the CPU side logic that can be confused treating large FVF batches as if they were hardware transform.

This PR completes the logic by making the CPU treat large FVF as though it was software transform.
2021-03-11 15:53:43 +00:00
Rémi Verschelde dc82fdcd05
Merge pull request #46898 from lawnjelly/ewok_fix_rotation_polarity
Batching - fix basis polarity in large fvf
2021-03-11 16:12:52 +01:00
lawnjelly f723fa6db9 Batching - fix basis polarity in large fvf
Slight technical hitch, the basis was reversed that was sent to the shader, so rotations were opposite. This PR reverses polarity of the basis to be correct.
2021-03-11 14:26:54 +00:00
Rémi Verschelde 13a57d8cdf
Merge pull request #46891 from godotengine/revert-46409-fix-scale-pivot-jitter
Revert "Fix flicker in control nodes due to pivot offset"
2021-03-11 11:58:18 +01:00
lawnjelly 9b6742346b Batching - fix off by one error in light scissoring
There have been a couple of reports of pixel lines when using light scissoring. These seem to be an off by one error caused by either rounding or pixel snapping.

This PR adds a single pixel boost to light scissor rects to protect against this. This should make little difference to performance.
2021-03-11 10:30:21 +00:00
Rémi Verschelde b7e06930aa
Revert "Fix flicker in control nodes due to pivot offset" 2021-03-11 11:01:48 +01:00
Rémi Verschelde 9952a5039a
Merge pull request #46827 from lawnjelly/proj_settings_alias
Add GLOBAL_DEF_ALIAS and alias for rename of pixel_snap
2021-03-10 14:41:28 +01:00
Rémi Verschelde 71f3d93966
Merge pull request #46829 from akien-mga/3.2-camera2d-update-on-viewport-resize
Camera2D: Update scrolls when the Viewport is resized
2021-03-10 14:22:11 +01:00
Rémi Verschelde 31cb0f06c0
Merge pull request #46856 from lawnjelly/ninepatch_defaults
Change default ninepatch mode to scaling
2021-03-10 12:14:08 +01:00
lawnjelly e70d7294e2 Support ninepatch mode in GLES3 shader
Although batching supported both ninepatch modes (fixed and scaling) when using ninepatch stretch mode, the ninepatch tiling modes (in GLES3) could only run through the shader.

The shader only supported one of the ninepatch modes. This PR uses the hack method of #if defined in the shader to prevent the use of a conditional. The define is set at startup according to the project setting.
2021-03-10 11:05:59 +00:00
lawnjelly d3930b1af2 Change default ninepatch mode to scaling
Changes default ninepatch mode to preserve compatibility, and renames default mode to 'fixed'.

Also adds an editor restart to changing ninepatch mode and software skinning, which will be more user friendly.
2021-03-10 09:30:23 +00:00
Rémi Verschelde 6e9b1d99e2 Camera2D: Update scrolls when the Viewport is resized
Factored the `viewport`/`custom_viewport` setup code which was used in two
locations to ensure consistency.

Fixes #46826.
2021-03-09 17:17:51 +01:00
lawnjelly 20f7037edb Add GLOBAL_DEF_ALIAS and alias for rename of pixel_snap
Having to rename project settings is rare, but when it does occur it can cause user confusion. In order to make compatibility more seamless this PR introduces two new GLOBAL_DEF functions,

GLOBAL_DEF_ALIAS(new_name, old_name, default)
GLOBAL_DEF_ALIAS_RST(new_name, old_name, default)

These are the same as the existing GLOBAL_DEF functions except that if the new setting is not found, it attempts to load from the old setting name. If the old setting is found, it stores it into the new setting, and then calls the regular GLOBAL_DEF functions.
2021-03-09 15:16:24 +00:00
Rémi Verschelde 64a9e86c5c
Merge pull request #46817 from Ev1lbl0w/bugfix-negative_vram_3.2
Fix negative VRAM values
2021-03-09 14:53:32 +01:00
Rémi Verschelde 20a6bb8509
Merge pull request #46815 from akien-mga/3.2-scons-fix-env-creation
[3.2] SCons: Use default env["ENV"] and prepend PATH to it
2021-03-09 11:20:28 +01:00
Rémi Verschelde 16fbe80dd2
Merge pull request #46802 from Faless/js/3.x_allow_hidpi
[3.2][HTML5] Respect allow_hidpi option during setup
2021-03-09 10:56:21 +01:00
Ev1lbl0w bae4b0c952
Fix negative VRAM values 2021-03-09 09:51:17 +00:00
Rémi Verschelde 0431241935 SCons: Use default env["ENV"] and prepend PATH to it
This fixes a regression from #46774 where `env["ENV"]` would miss some
important env variables on Windows, such as `SystemRoot`, `PATHEXT`, etc.

So we go back to the previous setup (letting SCons initialize `env["ENV"]`
as it sees fit for the host OS) but use `PrependENVPath` instead of
`AppendENVPath` to preserve the intended fix from #46774.

Fixes #46790 for 3.2.
2021-03-09 09:39:43 +01:00
Rémi Verschelde f79b8474ab
Merge pull request #46809 from likeich/fix_inertia_bug_3.2
[3.2] Fixes division by zero when 3d body does not have valid shape
2021-03-09 09:38:48 +01:00
Kyle 1c208d6baa Fixes division by zero when 3d body does not have valid shape (3.2 only)
Fixes #46738 by setting the default inertia to a valid value when there are no valid shapes for a 3d body.
2021-03-08 20:32:16 -05:00
Fabio Alessandrelli 758daab3ad [HTML5] Respect allow_hidpi option during setup
The option was forced to `true` before, unlike on other platforms.
2021-03-08 23:35:10 +01:00
Rémi Verschelde 0ddba5b712
Merge pull request #44323 from Calinou/doc-spatialmaterial-depth-no-triplanar
Document that SpatialMaterial doesn't support depth mapping + triplanar
2021-03-08 19:41:21 +01:00
Rémi Verschelde dc99f04d51 Update AUTHORS and DONORS list
New contributor added to AUTHORS:
@Ev1lbl0w

Thanks to all contributors and donors for making Godot possible!

(cherry picked from commit b3506bc63b)
2021-03-08 17:41:14 +01:00
Rémi Verschelde f1f472439e i18n: Sync translations with Weblate 2021-03-08 17:40:29 +01:00
kobewi e9e0cac3f5 Allow to save override.cfg with ProjectSettings
(cherry picked from commit 156c402f2b)
2021-03-08 17:40:22 +01:00
Angad Kambli 144749c31b use collision mask in vehicle raycast
(cherry picked from commit bfc533fc4c)
2021-03-08 17:40:22 +01:00
nemerle bd15558768 fix incorrectly connected optimize_dialog signal
(cherry picked from commit 7bbacb5ff6)
2021-03-08 17:37:13 +01:00
gatalskii f60d27fe16 mod: pop-up usability enhancement for support button
Now after choosing support level pop-up doesn't hide after each click

(cherry picked from commit efe05a166e)
2021-03-08 17:37:13 +01:00
Hugo Locurcio 266282813a Make the pagination buttons wider in the asset library browser
This makes the page number buttons easier to click.

(cherry picked from commit 25c6acb702)
2021-03-08 17:37:13 +01:00
Rémi Verschelde fd5966af64
Merge pull request #46797 from Faless/js/3.x_pwa_simple
[3.2][HTML5] Add PWA support to the editor page.
2021-03-08 17:29:57 +01:00
Fabio Alessandrelli d942d553ef [HTML5] Add PWA support to the editor page.
This allows to install it as an app, and provide offline support (after
the first run).
Practically, this boils down to adding a JSON file as a manifest, an
offline page to be displayed when the cached files are not avaialble,
and a JS file to cache resources and return them.

The reason for the "first run requirements" is that some browsers, will
emit an "install" by just visiting the page (to see if the JS code is
compatibile), and we do not want to force casual visitors to just
download the 10 MiB+ compressed editor WebAssembly file without pressing
the start button.

Special thanks to Hugo Locurcio (Calinou) for the initial work.
2021-03-08 17:06:41 +01:00
Fabio Alessandrelli 9028b7a095 [HTML5] Catch audio worklet errors on disconnect.
Which could happen if the worklet was not fully loaded, or the audio
context had already aborted.
2021-03-08 17:06:41 +01:00
Rémi Verschelde 9c30f70f64
Merge pull request #46794 from akien-mga/3.2-linux-fix-detect_prime-steam
[3.2] Linux: Fix PRIME detection on Steam
2021-03-08 16:30:09 +01:00