Commit Graph

3048 Commits

Author SHA1 Message Date
Rémi Verschelde 370f0a162d
Merge pull request #55424 from Calinou/voxelgi-remove-unused-struct-fields
Remove unused struct fields in VoxelGIData
2022-01-04 09:50:00 +01:00
Rémi Verschelde a97889abe4
Merge pull request #55422 from Calinou/gi-shader-remove-unused-define
Remove unused code in GI shaders
2022-01-04 09:49:42 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Yuri Roubinsky fd9c92d4ab Add a shader warning when the uniform buffer limit is exceeded 2022-01-03 16:24:56 +03:00
Rémi Verschelde 9221c0f8ad
Merge pull request #56190 from Chaosus/shader_varying_pass_to_func 2022-01-03 13:08:55 +01:00
Rémi Verschelde c6c834e745
Merge pull request #56187 from Chaosus/fix_default_texture 2022-01-03 13:08:25 +01:00
Rémi Verschelde cd38b42987
Merge pull request #56370 from Chaosus/fix_shader_instance_uniform 2022-01-03 13:06:18 +01:00
luz paz a124f1effe Fix various typos
Found via ` codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint,varn`
Update editor/import/resource_importer_layered_texture.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update doc/classes/TileSetScenesCollectionSource.xml

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/graph_edit.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/rich_text_label.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Revert previously committed change
2022-01-02 01:03:58 -05:00
Bastiaan Olij 9fe7565014 Fix XR viewport size overrule and incorrect usage of internal size 2022-01-02 11:17:36 +11:00
Yuri Roubinsky ab239e9abb Fix incorrect updating global uniform buffer 2021-12-31 13:31:01 +03:00
Hugo Locurcio df09bc38cb
Rename Lod Threshold to Mesh Lod Threshold
This makes it more obvious that the setting only affects mesh LOD,
not manual (H)LOD achieved using visibility ranges.
2021-12-29 00:11:50 +01:00
GanidhuAbey 133486bfba fixed depth of field bug with msaa 2021-12-26 23:13:47 -08:00
William Deurwaarder 68a5dad226 GPULightmapper: react on sky ambient properties
The panorama texture creation, used by GPULightmapper, has been adjusted to
also take the sky ambient properties into account.
2021-12-24 15:47:42 +01:00
William Deurwaarder 246fbd5442 GPULightmapper: cube to panorama copy function flip y based on flag
Cube to panorama copy function unconditionally flipped y, while other copy functions flipped y base on FLAG_FLIP_Y. Condition is added.
2021-12-24 00:47:42 +01:00
Yuri Roubinsky 108b6a2000 Allow pass varyings as out param to the function, when it's possible 2021-12-23 18:03:19 +03:00
Yuri Roubinsky 8e5008dfbd Fix default texture of unassigned sampler with hint_normal 2021-12-23 11:15:46 +03:00
Hugo Locurcio bf339842a5
Expose RenderingServer GI half resolution setter method
This is required for projects to be able to change the
GI half-resolution setting at run-time.
2021-12-22 19:38:48 +01:00
Yuri Roubinsky e8a457ba89 Refactor render_mode in shaders, forbid declaring duplicates 2021-12-21 22:20:09 +03:00
Fabio Alessandrelli e880294d9f [Headless] Workaround texture load failure.
Some assets are loaded based on OS/server feature detection, namely
textures (but potentially others).
The ResourceImporter will fail to load a texture if the OS reports not
supporting it. The OS, in turn, checks texture format support via the
RenderingServer.
This commit makes the dummy rasterizer report known texture formats as
supported (although unused), so that scenes can be correctly loaded when
they include references to imported textures.
2021-12-20 09:18:26 +01:00
bruvzg ea5bb8b47d
[Windows] Improve console handling and execute/create_process.
Always build with the GUI subsystem.
Redirect stdout and stderr output to the parent process console.
Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with `create_process`).
Add `open_console` argument to the `execute` and `create_process` to open a new console window.
Remove `interface/editor/hide_console_window` editor setting.
Remove `Toggle System Console` menu option.
Remove `set_console_visible` and `is_console_visible` functions.
2021-12-18 10:14:07 +02:00
Rémi Verschelde be83968b6b
Merge pull request #55970 from Chaosus/shader_fix_struct_warning 2021-12-16 13:35:44 +01:00
Yuri Roubinsky 1414a7be91 Fix struct usage passing to shader warning system 2021-12-15 22:54:46 +03:00
Yuri Roubinsky f0a58af12f Rename shader hint `filter_anisotropy` to `filter_anisotropic` 2021-12-15 22:12:38 +03:00
Yuri Roubinsky 25a2241e7d Fix shader array parsing in variable declaration 2021-12-15 17:54:15 +03:00
Rémi Verschelde de8348a9b3
Merge pull request #55903 from Chaosus/shader_struct 2021-12-15 13:07:48 +01:00
Rémi Verschelde 864ccb5776
Merge pull request #55913 from Chaosus/fix_shader_crash 2021-12-15 13:07:34 +01:00
Yuri Roubinsky 09185d76ac Rename shader hint `filter_aniso` to `filter_anisotropy` 2021-12-15 13:18:32 +03:00
Hugo Locurcio e962900f23
Rename and reorder bake mode properties for consistency
The order now goes from least to most computationally expensive:

- Disabled
- Static
- Dynamic
2021-12-14 12:01:12 +01:00
Yuri Roubinsky 3cbd8ef098 Fix shader crash when assigned array from struct to a variable by index 2021-12-13 21:19:13 +03:00
Yuri Roubinsky 31cc6ba622 Allow declaring multiple members in one expression in shader structs 2021-12-13 19:10:08 +03:00
Yuri Roubinsky 8862d1426d Restore shader parsing errors with lack of semicolon in a block 2021-12-11 17:30:40 +03:00
Camille Mohr-Daurat f1ca14cc8d
Merge pull request #55736 from nekomatata/physics-apply-forces
Improve RigidDynamicBody force and torque API
2021-12-10 17:16:28 -07:00
Camille Mohr-Daurat c6fe431a02
Merge pull request #55773 from nekomatata/fix-raycast-ccd
Fix rigid body ray cast CCD in 2D and 3D Godot Physics
2021-12-10 17:16:02 -07:00
PouleyKetchoupp 30a608b7b9 Fix rigid body ray cast CCD in 2D and 3D Godot Physics
For 2D:
Raycast CCD now works the same as in 3D, it changes the body's velocity
to place it at the impact position instead of generating a contact point
that causes a wrong push back.

For both 2D and 3D:
The raycast CCD process reads and modifies body velocities, so it needs
to be moved to pre_solve() instead of setup() to be processed linearly
on the main thread, otherwise multithreading can cause some CCD results
to be randomly lost when multiple collisions occur.
2021-12-10 16:25:14 -07:00
PouleyKetchoupp 940f3fde5c Improve RigidDynamicBody force and torque API
Makes the API for forces and impulses more flexible, easier to
understand and harmonized between 2D and 3D.

Rigid bodies now have 3 sets of methods for forces and impulses:
-apply_impulse() for impulses (one-shot and time independent)
-apply_force() for forces (time dependent) applied for the current step
-add_constant_force() for forces that keeps being applied each step

Also updated the documentation to clarify the different methods and
parameters in rigid body nodes, body direct state and physics servers.
2021-12-10 15:55:40 -07:00
Rémi Verschelde 0ba7103bea
Merge pull request #55702 from nekomatata/physics-solver-settings 2021-12-10 22:10:41 +01:00
Hugo Locurcio 92e9cca5be
Rename `hint_aniso` to `hint_anisotropy` in the shader language
The word "anisotropy" is used in full form in BaseMaterial3D's
anisotropy-related properties.
2021-12-10 17:41:17 +01:00
Hugo Locurcio b3174e7af9
Add `RenderingServer.get_video_adapter_type()` method
This can be used to distinguish between integrated, dedicated, virtual
and software-emulated GPUs. This in turn can be used to automatically
adjust graphics settings, or warn users about features that may run
slowly on their hardware.
2021-12-10 17:10:47 +01:00
Yuri Roubinsky 85380c5207
Merge pull request #55623 from Chaosus/shader_refactor_const_suffix 2021-12-10 17:01:43 +03:00
Yuri Roubinsky bcbcf14469 Refactor constant suffix parsing in a shader 2021-12-10 15:38:27 +03:00
Rémi Verschelde 7e720b43ad
Merge pull request #55762 from nekomatata/body-motion-no-margin 2021-12-10 11:04:32 +01:00
Rémi Verschelde f455660e93
Merge pull request #55572 from aaronfranke/ci-double 2021-12-10 10:02:38 +01:00
Yuri Roubinsky dcf3594500
Merge pull request #55763 from Chaosus/shader_hint_completion 2021-12-10 11:44:01 +03:00
Rémi Verschelde bdf8340e59
Merge pull request #43181 from nathanfranke/string-empty
Replace String comparisons with "", String() to is_empty()
2021-12-10 08:56:31 +01:00
Yuri Roubinsky b66510d509 Added completion for uniform hints in a shader 2021-12-10 10:12:25 +03:00
PouleyKetchoupp 0c354047e1 Handle test body motion with 0 margin
Margin needs to have a high enough value for test body motion to work
properly (separate using the margin, move without then gather rest info
with the margin again).

Fixes issues with test motion returning no collision in some cases with
margin equal to 0.
2021-12-09 10:52:27 -07:00
Rémi Verschelde f0b5cd51b6
Merge pull request #55714 from Geometror/fix-fog-spotlight 2021-12-09 18:05:17 +01:00
Aaron Franke e9808e3d9a
Add a double-precision editor build to CI 2021-12-09 09:52:48 -06:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Nathan Franke 41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
Hendrik Brucker 1da732af35 Fix volumetric fog in combination with spotlights 2021-12-08 22:17:09 +01:00
Yuri Roubinsky 76f6c0849c Make `compile` shader function to use struct instead long parameter list 2021-12-08 11:34:40 +03:00
Hugo Locurcio c5550108c8
Decrease the default dynamic range in VoxelGIData to 2.0
This reduces visible banding in indirect lighting and reflections.
Sharp reflections now match more closely the original scene.

The downside of this change is that clipping may appear in reflections
in extremely bright scenes, but this should not be a concern in most
scenes.
2021-12-08 00:28:17 +01:00
PouleyKetchoupp 8682adcb87 Add physics solver settings to project settings
Helps with discovery and setup of physics solver settings, in a specific
project settings section for both 2D and 3D.

Other changes for cleanup:
-Removed unused space parameters in 3D
SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO
SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS
-Added custom solver bias for Shape3D (same as Shape2D)
-Improved documentation for solver settings
2021-12-07 12:08:04 -07:00
Rémi Verschelde 46d384060e
Merge pull request #35901 from nathanfranke/pool-byte-array-subarray-exclusive 2021-12-07 14:00:59 +01:00
Rémi Verschelde 7ac9ea75cc
Rename `VideoPlayer` to `VideoStreamPlayer` for consistency
It's a player for `VideoStream` resources, just like `AudioStreamPlayer` is a
player for `AudioStream` resources.

