Commit Graph

167 Commits

Author SHA1 Message Date
50c96d5414 Fix building with ptrcall on. 2023-06-11 18:02:58 +02:00
552226ab5d Backported: Backport spatial shader built-ins
Backport of this PR: godotengine#63597
This adds these as new Built-Ins to Spatial Shaders
* Object's Position in World Space
* Camera Position in World Space
* Camera Direction in World Space
* Object's Position in View Space
- paddy-exe
be3d331f26
2023-06-11 09:37:10 +02:00
f058c87868 Backported from godot4: Rework Navigation Avoidance
Rework Navigation Avoidance.
- smix8
a6ac305f96
2023-06-10 20:58:49 +02:00
8b18898609 Backported from godot4: Rework const on NavigationServer methods
`const` is used on all methods, even when they cause modification of the server.  This reworks the methods of the server to only use `const` on method that don't change the state of the server.
- DarkKilauea
a0715b30f9
2023-06-09 22:03:42 +02:00
6384b9624f Ported from godot4: Make navigation mesh edge connections optional
Makes navigation mesh edge connections optional.
- smix8
f986b52b3c
2023-06-09 20:54:05 +02:00
29784d5d5b Ported from godot4: Enable assigning an owner to navigation regions and links
This allows users of the server APIs to get back the nodes that created certain regions and links.
- DarkKilauea
5769b0e8d8
2023-06-09 19:46:44 +02:00
160cb38a50 Ported from godot4: Add support for emitting a signal when entering a NavLink
- DarkKilauea
5d8ba2b2d1
2023-06-09 19:08:38 +02:00
19fac49904 Turn PoolVectors in NavigationPathQueryResults into Vectors. 2023-06-09 16:27:24 +02:00
ae018648fe Added missing binds. 2023-06-09 14:19:41 +02:00
268645ff0b Ported from godot4: Add NavigationAgent Path Debug Visualization
Adds path debug visuals for NavigationAgent2D, NavigationAgent3D and NavigationServer.
- smix8
0ab764e84b
2023-06-09 14:17:54 +02:00
11c84049fa Ported from godot4: Fix NavigationMesh debug visuals for non-triangulated meshes
Fixes NavigationMesh debug visuals for non-triangulated meshes.
- smix8
4490a3303b
2023-06-09 13:03:30 +02:00
23daaf95a6 Ported from godot4: Fix 2D navigation debug visuals ignoring half the ProjectSettings
Fixes that NavigationRegion2D and TileMap debug visuals ignored more or less half the ProjectSetting. E.g. random color could not be disabled, edges did not display.
2b19c70664
2023-06-09 11:29:33 +02:00
c11500d480 Ported from godot4: Rename Navigation uses of 'location' to 'position'
Contrary to the entire rest of the engine NavigationAgent's and NavigationLinks decided to deal with locations instead of positions.
- smix8
bf1571979c
2023-06-09 10:28:31 +02:00
b940854ca9 Ported from godot4: Add NavigationServer Performance Monitor
Adds Performance Monitor for NavigationServer3D.
- smix8
9802914f97
2023-06-09 10:17:43 +02:00
2b4d3e69de Fix non tools build. 2023-06-09 09:12:30 +02:00
a5a07d8ff6 Backported from godot4: Add NavigationServer2D debug functions
Adds debug functions to NavigationServer2D to mirror NavigationServer3D functions for 2D users.
- smix8
d254f0fa5f
2023-06-09 09:03:33 +02:00
9c95fade84 Backported from godot4: Fix navigation debug not toggleable in scripts
Fixes that navigation debug was not toggleable in script while even the docs mentioned it.
- smix8
aecad7bb25
2023-06-09 09:01:01 +02:00
d434a1c4e5 Backported from godot4: Fix Editor Navigation debug edge connection visuals
Fixes missing Navigation debug edge connection visuals in Editor due to disabled NavigationServer.
- smix8
8bfea7dcb4
2023-06-09 08:55:21 +02:00
0438c3cc3f Backported from godot4: Added node for Navigation links .
- DarkKilauea
3dd59013f4
2023-06-08 20:46:09 +02:00
f6e65112d7 Backported from godot4: Add NavigationPathQuery
Adds NavigationPathQueryParameters objects that can be used with NavigationServer.query_path() to query a customized navigation path.
- smix8
63dcb9aa80
2023-06-08 18:23:48 +02:00
7ce5f939a9 Ported the docs from the navigation mesh generator rework pr. 2023-06-06 16:52:04 +02:00
890d6f1b28 Removed region_bake_navmesh from the NavigationServer. 2023-06-06 09:36:19 +02:00
654cfb81b7 Renamed NavigationRegion2D back to NavigationPolygonInstance, as I think it fits the engine better. 2023-06-05 18:09:53 +02:00
68b9f4c90e Ported from godot4: Add more detailed Navigation Debug Visualization
- Adds more customization options to ProjectSettings.
- Displays navregion edge connections and navigation polygon edges in editor and at runtime.
- Majority of debug code moved from SceneTree to NavigationServer.
- Removes the irritating debug MeshInstance child node from NavigationRegion3D and replaces it with direct RenderingServer API.
- smix8
c394ea518e
2023-06-05 18:05:15 +02:00
5578afc3d6 Fix scons warning. 2023-06-05 14:56:10 +02:00
57153f4a33 Make overrides consistent again. 2023-06-04 13:11:04 +02:00
6136f0b802 Fix the type of the CreateNavigationMeshGeneratorCallback. 2023-06-04 09:41:39 +02:00
0a3d1d6cf5 Added in NavigationMeshGeneratorDummy and set up initialization. 2023-06-03 20:00:42 +02:00
9a35d6c7d3 Cleaned up NavigationMeshGenerator and added it to the build. 2023-06-03 18:45:20 +02:00
8cbb1bb879 Started porting pull request from godot 4: Rework NavigationMeshGenerator
Reworks NavigationMeshGenerator and navigation mesh parse and bake process. Adds navigation mesh baking for 2D.
- smix8
https://github.com/godotengine/godot/pull/70724
38699a8259
2023-06-03 18:22:12 +02:00
2114b2239b Split NavigationPolygon and NavigationPolygonInstance into 2 files. Also renamedNavigationPolygonInstance to NavigationRegion2D. 2023-06-03 16:54:48 +02:00
f4a4956b7a Ported: Fix Polygon2D skinned bounds (for culling)
The bound Rect2 was previously incorrect because bone transforms need to be applied to verts in bone space, rather than local space. This was previously resulting in skinned Polygon2Ds being incorrectly culled.
- lawnjelly
dd6c213dac
2023-05-01 13:34:35 +02:00
belzecue
ad1464d9e5 Backport from Godot 4 - Fix RigidDynamicBody gaining momentum with bounce #55313 2023-05-01 12:24:31 +02:00
1263101396 Ported: Batching - Add MultiRect command
Large groups of similar rects can be processed more efficiently using the MultiRect command. Processing common to the group can be done as a one off, instead of per rect.

Adds the new API to VisualServerCanvas, and uses the new functionality from Font, BitmapFont, DynamicFont and TileMap, via the VisualServerCanvasHelper class.

- lawnjelly

910ddd13c4
2023-04-20 23:09:37 +02:00
45ffb33025 Add init() virtual methods to the navigation servers. 2023-04-16 18:23:56 +02:00
86bdecbfe9 Now more than one Naviugation2D servers can be registered. 2023-04-16 18:19:57 +02:00
f6c1c1dc8d Move NavigationServer2d's forwarding logic to the navigation module as a new derived class. 2023-04-16 18:11:15 +02:00
7068f1834e Now more than one Navigation Server can be registered. 2023-04-16 17:42:34 +02:00
7567494570 Ported: Eliminate collision checks between geometry in rendering BVH.
Later logic using the `pairable_mask` would catch cases preventing pairing callbacks between geometry. However the collision checks were still taking place, wasting performance.
Here we utilize the `tree_mask` feature of BVH to totally eliminate unnecessary collision checks between geometry.
- lawnjelly
18d7d36b63
2023-04-15 10:51:26 +02:00
40a9b72afb Ported from godot-plus: Add ability to mute AudioServer.
Adds the option to change the audio driver to the Dummy driver and back at runtime, with a set of MuteState flags - Disabled (user control), Silence (period of silence), Focus Loss (when app is not in focus), and Paused (when app is paused).
Control for the flags is added for the editor in EditorSettings, and for the project in ProjectSettings.
Editor defaults to muted (Dummy driver) when there is no audio output, and automatically switches to active on output. This significantly reduces CPU usage.
- lawnjelly
cedb01fb84
2023-04-10 19:42:23 +02:00
stmSi
9b65e9df6a Fix Editor hanging if audiostream's pitch_scale is NaN 2023-03-12 14:14:29 +01:00
2cd4e4d828 Renamed Set to RBSet. 2023-01-15 19:42:08 +01:00
1b0aac6028 Renamed Map to RBMap. 2023-01-15 19:12:50 +01:00
lawnjelly
880f84f8c4 Fix pairing crash in physics Octree
Remove section of code that should not run and was causing crash.
2022-12-22 14:26:42 +01:00
smix8
9225e78f68 Fix Navigation agent callback wild pointer crash
Fixes crash in sanitizer builds when callback agent or object are already freed.

(cherry picked from commit 194c1c44e0a20faa4463e3a41bb12cf93a71fc03)
2022-12-22 14:12:00 +01:00
Ricardo Buring
721ae8f4ad Fix typo bug in heightmap shape
(cherry picked from commit 55eceb5150ee0c6b38f12f4be3fd601506959288)
2022-12-12 12:14:25 +01:00
dzil123
298be38336 Fix shader compiler asan out of bounds 2022-11-30 14:34:44 +01:00
BimDav
3e937eab15 Correctly compute inverse_mass when inertia is defined by user 2022-11-30 14:26:26 +01:00
clayjohn
c9b6b1bffe Properly initialize use_aabb_center in visual server 2022-11-13 00:25:23 +01:00
25d8fbdba4 Ported: visual instance layers are regarded during shadow culling.
todo: setting Camera cull_mask should mark affected shadows dirty somehow
- markusneg
16517ecb3d
2022-10-08 17:47:22 +02:00
Haoyu Qiu
f693b632fe Fix crash executing MultiMesh.reset_instance_physics_interpolation 2022-10-08 17:35:34 +02:00
93eb41c69e Ported: added options for sorting transparent objects
- QbieShay, akien-mga, clayjohn
acdcbefa4e
2022-09-17 10:54:57 +02:00
64f5bd2339 Ported: Bind Physics Interpolation functions in VisualServer
To allow maximum flexibility in the initial rollout, VisualServer functions were not bound in order to prevent compatibility issues if the API changed.

These functions are now bound to allow direct use from the VisualServer.
- lawnjelly
96a1b86717
2022-09-17 10:22:26 +02:00
Yuri Sizov
494dc2f957 Backport fixes to documentation for paths, curves and navigation servers 2022-09-16 13:07:20 +02:00
e24cb96418 Fix compile. 2022-09-16 13:05:22 +02:00
Pedro J. Estébanez
9db0cca2d9 Make audio thread control flags safe 2022-09-16 12:57:59 +02:00
e4ae7f2ebc Renamed Environment to Environment3D, and WorldEnvironment to WorldEnvironment3D. 2022-08-29 17:21:40 +02:00
e2d42db711 Also renamed the files. 2022-08-19 21:24:36 +02:00
cffe742085 Renamed the VisualServer to RenderringServer like in Godot4, as I think it's a lot better name for it. I did not yet rename the files. 2022-08-19 20:50:20 +02:00
f1619cad4f Ported: Add hint_transparent to use a transparent black placeholder texture - Calinou
ab9a95f266
2022-08-19 02:57:42 +02:00
2a13c65298 Ported: Visual/Physics/Navigation Servers validate RIDs with documentation update - tinmanjuggernaut
2be0738304
2022-08-19 02:52:31 +02:00
9757c39f05 Moved a few more core classes. 2022-08-17 17:43:49 +02:00
686663d3e4 Moved around more classes in core. 2022-08-17 16:01:01 +02:00
04feb63860 Moved Engine and projectSettings. 2022-08-17 15:35:28 +02:00
be16fe23ad Moved the error macros. 2022-08-17 15:14:19 +02:00
220b2db443 Moved String and related classes under a string folder in core. 2022-08-17 14:19:55 +02:00
dc9cc716c7 Moved Object related classes under core/object. 2022-08-17 13:45:14 +02:00
9555ee56b9 Moved Variant related classes under a variant folder in core. 2022-08-17 13:17:12 +02:00
388b88678e Moved container related classes in core under a new containers directory. 2022-08-17 12:53:49 +02:00
9e1588160f Now all Variant math types are structs. 2022-08-16 22:09:26 +02:00
e71e3ed897 Now Vector4, Vector4i, Projection, PoolVector4Array, PoolVector4iArray, are built in variant types. Also reordered the Variant's Type enum, renamed _RID in it to RID, fixed a few smaller issues and removed some very old compat code. 2022-08-16 21:55:56 +02:00
8c2e76840c Removed CameraMatrix, and switched to Projection. 2022-08-16 10:26:35 +02:00
e4cad690a3 Renamed elements in Transform2D to columns. 2022-08-14 15:37:05 +02:00
d9e094ab9a Renamed elements in Basis to rows. 2022-08-13 19:07:59 +02:00
c991043c95 Backported improvements to AABB from Godot 4. Also made sure all eligible methods are bound. 2022-08-13 18:21:54 +02:00
730bce8587 Renamed Quat to Quaternion for consistency with the other engine math classes. 2022-08-13 15:22:33 +02:00
2e628b7fa8 Ported: Fix skeleton 2D stale bounding rect
Adds special logic for handling skeleton bounding rect updates. Previously these were never being updated because the canvas item is never set to "rect_dirty".
-lawnjelly
18bb668a2e
2022-08-07 16:01:27 +02:00
39fa5450c2 Fix potential crash in VisualServer. 2022-07-31 19:54:25 +02:00
41ef59bcc8 Ported: Expose VisualServer.viewport_set_use_32_bpc_depth() to the scripting API.
Previously, only the Viewport methods/properties were exposed to the
scripting API. - Calinou
ed4976d1d5
2022-07-29 23:03:48 +02:00
81f5f0d0de Add missing include. 2022-07-29 23:00:39 +02:00
lawnjelly
8726cccd56 Portals - Allow more logging to be disabled
Some logging messages were still being issued when portals/debug/logging was false. This could be annoying in games that stream in parts of levels and repeatedly call `rooms_convert()`.

This PR allows all but essential logging to be disabled.
2022-07-29 22:37:46 +02:00
lawnjelly
50d5be10f8 Portals - Fix invalid room hint when reconverting room graph
In situations where rooms are converted multiple times, the previous room hint ID can reference a room number that is out of range of the new number of rooms. This fixes the bug by checking the room hint ID is within range.
2022-07-29 22:37:29 +02:00
11a92cfe27 Ported: Add NavigationServer map_force_update() function
Adds map_force_update() function to NavigationServer. This function immediately flushes the Navigationserver command queue and recalculates all navigationmeshes and region connections for a specific map.
- smix8
721c99a530
2022-07-29 17:56:48 +02:00
da20b32f66 Ported: Add NavigationServer.region_owns_point() helper function
Adds a helper function to check if a world space position is currently owned by a navigation region.
- smix8
f0069cc1e9
2022-07-29 17:52:38 +02:00
f811d48449 Ported: Add Navigation function to get all navigation maps
Added new function that returns all created navigation map RIDs from the NavigationServer. The function returns both 2D and 3D created navigation maps as technically there is no distinction between them.
- smix8
38ee593b76
2022-07-29 17:49:24 +02:00
Hugo Locurcio
0e32de0bad Clamp Viewport shadow atlas sizes to improve usability
- Add a range hint to the Viewport `shadow_atlas_size` property.
- Add range steps to the shadow resolution project settings that
  match the lowest allowed values (since lower increments don't
  make sense).
