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`
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.
Fixes that NavigationPolygon did not update in all cases because the internal NavigationMesh was not always unref and freed which blocked creating a new mesh later if nothing else freed it.
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.
Compatibility is based on OpenGL ES 3.0, so the height shader
(including deep parallax) and distance fade dither modes work
just fine with no adjustments required.
Fixes navigation polygon data corruption caused by thread-use that changed vertices or polygons while the navigation polygon was processed, e.g. by server region sync, navmesh baking or user thread updates.
Fixes navigation mesh data corruption caused by thread use that changed vertices or polygons while the navigation mesh was processed, e.g. by server sync or baking.
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.
The original implementation merged sub-polygons into a single polygon
when rotating. This can cause non-simple geometries downstream
algorithms cannot handle.
When VisualShaderNodeVaryingGetter type was Vector2/Vector3/Vector4, expanding the output ports and connecting an individual value to a scalar input would add ".x" to the assignment in the generated shader. This was due to `VisualShaderNodeVarying::get_port_type` ignoring the port number, and always returning the associated vector type. Added checks for `p_port == 0` to return either the vector type, or scalar for expanded ports, matching similar logic in other nodes, like `VisualShaderNodeColorConstant::get_output_port_type`.
Fixes#92832
When importing images, we store a compressed version of the image to a .ctex file with ResourceImporterTexture::save_to_ctex_format. When importing many large images at once, this can use a large amount of memory, especially when the .ctex file uses WebP format.
This change is for ResourceImporterTexture::save_to_ctex_format to use the original Image object instead of p_image->get_image_from_mipmap(0), to avoid creating a copy of the full uncompressed image when looping through the base Image and mipmaps. This reduces the import memory usage for large images by around 10% when using WebP, and 35-40% when Project Settings/Rendering/Textures/Lossless Compression/Force PNG is enabled, may vary depending on the image and number of import threads running. Same change applied to PortableCompressedTexture2D::create_from_image, which has similar logic.
This helps with #92084, but does not fully resolve the issue on its own, as compressing with WebP on many threads can still use a large amount of memory - this just lowers that amount, and makes it more likely that enabling "Force PNG" will reduce memory usage enough to import the files.
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)
* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable