Commit Graph

35 Commits

Author SHA1 Message Date
Dario
e2c6daf7ef Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile.
- Implements asynchronous transfer queues from PR #87590.
- Adds ubershaders that can run with specialization constants specified as push constants.
- Pipelines with specialization constants can compile in the background.
- Added monitoring for pipeline compilations.
- Materials and shaders can now be created asynchronously on background threads.
- Meshes that are loaded on background threads can also compile pipelines as part of the loading process.
2024-10-02 15:11:58 -03:00
Thaddeus Crews
9f9ee0c813
SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
Thaddeus Crews
b37fc1014a
Style: Apply new clang-format changes 2024-09-20 08:09:48 -05:00
Rémi Verschelde
b214aa8faf
Merge pull request #96880 from zeux/fix-vcache-nontri
Fix a crash in `ImporterMesh::create_shadow_mesh` for non-triangle surfaces
2024-09-12 09:26:01 +02:00
Rémi Verschelde
b9b07d619f
Merge pull request #94783 from TokageItLab/validate-gltf-anim-name
Add validation to glTF importer for Blendshape and Animation
2024-09-12 09:25:10 +02:00
Arseny Kapoulkine
7d7b43bca2 Fix a crash in ImporterMesh::create_shadow_mesh for non-triangle surfaces
optimize_vertex_cache_func assumes the input is a triangle mesh; when an
imported mesh contains points/lines/triangle strips, this code should be
disabled.
2024-09-11 13:18:58 -07:00
A Thousand Ships
194bdde947
Cleanup of raw nullptr checks with Ref
Using `is_valid/null` over checks with `nullptr` or `ERR_FAIL_NULL` etc.
2024-08-31 15:01:09 +02:00
A Thousand Ships
e33fdb4296
Use MutexLock in more places 2024-08-29 14:12:59 +02:00
Rémi Verschelde
78935cad95
Merge pull request #94954 from raulsntos/mark-internal-properties
Mark underscored properties as internal
2024-08-28 00:12:42 +02:00
Rémi Verschelde
091212b4f1
Merge pull request #93602 from aaronp64/inspector_latency
Improve Editor Inspector/Theme item lookup performance
2024-08-22 00:10:26 +02:00
aaronp64
7593e55527 Improve Editor Inspector/Theme item lookup performance
Changes to reduce the latency between changing node selection in the editor and seeing the new node reflected in the Inspector tab

- Use Vector instead of List for ThemeOwner::get_theme_type_dependencies and related functions
- Use Vector instead of List for ThemeContext::themes, set_themes(), and get_themes()
- Add ClassDB:get_inheritance_chain_nocheck to get all parent/ancestor classes at once, to avoid repeated ClassDB locking overhead
- Update BIND_THEME_ITEM macros and ThemeDB::update_class_instance_items to use provided StringNames for call to ThemeItemSetter, instead of creating a new StringName in each call

These changes reduce the time taken by EditorInspector::update_tree by around 30-35%
2024-08-20 13:39:40 -04:00
smix8
2e1f6b50fb Add bounds function to NavigationMeshSourceGeometryData
Adds get_bounds() function to NavigationMeshSourceGeometryData2D/3D to get a bounding box that covers all the geometry.
2024-08-19 00:12:37 +02:00
Patrick Sean Klein
a1fe6ffa19
NavigationPolygon: Implement get/set_polygon fast paths. 2024-08-17 00:31:58 +02:00
Arseny Kapoulkine
0fde03c0e0 Optimize base and shadow meshes for cache
Previously, vertex cache optimization was ran for the LOD meshes, but
was never ran for the base mesh or for the shadow meshes, including
shadow LOD chain (shadow LOD chain would sometimes get implicitly
optimized for vertex cache as a byproduct of base LOD optimization, but
not always). This could significantly affect the rendering performance
of geometry heavy scenes, especially for depth or shadow passes where
the fragment load is light.
2024-08-16 07:36:12 -07:00
Rémi Verschelde
5960555f9b
Merge pull request #94726 from BastiaanOlij/primitive_texel_size_update
Make primitive meshes react to texel size change
2024-08-16 10:34:35 +02:00
Rémi Verschelde
e58a7530aa
Merge pull request #93727 from zeux/raycast-opt
Disable normal raycaster for LOD generation by default
2024-08-16 10:34:03 +02:00
Raul Santos
7a20ba9b63
Mark underscored properties as internal
These properties look like they were intended to be internal but they were missing the `PROPERTY_USAGE_INTERNAL` flag.

