-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vulkan - 4.0 dev - SoftBodies are broken #33485
Comments
I am also getting this on 3.2 with a mesh from blender. I am guessing that Godot's internal meshes are generated with a different index format than the GLTF exporter/importer does; this is because when I replace my character's cape with a plane, it works fine. The softbody code should be able to handle other index formats. I was taking a look into this and it comes down to the function Here is a snippet of code I'm talking about.
The code seems reasonable except for I'm not sure why there is this error catch here. Is there not a way around this? EDIT: I'm using the current 3.2 branch |
Same problem on Windows 10 3.2 / 3.2.1. I can use internal godot meshes, but it's not working with anything imported. |
I think I have a solution for this and I'm writing it here to take note while I'm at work. Since there seems to be two cases, one where mesh indices are in the generated surface arrays and one where they are not. Since the is already handling the case of indices being there, the second case could just be an array from From my understanding, the faces of a mesh are defined using vertex indices, which would make sense for generated meshes, meaning you could have an algorithm for point generation and create triangles using some derived function for faces based on the indices, meaning they don't map up directly. Because of the above, I imagine blender is giving us meshes that have their data in order and thus lack the indices array. This is why I think we could generate an array which is a sequence of ints from 0 to n on the fly and not create errors. I'll try this later tonight but I have hopes that should fix this issue. If any of my assumptions are wrong feel free to correct me. |
Ok, I'm working on a solution, I've got passed the breaking and now I just need to figure out why its producing strange results in the simulation. What I mentioned in the last comment works, but for some reason gravity has reversed. I will investigate further and open a PR when it is ready. EDIT ----------------------- |
Fixed in #46937 |
Godot version:
Godot Engine v4.0.devel.custom_build.d6abb52db (updated on 08-11-2019)
OS/device including version:
Windows 10 64bits
Issue description:
Adding a mesh to a SoftBody in scene returns errors :
ERROR: set_soft_mesh: Condition ' !(soft_mesh->surface_get_format(0) & VisualServer::ARRAY_FORMAT_INDEX) ' is true. At: modules\bullet\soft_body_bullet.cpp:132
Sometimes followed by the following error :
ERROR: clean_up_dependencies: Condition ' !F ' is true. Continuing..: At: ./servers/visual/rasterizer.h:177
And by this for QuadMesh and PlaneMesh :
ERROR: invert: Condition ' det == 0 ' is true. At: core\math\basis.cpp:69
Avoids the scene from starting returns the following errors :
ERROR: Size of data provided (768) does not match expected (864) At: servers\visual\rasterizer_rd\rasterizer_storage_rd.cpp:1872 ERROR: mesh_get_surface: Index (uint32_t)p_surface=0 out of size (mesh->surface_count=0) At: servers\visual\rasterizer_rd\rasterizer_storage_rd.cpp:1990 ERROR: mesh_create_arrays_from_surface_data: Condition ' vertex_data.size() == 0 ' is true. returned: Array() At: servers\visual_server.cpp:1561 ERROR: operator[]: FATAL: Index p_index=0 out of size (((Vector<T> *)(this))->_cowdata.size()=0) At: ./core/vector.h:49 ERROR: _get_socket_error: Socket error: 10054 At: drivers\unix\net_socket_posix.cpp:198
Steps to reproduce:
Add a SoftBody to a scene and assign it a Mesh
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: