Commit graph

2492 commits

Author SHA1 Message Date
Anilforextra
90908cd67d Add Get Center Method for Rect2/Rect2i and AABB. 2021-09-21 21:14:17 +05:45
Bastiaan Olij
c527078634 Change to using doubles in XR classes 2021-09-21 22:46:31 +10:00
bruvzg
c931906af7 Add flag to connected grapheme. Apply RTL displacement FX only to the whole connected grapheme. Pass more glyph info to the custom RTL FX. 2021-09-21 13:51:38 +03:00
Frixuu
650e63a7ca Allow for mapping keycodes to current layout 2021-09-21 00:03:02 +02:00
Rémi Verschelde
62aed73d88
Merge pull request #52545 from JFonS/occ_fixes
Occlusion culling fixes
2021-09-20 13:20:03 +02:00
Yuri Roubinsky
f68d3f67b5 Fix shader crash when passing array to built-in function without index 2021-09-18 14:05:14 +03:00
Aaron Franke
bf0213470c
Replace Vector3.to_diagonal_matrix with Basis.from_scale 2021-09-17 10:30:30 -05:00
Rémi Verschelde
ec23d1348a
Merge pull request #52409 from GiantBlargg/position-depth-pre-pass 2021-09-17 14:21:29 +02:00
PouleyKetchoupp
ed1ba5093f Clarify RigidDynamicBody modes
RigidDynamicBody modes are replaced with several properties to make their
usage clearer:
-lock_rotation: disable body's rotation (instead of MODE_LOCKED)
-freeze: no gravity or forces (instead of MODE_STATIC and MODE_KINEMATIC)
-freeze_mode: Static (can be only teleported) or Kinematic (can be animated)

Also renamed MODE_DYNAMIC_LOCKED to MODE_DYNAMIC_LINEAR in the physics
servers.
2021-09-16 16:03:48 -07:00
Camille Mohr-Daurat
062cff373a
Merge pull request #52668 from qarmin/cppcheck_servers_physics
Initialize variables in servers/physics
2021-09-16 09:06:03 -07:00
Camille Mohr-Daurat
1852afb6b0
Merge pull request #52679 from nekomatata/world-boundary-shape
Rename WorldMarginShape to WorldBoundaryShape
2021-09-15 16:02:40 -07:00
qarmin
91257c3900 Initialize variables in servers/physics 2021-09-15 19:41:32 +02:00
Fabio Alessandrelli
d187bb4e11 [HTML5] Use browser mix rate by default on the Web.
Browsers doesn't really like forcing the mix rate, e.g. Firefox does not
allow input (microphone) if the mix rate is not the default one, Chrom*
will exhibit worse performances, etc.
2021-09-15 11:56:21 +02:00
PouleyKetchoupp
bb75aec8bc Rename WorldMarginShape to WorldBoundaryShape 2021-09-14 11:16:31 -07:00
Aaron Franke
3a902c66c4
Revert some URLs from the "Replace HTTP URLs with HTTPS" PR 2021-09-13 15:18:35 -05:00
Rémi Verschelde
70ba366743
Merge pull request #50375 from Paulb23/code_edit_unit_tests 2021-09-13 21:51:20 +02:00
Rémi Verschelde
8ecc571158
Merge pull request #49063 from Calinou/remove-16x-msaa
Remove 16× MSAA support due to driver bugs and low performance
2021-09-13 17:34:04 +02:00
Rémi Verschelde
078bdef7e9
Merge pull request #51939 from clayjohn/VULKAN-horizon-so-fix
Compute horizon SO threshold before transformation
2021-09-13 11:44:42 +02:00
JFonS
5f69218edc
Merge pull request #51604 from TechnoPorg/fix-vulkan-parent-material
Vulkan: Fix CanvasItem::use_parent_material
2021-09-12 01:00:30 +02:00
Lyuma
aca4b737f1 8 uvs for glTF2, URI decode and Vertex Custom api.
Add glTF2 uri decode for paths.

Add vertex custom apis.

Add scene importer api.

Change Color to float; add support for float-based custom channels in SurfaceTool and EditorSceneImporterMesh

Co-authored-by: darth negative hunter
 <thenegativehunter2@users.noreply.github.com>
2021-09-10 09:16:48 -07:00
jfons
d6fb8e1d93 Occlusion culling fixes 2021-09-10 18:15:10 +02:00
Juan Linietsky
7c9cdea836
Merge pull request #52476 from Lauson1ex/master
Replace current ACES tonemapper with a high quality one
2021-09-09 19:13:44 -03:00
Juan Linietsky
3c554f09ea
Merge pull request #52252 from Calinou/sdfgi-use-light-indirect-energy
Use the Light3D Indirect Energy property in SDFGI
2021-09-09 17:17:48 -03:00
Bastiaan Olij
506ae80876 Expose Vulkan internal values for access from extensions 2021-09-09 22:28:32 +10:00
Endri Lauson
065d13eddc Replace ACES tonemapper with a high quality one 2021-09-07 19:46:02 -03:00
Juan Linietsky
ca11f8ad30
Merge pull request #52237 from ellenhp/polyphony
Add optional polyphonic playback to built-in audio player nodes
2021-09-07 17:38:51 -03:00
Ellen Poe
0e3cab41eb Add polyphony to Audio Stream Player nodes 2021-09-07 09:44:39 -07:00
Max Hilbrunner
acc776f7b6
Merge pull request #52442 from Faless/mp/4.x_rpc_manager
[Net] Move multiplayer classes to own subfolder. Split RPC from MultiplayerAPI.
2021-09-07 18:44:39 +02:00
Fabio Alessandrelli
bf9aae09ba [Net] Move multiplayer to core subdir, split RPCManager.
Move multiplayer classes to "core/multiplayer" subdir.

Move the RPCConfig and enums (TransferMode, RPCMode) to a separate
file (multiplayer.h), and bind them to the global namespace.

Move the RPC handling code to its own class (RPCManager).

Renames "get_rpc_sender_id" to "get_remote_sender_id".
2021-09-07 11:14:30 +02:00
Camille Mohr-Daurat
29bdd000f0
Merge pull request #48708 from nekomatata/heightmap-raycast-acceleration
Optimize raycast with large Heightmap shape data
2021-09-06 16:22:16 -07:00
Bastiaan Olij
461d31427c
Merge pull request #52205 from BastiaanOlij/blit_source_rect
Add source rectangle to blit
2021-09-07 09:21:13 +10:00
Bastiaan Olij
76b83ff615
Merge pull request #52405 from BastiaanOlij/xr_extension_missing_names
Add missing parameter names to _commit_views GDVIRTUAL_BIND
2021-09-07 09:20:49 +10:00
PouleyKetchoupp
8d56354f7c Optimize raycast with large Heightmap shape data
Port raycast accelerator from Bullet's btHeightfieldTerrainShape.
2021-09-06 16:01:44 -07:00
PouleyKetchoupp
82ea2a7045 Proper support for custom mass properties in 2D/3D physics bodies
Changes:
-Added support for custom inertia and center of mass in 3D
-Added support for custom center of mass in 2D
-Calculated center of mass from shapes in 2D (same as in 3D)
-Fixed mass properties calculation with disabled shapes in 2D/3D
-Removed first_integration which is not used in 2D and doesn't seem to
make a lot of sense (prevents omit_force_integration to work during the
first frame)
-Support for custom inertia on different axes for RigidBody3D
2021-09-06 10:20:16 -07:00
Camille Mohr-Daurat
e1ae2708ee
Merge pull request #52271 from nekomatata/query-layer-default-mask
Harmonize default value for collision mask in ray/shape queries
2021-09-06 09:33:18 -07:00
Daniel Doran
3138b94058 Fix depth pass for shaders that set POSITION 2021-09-05 01:05:42 -06:00
Bastiaan Olij
32ddcaf15e Add missing parameter names to _commit_views GDVIRTUAL_BIND 2021-09-05 11:51:13 +10:00
Paulb23
24d02d0b4e Fix dummy rendering server memory leaks 2021-09-01 16:46:04 +01:00
Paulb23
d186862338 Fix InputMap and display server not nulling singleton on free 2021-09-01 16:46:04 +01:00
PouleyKetchoupp
83baecdff0 Add AnimatableBody inherited from StaticBody for moving platforms
Instead of having a physics node named Static that can be either Static
or Kinematic, AnimatableBody is added again as a separate node:
-Inherited from StaticBody to make its usage clearer
-Still separated from CharacterBody to make its usage more focused

Properly implemented constant velocity for kinematic bodies in godot
physics servers (induced velocity without actually moving).

