Commit graph

2918 commits

Author SHA1 Message Date
Bastiaan Olij
173105596e Adding a tracking confidence state to XRPose 2022-01-20 10:35:50 +11:00
Haoyu Qiu
314f309035 Add DisplayServer.clipboard_has() to check clipboard content 2022-01-19 23:44:20 +08:00
Rémi Verschelde
cba2fd2e80
Revert "Add new scaling modes for splash screen"
This reverts commit fcc9f5ce39.

The feature is good but the implementation still needs more work.
A new PR will be made with a rework of this commit.
2022-01-19 16:09:52 +01:00
Yuri Roubinsky
e0304f83e7 Add translation links to shader errors 2022-01-19 15:16:32 +03:00
Rémi Verschelde
8b8e858778
Merge pull request #54489 from briansemrau/texture-delete-update 2022-01-19 10:10:54 +01:00
Rémi Verschelde
74b110a736
Merge pull request #56825 from bruvzg/macos_fix_fullscr_multiwindow 2022-01-19 10:03:17 +01:00
Samuel Pedrajas
fcc9f5ce39
Add new scaling modes for splash screen
Removes the `fullsize` option which is superseded by `stretch_mode`.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-01-18 23:29:11 +01:00
Rémi Verschelde
01eefa2c50
Merge pull request #56761 from Calinou/sdfgi-allow-any-number-of-cascades 2022-01-18 16:21:39 +01:00
Yuri Roubinsky
366d3930ac
Merge pull request #56893 from Chaosus/shader_unify_vardecl 2022-01-18 14:13:56 +03:00
bruvzg
d62ca0c9c0 Window management improvements.
[macOS] Fix transient windows not working in the full-screen mode.
[macOS] Fix moving transient windows to the other screen than parent window.
[macOS] Fix popup menu switch on hover.
[macOS] Use content origin rect for windows position (to ensure `DS.mouse_get_position` is equal to `DS.window_get_position` + mouse position from the input events).
[macOS] Fix incorrect input coordinates, when external display with different scaling in connected/disconnected.
[macOS/Windows] Fix moving fullscreen windows between the screens.
Add auto refocusing of the parent window, when the focused transient window is closed.
Remove redundant `DS.mouse_get_absolute_position` function (returns mouse position in the screen coordinates, same as `DS.mouse_get_position`).
2022-01-18 11:47:03 +02:00
Yuri Roubinsky
36a82c8c69 Unify variable and array declarations in shaders 2022-01-18 12:42:39 +03:00
clayjohn
ba431a9306 Fix volumetric fog memory leak on resize 2022-01-17 21:30:48 -08:00
Hugo Locurcio
2dc7b03a82
Allow using between 1 and 8 cascades for SDFGI
This provides more flexibility between performance and quality
adjustments, especially when using SDFGI for small-scale levels
(which can be useful for procedurally generated scenes).
2022-01-17 16:49:02 +01:00
Rémi Verschelde
57ad84537d
Merge pull request #56860 from bruvzg/icu_case 2022-01-17 14:28:38 +01:00
Rémi Verschelde
8bdef23f7f
Merge pull request #56012 from bruvzg/wt🤎4 2022-01-17 13:26:15 +01:00
bruvzg
e02a097280
[TextServer] Implement locale and context sensitive case conversion functions. 2022-01-17 14:23:36 +02:00
Haoyu Qiu
7870cf24f2 Fix invalid read when using LightOccluder2D 2022-01-17 16:02:26 +08:00
Hugo Locurcio
d6c7d4ab5d
Fix visible background line in intersections in screen-space reflections
Adjusting the step grading by one resolves the issue without affecting
performance or introducing adverse artifacts.
2022-01-16 18:08:07 +01:00
Rémi Verschelde
a27b85378b
Merge pull request #56309 from Calinou/remove-pvrtc-support 2022-01-16 11:15:34 +01:00
clayjohn
abd0003e4c Remove mistakenly added push constant from SSR 2022-01-15 17:03:55 -08:00
Yuri Roubinsky
08208406ca Refactor size expression parsing for arrays in the shaders 2022-01-15 15:47:39 +03:00
Hugo Locurcio
40be15920f
Remove support for PVRTC texture encoding and decoding
On the only platform where PVRTC is supported (iOS),
ETC2 generally supersedes PVRTC in every possible way. The increased
memory usage is not really a problem thanks to modern iOS' devices
processing power being higher than its Android counterparts.
2022-01-14 21:08:22 +01:00
bruvzg
89f37d4105
Add support for getting native display, window, and view handles. 2022-01-14 13:36:32 +02:00
Yuri Roubinsky
0845b25497 Fix shader crashing when declaring matrix or array varyings 2022-01-14 10:37:39 +03:00
luz paz
858bcd5058 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,inh,inout,leapyear,lod,nd,numer,ois,ony,paket,ro,seeked,sinc,switchs,te,uint,varn,vew`
2022-01-13 23:20:01 -05:00
Yuri Roubinsky
4201af6649 Fix completion for global constants in shaders 2022-01-13 19:52:06 +03:00
Yuri Roubinsky
c377891145 Add completion for shader_type 2022-01-13 18:37:13 +03:00
Yuri Roubinsky
b0356bcb72 Prevent redefinition of main functions in shader 2022-01-13 15:12:35 +03:00
Rémi Verschelde
a987ebfde2
Merge pull request #56714 from bruvzg/fix_alignment_break_overrun 2022-01-13 10:20:02 +01:00
bruvzg
baec983d8a
[TextServer] Improvements for line breaking, "Fill" alignment, overrun, and interaction between these modes.
Fix "Fill" alignment processing wrong side of the text if overrun trim was applied.
Improve "Fill" alignment to avoid adding excessive subsequent spaces or elongations.
Add font detection to the overrun, to correctly add ellipsis (was using last glyph font, which doesn't necessary have dot character).
Improve line breaking to avoid adding excessive subsequent soft break points for languages without word separator.
Port missing overrun/justification code to the Fallback text server.
Fix inferred text direction detection by controls.
Add tests for "Fill" alignment and line breaking glyph flags.
2022-01-13 08:53:28 +02:00
clayjohn
9b1f242feb Fix cannot use gaussian blur error 2022-01-12 21:58:37 -08:00
Rémi Verschelde
586a973b6b
Merge pull request #56169 from dkaste/fix-clip-rects
Fix canvas items being drawn outside clip rects
2022-01-12 23:59:42 +01:00
Rémi Verschelde
585231a172
Merge pull request #56492 from akien-mga/remove-author-docstrings 2022-01-12 15:24:17 +01:00
Yuri Roubinsky
422f7b280f Optimize include files to improve shader_language.h compilation speed 2022-01-12 14:19:12 +03:00
Rémi Verschelde
bfd0afca58
Merge pull request #55656 from clayjohn/GLSL3-compiler 2022-01-12 11:33:48 +01:00
Rémi Verschelde
189662e5bd
Merge pull request #56696 from AnilBK/use-init-lists 2022-01-12 10:04:45 +01:00
clayjohn
99064d57db New OpenGL batching canvas renderer 2022-01-11 22:26:18 -08:00
Anilforextra
6c3a0460a8 Use List Initializations for Vectors. 2022-01-12 10:15:12 +05:45
Rémi Verschelde
d40d86b959
Merge pull request #56667 from Ice-Cube69/fix_incorrect_property_types 2022-01-11 14:34:18 +01:00
Arnav Vijaywargiya
0c46f73b5e Fixed incorrect property types 2022-01-11 17:17:11 +05:30
Rémi Verschelde
267bee934a
Merge pull request #56416 from BastiaanOlij/fix_xr_viewport_size_overrule
Fix XR viewport size overrule and incorrect usage of internal size
2022-01-11 08:44:36 +01:00
Rémi Verschelde
04fa320650
Merge pull request #56627 from Chaosus/shader_better_limit_warning 2022-01-10 14:06:54 +01:00
Darren Kaste
b0d9e14155 Fix canvas items being drawn outside clip rects 2022-01-09 18:15:46 -05:00
bruvzg
c89c515ccf
[TextServer] Improve ligature cursor handling.
Fix mid-grapheme hit test.
Fix OpenType features property handling, add default features override option.
Enable mid-grapheme cursor by default.
2022-01-09 19:03:48 +02:00
Yuri Roubinsky
bd61d8f80c Enhances a shader uniform limit warning 2022-01-08 21:44:37 +03:00
Anilforextra
c9f5d88f3a Use fill() to fill an entire image instead of setting pixels individually. 2022-01-08 17:43:15 +05:45
Rémi Verschelde
9e97262132
Merge pull request #56170 from Calinou/renderingserver-expose-gi-half-resolution 2022-01-07 00:05:43 +01:00
Rémi Verschelde
5e7faed078
Merge pull request #56540 from Calinou/renderingserver-expose-ssil-quality
Expose RenderingServer SSIL quality setter methods
2022-01-06 20:26:59 +01:00
SaracenOne
cd842b65bf Fix queueing a texture and regular uniform update in RD backend in succession. 2022-01-06 16:05:07 +00:00
Hugo Locurcio
221efffdf7
Expose RenderingServer SSIL quality setter methods
This allows changing SSIL quality at run-time in a project.
2022-01-06 02:35:49 +01:00
Rémi Verschelde
cbf8757289
Merge pull request #56522 from akien-mga/navigation-restore-safe-get_singleton 2022-01-05 17:10:21 +01:00
Rémi Verschelde
b23552922f
NavigationServer: Restore constness for thread safe get_singleton
This was removed by mistake in #47024, NavigationServer uses internal
mutability for thread safety, and removing `const` breaks the contract.
2022-01-05 15:41:21 +01:00
Fernando Cosentino
ca79373d13
Added material_overlay property to MeshInstance3D
Applying overlay materials into multi-surface meshes currently
requires adding a next pass material to all the surfaces, which
might be cumbersome when the material is to be applied to a range
of different geometries. This also makes it not trivial to use
AnimationPlayer to control the material in case of visual effects.
The material_override property is not an option as it works
replacing the active material for the surfaces, not adding a new pass.

This commit adds the material_overlay property to GeometryInstance3D
(and therefore MeshInstance3D), having the same reach as
material_override (that is, all surfaces) but adding a new material
pass on top of the active materials, instead of replacing them.
2022-01-05 11:47:51 +01:00
JFonS
7c5c351766
Merge pull request #56220 from williamd67/GPULightmapper-implement-sky-ambient-light
GPULightmapper: react on sky ambient properties
2022-01-05 10:55:05 +01:00
Rémi Verschelde
e976cd0b29
Merge pull request #56208 from williamd67/GPULightmapper-sky-upside-down 2022-01-05 10:51:19 +01:00
Rémi Verschelde
c7bbb3a621
Merge pull request #56278 from GanidhuAbey/dof_msaa_bug 2022-01-05 10:47:27 +01:00
bruvzg
679fe92bb3
Fix incorrect format and buffer used for bone weights. 2022-01-05 08:44:59 +02:00
Rémi Verschelde
ba2bdc478b
Style: Remove inconsistently used @author docstrings
Each file in Godot has had multiple contributors who co-authored it over the
years, and the information of who was the original person to create that file
is not very relevant, especially when used so inconsistently.

`git blame` is a much better way to know who initially authored or later
modified a given chunk of code, and most IDEs now have good integration to
show this information.
2022-01-04 20:42:50 +01:00
Rémi Verschelde
eab30316ee
Merge pull request #55332 from Calinou/voxelgidata-tweak-default-dynamic-range
Decrease the default dynamic range in VoxelGIData to 2.0
2022-01-04 17:18:28 +01:00
Rémi Verschelde
3a5a3473be
Merge pull request #54791 from NHodgesVFX/master
[4.x] add more OpenGL attributes
2022-01-04 16:52:27 +01:00
Yuri Roubinsky
bba9d9be14
Merge pull request #56486 from Chaosus/shader_fix_render_mode 2022-01-04 18:44:11 +03:00
Rémi Verschelde
095c72b03e
Merge pull request #55790 from Calinou/renderingserver-add-device-type-getter
Add `RenderingServer.get_video_adapter_type()` method
2022-01-04 16:43:23 +01:00
Rémi Verschelde
851fb16350
Merge pull request #56305 from Calinou/rename-lod-threshold 2022-01-04 15:28:06 +01:00
Rémi Verschelde
ff211c8e5a
Merge pull request #55386 from Calinou/allow-disable-depth-prepass 2022-01-04 15:25:11 +01:00
Yuri Roubinsky
5123ffe4a7 Fix world_vertex_coords render mode usage in the shaders 2022-01-04 17:06:12 +03:00
JFonS
e432181dc3
Merge pull request #55418 from Calinou/voxelgi-dynamic-map-use-16-bit-depth
Use 16-bit depth to improve dynamic VoxelGI performance
2022-01-04 14:17:47 +01:00
Yuri Roubinsky
b74968c2ca
Merge pull request #56477 from Chaosus/fix_device_crash 2022-01-04 13:23:38 +03:00
Rémi Verschelde
7f66c16c03
Merge pull request #51206 from clayjohn/Vulkan-ASSGI 2022-01-04 10:00:17 +01:00
Rémi Verschelde
34de6d16aa
Merge pull request #54409 from clayjohn/VULKAN-glow-flicker 2022-01-04 09:59:07 +01:00
Yuri Roubinsky
0e2ef987b1 Add a check for device in shader lang to prevent startup editor crash 2022-01-04 11:50:50 +03:00
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