Commit graph

1782 commits

Author SHA1 Message Date
Rémi Verschelde
02e4e208ef
Fix various GCC 13 warnings
Fixes occurrences of `-Wtype-limits`, `-Wmaybe-uninitialized`,
`-Wduplicated-branches`.
2023-12-08 15:32:59 +01:00
Rémi Verschelde
5f9cbe514d
Merge pull request #75468 from Ansraer/four_is_overkill
[3.x] Add support for 3 dir shadow splits
2023-10-01 22:50:57 +02:00
Rémi Verschelde
06401129bc
Merge pull request #80764 from mrezai/improve-lightprobes-performance
Improve BakedLightmap's lightprobes performance
2023-09-20 23:39:26 +02:00
Rémi Verschelde
cc48c1825f
Merge pull request #80887 from lawnjelly/cpuparticles2d_fix_double_xform
[3.x] CPUParticles2D - fix interpolated transforms and culling
2023-09-18 17:00:00 +02:00
Rémi Verschelde
7ce807a9c5
Merge pull request #74986 from Rubonnek/fix-audio-effect-leak
[3.x] Fix AudioEffectRecord circular reference
2023-09-06 15:12:33 +02:00
lawnjelly
723632a76a CPUParticles2D - fix interpolated transforms and culling
1) Physics interpolated particles in global mode are specified in global space. In VisualServer they should therefore ignore local transform.

2) Additionally, the expected final_transform should be passed on to children, rather than the identity transform used on the local item.

3) Local bounds in hierarchical culling are fixed for items using identity transform, by calculating their local bound in local space from the global space particles.
2023-08-22 12:57:54 +01:00
Mohammad Rezai
f6e2c37c43 Improve BakedLightmap's lightprobes performance 2023-08-19 20:58:20 +03:30
Rémi Verschelde
55550da68b
SCons: Disable C++ exception handling
Upon investigating the extremely slow MSVC build times in #80513, I noticed
that while Godot policy is to never use exceptions, we weren't enforcing it
with compiler flags, and thus still included exception handling code and
stack unwinding.

This is wasteful on multiple aspects:

- Binary size: Around 20% binary size reduction with exceptions disabled
  for both MSVC and GCC binaries.
- Compile time:
  * More than 50% build time reduction with MSVC.
  * 10% to 25% build time reduction with GCC + LTO.
- Performance: Possibly, needs to be benchmarked.

Since users may want to re-enable exceptions in their own thirdparty code
or the libraries they compile with Godot, this behavior can be toggled with
the `disable_exceptions` SCons option, which defaults to true.
2023-08-16 10:34:10 +02:00
Rémi Verschelde
b8ff6190a8
Merge pull request #80176 from lawnjelly/fti_2d_particles
[3.x] Physics Interpolation - add support for CPUParticles2D
2023-08-08 14:27:38 +02:00
lawnjelly
a117a3307a Physics Interpolation - add support for CPUParticles2D
Similar to the existing 3D CPUParticles physics interpolation.
2023-08-03 14:44:08 +01:00
lawnjelly
ad577e3c7e Fix 2D MultiMesh hierarchical culling
Fixes updating local bounds for MultiMeshes used in canvas items by introducing a back link.
2023-08-03 06:49:01 +01:00
lawnjelly
61e41cc9a1 Add debug_canvas_item_get_local_bound() function to VisualServer
Useful for debugging hierarchical culling.
2023-08-02 17:05:13 +01:00
Rémi Verschelde
078e1b9f45
Merge pull request #79498 from lawnjelly/multirect_fix_flushing
[3.x] MultiRect - Fix flushing in TextEdit
2023-08-02 17:27:35 +02:00
lawnjelly
5162efbfe9 2D Fixed Timestep Interpolation
Adds support to canvas items and Camera2D.
2023-08-01 16:07:48 +01:00
lawnjelly
8814578ceb MultiRect - Fix flushing in TextEdit
The FontDrawer used in TextEdit was previously not being flushed before drawing auto-completion boxes. This was causing rendering artifacts.
This PR also increases the backward compatibility of the MultiRect OFF mode, by forcing a flush after each character.
2023-07-15 14:02:21 +01:00
lawnjelly
43e181a00a Single Compilation Unit build.
Adds support for simple SCU build.
This speeds up compilation by compiling multiple cpp files within a single translation unit.
2023-07-02 20:13:16 +01:00
lawnjelly
b777a9e5f9 Canvas item hierarchical culling
Adds optional hierarchical culling to the 2D rendering (within VisualServer).

Each canvas item maintains a bound in local space of the item itself and all child / grandchild items. This allows branches to be culled at once when they don't intersect a viewport.
2023-04-25 20:17:33 +01:00
Rémi Verschelde
a2534cecf2
Merge pull request #76216 from belzecue/backport-PR55313
[3.x] Fix RigidDynamicBody gaining momentum with bounce
2023-04-25 16:25:03 +02:00
Rémi Verschelde
bfb6877b3c
Merge pull request #75612 from lawnjelly/fix_skele2d_bounds2
[3.x] Fix Polygon2D skinned bounds (for culling)
2023-04-25 16:24:59 +02:00
belzecue
efb4a0a6d5 Backport from Godot 4 - Fix RigidDynamicBody gaining momentum with bounce #55313 2023-04-19 01:13:58 +08:00
Rémi Verschelde
4c5a934408
Merge pull request #68960 from lawnjelly/multirect
Batching - Add MultiRect command
2023-04-17 17:25:20 +02:00
lawnjelly
dd6c213dac Fix Polygon2D skinned bounds (for culling)
The bound Rect2 was previously incorrect because bone transforms need to be applied to verts in bone space, rather than local space. This was previously resulting in skinned Polygon2Ds being incorrectly culled.
2023-04-12 10:17:02 +01:00
Ansraer
54bc6a300e add support for 3 dir shadow splits 2023-03-29 13:40:17 +02:00
Wilson E. Alvarez
ae1b209d6e
Fix AudioEffectRecord circular reference 2023-03-18 19:15:39 -04:00
lawnjelly
910ddd13c4 Batching - Add MultiRect command
Large groups of similar rects can be processed more efficiently using the MultiRect command. Processing common to the group can be done as a one off, instead of per rect.