2022-07-29 17:38:06 +02:00
7ad35d62ea Ported: Physics Interpolation - fix stale interpolation data when unhiding
A previous optimization prevented instances being added to the interpolation lists when hidden to save processing. This caused a regression when unhiding nodes outside of the physics tick - the interpolated transforms would be stale until the next physics tick, causing a glitch.
This PR readds instances immediately to the interpolation lists when they are unhidden, preventing this glitch.
- lawnjelly

and

 Physics Interpolation - fix continuous updating in unmoving objects
Adds instances to the transform update list as well as the interpolate update list when unhiding them. This ensures that the system auto-detects non-moving objects, and removes them from the interpolate update list on the next tick, preventing unnecessary updates.
- lawnjelly

991687cc10
e4f252d94f

Properly this time.
2022-07-29 10:59:58 +02:00
Marcel Admiraal
0611c7db0d Cleanup AudioEffectRecord thread_active variable 2022-07-29 09:14:43 +02:00
bb5acfd745 Ported: [3.5] Update NavigationServer backport
Backports features and bugfixes from current Godot 4.0 to 3.5 and brings functions and codebase of both version largely in sync to make tutorials more compatible and future backports easier.
- smix8
8bd7c6188b
2022-07-28 22:34:28 +02:00
13c4945b3a Ported: Add INFO_SHADER_COMPILES_IN_FRAME to GL ES 3 render info - RandomShaper
f46d7583ff
2022-07-28 19:37:52 +02:00
lawnjelly
739b0c0c3f Physics Interpolation - fix stale interpolation data when unhiding
A previous optimization prevented instances being added to the interpolation lists when hidden to save processing. This caused a regression when unhiding nodes outside of the physics tick - the interpolated transforms would be stale until the next physics tick, causing a glitch.

This PR readds instances immediately to the interpolation lists when they are unhidden, preventing this glitch.
2022-07-28 19:23:13 +02:00
Hugo Locurcio
c133ff34d4 Add a 3D suffix to relevant physics profiler categories
2D physics categories already had a 2D suffix: "Physics 2D"

(cherry picked from commit 36428305a685889c8f307896951082fda58a974f)
2022-07-28 11:52:41 +02:00
lawnjelly
d6a677f878 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-07-28 11:39:14 +02:00
08c0756260 Ported: 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.
- smix8
3977eb9107
2022-07-27 18:58:09 +02:00
24eccc4281 Ported: Fix warnings found by Emscripten 3.1.10
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.
- akien-mga
5e693b6d84
2022-07-27 18:39:35 +02:00
4781f146fb Ported: 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.
- lawnjelly
ec9a17cfad
2022-07-27 17:43:40 +02:00
smix8
fa0b1f561a Expose VisualServer.texture_set_proxy() to GDScript
Expose VisualServer.texture_set_proxy() to GDScript
2022-07-27 13:06:42 +02:00
Rémi Verschelde
0fa5feae1a MultiMesh: Fix potential crash found by fuzzing
Fixes #58293.
2022-07-26 15:55:28 +02:00
clayjohn
ebe72ade75 Sort based on camera position when using perspective camera 2022-07-26 15:04:35 +02:00
tdetoy
4c295c2cd6 mesh_surface_get_format_offset and mesh_surface_get_format_stride will now provide an error with an invalid array index 2022-07-26 15:04:05 +02:00