Commit graph

3924 commits

Author SHA1 Message Date
clayjohn
e5abca4990 Only disable depth writing in opaque pipelines
This restores the behaviour of the visibility fade
2023-01-09 09:45:43 -08:00
Pedro J. Estébanez
5ca2ba45f1 Make inclusion of Godot version in shader hash universal 2023-01-09 17:47:02 +01:00
Rémi Verschelde
e7905f4f48
Merge pull request #71045 from reduz/use-bitfield-in-core-types
Use BitField<> in core type masks
2023-01-09 08:33:26 +01:00
smix8
9802914f97 Add NavigationServer Performance Monitor
Adds Performance Monitor for NavigationServer3D.
2023-01-08 22:58:21 +01:00
Rémi Verschelde
378d589e2d
Merge pull request #71037 from reduz/array-format-bitfield
Use BitField<> hint for Mesh.ArrayFormat and Control.SizeFlags
2023-01-08 22:51:03 +01:00
Rémi Verschelde
c3c5eceb35
Merge pull request #70463 from DarkKilauea/nav-server-const
[4.x] Rework const on NavigationServer methods
2023-01-08 22:50:05 +01:00
Rémi Verschelde
1e32a286f3
Merge pull request #70281 from CherrySodaPop/get-impulse-3d
Implement collision impulse in Godot Physics 3D
2023-01-08 22:40:06 +01:00
Juan Linietsky
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
Juan Linietsky
47592927b3 Use BitField<> hint for ArrayFormat
This was missing in the conversion of bitflags to BitField<>.
2023-01-08 18:47:48 +01:00
Lily Garcia
8ee6264cc9 Implement collision impulse in Godot Physics 3D 2023-01-07 22:34:28 -05:00
Josh Jones
a0715b30f9 Rework const on NavigationServer methods
`const` is used on all methods, even when they cause modification of the server.  This reworks the methods of the server to only use `const` on method that don't change the state of the server.
2023-01-07 17:29:00 -08:00
Rémi Verschelde
d642274f75
Merge pull request #70939 from bruvzg/win_screen_2
Add support for the custom initial screen for the main window, fix primary screen detection.
2023-01-07 13:21:36 +01:00
Rémi Verschelde
57540ae00d
Merge pull request #70858 from Malcolmnixon/fast-concave-support
Optimize GodotConvexPolygonShape3D::get_support
2023-01-07 13:17:39 +01:00
bruvzg
2718a7b7d3
Add support for the custom initial screen for the main window, fix primary screen detection. 2023-01-07 11:14:35 +02:00
Bastiaan Olij
9b549231e4 Move luminance effect into its own class and use new buffers system 2023-01-07 14:40:42 +11:00
Rémi Verschelde
163f6f5fe8
Merge pull request #68429 from KoBeWi/PropertySettings
Add PropertyInfo overload for GLOBAL_DEF
2023-01-06 22:59:29 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Rémi Verschelde
a5e43daca1
Merge pull request #70929 from clayjohn/RD-mobile
Use proper indices for lights, decals, and reflection probes in mobile scene shader
2023-01-05 12:57:46 +01:00
Rémi Verschelde
0668b64c32
Merge pull request #70924 from clayjohn/canvas-bg-bugs
Always try to clear render target before drawing 3D with Canvas BG mode
2023-01-05 12:57:39 +01:00
clayjohn
aaa9d626f3 Use proper indices for lights, decals, and reflection probes in mobile scene shader 2023-01-04 14:03:48 -08:00
clayjohn
72bc7e5a9d Always try to clear render target before drawing 3D with Canvas BG mode
This is necessary to ensure that we aren't copying garbage data to the 3D renderbuffer
2023-01-03 15:46:03 -08:00
Rémi Verschelde
0160fea1ce
Merge pull request #70884 from clayjohn/Depth-prepass
Ignore depth draw optimization when using depth draw alpha prepass
2023-01-03 23:23:29 +01:00
Rémi Verschelde
698ee56e54
Merge pull request #70638 from markusneg/cull-masked-shadows-gd4
Visual instance layers are regarded during shadow culling
2023-01-03 23:22:31 +01:00
clayjohn
062fb8b0dc Ignore depth draw optimization when using depth draw alpha prepass
This is necessary as the scene shader still uses alpha in this case so we can't discard fragments that weren't written to the depth buffer
2023-01-03 12:33:07 -08:00
Rémi Verschelde
8791e333da
Merge pull request #70624 from bruvzg/cur_sc
Improve `window_set_current_screen` and fix secondary window initial mode and positions.
2023-01-03 15:56:05 +01:00
Rémi Verschelde
432c0dee7c
Merge pull request #70708 from rburing/bind_pin_joint_set_param_2d
Bind setter and getter for pin joint parameters in `PhysicsServer2D`
2023-01-03 12:39:43 +01:00
Rémi Verschelde
151e1355e8
Merge pull request #63650 from fabriceci/apply-moving-platform-angular-velocity
Allow to apply the angular velocity of a moving platform
2023-01-03 12:39:35 +01:00
Rémi Verschelde
1b634c06d0
Merge pull request #69972 from adamscott/add-server-checks-before-free
Add safety-checks before some servers `free()`
2023-01-03 12:22:24 +01:00
Rémi Verschelde
6d7f6c1eb9
Merge pull request #70654 from Malcolmnixon/concave_collisions
Fix move_and_collide for concave CharacterBody3D objects
2023-01-03 12:20:11 +01:00
Malcolm Nixon
37e4f8befa Micro-optimizations of the GodotConvexPolygonShape3D::get_support function. Specifically this uses pointer-array-dereference rather than LocalVector<T> dereference as this performs range-checking on known-good indexes.
Added more comments. Changed loops back to classic for-iteration style.
2023-01-02 21:15:46 -05:00
Peter Eastman
d1f95c75cc Analytic sphere-box, sphere-cylinder, and capsule-cylinder collisions 2023-01-02 12:30:16 -08:00
Malcolm Nixon
220e8a0390 Modified the collision_sphere_capsule function to only test the one "correct" axis which corresponds to the correct collision normal.
Added logically identical fix to the capsule/capsule collision, and verified it now produces correct collision points and normals.

Added analytic_sphere_collision helper function which reports the A and B points directly without using SAT.

Modified _collision_sphere_sphere, _collision_sphere_capsule, and _collision_capsule_capsule to use the new analytic_sphere_collision.

Fix white-space issue

Additional code formatting fixes.

Updated new analytic_sphere_collision to correctly handle null collector callback.
2023-01-02 14:52:19 -05:00
Adam Scott
ea33001b95 Add safety-checks before some servers free() 2022-12-29 16:23:38 -05:00
Mikael Hermansson
ba8af83679 Bind methods related to physics query exclusions 2022-12-29 19:29:08 +01:00
Ricardo Buring
6bc313c765 Bind setter and getter for pin joint parameters in PhysicsServer2D 2022-12-29 17:36:08 +01:00
bruvzg
f7955633de
Improve window_set_current_screen and fix secondary window initial mode and positions. 2022-12-29 09:43:39 +02:00
Malcolm Nixon
dfa2a0c9ae Remove unnecessary bail-out if shape A is concave. The test for A being concave is already performed later. 2022-12-27 20:45:43 -05:00
Markus Grafen
041b64ea7e visual instance layers are regarded during shadow culling
Partially cherry-picked from 16517ecb. Todos:
- setting Camera cull_mask should mark affected shadows dirty somehow
2022-12-27 18:43:53 +01:00
Bastiaan Olij
8bf16b0ce5 Fix errors related to reflection probe now using a render buffers object 2022-12-26 22:23:22 +11:00
Rémi Verschelde
f064898956
Merge pull request #70253 from BastiaanOlij/cleanup_sky_render
Cleanup and improve sky render
2022-12-23 23:44:02 +01:00
Rémi Verschelde
d8a0382e3f
Merge pull request #70476 from BastiaanOlij/move_sdfgi_init
Move SDFGI update logic into clustered renderer
2022-12-23 23:43:56 +01:00
Rémi Verschelde
2e07477751
Merge pull request #70214 from Ansraer/speed-maybe
[4.x] Use depth prepass to increase opaque render performance
2022-12-23 23:43:50 +01:00
Ansraer
d44a91c2f7 use depth prepass to increase performance 2022-12-23 17:15:46 +01:00
Mikael Hermansson
c1379523ea Bind methods related to disabling collision between joint bodies 2022-12-23 14:16:33 +01:00
Bastiaan Olij
65ca9e6924 Move SDFGI update logic into clustered renderer 2022-12-24 00:00:11 +11:00
Rémi Verschelde
1cab6c91e9
Merge pull request #69998 from BastiaanOlij/sorting-pivot-4
Added options for sorting transparent objects (port of PR #63040)
2022-12-23 09:47:24 +01:00
Bastiaan Olij
e886a7af81 Cleanup and improve sky render 2022-12-23 19:45:19 +11:00
Bastiaan Olij
6f4f38db07 Added options for sorting transparent objects (port of PR 63040) 2022-12-23 19:30:33 +11:00
Rémi Verschelde
56b828eb82
Merge pull request #70457 from clayjohn/RD-particles-update
Avoid updating particles during 2D rendering
2022-12-23 09:11:58 +01:00
Rémi Verschelde
13850d7812
Merge pull request #70455 from clayjohn/RD-particle-trail
Check for disabled particle trail particle before initializing particle trail
2022-12-23 09:11:48 +01:00
Yuri Rubinsky
f28348fc5c Fix shader crash when using boolean type for vertex->fragment varyings 2022-12-23 07:47:49 +03:00
clayjohn
41021b07be Avoid updating particles during 2D rendering
In 2D the particle uniform set isn't obtained until the render pass. So in 2D just avoid rendering if not updated yet.
2022-12-22 12:04:34 -07:00
clayjohn
4d301ee21e Check for disabled particle trail particle before initializing particle trail 2022-12-22 11:30:59 -07:00
Rémi Verschelde
291add339f
Merge pull request #70422 from clayjohn/RD-trails
Disable particle trails particles when parent parent is not active.
2022-12-21 23:38:04 +01:00
clayjohn
eb10c71d6c Disable particle trails particles when parent parent is not active. 2022-12-21 15:19:57 -07:00
Rémi Verschelde
29464cb9dc
Merge pull request #70418 from clayjohn/RD-particles
Ensure that particles are processed at least once before being used
2022-12-21 22:46:30 +01:00
clayjohn
886cae515c Ensure that particles are processed at least once before being used 2022-12-21 14:06:05 -07:00
Rémi Verschelde
5ad02aa08d
Merge pull request #67111 from DarkKilauea/nav-queries-link
Added signal to NavigationAgent when entering a link
2022-12-21 19:38:20 +01:00
Rémi Verschelde
63f95c0e58
Merge pull request #70366 from quentinguidee/refactoring/fix-double-get-singleton
Fix double get_singleton()
2022-12-21 09:27:02 +01:00
Rémi Verschelde
4f3ec4121a
Merge pull request #70350 from Chaosus/stringname_operator
Add missing != operator to `StringName`
2022-12-21 09:21:32 +01:00
MrBlockers
569ead5762 Add optional arguments to AudioStreamRandomizer
Adds stream and weight parameters to add_stream. By default, weight is
1.0f.
2022-12-20 18:48:02 -05:00
Quentin Guidée
d9c05f7fbd
Fix double get_singleton()
Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com>
2022-12-20 14:26:15 -05:00
Yuri Rubinsky
522d4243bf Add missing != operator to StringName 2022-12-20 17:25:54 +03:00
Rémi Verschelde
f318d60e06
Merge pull request #65376 from reduz/astc-support
Implement basic ASTC support
2022-12-20 12:44:30 +01:00
Juan Linietsky
71d21c7ccb Implement basic ASTC support
Implements basic ASTC support:
* Only 4x4 and 8x8 block sizes.
* Other block sizes are too complex to handle for Godot image compression handling. May be implemented sometime in the future.

The need for ASTC is mostly for the following use cases:
* Implement a high quality compression option for textures on mobile and M1 Apple hardware.
* For this, the 4x4 is sufficient, since it uses the same size as BPTC.

ASTC supports a lot of block sizes, but the benefit of supporting most of them is slim, while the implementation complexity in Godot is very high.
Supporting only 4x4 (and 8x8) solves the real problem, which is lack of a BPTC alternative on hardware where it's missing.

Note: This does not yet support encoding on import, an ASTC encoder will need to be added.
2022-12-20 11:26:30 +01:00
Rémi Verschelde
1dad415131
Merge pull request #70300 from RandomShaper/depth_format
Ensure depth buffer format picked actually supports full intended usage
2022-12-19 17:11:24 +01:00
Rémi Verschelde
adc1096b19
Merge pull request #70219 from bruvzg/msdf_outline_scaling
Scale MSDF font outline with the font size and MSDF source size to match dynamic font behavior.
2022-12-19 16:26:56 +01:00
Rémi Verschelde
f117487ddb
Merge pull request #70236 from quentinguidee/refactor/delete-nullptr
AudioServer: Remove redundant nullptr check before `delete`
2022-12-19 16:26:39 +01:00
Pedro J. Estébanez
d8283550e6 Ensure depth buffer format picked actually supports full intended usage 2022-12-19 16:23:33 +01:00
Rémi Verschelde
e9f3e7111f
Merge pull request #70237 from quentinguidee/refactor/fix-comma-instead-of-semicolon
Fix use of comma instead of semicolon
2022-12-18 16:55:10 +01:00
Quentin Guidée
e0f1e02cc7
Fix use of comma instead of semicolon
Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com>
2022-12-17 20:17:04 -05:00
Quentin Guidée
7465ca9587
Remove redundant nullptr check before delete 2022-12-17 19:57:16 -05:00
Josh Jones
5d8ba2b2d1 Add support for emitting a signal when entering a NavLink 2022-12-17 16:33:41 -08:00
smix8
34e7628f5f Fix Navigation API abbreviations inconsistency
Schema for navigation to name user facing API with  "navigation" without abbreviation and e.g. NavigationServer internals with abbr "nav".
2022-12-17 22:06:22 +01:00
bruvzg
20d9457f9d
Scale MSDF font outline with the font size and MSDF source size to match dynamic font behavior. 2022-12-17 22:47:54 +02:00
smix8
4d68e2b18a Move NavigationPolygon to dedicated resource file
Moves NavigationPolygon resource class from NavigationRegion2D file to a dedicated file in resource folder.
2022-12-17 19:52:40 +01:00
Rémi Verschelde
c903312572
Merge pull request #70160 from Geekotron/ccd-regression-fix-70154
Fix regression 70154 caused by my prior CCD fix.
2022-12-17 14:03:43 +01:00
Rémi Verschelde
2b056115ef
Merge pull request #70091 from clayjohn/bone-aabbs
Remove mesh bone_aabbs as they are not used anywhere and calculating them is a pain
2022-12-17 12:32:32 +01:00
Rémi Verschelde
676f60b0cc
Merge pull request #70132 from clayjohn/RT-update
Implement render_target_was_used API so that Viewports can properly check if they have been used.
2022-12-17 12:26:51 +01:00
Rémi Verschelde
376290ea86
Merge pull request #70163 from clayjohn/particles-sdf
Transform sdf xfrom by particle emission transform when particles are in global space
2022-12-17 12:24:51 +01:00
Rémi Verschelde
740e5a6404
Merge pull request #70172 from clayjohn/RD-boot-filter
Enable using filtering on boot image in RD renderer
2022-12-17 12:24:24 +01:00
Rémi Verschelde
3b6d697676
Merge pull request #70133 from lyuma/negative_scale_backface
Flip culling when rendering a camera with negative scale
2022-12-17 12:22:18 +01:00
Rémi Verschelde
2b2c372dbc
Merge pull request #70122 from clayjohn/VRS-r8uint
Don't attempt to create or use an R8_UINT texture as storage if VRS is not supported
2022-12-17 12:22:03 +01:00
Rémi Verschelde
13593d8644
Merge pull request #70087 from clayjohn/mesh-aabb
Cache mesh AABB when modified by skeleton and update instance AABB when skeleton changes
2022-12-17 12:21:01 +01:00
clayjohn
669a87bd89 Enable using filtering on boot image in RD renderer 2022-12-16 13:42:03 -08:00
clayjohn
99a159cd9b Transform sdf xfrom by particle emission transform when particles are in global space 2022-12-16 11:55:11 -08:00
Geekotron
ae55229618 Fix regression 70154 caused by my prior CCD fix.
At high velocities `from - motion *.1` is *behind the RB* - not within its collider as the comment suggested - so it could not be used for determining movement length
2022-12-16 11:39:19 -07:00
clayjohn
5e90b90a97 Don't attempt to create or use an R8_UINT texture as storage if VRS is not supported 2022-12-16 09:53:12 -08:00
clayjohn
1b330820bf Implement render_target_was_used API so that Viewports can properly check if they have been used.
For the RD renderer, this does not work for Viewports used in scene shaders yet
2022-12-16 09:50:45 -08:00
Haoyu Qiu
207e52c161 Fix String::word_wrap() for long words
- Changes `TextServer.string_get_word_breaks()`
  - Returns pairs of boundary start and end offsets
  - Accepts `chars_per_line` to return line breaks
- Removes `String::word_wrap()`

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-12-16 13:18:57 +08:00
Lyuma
80dea918c4 Flip culling when rendering a camera with negative scale 2022-12-15 16:12:10 -08:00
bruvzg
53c76fa5d1
[RTL/TextServer] Add baseline inline alignment mode for objects and RTL tables. 2022-12-15 23:16:02 +02:00
Yuri Rubinsky
5c83e95103
Merge pull request #70016 from Chaosus/refactor_rd_shader_data
fixed https://github.com/godotengine/godot/issues/69949
2022-12-15 20:28:26 +03:00
Yuri Rubinsky
807632a90c Changed STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT type to enum flags 2022-12-15 14:10:37 +03:00
Rémi Verschelde
762c6d4b36
Merge pull request #69709 from RandomShaper/refactor_spirv_reflection
Refactor SPIR-V reflection into a generic RenderingDevice feature
2022-12-15 09:21:35 +01:00
Rémi Verschelde
a194984e96
Merge pull request #70068 from clayjohn/mobile-lights
Initialize light index push constants to 0xFFFFFFFF instead of 0xFFFF
2022-12-15 09:20:44 +01:00
Rémi Verschelde
e1bcadd12d
Merge pull request #56804 from Calinou/ssr-add-max-roughness-cutoff
Add maximum roughness cutoff to SSR to improve performance
2022-12-15 09:20:29 +01:00
Yuri Rubinsky
56954485ed Refactor ShaderData & fix the sorting of shader uniforms 2022-12-15 10:02:59 +03:00
clayjohn
ef246d9156 Remove mesh bone_aabbs as they are not used anywhere and calculating them is a pain 2022-12-14 19:32:19 -08:00
clayjohn
b7088bbf52 Cache mesh AABB when modified by skeleton and update instance AABB when
skeleton changes
2022-12-14 18:07:07 -08:00