Commit Graph

1701 Commits

Author SHA1 Message Date
Hugo Locurcio 46b7133967 Add a 3D suffix to relevant physics profiler categories
2D physics categories already had a 2D suffix: "Physics 2D"

(cherry picked from commit 36428305a6)
2022-06-01 00:29:46 +02:00
lawnjelly e7a73579e3 Portals - force full check on adding moving object
Moving objects being added during instance_moving_create() were incorrectly not forcing a full check to find which room they were within. This could result in moving objects being re-added not correctly identifying their current room, and thus culling incorrectly. This PR forces a full check on calling instance_moving_create.
2022-05-29 15:53:25 +01:00
Haoyu Qiu 067e738cb8 Fix various typos 2022-05-19 19:07:45 +08:00
Haoyu Qiu b657d0c76c Add dedicated macros for property name extraction
* Replace case-by-case extraction with PNAME & GNAME
* Fix group handling when group hint begins with property name
* Exclude properties that are PROPERTY_USAGE_NOEDITOR
2022-05-19 11:31:35 +08:00
smix8 3977eb9107 Add NavigationServer2D/3D API functions to find missing RID info
Utility functions for NavigationServer2D/3D to find missing RID information when working with Server API directly. e.g. from map to regions and agents, from agent or region to map, from region to map and agents and so on ....

Requirement to work with NavigationServer API exklusive without SceneTree nodes and when juggling agents and regions between multiple navigation maps.

(cherry picked from commit 371054e3e5)
2022-05-16 21:10:36 +02:00
Rémi Verschelde 5e693b6d84 Fix warnings found by Emscripten 3.1.10
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.

(cherry picked from commit d8935b27a9)
2022-05-16 16:38:26 +02:00
lawnjelly ec9a17cfad Physics Interpolation - optimize hidden nodes
In order to prevent glitches when unhiding nodes, set_transform() is still called to the VisualServer even for hidden nodes when the node is interpolated. This activates a lot of logic which is not necessary just to keep the previous transform updated.

This PR adds an early out which misses out on the unnecessary logic when instances are invisible.
2022-05-10 08:59:34 +01:00
lawnjelly f1bef3c592 Physics Interpolation - improve warnings with NodePath
It has been pointed out to me that it is far more useful to display the NodePath in the warning than the name of the node, as there may be lots of nodes sharing the same name in a project. This PR fixes this.
2022-05-04 18:46:14 +01:00
Rémi Verschelde f06e68f2a2
Merge pull request #54682 from smix8/textureproxy 2022-04-28 19:47:20 +02:00
smix8 ca1216fcef Expose VisualServer.texture_set_proxy() to GDScript
Expose VisualServer.texture_set_proxy() to GDScript
2022-04-28 18:53:29 +02:00
Rémi Verschelde 4cfc96fea7
Merge pull request #60531 from lawnjelly/fti_usage_warnings 2022-04-28 12:00:49 +02:00
lawnjelly ad9b2b3794 Physics Interpolation - add helper warnings
When physics interpolation is active on a node, it is essential that transforms are updated during "_physics_process()" rather than "_process()" calls, for the interpolation to give the correct result.

This PR adds optional warnings for instances, cameras and multimeshes which can flag updates being incorrectly called, and thus make these problems much easier to fix.
2022-04-26 13:56:02 +01:00
Rémi Verschelde d063bc4277
Merge pull request #60381 from clayjohn/3.x-sorting
[3.x] Sort based on camera position when using perspective camera
2022-04-26 12:26:31 +02:00
Rémi Verschelde 24307bd074 MultiMesh: Fix potential crash found by fuzzing
Fixes #58293.
2022-04-25 16:55:54 +02:00
clayjohn 76ff41cad1 Sort based on camera position when using perspective camera 2022-04-19 14:54:51 -07:00
tdetoy 8e57aae57d mesh_surface_get_format_offset and mesh_surface_get_format_stride will now provide an error with an invalid array index 2022-04-19 00:36:59 -04:00
Rémi Verschelde e1eb3c2fb1
Merge pull request #60147 from lawnjelly/interpolation_out_of_scenario 2022-04-13 17:08:08 +02:00
lawnjelly d2b1d29634 Physics interpolation - Move out of Scenario
Move VisualServer interpolation data out of Scenario and into VisualServerScene, so the interpolation data and enabled status is now common to all Scenarios.

Fix physics interpolation in multithreaded mode by ensuring tick and pre-draw are called.
2022-04-11 15:04:24 +01:00
Haoyu Qiu f24312380f Rename NavigationServer's free method to free_rid 2022-04-08 17:31:04 +08:00
Rémi Verschelde 21c3048397 Add missing argument names in bindings 2022-04-04 12:56:59 +02:00
Yuri Rubinsky 385515431b
Merge pull request #59775 from Chaosus/shader_fix_3.x 2022-04-01 21:37:47 +03:00
Bartłomiej T. Listwon df39e0f472 Fix crash in AudioServer when switching audio devices with different audio channels count (connecting PS5 controller, bluetooth 5.1 headphones etc.) 2022-04-01 10:45:42 +02:00
Yuri Roubinsky b5c5c2d52b Fix shader crashing when attempting to access length() at global space 2022-04-01 08:44:57 +03:00
Rémi Verschelde 3eee2f45a3
Merge pull request #57674 from RandomShaper/fix_ubershader_android
Improve ubershader compatibility
2022-03-13 00:53:48 +01:00
Rémi Verschelde c63ab664d2 Revert "PitchShift effect quality and performance tweaks for different pitch scale values"
(cherry picked from commit dae0135ae5)
2022-03-02 12:02:37 +01:00
lawnjelly 036bace9e9 BVH - Fix area-area collision regression
Minimal approach to fixing regression whereby static areas where not detect dynamic areas.
2022-02-26 11:36:27 +00:00
Rémi Verschelde 6ca309e058
Merge pull request #58531 from rburing/area_call_queries_fix_premature_return
[3.x] Godot Physics `AreaSW` and `Area2DSW`: fix premature return in `call_queries`
2022-02-26 09:36:14 +01:00
Ricardo Buring 89ce63a84f AreaSW and Area2DSW: fix premature return in call_queries 2022-02-25 14:41:34 +01:00
Ricardo Buring e6f1a44b4d In final phase of test_body_motion, move and cull AABB for body once instead of for every shape 2022-02-21 15:03:09 +01:00
Hugo Locurcio cfba65fa23 Expose `AudioServer.capture_device` as a property
This is more consistent with `AudioServer.device` (for output),
which is already exposed as a property.

(cherry picked from commit 1d35b37499)
2022-02-19 15:57:36 +01:00
Rémi Verschelde 2dd545b512
Merge pull request #58141 from lawnjelly/occluder_shared_resources 2022-02-16 13:29:55 +01:00
lawnjelly 3c2df49832 Fix Occluder to properly share resources
In order to properly support the resource sharing paradigm, Occluders are split into Instances and Resources in the VisualServer. Instances are owned by a Scenario, and Resources are global. OccluderShape resources can now correctly be shared by multiple OccluderInstances.
2022-02-16 09:55:11 +00:00
lawnjelly 522bce1159 Fixed Timestep Interpolation (3D)
Adds fixed timestep interpolation to the visual server.
Switchable on and off with project setting.

This version does not add new API for set_transform etc, when nodes have the interpolated flag set they will always use interpolation.
2022-02-16 09:41:23 +00:00
Bartłomiej T. Listwon 51d028fce0
Audio quality improvements in PitchShift
(cherry picked from commit 29b6ed9283)
2022-02-15 12:30:17 +01:00
Bartłomiej T. Listwon 6471d0a57a
Pass audio samples untouched for pitch_scale around 1.0f
(cherry picked from commit c02e979dbf)
2022-02-15 12:28:31 +01:00
Rémi Verschelde 7a16bb2ee4
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.

(cherry picked from commit 1bdb82c64e)
2022-02-11 09:50:59 +01:00
Jérémy Zurcher f9fdd526d5 fix portal_occlusion_culler compilation with target=debug tools=no 2022-02-06 13:22:33 +01:00
Pedro J. Estébanez 0d1ec9a7cf Improve ubershader compatibility
- Prevent debug enforced use of ubershader on shaders not supporting it
- Use unsigned integer for ubershader flags
- Add project setting for disabling async shader compilation on mobile
- Stop sampling some textures through different kinds of samplers at the same time
2022-02-05 22:12:31 +01:00
Rémi Verschelde 689f59dca0
Merge pull request #53463 from lawnjelly/vital_redraws
Add editor vital redraws only option
2022-02-04 21:42:49 +01:00
Pawel Lampe 6c6e50bf0c Fix navigation merge errors, fixes #56786
- improved `detail/sample_max_error` default value
- improved floating point precision handling in cell key calculations
- improved `merge error` error message
- exposed `cell_height` of `nav_map` to the `Navigation`
- fixed cell key `y` calculation
2022-02-02 23:52:29 +01:00
lawnjelly a0c6d16c90 Add editor vital redraws only option
When editor continuous redraws is switched off, the editor only redraws when a redraw_request was issued by an element in the scene. This works well in most situations, but when scenes have dynamic content they will continuously issue redraw_requests.

This can be fine on high power desktops but can be an annoyance on lower power machines.

This PR splits redraw requests into high and low priority requests, defaulting to high priority. Requests due to e.g. shaders using TIME are assigned low priority.

An extra editor setting is used to record the user preference and an extra option is added to the editor spinner menu, to allow the user to select between 3 modes:

* Continuous
* Update all changes
* Update vital changes
2022-02-02 11:26:45 +00:00
lawnjelly 8ea20f5fdd Add OccluderShapePolygon
Add OccluderShapePolygon, glue to Occluder and gizmos etc.
2022-02-01 11:31:06 +00:00
Rémi Verschelde d62166f68f
Merge pull request #57186 from lawnjelly/gameplay_fix_ticks 2022-01-25 11:39:26 +01:00
lawnjelly 38240fd0c8 Portals - Fix gameplay monitor ticking
Due to an optimization to prevent processing except when camera rooms changed, the ticking synchronization and updating of previous and current lists could get out of sync for affected objects, leading to missing gameplay notifications.

This PR adds new paths to properly support and synchronize objects in this "room based" path.
2022-01-25 10:07:50 +00:00
Yuri Roubinsky 85deed9207 Backport some changes to 3.x shaders 2022-01-25 10:34:57 +03:00
Rémi Verschelde 6c0c0c4b29
Merge pull request #54165 from Calinou/directional-shadow-runtime-change-3.x
Allow changing directional shadow size at run-time
2022-01-22 15:25:09 +01:00
Rémi Verschelde c6480e2166
Merge pull request #57033 from lawnjelly/gameplay_monitor_unload
Portals - fix gameplay monitor unloading
2022-01-21 18:33:50 +01:00
lawnjelly dc14636e68 BVH templated mask checks and generic NUM_TREES
Refactors the BVH to make it more generic and customizable. Instead of hard coding the system of pairable_mask and pairable_type into the BVH, this information is no longer stored internally, and instead the BVH uses callbacks both for determining whether pairs of objects can pair with each other, and for filtering cull / intersection tests.

In addition, instead of hard coding the number of trees, the BVH now supports up to 32 trees, and each object can supply a tree collision mask to determine which trees it can collide against.

This enables the BVH to scale to either the two or 3 trees needed in physics, and the single tree used without pairing in Godot 4 render tree.
2022-01-21 10:08:29 +00:00
lawnjelly 6c1e243fa2 Portals - fix gameplay monitor unloading
The gameplay monitor wasn't being unloaded correctly in between levels. This meant that exit signals were not being sent, and entered signals for the new level were being missed.

This PR sends appropriate exit signals on unloading, and clear the data.
2022-01-21 09:38:48 +00:00
Haoyu Qiu ac144e7e8c
Fix invalid read when using LightOccluder2D
(cherry picked from commit 7870cf24f2)
2022-01-19 16:02:54 +01:00