- `PackedScene::_bundled`
- `PortableCompressedTexture2D::_data`
- `ImporterMesh::_data`
2024-07-30 18:50:00 +02:00
Silc 'Tokage' Renew
0235086c14 Add validation to glTF importer for Blendshape and Animation 2024-07-26 18:05:34 +09:00
Bastiaan Olij
b9790cef47 Make primitive meshes react to texel size change 2024-07-26 13:54:11 +10:00
Arseny Kapoulkine
18d6ae1161 Fix LOD generation for meshes with tangents & mirrored UVs
When UVs are mirrored in a mesh, collapsing vertices across the
mirroring seam can significantly reduce quality in a way that is not
apparent to the simplifier. Even if simplifier was given access to UV
data, the coordinates would need to be weighted very highly to prevent
these collapses, which would penalize overall quality of reasonable
models.

Normally, well behaved models with mirrored UVs have tangent data that
is correctly mirrored, which results in duplicate vertices along the
seam. The simplifier automatically recognizes that seam and preserves
its structure; typically models have few edge loops where UV winding is
flipped so this does not affect simplification quality much.

However, pre-processing for LOD data welded vertices when UVs and
normals were close, which welds these seams and breaks simplification,
creating triangles with distorted UVs.

We now take tangent frame sign into account when the input model has
tangent data, and only weld vertices when the sign is the same.
2024-07-23 16:35:46 -07:00
Arseny Kapoulkine
a13a64eacd Disable normal raycaster for LOD generation by default
Normal raycaster makes LOD generation process >2x slower and often
generates normals that look significantly worse compared to what the
simplifier comes up with by default. This was likely different before
last meshoptimizer upgrade, as the attribute metric was not functioning
properly, but now it looks like it's doing more harm than good.

This change makes it disabled by default but keeps an easy option to
re-enable it per mesh using LOD parameters for now until we get more
confidence and can remove the code outright.

Because the long term plan would be to disable this feature entirely,
the scripting API isn't changed, and it's just off-by-default there with
no way to re-enable.
2024-07-02 10:18:15 -07:00
smix8
d4722b9e1f Fix thread-use causing navigation source geometry data corruption
Fixes navigation source geometry data corruption caused by thread-use that changed vertices or indices while the source geometry data was used in a parsing process or read from by the navmesh baking.
2024-06-21 08:06:14 +02:00
kobewi
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
Rémi Verschelde
98cce21e78
Merge pull request #90921 from smix8/navmesh_bake_warn
Warn that navigation mesh baking from Meshes is bad for runtime performance
2024-04-22 22:18:30 +02:00
Rémi Verschelde
bfca90acb7
Merge pull request #90935 from smix8/navdata_append
Add NavigationMeshSourceGeometryData append functions
2024-04-22 12:53:32 +02:00
smix8
b9225f67c8 Warn that navigation mesh baking from Meshes is bad for runtime performance
Warns that navigation mesh baking from Meshes is bad for runtime performance.
2024-04-22 12:49:47 +02:00
smix8
2594c57361 Add NavigationMeshSourceGeometryData append functions
Adds append functions to NavigationMeshSourceGeometryData.
2024-04-21 04:57:05 +02:00
Lyuma
a99756a07f Expose create_from_arrays in SurfaceTool and cleanup some naming 2024-04-19 18:45:06 -07:00
Aaron Franke
77e35cf781
Move NavigationMeshSourceGeometryData(2D/3D) to the 2D/3D subfolders 2024-04-15 18:40:43 -07:00
smix8
924a5c6573 Add HeightMapShape3D update with Image data
Adds HeightMapShape3D update with Image data.
2024-04-04 02:10:00 +02:00
A Thousand Ships
79ba22a73f
Use Vector* component-wise min/max/clamp functions where applicable 2024-03-20 13:47:42 +01:00
Aaron Franke
6aac3e4a16 Disable all 3D nodes, physics, and resources when compiling without 3D 2024-03-11 01:00:55 -07:00
Micky
ba867042a2 Fix Label3D, TextMesh & Font not following project default theme in editor 2024-03-09 17:35:48 +01:00
jsjtxietian
1716f12451 Expose PrimitiveMesh's request_update` method 2024-03-06 19:18:01 +08:00
Aaron Franke
c399424db9
Move 3D-only resources to their own folder 2024-02-26 05:23:04 -06:00