summaryrefslogtreecommitdiff
path: root/scene/resources/mesh.cpp
AgeCommit message (Collapse)Author
2022-06-22Add surface indices to TriangleMeshreduz
Helps unblock #56597
2022-06-11Add suffixes to all nodes and resourcesFireForge
2022-05-31Make `Mesh::generate_triangle_mesh()` handle `PRIMITIVE_TRIANGLE_STRIP`kleonc
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-03Merge pull request #60727 from aaronfranke/basis-axis-columnRémi Verschelde
2022-05-03Rename Basis get_axis to get_column, remove redundant methodsAaron Franke
2022-04-28Implement placeholder assetsreduz
* Placeholder textures * Placeholder meshes * Placeholder material This PR is the first step towards implementing https://github.com/godotengine/godot-proposals/issues/2756 It adds an asset type that uses no resources, which can be used to replace the existing ones on export for using on the upcoming server export.
2022-03-10Discern between virtual and abstract class bindingsreduz
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract". * Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions. * Converted a large amount of classes from "abstract" to "virtual" where it makes sense. Most classes that make sense have been converted. Missing: * Physics servers * VideoStream * Script* classes. which will go in a separate PR due to the complexity involved.
2022-02-24Add sanity checks to lightmap unwrap texel sizejfons
2022-02-02Vectors: Use clear() and has().Anilforextra
Use clear() instead of resize(0). Use has() instead of "find(p_val) != -1".
2022-01-08Merge pull request #56330 from nikitalita/convert-old-octahedralRémi Verschelde
Convert octahedral compressed normals/tangents on 3.x meshes
2022-01-08convert old octahedral compressed normals/tangentsnikitalita
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-21Added resource path to message about old mesh format conversionMarc Gilleron
2021-12-09Replace String comparisons with "", String() to is_empty()Nathan Franke
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
2021-12-05Remove or make verbose some debugging printsHugo Locurcio
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-11-03Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio
This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-10-12Replaced NULL with nullptrM. Huri
2021-09-30Use range iterators for `Map`Lightning_A
2021-09-16Merge pull request #52681 from nekomatata/rename-rigid-bodyCamille Mohr-Daurat
Rename RigidBody to RigidDynamicBody and SoftBody to SoftDynamicBody
2021-09-16Rename RigidBody to RigidDynamicBody and SoftBody to SoftDynamicBodyPouleyKetchoupp
2021-09-14Clean convex hull decomposition codePouleyKetchoupp
Remove unnecessary conversion between triangle data and vertex data whenever possible.
2021-09-14Merge pull request #52266 from AndreaCatania/collRémi Verschelde
2021-09-108 uvs for glTF2, URI decode and Vertex Custom api.Lyuma
Add glTF2 uri decode for paths. Add vertex custom apis. Add scene importer api. Change Color to float; add support for float-based custom channels in SurfaceTool and EditorSceneImporterMesh Co-authored-by: darth negative hunter <thenegativehunter2@users.noreply.github.com>
2021-09-08Improve collision generation usability in the new 3D scene import workflow.AndreaCatania
With this PR it's possible to add a collision during the Mesh import, directly in editor. To generate the shape is possible to chose between the following options: - Decompose Convex: The Mesh is decomposed in one or many Convex Shapes (Using the VHACD library). - Simple Convex: Is generated a convex shape that enclose the entire mesh. - Trimesh: Generate a trimesh shape using the Mesh faces. - Box: Add a primitive box shape, where you can tweak the `size`, `position`, `rotation`. - Sphere: Add a primitive sphere shape, where you can tweak the `radius`, `position`, `rotation`. - Cylinder: Add a primitive cylinder shape, where you can tweak the `height`, `radius`, `position`, `rotation`. - Capsule: Add a primitive capsule shape, where you can tweak the `height`, `radius`, `position`, `rotation`. It's also possible to chose the generated body, so you can create: - Rigid Body - Static Body - Area
2021-08-30Revert " Improve collision generation usability in the new 3D scene import ↵Juan Linietsky
workflow."
2021-08-28Improve collision generation usability in the new 3D scene import workflow.AndreaCatania
With this PR it's possible to add a collision during the Mesh import, directly in editor. To generate the shape is possible to chose between the following options: - Decompose Convex: The Mesh is decomposed in one or many Convex Shapes (Using the VHACD library). - Simple Convex: Is generated a convex shape that enclose the entire mesh. - Trimesh: Generate a trimesh shape using the Mesh faces. - Box: Add a primitive box shape, where you can tweak the `size`, `position`, `rotation`. - Sphere: Add a primitive sphere shape, where you can tweak the `radius`, `position`, `rotation`. - Cylinder: Add a primitive cylinder shape, where you can tweak the `height`, `radius`, `position`, `rotation`. - Capsule: Add a primitive capsule shape, where you can tweak the `height`, `radius`, `position`, `rotation`. It's also possible to chose the generated body, so you can create: - Rigid Body. - Static Body. - Area.
2021-08-10Enclose unused components in DISABLE_DEPRECATEDhpnrep6
2021-07-07Options to clean/simplify convex hull generated from meshPouleyKetchoupp
Clean: remove duplicate and interior vertices (uses Bullet algorithm) Simplify: modify the geometry for further simplification (uses VHACD algorithm) In the editor, single convex hull now uses the clean option. Added a new editor entry to create a simplified convex hull, can be useful for creating convex hull from highly tessellated triangle meshes.
2021-07-04Allow using ORMMaterial3D by using BaseMaterial3D as a resource hintHugo Locurcio
Previously, only StandardMaterial3D could be defined as an alternative to ShaderMaterial. This also reorders the CanvasItemMaterial property hints to follow alphabetical order (which is enforced by the inspector).
2021-07-02Add compatibility with old mesh formatsreduz
* Can load 2.x meshes * Can load 3.x meshes
2021-06-30Deprecate ImmediateGeometryreduz
* Removed entirely from RenderingServer. * Replaced by ImmediateMesh resource. * ImmediateMesh replaces ImmediateGeometry, but could use more optimization in the future. * Sprite3D and AnimatedSprite3D work again, ported from Godot 3.x (though a lot of work was needed to adapt them to Godot 4). * RootMotionView works again. * Polygon3D editor works again.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-06-03Rename Transform to Transform3D in coreAaron Franke
2021-05-03Assorted fixes to UV unwrapping and GPU lightmapperjfons
Various fixes to UV2 unwrapping and the GPU lightmapper. Listed here for context in case of git blame/bisect: * Fix UV2 unwrapping on import, also cleaned up the unwrap cache code. * Fix saving of RGBA images in EXR format. * Fixes to the GPU lightmapper: - Added padding between atlas elements, avoids bleeding. - Remove old SDF generation code. - Fix baked attenuation for Omni/Spot lights. - Fix baking of material properties onto UV2 (wireframe was wrongly used before). - Disable statically baked lights for objects that have a lightmap texture to avoid applying the same light twice. - Fix lightmap pairing in RendererSceneCull. - Fix UV2 array generated from `RenderingServer::mesh_surface_get_arrays()`. - Port autoexposure fix for OIDN from 3.x. - Save debug textures as EXR when using floating point format.
2021-04-30Implement Particle Trailsreduz
-Enable the trails and set the length in seconds -Provide a mesh with a skeleton and a skin -Or, alternatively use one of the built-in TubeTrailMesh/RibbonTrailMesh -Works deterministically -Fixed particle collisions (were broken) -Not working in 2D yet (that will happen next)
2021-04-01Merge pull request #42827 from lyuma/rename_bones_blendshapesRémi Verschelde
Allow renaming bones and blendshapes.
2021-02-11Improve resource load cachereduz
-Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
2021-02-10Removed _change_notifyreduz
-For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
2021-02-09Initialize class variables with default values in scene/ [2/2]Rafał Mikrut
2021-01-25Implement shadow meshesreduz
-When importing, a vertex-only version of the mesh is created. -This version is used when rendering shadows, and improves performance by reducing bandwidth -It's automatic, but can optionally be used by users, in case they want to make special versions of geometry for shadow casting.
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-12-29Consistently use normal_mapMarcel Admiraal
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-12-16Reimplement skeletons and blend shapesreduz
Uses compute shaders, which only once, on demand, and all in parallel.
2020-12-13Rework Mesh handling on scene importing.reduz
-Reworked how meshes are treated by importer by using EditorSceneImporterMesh and EditorSceneImporterMeshNode. Instead of Mesh and MeshInstance, this allows more efficient processing of meshes before they are actually registered in the RenderingServer. -Integrated MeshOptimizer -Reworked internals of SurfaceTool to use arrays, making it more performant and easy to run optimizatons on.
2020-12-04Rebind Mesh/ArrayMesh enumsAaron Franke
2020-12-04doc: Sync classref with current sourceRémi Verschelde
And fixups: - Add missing bindings in RenderingServer - Remove duplicate ArrayMesh enum bindings (they're in Mesh already) - Remove redundant _unhandled_key_input binding in Control (it's in Node already)
2020-12-02Refactored Mesh internals and formats.reduz
-Changed how mesh data is organized, hoping to make it more efficient on Vulkan and GLES. -Removed compression, it now always uses the most efficient format. -Added support for custom arrays (up to 8 custom formats) -Added support for 8 weights in skeleton data. -Added a simple optional versioning system for imported assets, to reimport if binary is newer -Fixes #43979 (I needed to test) WARNING: -NOT backwards compatible with previous 4.x-devel, will most likely never be, but it will force reimport scenes due to version change. -NOT backwards compatible with 3.x scenes, this will be eventually re-added. -Skeletons not working any longer, will fix in next PR.
2020-11-16Remove empty lines around braces with the formatting scriptAaron Franke