Adds the new API to VisualServerCanvas, and uses the new functionality from Font, BitmapFont, DynamicFont and TileMap, via the VisualServerCanvasHelper class.
2023-03-10 10:58:04 +00:00
lawnjelly
18d7d36b63 Eliminate collision checks between geometry in rendering BVH.
Later logic using the `pairable_mask` would catch cases preventing pairing callbacks between geometry. However the collision checks were still taking place, wasting performance.

Here we utilize the `tree_mask` feature of BVH to totally eliminate unnecessary collision checks between geometry.
2023-03-09 11:16:30 +00:00
Rémi Verschelde
89788cdcc2
Merge pull request #70514 from stmSi/fix-editor-hanging-audio-pitch-scale-nan
[3.x] Fix hanging if audiostream's pitch_scale is NaN
2023-02-17 12:15:27 +01:00
Rémi Verschelde
1426cd3b3a
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".

Backported from #70885.
2023-01-10 15:26:54 +01:00
stmSi
28e1fc4af9 Fix Editor hanging if audiostream's pitch_scale is NaN 2022-12-24 12:34:22 +06:30
Rémi Verschelde
39edf7ee8a
Merge pull request #70365 from lawnjelly/octree_pairing_fix
Fix pairing crash in physics Octree
2022-12-22 08:56:30 +01:00
lawnjelly
6a2912c856 Fix pairing crash in physics Octree
Remove section of code that should not run and was causing crash.
2022-12-20 19:25:34 +00:00
smix8
17e6d76de6 Fix Navigation agent callback wild pointer crash
Fixes crash in sanitizer builds when callback agent or object are already freed.

(cherry picked from commit 194c1c44e0)
2022-12-18 10:32:04 +08:00
Ricardo Buring
40357471dc Fix typo bug in heightmap shape
(cherry picked from commit 55eceb5150)
2022-12-12 14:00:37 +08:00
dzil123
aa0b91ca52 [3.x] Fix shader compiler asan out of bounds 2022-11-17 19:24:15 -08:00
BimDav
de40dfaac0 Correctly compute inverse_mass when inertia is defined by user 2022-11-14 18:39:57 +01:00
avemort
872e36b8f9 expose ARVRInterface::get_transform_for_eye to gdscript 2022-11-10 15:25:07 -03:00
clayjohn
7e840ae883 Properly initialize use_aabb_center in visual server 2022-10-11 09:53:59 -07:00
Haoyu Qiu
f33dfe8236 Fix crash executing MultiMesh.reset_instance_physics_interpolation 2022-10-02 15:30:55 +08:00
Rémi Verschelde
24ebc32126
Merge pull request #61841 from markusneg/cull-masked-shadows 2022-09-23 09:43:20 +02:00
Hugo Locurcio
d3c9817300 Use verbose prints when registering cameras in CameraServer
This prevents lines from being printed every time the editor or project
starts in the editor Output log.

(cherry picked from commit b83e0b6447)
2022-09-05 15:35:45 +02:00
Rémi Verschelde
2ee933bb77
Merge pull request #64920 from lawnjelly/bind_physics_interpolation
Bind Physics Interpolation functions in VisualServer
2022-08-30 22:02:58 +02:00
lawnjelly
96a1b86717 Bind Physics Interpolation functions in VisualServer
To allow maximum flexibility in the initial rollout, VisualServer functions were not bound in order to prevent compatibility issues if the API changed.

These functions are now bound to allow direct use from the VisualServer.
2022-08-30 18:06:12 +01:00
QbieShay
acdcbefa4e added options for sorting transparent objects
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
2022-08-30 13:39:32 +02:00
fabriceci
b3210c5cd6 Hack as a hot fix for Bullet's collision margin issue 2022-08-25 16:32:48 +02:00
Rémi Verschelde
a86da2eb8b
Merge pull request #64608 from RandomShaper/safe_audio_threading_3.x 2022-08-25 10:12:44 +02:00
Yuri Sizov
39f46613bb Backport fixes to documentation for paths, curves and navigation servers 2022-08-19 15:52:03 +03:00
Pedro J. Estébanez
c92ceca5ce Make audio thread control flags safe 2022-08-19 11:55:23 +02:00
Cory Petkovsek
d7ba3b73a9 Clarify invalid RID errors in Server free() functions. 2022-08-12 23:02:09 +08:00
Rémi Verschelde
36fc99158d
Merge pull request #63971 from paddy-exe/spatial-shader-built-ins 2022-08-08 15:50:25 +02:00
Rémi Verschelde
ee3bad3f92
Merge pull request #63430 from lawnjelly/audioserver_optimize 2022-08-08 15:44:04 +02:00