Commit Graph

2644 Commits

Author SHA1 Message Date
Rémi Verschelde 3e3300637e
Merge pull request #55281 from bruvzg/mvk_fog_volumes 2021-11-24 16:59:20 +01:00
bruvzg 5e0a034524
[macOS / iOS] Use storage buffers instead of unsupported images for the volumetric fog on MoltenVK. 2021-11-24 09:16:16 +02:00
Lightning_A e078f970db Rename `remove()` to `remove_at()` when removing by index 2021-11-23 18:58:57 -07:00
Yuri Roubinsky c7043dbfdc Prevent return statement from using in block in shader main functions 2021-11-23 10:36:33 +03:00
Brennen Green 37993f0c0c Add wakeup() conditional if previous gravity was 0 2021-11-22 12:03:50 -05:00
Yuri Sizov e85e6ec7fc Add methods to get position from column and line in TextEdit 2021-11-22 15:13:13 +03:00
Marcel Admiraal 1d1ceca6b4 Add area to moved list when changing monitorable,
and only remove area from query when deleting pair if it was monitorable.
2021-11-20 06:57:34 +00:00
Yuri Roubinsky f4c0e90fd9 Allow passing non-variable constant to const function param in shaders 2021-11-19 12:14:13 +03:00
Rémi Verschelde fa11b45961
Merge pull request #55084 from JFonS/fix_depth_prepass
Fix Depth-Prepass transparency mode
2021-11-18 17:39:46 +01:00
Rémi Verschelde 3f9c24a8d7
Merge pull request #55085 from JFonS/transparency_fixes
Fix transparency state initialization
2021-11-18 17:17:20 +01:00
jfons 4c4b6620a0 Fix Depth-Prepass transparency mode
Add mising bits of implementation and ensure depth-prepass objects are
only rendered in the transparency pass.
2021-11-18 12:49:46 +01:00
Rémi Verschelde c6555cafa5
Merge pull request #55074 from nekomatata/fix-soft-body-gravity 2021-11-18 09:27:23 +01:00
PouleyKetchoupp ea52c68337 Fix applied gravity on soft bodies
Regression fix, gravity was accumulated between frames after some
changes around area gravity calculation.

Also got rid of unused member and method in soft body class.
2021-11-17 17:59:26 -07:00
PouleyKetchoupp d630269593 Fix contact generation with backface collision disabled
Replaced the previous implementation for backface collision handling (in
test_axis function from SAT algorithm) with much simpler logic in the
collision generation phase with face shapes, in order to get rid of
wrong contacts when backface collision is disabled.

Now it just ignores the generated collision if the contact normal is
against the face normal, with a threshold to keep edge contacts.

Added a special case for soft bodies to invert the collision instead of
ignoring it, because for now it's the best solution to avoid soft bodies
to go through concave shapes (they use small spheres). This might be
replaced with a better algorithm for soft bodies later.
2021-11-17 17:57:02 -07:00
PouleyKetchoupp 43ff9ad86f Fix rest_info returning no result with high margin and low motion
Apply the same logic as in test_body_motion to make sure the minimum
allowed depth doesn't filter out all contacts in this case.
2021-11-17 11:47:30 -07:00
Rémi Verschelde c30aa372ca
Merge pull request #55029 from clayjohn/VULKAN-SRGB
Add SHADER_IS_SRGB define to Vulkan renderer
2021-11-17 08:46:23 +01:00
clayjohn 358820c4b7 Fix SRGB conversions in Vulkan Renderer 2021-11-16 20:56:13 -08:00
Camille Mohr-Daurat 7d1b454b67
Merge pull request #55036 from nekomatata/bvh-fix-update
Fix physics BVH pairing for teleported or fast moving objects
2021-11-16 17:59:21 -07:00
PouleyKetchoupp afb9e2d9b7 Fix physics BVH pairing for teleported or fast moving objects
Updating the broadphase to find new collision pairs was done after
checking for collision islands, so it was working in most cases due to
the pairing margin used in the BVH, but in case of teleported objects
the narrowphase collision could be skipped.

Now it's done before checking for collision islands, so we can ensure
that broadphase pairing has been done at the same time as objects are
marked as moved so their collision can be checked properly.

This issue didn't happen in the Octree/HashGrid because they do nothing
on update and trigger pairs directly when objects move instead.
2021-11-16 14:51:37 -07:00
Hugo Locurcio 8fb7e622a6
Rename built-in `SGN()` macro to `SIGN()`
This matches the name of the GDScript function (except it's uppercase
here).
2021-11-16 20:40:49 +01:00
Yuri Roubinsky df3b42411d Fix broken light_compute in mobile renderer 2021-11-13 17:24:31 +03:00
Brian Semrau 716e15cd26 Fix multimesh still drawing when visible instances is zero 2021-11-12 21:51:14 -05:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
jfons dbf20f58a0 Fix transparency state initialization 2021-11-12 12:11:57 +01:00
Yuri Roubinsky 826e781bfa Fix default_texture_param in shader pipeline to support uniform arrays 2021-11-12 12:53:40 +03:00
Rémi Verschelde 13769aebe9
Merge pull request #54867 from Chaosus/shader_fix_light_albedo
Fix shader crashing when using `ALBEDO` or `ALPHA` in light function
2021-11-12 08:35:53 +01:00
Camille Mohr-Daurat 11e03ae7f0
Merge pull request #54810 from nekomatata/area-separate-override-modes
Separate space override modes for gravity/damping in Area
2021-11-11 15:11:21 -07:00
Yuri Roubinsky a45ae7b1c7 Fix shader crashing when using `ALBEDO` or `ALPHA` in light function 2021-11-11 11:59:30 +03:00
PouleyKetchoupp c3ae7ddedd Add raycast options to hit when starting inside / hit back faces
Makes the results consistent for all shape types with options to set
the desired behavior.
2021-11-10 17:43:35 -07:00
Rémi Verschelde 5cc0ad5393
Merge pull request #54783 from ator-dev/fix-override-exposure 2021-11-10 18:45:04 +01:00
PouleyKetchoupp bfd0d33244 Fix errors in CharacterBody when floor is destroyed or removed
In all physics servers, body_get_direct_state() now silently returns
nullptr when the body has been already freed or is removed from space,
so the client code can detect this state and invalidate the body rid.

In 2D, there is no change in behavior (just no more errors).

In 3D, the Bullet server returned a valid direct body state when the
body was removed from the physics space, but in this case it didn't
make sense to use the information from the body state.
2021-11-10 08:27:33 -07:00
PouleyKetchoupp 3d1c123d45 Separate space override modes for gravity/damping in Area
Also make inspector clearer for gravity point properties.
2021-11-09 10:29:24 -07:00
Rémi Verschelde 9444a3f01d
Merge pull request #54736 from Chaosus/shader_fix_uniform 2021-11-09 08:25:12 +01:00
Camille Mohr-Daurat c6062cd93e
Merge pull request #54134 from nekomatata/body-center-of-mass-local
Expose local center of mass in physics servers
2021-11-08 18:44:51 -07:00
PouleyKetchoupp fc8c766ef9 Expose local center of mass in physics servers
Center of mass in body's local space is more useful than the transformed
one in some cases, like drawing its position for debug.

It's especially useful to get the generated local center of mass when
in auto mode (by default).

Physics Server BODY_PARAM_CENTER_OF_MASS:
Now always returns the local center of mass, instead of setting a local
center of mass and getting a transformed one.
This causes compatibility breaking, but it makes more sense for the
parameter to be consistent between getter and setter.

Direct Body State:
There are now two properties, because both of them can be useful in
different situations.
center_of_mass: relative position in global coordinates (same as before)
center_of_mass_local: position in local coordinates
2021-11-08 16:17:57 -07:00
Rémi Verschelde 5968653662
Merge pull request #46721 from bruvzg/custom_word_break_punct 2021-11-09 00:13:59 +01:00
Rémi Verschelde d9a74fd07f
Merge pull request #54372 from bruvzg/text_edit_ui 2021-11-09 00:13:25 +01:00
Dominic-ATOR d7a4187b05 Implement CameraEffects override_exposure 2021-11-08 21:14:56 +00:00
Rémi Verschelde e87687a6d0
Merge pull request #54486 from ibrahn/thread-work-pool-lazier 2021-11-08 13:39:39 +01:00
Yuri Roubinsky bbfa5f29c7 Pushes array of uniforms to first place in the buffer to prevent bug 2021-11-07 23:30:09 +03:00
Brian Semrau dc11e73bf0 Rename AABB `get_area` to `get_volume` 2021-11-05 18:22:42 -04:00
Camille Mohr-Daurat 70c82d9d3d
Merge pull request #54642 from BoilingFusion/master
Fix the volume calculation for cylinders
2021-11-05 15:08:57 -07:00
Rémi Verschelde 13aaa73124
Merge pull request #54573 from nekomatata/query-parameters 2021-11-05 21:52:39 +01:00
Julian Adamse 03903fdeec Fix the volume calculation for cylinders 2021-11-05 20:49:14 +01:00
Brian Semrau ac24070056 Use Callable in RS::request_frame_drawn_callback 2021-11-05 01:59:38 -04:00
PouleyKetchoupp acbd24ea84 Use parameter classes instead of arguments for all physics queries
Same as what is already done for shape queries, applied to point and ray
queries. Easier to document and more flexible to add more parameters.

Also expose intersect_point method to script in 3D.
Remove intersect_point_on_canvas in 2D, replaced with a parameter.
2021-11-04 11:44:39 -07:00
Hugo Locurcio c012fbc8b2
Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`
This is consistent with other constants that include `NO`,
such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-11-03 23:06:17 +01:00
rafallus 770e3a8e51 Use `Callable` in Area monitor callback 2021-11-01 21:53:17 -06:00
Ibrahn Sahir 151d2e34ca ThreadWorkPool no longer starts worker threads if given zero work. 2021-11-01 19:19:25 +00:00
Camille Mohr-Daurat a57de3b818
Merge pull request #37880 from nekomatata/rigid-body-damping-override
Improved RigidDynamicBody linear/angular damping override
2021-11-01 11:24:01 -07:00