Closes https://github.com/godotengine/godot-proposals/issues/3624.
2021-12-06 19:01:28 +01:00
Rémi Verschelde 4bce5e302e
Merge pull request #55602 from nekomatata/improve-rigidbody-contacts 2021-12-06 16:49:42 +01:00
Hugo Locurcio 89ec3d3bc7
Remove or make verbose some debugging prints
The message about SpatialMaterial conversion was turned into a warning,
as it can potentially interfere with porting projects from Godot 3.x
(if there's a bug in the conversion code).
2021-12-05 23:22:23 +01:00
PouleyKetchoupp 2273a78af1 Update space parameters in 2D and 3D
Clarified space parameters for contacts and added missing ones.

List of changes:
-Add contact bias to space parameters
-Add solver iterations to space parameters, instead of a specific
physics server function
-Renamed BODY_MAX_ALLOWED_PENETRATION to CONTACT_MAX_ALLOWED_PENETRATION
to make it consistent with other contact parameters
2021-12-03 12:01:38 -07:00
PouleyKetchoupp 5cbc7149a1 Improve RigidDynamicBody contacts in 2D and 3D
Changed the algorithm for solving contacts to keep previous contacts as
long as they are under the max separation threshold to keep contact
impulses more consistent and contacts more stable.

Also made 2D consistent with 3D and changed some default parameters:
-Contact bias is now 0.8 instead of 0.3 to avoid springy contacts
-Solver iterations are 16 instead of 8 by default for better stability

Performance considerations:
Tested with stress tests that include lots of contacts from overlapping
bodies.
3D: There's no measurable difference in performance.
2D: Performance is a bit lower (close to 10% slower in extreme cases)
The benefit for 2D physics to be much more stable outweighs the slight
decrease in performance, and this could be alleviated by changing the
algorithm to use jacobians for contact solving to help with cache
efficiency and memory allocations.
2021-12-03 10:40:15 -07:00
Yuri Roubinsky 10b10ae1fa Fix `^=` operator in shaders 2021-12-03 10:20:44 +03:00
Rémi Verschelde 892a5a72cd
Merge pull request #55474 from akien-mga/copy-operators-no-reference 2021-12-02 17:34:45 +01:00
Rémi Verschelde 1398436ab8
Merge pull request #53904 from ChristopheClaustre/bugfix_shader_compile_spirv_from_source 2021-12-02 10:07:35 +01:00
Rémi Verschelde 81b7418013
Merge pull request #55402 from TokageItLab/fixed-immediatemesh-minimum-aabb
Fixed minimum size of `AABB` in `ImmediateMesh` to draw only one vertex
2021-12-02 08:05:56 +01:00
Silc 'Tokage' Renew ca2b7a87a5 Fixed minimum size of aabb in ImmediateMesh to draw only one vertex 2021-12-02 08:33:33 +09:00
Yuri Roubinsky 5ee73dc5a6 Fix shader crash when using existed constant name for struct 2021-12-01 18:11:45 +03:00
Yuri Roubinsky a48c205191 Fix declaring array size twice in global shader constant 2021-12-01 16:44:25 +03:00
Yuri Roubinsky 5ba93619fa Allow using empty statements in the shader, added formatting warning 2021-12-01 11:52:25 +03:00
Rémi Verschelde 5643f5e616
Merge pull request #55490 from Chaosus/fix_shader_crash 2021-11-30 20:13:12 +01:00
Rémi Verschelde bdd118e765
Merge pull request #55431 from Chaosus/shader_fix_constants 2021-11-30 19:40:52 +01:00
Yuri Roubinsky be7c03779a Fix shader crash when assigning array to non-array in global constant 2021-11-30 21:28:55 +03:00
Rémi Verschelde 7da392bcc5
Don't return reference on copy assignment operators
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.

According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.

This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
2021-11-30 16:26:29 +01:00
Yuri Roubinsky 5b4d8545ed Fix `INDEX` built-in in a process function of particle shader 2021-11-29 12:54:24 +03:00
Yuri Roubinsky 6e80e97b0f Fix built-in(PI, TAU, E) assignment to a global constant in a shader 2021-11-29 10:32:36 +03:00
Hugo Locurcio 36106dba3b
Remove unused struct fields in VoxelGIData
This reduces the struct size from 112 bytes to 96 bytes.
2021-11-28 23:09:51 +01:00
Hugo Locurcio 0beacf2ce8
Remove unused code in GI shaders 2021-11-28 22:58:54 +01:00
Hugo Locurcio 565f9c0448
Use 16-bit depth to improve dynamic VoxelGI performance
In a complex scene with several dynamic emissive objects, this
saves over 1 ms of GPU time on a GTX 1080 in 2560×1440.
2021-11-28 18:51:36 +01:00
Hugo Locurcio 989a7d9270
Allow disabling the depth prepass in the Vulkan Clustered backend
In scenes that have little to no overdraw, disabling the depth prepass
can give a small performance boost. Nonetheless, in most other scenarios,
the depth prepass should be left enabled as it improves performance
significantly.
2021-11-27 17:54:45 +01:00
Nathan Franke dd30253cdc
PackedByteArray, Array slice end exclusive, rename subarray to slice 2021-11-26 22:13:12 -06:00
Yuri Roubinsky 0f1f002e74 Fix `TIME` using in custom functions of particle shader 2021-11-26 19:03:01 +03:00
Rémi Verschelde 4813abc6e7
Merge pull request #55311 from Chaosus/fix_uniform_array
Fix uniform array alignment to fix a bug
2021-11-26 08:25:14 +01:00
Rémi Verschelde a5f878d884
Merge pull request #55325 from Calinou/fsr-use-warn-print 2021-11-26 00:14:23 +01:00
Rémi Verschelde dc585e2050
Merge pull request #55313 from nekomatata/bounce-energy-stability 2021-11-25 23:07:28 +01:00
Rémi Verschelde ca70756238
Merge pull request #55310 from Ev1lbl0w/fix_headless_window_errors 2021-11-25 22:52:55 +01:00
Hugo Locurcio 079ae6a03f
Use `WARN_PRINT_ONCE()` for FSR-related warning messages
`print_error()` should generally not be used directly. Also,
falling back is best done by printing a warning message instead
of an error message.
2021-11-25 22:47:11 +01:00
Yuri Roubinsky 43d999e346 Fix uniform array alignment to fix a bug 2021-11-25 23:38:08 +03:00
Hugo Locurcio c73a51fd55
Remove disabled debug code in ClusterBuilderRD 2021-11-25 20:28:50 +01:00
PouleyKetchoupp 7032cf0637 Fix RigidDynamicBody gaining momentum with bounce
Bounce calculation now uses the previous frame's velocity, so it's
consistent with the actual motion of the bodies involved and not the
yet-to-be-applied forces.

When bounce is 1, using the current velocity was causing the new forces
(including gravity) to be taken into account, which lead to the bounce
velocity to be higher than the falling velocity at the moment of impact,
adding more and more energy over time.
2021-11-25 09:51:57 -07:00
Ricardo Subtil 11caecb755 Added more empty definitions for headless display server 2021-11-25 16:28:23 +00:00
Yuri Roubinsky 9b1f8f7a96 Revert "Pushes array of uniforms to first place in the buffer" 2021-11-25 16:13:19 +03:00
bruvzg b7e6e50dd2
[macOS / iOS] Use non atomic operation to store facing bits on MoltenVK. 2021-11-25 12:43:45 +02:00
Rémi Verschelde 547c270777
Merge pull request #51679 from Je06jm/fsr
AMD FidelityFX Super Resolution
2021-11-24 22:34:48 +01:00
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
Je06jm 20deb0917d Implemented AMD's FSR as a computer shader for upscaling 3D scenes 2021-11-23 14:16:03 -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
chris.clst 038be68649
Merge branch 'godotengine:master' into bugfix_shader_compile_spirv_from_source 2021-11-14 03:23:22 +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
Brian Semrau f123a79170 Make draw/compute lists threadsafe
Lock the rendering device while command buffers are in use
2021-11-11 13:55:09 -05: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
ChristopheClaustre cc39ba5509 rendering_device: if one compiles with at least on stage without sources, it was always returning an unusable bytecode (because errored) 2021-11-09 22:53:30 +01: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
NHodgesVFX dbe366a830 add more OpenGL attributes 2021-11-08 20:12:11 -05: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
clayjohn 0eff109a21 Added SSIL post processing effect 2021-11-06 12:43:19 -07:00
Hugo Locurcio 91aa7cf1da
Decrease the default VoxelGI quality to improve performance
On a GeForce GTX 1080 in 2002×1447 resolution, decreasing VoxelGI quality
from High to Low quality saves 1.2 ms of GPU time in a medium-sized
test scene. This only results in a minor drop in quality.
2021-11-06 19:40:52 +01: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
Brian Semrau 4a1c28460e Fix materials not updating when texture replaced/deleted 2021-11-01 15:33:59 -04: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
Rémi Verschelde 02ae47154c
Merge pull request #54356 from Chaosus/shader_fix_matrix_autocompletion 2021-11-01 14:06:04 +01:00
Rémi Verschelde d86b680e07
Merge pull request #54480 from timothyqiu/texture-replace 2021-11-01 12:56:05 +01:00
Haoyu Qiu 10818cfc10 Fix memory leak when using CurveTexture.set_texture_mode 2021-11-01 18:57:59 +08:00
Rémi Verschelde 210e6cc167
Merge pull request #54459 from rxlecky/fix-multimesh-buffer-overflow-53603 2021-11-01 11:18:11 +01:00
SeleckyErik 6b04f08b28 Fix multimesh buffer overflow in RendererStorageRD 2021-10-31 18:48:51 +01:00
Rémi Verschelde 1aef3a42b2
Merge pull request #54448 from CakHuri/treshold-to-threshold
Repair mistyped of 'threshold' on several files.
2021-10-31 18:32:18 +01:00
Rémi Verschelde 16dc607f8a
Merge pull request #54307 from Calinou/add-opengl-renderer-squash
Add OpenGL renderer (squashed)
2021-10-31 18:30:38 +01:00
M. Huri 4052d85d05 Repaired mistyped of 'threshold' on several files. 2021-10-31 22:11:42 +07:00
Clay John 8a10bb7d0d
Use OpenGL 3.3 core profile instead of compatibility profile
- Rename OpenGL to GLES3 in the source code per community feedback.
  - The renderer is still exposed as "OpenGL 3" to the user.
- Hide renderer selection dropdown until OpenGL support is more mature.
  - The renderer can still be changed in the Project Settings or using
    the `--rendering-driver opengl` command line argument.
- Remove commented out exporter code.
- Remove some OpenGL/DisplayServer-related debugging prints.
2021-10-31 15:56:45 +01:00
bruvzg 3f33e1d7d6 Add functions for getting name and font style from dynamic and bitmap fonts.
Add font selection toolbar editor plugin.
2021-10-31 12:40:58 +02:00
Rémi Verschelde d6f972fad4
Merge pull request #54403 from briansemrau/fix-small-fogvolume
FogVolume don't dispatch compute with zero-dimension groups
2021-10-31 09:12:10 +01:00
Brian Semrau 8f75ad4df2 Don't use Texture image caches if they are rendered to 2021-10-30 13:34:39 -04:00
Rémi Verschelde 6b0b1a4c04
Merge pull request #54405 from JFonS/fix_instance_index
Fix instance index in forward clustered shader
2021-10-30 14:22:22 +02:00
Brian Semrau 346e497959 Disallow compute dispatch with zero dimensions. 2021-10-30 02:39:25 -04:00
clayjohn 4d1d2b3900 Weight glow samples to reduce fireflies 2021-10-29 21:41:57 -07:00
jfons 6db13d3231 Fix instance index in forward clustered shader 2021-10-30 02:53:09 +02:00
Hugo Locurcio ce97ddbcb1
Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3
- Use lowercase driver names for the `--rendering-driver`
  command line argument.
2021-10-30 02:05:49 +02:00
lawnjelly e3491a3744
Add GLES2 2D renderer + Linux display manager
First implementation with Linux display manager.

- Add single-threaded mode for EditorResourcePreview (needed for OpenGL).

Co-authored-by: clayjohn <claynjohn@gmail.com>
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
2021-10-30 02:05:48 +02:00
Yuri Roubinsky 4da0de0085 Fix error spammed to output if `FogVolume` is setted to scene 2021-10-29 23:24:01 +03:00
Yuri Roubinsky a6ddfecc9f Fix crash when opening a converted `FogMaterial` 2021-10-29 14:18:38 +03:00
clayjohn 1b2cd9f251 Addition of FogVolumes, FogShaders, FogMaterial, and overhaul of VolumetricFog
Co-authored-by: Brian Semrau <brian.semrau@gmail.com>
2021-10-28 22:02:23 -07:00
Yuri Roubinsky 04a2053f9b Removed incorrect autocompletion of matrixes in shader 2021-10-28 20:21:18 +03:00
Rémi Verschelde f7d852b532
Merge pull request #54350 from akien-mga/clang-format-dont-align-operands 2021-10-28 17:10:52 +02:00
Rémi Verschelde e2deec67b9
Merge pull request #54222 from JFonS/instance-fade 2021-10-28 16:05:55 +02:00
Rémi Verschelde 3a6be64c12
clang-format: Various fixes to comments alignment from `clang-format` 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde 3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
bruvzg 63f3051154 Implement TextServer `strip_diacritics` function. 2021-10-28 10:12:57 +03:00
Joan Fons 95bc9c40d9 Fix shadow disabling on mobile renderer 2021-10-26 15:37:22 +02:00
PouleyKetchoupp daf7dcac7a Improved RigidDynamicBody linear/angular damping override
Damping values are now non-negative.

Add new properties linear_damp_mode and angular_damp_mode to set the way
RigidDynamicBody and PhysicalBone (2D & 3D) use damping values.
It can now be Combine (default) to add to the default/areas, or Replace
to override the value completely (current behavior).
2021-10-25 18:22:12 -07:00
reduz d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
jfons c46d1ea2b2 Fix shadow disabling settings
Fixes the SHADOW_CASTING_SETTING_OFF setting in
GeometryInstance3D and the "shadows_disabled" render
mode in spatial materials, which were not working
before.
2021-10-25 16:11:32 +02:00
JFonS c571e4a7f4 Implement distance fade and transparency
The built-in ALPHA in spatial shaders comes pre-set with a per-instance
transparency value. Multiply by it if you want to keep it.

The transparency value of any given GeometryInstance3D is affected by:
   - Its new "transparency" property.
   - Its own visiblity range when the new "visibility_range_fade_mode"
     property is set to "Self".
   - Its parent visibility range when the parent's fade mode is
     set to "Dependencies".

The "Self" mode will fade-out the instance when reaching the visibility
range limits, while the "Dependencies" mode will fade-in its
dependencies.

Per-instance transparency is only implemented in the forward clustered
renderer, support for mobile should be added in the future.

Co-authored-by: reduz <reduzio@gmail.com>
2021-10-25 11:39:34 +02:00
jfons 88d9914519 Fix state inconsistencies in visibility dependencies. 2021-10-25 11:37:53 +02:00
Rémi Verschelde b2ab5cb504
Merge pull request #54045 from ConteZero/primary_clipboard_linux_fix_warning 2021-10-23 19:13:34 +02:00
Hugo Locurcio 970bed62ab
Decrease the default soft shadow quality to improve performance
Soft shadows are relatively expensive to filter. However, with the
default blur factors, it's not needed to use too many samples
(unless PCSS-like shadows are used with a large size). Textures
and screen-space antialiasing can also be used to mask the noise
pattern effectively.

On a GeForce GTX 1080, going from Medium to Low for both shadow types
saves 0.2-0.4 ms of GPU time per frame in 2560×1440 resolution.
This can translate to significantly higher savings on lower-end GPUs.

Given how the shader works, this improves rendering performance
even if lights with shadows are never used.
2021-10-23 16:32:38 +02:00
ConteZero 8c48b4a7e0 Fix primary clipboard warning 2021-10-23 15:50:01 +02:00
Camille Mohr-Daurat d47481f190
Merge pull request #54124 from Uxeron/CenterOfMassRotationFix
Fix physics body rotating incorrectly around it's center of mass
2021-10-22 12:58:18 -07:00
Rémi Verschelde f7e6ebcdb1
Merge pull request #54131 from nekomatata/fix-2d-body-center-of-mass-auto 2021-10-22 21:34:35 +02:00
Uxeron 2275e26476 Fix physics body rotating incorrectly around it's center of mass 2021-10-22 21:23:54 +03:00
PouleyKetchoupp 0a04602835 Fix RigidDynamicBody2D auto center of mass calculation
Should be changing the local center of mass, which is then transformed
into `center_of_mass`.
It was causing the center of mass to be always in (0,0) by default with
multiple shapes.
2021-10-22 11:08:53 -07:00
Rémi Verschelde 3bebbcacdb
Merge pull request #53992 from Calinou/hard-shadow-mapping-allow-dithering 2021-10-22 19:34:09 +02:00
Rémi Verschelde 9f7218eb69
Merge pull request #54088 from madmiraal/remove-unimplemented-methods 2021-10-22 12:59:32 +02:00
Rémi Verschelde fe3d62f2dc
Merge pull request #54110 from nekomatata/fix-rigid-body-update-collision-layer 2021-10-22 12:06:30 +02:00
PouleyKetchoupp d804c34285 Fix RigidDynamicBody collision update after changing collision layer/mask
Changing the collision layer of a sleeping body was not triggering area
updates correctly.

Bodies need to be active for collision to be checked against already
overlapping bodies and areas.

Neighbors need to be activated too in order to handle the case where a
static body is modified (it can't be activated directly but paired
bodies need to check their collision again).

In 3D, moved the call to wakeup() from the physics server to
GodotBody3D::_shapes_changed to make it consistent with 2D and also
handle the case where shapes are modified (_shapes_changed is called in
both this case and collision layer changes).
2021-10-21 17:36:58 -07:00
Yuri Roubinsky bbcf8ac672
Merge pull request #54082 from Chaosus/fix_shader_crash 2021-10-21 21:19:24 +03:00
Marcel Admiraal 87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
Rémi Verschelde 836f86688f
Merge pull request #54053 from nekomatata/fix-soft-body-disable-mode
Fix SoftDynamicBody3D crash when setting disable mode
2021-10-21 19:33:01 +02:00
Yuri Roubinsky 57fd362fe1 Prevent shader crash when passing constant expression to `textureGather` 2021-10-21 19:46:05 +03:00
Hugo Locurcio e87ec8ec17
Add Soft Very Low shadow quality mode for 3D
This can be used to improve 3D shadow rendering quality at little
performance cost. Unlike the existing Hard setting which is limited
to variable shadow blur only, it works with both fixed blur and
variable blur.
2021-10-21 18:34:26 +02:00
Yuri Roubinsky cacfb22365
Merge pull request #54063 from Chaosus/shader_fix_spatial_samplers 2021-10-21 19:12:43 +03:00
PouleyKetchoupp e6f7235ffb Fix SoftDynamicBody3D crash when setting disable mode
Proper logic for changing physics state when disabled and disabled mode
is changed (it was unnecessarily making calls to re-initialize physics).

Extra error handling in soft body implementations to avoid crashes with
invalid mesh.
2021-10-21 08:56:12 -07:00
Rémi Verschelde 194b72821d
Merge pull request #54011 from nekomatata/center-of-mass-2d-transform 2021-10-21 11:41:56 +02:00
Yuri Roubinsky 9142df46b3 Fix built-in texture samplers passing for spatial shader mode 2021-10-21 12:32:32 +03:00
Yuri Roubinsky 5a354aaf6d Prevent a rendering crash and error spam for uniform texture array 2021-10-20 21:30:27 +03:00
Rémi Verschelde da98357e6e
doctool: Fix differences between headless and Vulkan rendering backends
Fixes #53913.
2021-10-20 17:48:50 +02:00
Rémi Verschelde 8748247d6f
Merge pull request #53702 from ConteZero/primary_clipboard_linux 2021-10-20 16:35:04 +02:00
Bastiaan Olij 6794b6f10b Fix double _get_tracking_status declaration 2021-10-20 17:39:08 +11:00
PouleyKetchoupp c1577e5a3f Fix 2D center of mass not updated from transform
Same logic as what was done in 3D, applied to 2D center of mass.

Also did some minor cleanup in 3D and fixed center of mass transform
during the first frame after teleporting a dynamic body.
2021-10-19 16:22:30 -07:00
Rémi Verschelde 244faf5588
Merge pull request #53972 from zedutch/fix-shader-time-update
Fix shaders using `TIME` not continuously updating
2021-10-19 16:37:55 +02:00
Rémi Verschelde 85a8939fa2
Merge pull request #53790 from briansemrau/remove-distant-shadowy-void 2021-10-19 15:17:09 +02:00
Bastiaan Olij 96b707215d Add support for returning the play area from XRInterface 2021-10-19 21:17:04 +11:00
Rémi Verschelde 4387f9645b
Merge pull request #52940 from groud/toast_notification 2021-10-19 09:57:13 +02:00
Rémi Verschelde 483df71120
Merge pull request #53980 from nekomatata/rename-godot-physics-classes 2021-10-19 08:24:02 +02:00
Rémi Verschelde 723b988fde
Merge pull request #52210 from BastiaanOlij/enhance_xr_trackers 2021-10-19 08:11:32 +02:00
Rémi Verschelde fbd701a128
Merge pull request #53960 from Klowner/audioserver-startplaybackstream-potential-leak 2021-10-19 08:09:45 +02:00
PouleyKetchoupp cc39dca9f7 Rename Godot Physics classes from *SW to Godot*
Also moved MT physics server wrappers to the main servers folder, since
they don't have to be implementation specific.
2021-10-18 17:01:10 -07:00
Robin Arys 0e31465a59 Fix shaders that use TIME do not force editor to continuously update 2021-10-18 22:53:20 +02:00
Haoyu Qiu 2200544141 Validate enum range in RendererViewport::viewport_get_render_info 2021-10-18 22:58:38 +08:00
Mark Riedesel 61ab63a4be fix potential memory leak of AudioStreamPlaybackBusDetails in AudioServer::start_playback_stream() 2021-10-18 10:47:11 -04:00
ConteZero 838c9d37b4 Added primary clipboard for Linux 2021-10-18 14:01:06 +02:00
Yuri Roubinsky 26a26d6657 Fix errors on quitting from an empty project 2021-10-18 14:24:03 +03:00
bruvzg 7c4fbc31a6 [TextServer] Use `round` instead of `floor` for hex code box size calculation to better match font size. 2021-10-18 11:02:49 +03:00
Bastiaan Olij 5d1ea92daf Rework XR positional trackers 2021-10-17 12:12:20 +11:00
mennomax b4eeeb315a
Swap args of Plane(point, normal) constructor
Now (normal, point)
2021-10-15 20:49:42 -05:00
Brian Semrau c4513d5add Rename RD::free binding to free_rid 2021-10-15 15:35:05 -04:00
Rémi Verschelde 5a276443bd
Merge pull request #53815 from Chaosus/fix_wireframe_render_mode 2021-10-15 16:19:36 +02:00
Yuri Roubinsky 31ad85881d Fix `wireframe` render mode 2021-10-15 06:53:52 +03:00
Brian Semrau e9f1b0a0b2 Remove incorrect fog height density remapping 2021-10-14 16:09:45 -04:00
Brian Semrau 4fefd7cddd Fix several issues with directional shadows
- Internally disable blend splits in orthogonal directional shadow mode
- Fix soft shadows ignoring fade and blend_splits
- Fix soft shadow edge stability
2021-10-14 11:44:32 -04:00
Gilles Roudière 0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
Brian Semrau a62e240260 Fix the height fog effect 2021-10-14 04:08:39 -04:00
Yuri Roubinsky e9b7ffd1fa Added few more built-ins to shader language 2021-10-13 20:27:36 +03:00
Rémi Verschelde 88463c3eee
Merge pull request #53712 from CakHuri/nullptr
Replace NULL with nullptr
2021-10-12 22:30:43 +02:00
M. Huri 033dc4dbef Replaced NULL with nullptr 2021-10-12 20:20:19 +07:00
Aaron Franke 7e51e4cb84
Fix some LGTM errors of "Multiplication result converted to larger type" 2021-10-12 00:17:27 -05:00
Yuri Roubinsky db2ee03fff Fix shader crash on using METALLIC and ROUGHNESS built-ins in light func 2021-10-11 13:35:53 +03:00
Rémi Verschelde b47580a7a4
Merge pull request #53641 from DeeJayLSP/audio_pitch_fix 2021-10-11 09:22:49 +02:00
Douglas Leão 39a90751dc Allow AudioStreamPlayer(2D) to provide `pitch_scale` on playback 2021-10-10 18:52:29 -03:00
Rémi Verschelde 09b0293fad
Merge pull request #53066 from Chaosus/shader_funcs 2021-10-10 21:37:07 +02:00
Joan Fons 8ab7ca4b32 Fix auto LOD generation for blendshapes. 2021-10-09 20:31:28 +02:00
Rémi Verschelde 5ae569560d
Fix missing argument names in bindings
While at it, tweak some boolean setters to use `p_enabled` for the bool.

Also renames `draw_minimap()` to `set_draw_minimap()`.
2021-10-09 00:20:10 +02:00
Hugo Locurcio 73c6e19acc
Allow any floating-point value as a 3D rendering scale option
This allows for finer control over 3D rendering resolution.
Supersampling can also be performed by setting a 3D rendering
resolution above 1.0, which is useful for offline rendering or
for very high-end GPUs.
2021-10-08 18:22:10 +02:00
Rémi Verschelde 96767c18f8
Merge pull request #53527 from Chaosus/shader_array 2021-10-08 12:37:05 +02:00
Yuri Roubinsky b1ac3e256f Allow declare the shader arrays with a size defined before identifier 2021-10-08 10:28:31 +03:00
Rémi Verschelde a6c4de49e1
Merge pull request #53523 from Calinou/remove-occlusion-color 2021-10-07 22:26:10 +02:00
Hugo Locurcio 265bae824f
Remove unimplemented `Environment.ambient_light_occlusion_color` property
This property was intended to provide a way to have SSAO or VoxelGI
ambient occlusion with a color other than black. However, it was
dropped during the Vulkan renderer development due to the performance
overhead it caused when the feature wasn't used.
2021-10-07 17:47:52 +02:00
Hugo Locurcio bcf4a56c74
Replace references to VisualServer in code comments with RenderingServer
VisualServer no longer exists in the `master` branch.
2021-10-07 15:49:41 +02:00
Yuri Roubinsky e707391fb8 Fix shader crash when passing array to index expression 2021-10-07 10:48:32 +03:00
Yuri Roubinsky 410cab4c61
Merge pull request #53491 from Chaosus/shader_fix_texture_array_uniforms 2021-10-07 10:00:12 +03:00
Rémi Verschelde 149e10da1c
Merge pull request #53504 from clayjohn/VULKAN-sky-bug
Remove bogus sky error check
2021-10-07 08:09:01 +02:00
Rémi Verschelde 3f94a5ebe7
Merge pull request #51115 from clayjohn/VULKAN-SSAO-radius
Move assignment of SSAO radius push constant
2021-10-07 08:04:17 +02:00
clayjohn 23dc490f40 Remove bogus sky error check 2021-10-06 22:04:56 -07:00
Yuri Roubinsky b5028da5c0 Fix regression which prevents using texture array uniforms 2021-10-06 22:31:07 +03:00
Yuri Roubinsky be6f36a66d Add missing shader built-ins 2021-10-05 20:50:26 +03:00
Rémi Verschelde 08eee3a669
Merge pull request #53425 from Chaosus/shader_fix 2021-10-05 13:06:32 +02:00
Yuri Roubinsky 7c07ae4c50 Fix shader crash when passing array.length to functions
and similar cases
2021-10-05 12:49:59 +03:00
Rémi Verschelde 6637207c70
Merge pull request #53420 from nekomatata/fix-tilemap-moving-platform 2021-10-05 10:50:56 +02:00
Yuri Roubinsky 0e1f4628f4
Merge pull request #53412 from Chaosus/shader_fix_uniform_arrays 2021-10-05 06:56:58 +03:00
Camille Mohr-Daurat 4778770d3c
Merge pull request #53365 from danger-dan/wakeup_fix
Use wakeup() function to wake sleeping bodies on impulse, force and velocities. Fix for PR #52967
2021-10-04 18:03:35 -07:00
Daniel 243f235300 Changed from directly waking bodies to using the wakeup() functions in direct body state changes (forces, impulses and veloicities). this 'bug' was introduced in PR #52967
added wakeup to 2d direct body
2021-10-05 13:17:05 +13:00
Yuri Roubinsky 69ece73653 Fix syntax parsing error of uniform arrays declaration in shader 2021-10-04 23:19:43 +03:00
PouleyKetchoupp 4f8d761be6 Fix physics glitch with TileMap moving platforms
Added a parameter in test_body_motion to exclude attached objects from
collision, used to avoid collision with all TileMap tiles with moving
platform motion instead of just the one tile the character touches.

Same changes made in 3D for consistency, and handling potential similar
cases.
2021-10-04 12:27:42 -07:00
Rémi Verschelde 5b270278c8
Merge pull request #53280 from nekomatata/test-body-motion-parameters 2021-10-04 21:05:38 +02:00
PouleyKetchoupp 3ae5687d48 Script interface improvements for test body motion
-Physics servers test body motion use a class to hold parameters instead
of multiple arguments to make it more readable and flexible since there
are many options
-Improved documentation for test body motion and kinematic collision
-Removed read-only properties for body motion results (not handled in
scripts, so they should be get_ methods only instead)
2021-10-04 10:49:10 -07:00
Rémi Verschelde a2361851dc
Merge pull request #53398 from nekomatata/soft-body-index-check
Fix remaining crashes with pinned vertices in GodotPhysics Soft Body
2021-10-04 19:21:08 +02:00
Yuri Roubinsky 87e7f793e4
Merge pull request #49485 from Chaosus/shader_uniform_arrays 2021-10-04 19:16:19 +03:00
PouleyKetchoupp f9702cc8d0 Fix crashes with pinned vertices in GodotPhysics Soft Body 2021-10-04 08:45:27 -07:00
Rémi Verschelde 2a09e11986
Merge pull request #52802 from V-Sekai/gltf-extensions 2021-10-04 15:52:24 +02:00
Yuri Roubinsky 6873ecaaf9 Added support for uniform arrays in shaders 2021-10-04 13:57:44 +03:00
Haoyu Qiu f3816898fa Fix crash when pinned SoftBody point is out of range 2021-10-04 16:42:53 +08:00
K. S. Ernest (iFire) Lee 1463fc889b GLTF for game templates.
Convert GLTF Document to use ImporterMeshInstance3D.

Add a GLTFDocument extension list and an extension for converting the importer mesh instance 3d to mesh instance 3d.

Use GLTF module when the editor tools are disabled.

Modified the render server to be less restrictive on matching blend arrays and have more logging.

Misc bugs with multimesh.

Always index the meshes.
2021-10-03 12:37:52 -07:00
Rémi Verschelde a88e82078d
Merge pull request #42364 from madmiraal/fix-39887 2021-10-03 13:41:25 +02:00
bruvzg 27e9d07f11 Remove Scene dependency from the TextServer, use scalable hex box font instead of built-in bitmap one. 2021-10-03 00:22:10 +03:00
Camille Mohr-Daurat fdd25d7c84
Merge pull request #53311 from nekomatata/soft-body-remove-mesh-reference
Remove scene code in physics servers
2021-10-01 09:56:49 -07:00
PouleyKetchoupp b8eeb34b4e Remove scene code in physics servers
Replaced Mesh with mesh RID in Godot Physics 3D and Bullet.
2021-10-01 08:42:47 -07:00
bruvzg daa613333e [Text Server] Add support for user defined punctuation list, used for word breaking. 2021-10-01 16:45:16 +03:00
bruvzg 0c0b5c84b0 Implement TextServer GDExtension interface, remove TextServer GDNative interface. 2021-10-01 15:13:29 +03:00
Rémi Verschelde a7011fa294
Merge pull request #52684 from Frixuu/master 2021-10-01 11:53:01 +02:00
Rémi Verschelde 6ed3e9c182
Merge pull request #53208 from timothyqiu/headless-crash 2021-10-01 11:29:19 +02:00
Lightning_A c63b18507d Use range iterators for `Map` 2021-09-30 15:09:12 -06:00
Camille Mohr-Daurat 1c0ae31c9e
Merge pull request #53266 from nekomatata/remove-shape-metadata
Remove shape metadata from 2D physics server
2021-09-30 12:11:50 -07:00
Juan Linietsky c370b4c4d0
Merge pull request #52544 from JFonS/lod_fixes
Auto LOD fixes and improvements
2021-09-30 14:49:11 -03:00
PouleyKetchoupp d0ec46be68 Remove shape metadata from 2D physics server
Shape metadata was only used to get tile information when colliding with
tilemaps. It's not needed anymore since there's an API in tilemap using
body ids instead.
2021-09-30 10:45:36 -07:00
Hugo Locurcio ba65730cbf
Rename RID's `getornull()` to `get_or_null()` 2021-09-29 23:58:02 +02:00
Manuel Dun 485eac3d3f radial fog fix 2021-09-29 15:49:59 -04:00
Haoyu Qiu 9dd0d3f550 Don't memcpy to nullptr even if length is zero 2021-09-29 20:58:14 +08:00
Rémi Verschelde 4c1d2e9350
Merge pull request #53199 from Geometror/fix-skeleton2d 2021-09-29 13:47:12 +02:00
Haoyu Qiu 82f7f2c46c Fix crash in headless mode 2021-09-29 17:24:53 +08:00
Camille Mohr-Daurat 341b532d5e
Merge pull request #52754 from nekomatata/dynamic-body-modes
Clarify RigidDynamicBody modes
2021-09-28 17:11:17 -07:00
Hendrik Brucker 6a9f3746af Fix editor freeze when asigning Skeleton2D to Polygon2D 2021-09-29 01:50:01 +02:00
Rémi Verschelde 4296539d94
Merge pull request #53072 from CaptainProton42/fix-gpuparticles3d-generate-aabb 2021-09-28 16:20:22 +02:00
Bastiaan Olij 0320532876
Merge pull request #52864 from BastiaanOlij/xr_extension_return_buffers
Fix access to render target texture for XR interfaces
2021-09-28 20:19:20 +10:00
Rémi Verschelde 60988a06c2
Merge pull request #52953 from nekomatata/fix-collision-recovery-depth 2021-09-28 12:11:38 +02:00
Bastiaan Olij cbdde9dff9 Fix access to render target texture for XR interfaces 2021-09-28 19:46:50 +10:00
PouleyKetchoupp bf523a2b2a Improved logic for CharacterBody collision recovery depth
Allows 2D character controller to work without applying gravity when
touching the ground (also more safely in 3D), and collision detection
is more flexible with different safe margin values.

Character body motion changes in 2D and 3D:
-Recovery only for depth > min contact depth to help with collision
detection consistency (rest info could be lost if recovery was too much)
-Adaptive min contact depth (based on margin) instead of space parameter

Extra CharacterBody changes:
-2D: apply changes made in 3D for stop on slope and floor snap that help
fixing some jittering cases
-3D: fix minor inconsistencies in stop on slope and floor snap logic
2021-09-27 15:31:41 -07:00
jfons 9e1810695c Auto LOD fixes and improvements
* Fixed LODs for shadow meshes.
* Added a merging step before simplification. This helps with tesselated
  meshes that were previously left untouched. The angle difference at
  wich edges ar considered "hard" can be tweaked as an import setting.
* LODs will now start with the highest decimation possible and keep
  doubling (approximately) the number of triangles from there. This
  makes sure that very low triangle counts are included when possible.
* Given more weight to normal preservation.
* Modified MeshOptimizer to report distance-based error instead of
  including attributes in the reported metrics.
* Added attribute transference between the original mesh and the
  various LODs. Right now only normals are taken into account,
  but it could be expanded to other attributes in the future.
2021-09-27 17:04:56 +02:00
CaptainProton42 1731030b3c Fix GPUParticles3D local_coords 2021-09-26 00:30:37 +02:00
CaptainProton42 dd70daafba Fix GPUParticles3D generate AABB 2021-09-26 00:30:37 +02:00
Anilforextra cdd912c48e Construct values only when necessary. 2021-09-25 14:46:45 +05:45
Rémi Verschelde fb4fadfd1e
Merge pull request #52967 from danger-dan/dev_vehicle_sleep_fix 2021-09-24 11:47:15 +02:00
Daniel e8efe621d5 Added set_active(true) to all body direct state force apply/impulses. #52915 2021-09-24 17:22:51 +12:00
Anilforextra cc51b045da Construct values only when necessary. 2021-09-23 22:26:07 +05:45
Yuri Roubinsky e9e21a592e Prevents editor crash when compare with negative float in shader 2021-09-22 13:26:40 +03:00
fabriceci fd9e573ba6 Port 2D improvement to move and slide 3D
Co-authored-by: Camille Mohr-Daurat <pouleyketchoup@gmail.com>
2021-09-22 00:14:04 +02:00
Rémi Verschelde ba57252bd8
Merge pull request #52878 from AnilBK/add-get-center 2021-09-21 21:30:30 +02:00
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