Also updated description for the different physics nodes to make their
usage clearer.
2021-08-31 18:14:32 -07:00
Clay John
036b7a0985
Merge pull request #51873 from Chaosus/fix_uniform_error_spam
Fix incorrect checking of uniform set to prevent error spam (2)
2021-08-31 11:28:48 -07:00
Juan Linietsky
7946066577
Merge pull request #49471 from nekomatata/body-state-sync-callback
Clean physics direct body state usage in 2D and 3D physics
2021-08-31 14:30:17 -03:00
PouleyKetchoupp
26bd432707 Harmonize default value for collision mask in ray/shape queries
The default mask for queries was 0, 0x7FFFFFFF or 0xFFFFFFFF depending
on the cases.

Now always using 0xFFFFFFFF (in the form of UINT32_MAX to make it clear)
in order to use all layers by default.
2021-08-30 16:42:49 -07:00
Hugo Locurcio
2c507cd426
Use the Light3D Indirect Energy property in SDFGI
The Indirect Energy property was previously ignored in SDFGI
(unlike VoxelGI).
2021-08-30 14:53:03 +02:00
Bastiaan Olij
fbac863bfb Add source rectangle to blit 2021-08-29 14:57:16 +10:00
Max Hilbrunner
7368004869
Merge pull request #52176 from BastiaanOlij/fix_gl_size_param
Fix double named size parameter
2021-08-28 19:35:20 +02:00
Bastiaan Olij
b9c64df69b Fix double named size parameter 2021-08-28 13:30:43 +10:00
Fabio Alessandrelli
dcf2d09231
Merge pull request #52070 from nekomatata/area-point-gravity-fix
Fix point gravity calculation
2021-08-28 05:10:15 +02:00
Juan Linietsky
54caaa21ce
Merge pull request #51296 from ellenhp/mix_in_audio_server
Move mixing out of the AudioStreamPlayback* nodes
2021-08-27 15:38:20 -03:00
Ellen Poe
3598d300cb Do all audio mixing in the AudioServer 2021-08-27 10:41:57 -07:00
Ellen Poe
53843ba872 Require AudioStream::mix to return the number of frames successfully mixed 2021-08-27 10:27:58 -07:00
PouleyKetchoupp
cc43c2ea16 Optimize area detection and intersect_shape queries with concave shapes
Whenever contact points are not needed, collision checks with concave
shapes (triangle mesh and heightmap) stop at the first colliding
triangle.
2021-08-27 09:53:40 -07:00
K. S. Ernest (iFire) Lee
90a35dac48
Merge pull request #51908 from bruvzg/msdf_fonts2
Make FontData importable resource. Add multi-channel SDF font rendering.
2021-08-27 08:51:37 -07:00
Camille Mohr-Daurat
ca4f20529c
Merge pull request #51896 from nekomatata/restore-ray-shape
Refactor RayShape and rename to SeparationRayShape
2021-08-27 08:49:49 -07:00
Juan Linietsky
712bcf564f
Merge pull request #52092 from Calinou/voxelgi-remove-anisotropic-leftovers
Remove leftovers of anisotropy in the VoxelGI shader code
2021-08-27 12:22:57 -03:00
bruvzg
4c3f7d1290 Makes FontData importable resource.
Adds multi-channel SDF font texture generation and rendering support.
Adds per-font oversampling support.
Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading.
Adds BMFont binary format and outline support.
2021-08-27 15:43:18 +03:00
Bastiaan Olij
c5f62fad90
Merge pull request #52003 from BastiaanOlij/xr_interface_extension
Adding GDExtension support to XRInterface
2021-08-27 11:51:43 +10:00
Camille Mohr-Daurat
f89adbf112
Merge pull request #51801 from nekomatata/area-one-directional-layer-check
One-directional layer check for Area vs. RigidBody/SoftBody/Area
2021-08-26 07:59:06 -07:00
Bastiaan Olij
86ff7f8550 Adding GDExtension support to XRInterface 2021-08-26 23:24:44 +10:00
Bastiaan Olij
64626cc435 Optionally scale 3D render content 2021-08-26 20:48:40 +10:00
Bastiaan Olij
6e87d62873
Merge pull request #50883 from BastiaanOlij/mobile_hdr
Scale color output in the mobile renderer to provide HDR support
2021-08-26 11:23:22 +10:00
PouleyKetchoupp
6a9ed72185 Clean physics direct body state usage in 2D and 3D physics
Use a C++ callback instead of Callable for synchronizing physics nodes' state with physics servers.

Remove usage of PhysicsDirectBodyState in physics nodes when not
necessary.

Store PhysicsDirectBodyState for bodies individually instead of a
singleton to avoid issues when accessing direct body state for multiple
bodies.

PhysicsDirectBodyState is initialized only when needed, so it doesn't
have to be created when using the physics server directly.

Move PhysicsDirectBodyState2D and PhysicsDirectBodyState3D to separate
cpp files.
2021-08-25 08:57:42 -07:00
JFonS
c334989e00
Merge pull request #51821 from Calinou/builtin-shaders-add-comments
Add comments at the top of each built-in shader to ease debugging
2021-08-25 11:37:57 +02:00
Hugo Locurcio
6a6c0890c2
Remove leftovers of anisotropy in the VoxelGI shader code
Anisotropy support was removed when VoxelGI was reworked as it was
too demanding on the GPU.
2021-08-25 10:23:28 +02:00
Hugo Locurcio
7192852da3
Remove 16× MSAA support due to driver bugs and low performance
In the `master` branch, 16× MSAA caused the entire system to freeze
on NVIDIA GPUs. This is likely caused by graphics drivers not actually
implementing 16× MSAA, but combining 8× MSAA with 2× SSAA instead.

On top of that, modern shader complexity makes 16× MSAA very difficult
to use while keeping a good framerate. 8× MSAA is hard enough to use
as it is.
2021-08-25 07:56:27 +02:00
PouleyKetchoupp
3d5dc80348 Rename RayShape to SeparationRayShape
Makes it clearer that it's used for special cases when picking a
collision shape.
2021-08-24 17:34:55 -07:00
PouleyKetchoupp
aa4791735d Rename slips_on_slope to slide_on_slope
Also added some precision to the documentation.
2021-08-24 17:34:55 -07:00
PouleyKetchoupp
d9720d4395 Fix CharacterBody motion with RayShape
Make separation ray shapes work properly in move_and_slide, wihtout the
specific code in CharacterBody like before.

Now most of the logic is handled inside the physics server. The only
thing that's needed is to use ray shapes only for recovery and ignore
them when performing the motion itself (unless we're snapping or slips
on slope is on).
2021-08-24 17:34:55 -07:00
PouleyKetchoupp
829fb4fba1 Fix RayShape collision detection
One-way collision is disabled for both rigid bodies and character
bodies.

Kinematic margin is now applied to ray shapes to help getting consistent
results in slopes and flat surfaces.

Convex shapes don't return inverted normals when a segment test starts
inside (raycasting will be made consistent in a separate patch).

Ray shapes also discard contacts when fully contained inside a shape
and when the contact direction is inverted, so the behavior is
consistent with all shape types. Now they always separate only when
intersecting the top of a shape (for downward rays).
2021-08-24 16:03:05 -07:00
PouleyKetchoupp
45c7af9862 Restore RayShape as a regular shape type
Partial revert from previously removing ray shapes completely, added
back as a shape type but without the specific character controller code.
2021-08-24 16:03:05 -07:00
PouleyKetchoupp
9c9e528e3e Fix point gravity calculation
Removing the + 1 in point gravity formula when using distance scale to
make it more accurate for standard gravitation.

Fixes precession in orbits for games using gravitation.

Also moved gravity calculation to area to use it for both rigid bodies
and soft bodies in 3D (same change in 2D for consistency).

Co-authored-by: Ryan Peach <ryan.peach@keysight.com>
2021-08-24 09:32:28 -07:00
Camille Mohr-Daurat
770a1d00a3
Merge pull request #51751 from jeffrey-cochran/windforce
Created an area-specific wind force that interacts with soft bodies
2021-08-23 16:48:19 -07:00
reduz
44d62a9f4b Implement NativeExtension pointer arguments
* Allows calling into native extensions directly with a pointer
* Makes it easier to implement some APIs more efficiently
* Appears with a "*" in the documentation for the argument.
* Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint.
* AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
2021-08-23 19:58:40 -03:00
Jeffrey Cochran
e806397196 Enabled area-specific wind forces 2021-08-23 17:00:50 -04:00
Max Hilbrunner
583b6a594a
Merge pull request #51971 from aaronfranke/https
Replace HTTP URLs with HTTPS for sites with HTTPS versions
2021-08-23 15:58:54 +02:00
Michael Alexsander
88db541705
Merge pull request #51947 from AnilBK/redundant-assignments
[cppcheck] Remove some redundant assignments.
2021-08-23 13:23:45 +00:00
Bastiaan Olij
d22163c657 Scale color output in the mobile renderer to provide HDR support 2021-08-23 15:30:36 +10:00
Bastiaan Olij
2d446771d6
Merge pull request #51980 from BastiaanOlij/fix_multiview_tonemap
Fix multiview defines in tonemap shader
2021-08-23 12:02:18 +10:00
Aaron Franke
ae1702bee5
Replace HTTP links with HTTPS for sites with HTTPS versions 2021-08-22 20:13:11 -05:00
Duarte David
7e94c583e0 Fixed non-uniform scaling of normals 2021-08-22 19:28:18 +01:00
Michael Alexsander
2f8a58ad46
Merge pull request #51886 from Geometror/fix-layout-editor-file-dialog
Fix ItemList layout (+EditorFileDialog)
2021-08-22 16:47:11 +00:00
Bastiaan Olij
74a647bddd Fix multiview defines in tonemap shader 2021-08-22 21:30:58 +10:00
Anilforextra
c86db8b710 Remove redundant assignments.
Use used_in_transfer instead of used_in_compute twice.
2021-08-21 19:20:07 +05:45
clayjohn
bccc4cd735 Compute horizon so threshold before transformation 2021-08-20 19:27:52 -07:00
Hendrik Brucker
72e49eadec Fix ItemList layout (+EditorFileDialog) 2021-08-21 00:22:09 +02:00
PouleyKetchoupp
dafb6edacf Fix compilation warnings in Shape2DSW/Shape3DSW 2021-08-19 16:19:49 -07:00
jfons
55e7832d7b Improvements to SpotLight3D and OmniLight3D's shadows
OmniLight3D:
* Fixed lack of precision in cube map mode by scaling the projection's
  znear.
* Fixed aliasing issues by making the paraboloids use two square regions instead of two half
  squares.
* Fixed shadowmap atlas bleeding by adding padding.
* Fixed sihadow blur's inconsistent radius and unclamped sampling.

SpotLight3D:
* Fixed lack of precision by scaling the projection's znear.
* Fixed normal biasing.

Both:
* Tweaked biasing to make sure it works out of the box in most situations.
2021-08-19 13:46:51 +02:00
Yuri Roubinsky
b6af457d25 Fix incorrect checking of uniform set to prevent error spam (2) 2021-08-19 09:11:01 +03:00
Rémi Verschelde
f6626a40e5
Merge pull request #51843 from reduz/fixes-to-mobile-renderer-3
More fixes to mobile renderer
2021-08-18 20:43:25 +02:00
Rémi Verschelde
2fcf3057fd
Merge pull request #51792 from Chaosus/removed_restart 2021-08-18 19:59:57 +02:00
reduz
700f9d916d More fixes to mobile renderer
* Specify all precision qualifiers
* Makes renderer work on Adreno Vulkan
2021-08-18 12:20:19 -03:00
Hugo Locurcio
a139e58f8c
Add comments at the top of each built-in shader to ease debugging
When a shader error is printed about a built-in shader, the origin
of the shader will now be recognizable immediately by looking at
the top of the printed shader code.
2021-08-18 03:09:22 +02:00
reduz
6027cd0a1d Fixes to mobile renderer
* Make sure shaders are named, to aid in debug in case of failure
* SceneRenderRD was being wrongly initialized (virtual functions being called when derivative class not initialized).
* Fixed some bugs resulting on the above being corrected.
2021-08-17 13:52:06 -03:00
PouleyKetchoupp
d034c1b0fa One-directional layer check for Area vs. RigidBody/SoftBody/Area
Same thing that was already done for rigid body and character body
collision detection.
2021-08-17 09:32:00 -07:00
TechnoPorg
b097e7f510 Vulkan: Fix CanvasItem::use_parent_material
The "Use Parent Material" option now does something when enabled on a CanvasItem. As before, it's not just limited to a node's direct parent but can move up the tree until it finds a material.
Also corrected a typo in rendering_device_vulkan.h that didn't merit its own commit.
2021-08-17 09:08:56 -06:00
Yuri Roubinsky
c1cd0fe6d1 Removed RESTART built-in from start particle shader function 2021-08-17 15:13:16 +03:00
Yuri Roubinsky
06add309d7 Fix incorrect uniform buffer size for particles 2021-08-17 13:33:28 +03:00
LoipesMas
4e6e25eae7 Epsilon check for angular velocity in Body3DSW 2021-08-16 20:05:48 +02:00
Juan Linietsky
d5a30431b9
Merge pull request #51635 from reduz/further-mobile-optimizations
More optimizations on the mobile renderer.
2021-08-16 14:50:52 -03:00
Rémi Verschelde
43440228db
Merge pull request #51645 from fabriceci/improve-physics-api
API improvement on the physics (CharacterBody and related classes)
2021-08-16 17:05:08 +02:00