Add More Support and Optimizations for PBD simulation purposes. #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although QuarkPhysics does not have multithreading capabilities to comfortably handle a large number of particles in PBD soft body simulations, we can improve this aspect in single-thread mode with the necessary optimizations that are currently missing, using fun experimental body types for various tests. This PR is expected to add the following supports:
Add a newQTexturedPBDBodyNode
node type for quick tests and use in projects. This node type converts particles into a PBD body with the given texture data. To save on rendering, it uses Godot'sMultimeshInstance
features and offloads the rendering task to the GPU, separate from other physics objects. It applies a morphing effect to the particles and blends them together. It also has a breakable property that can be adjusted for durability, if needed.QAngleConstraintsObject
object. This object can create angle constraints between 3 given particles. It will be available for all uses in the physics engine where needed, though it will not be used inQTexturedPBDBodyNode
.Data from this PR:
QTexturedPBDBodyNode
, it was observed that a large number of particles require many iterations. For networks composed of a large number of particles that are interconnected, colliding with each other, and in contact with the world, our default modest iteration count is insufficient to solve them. The necessary iteration counts for solving them cause significant performance bottlenecks.QSpringObject
, colliding with themselves and other similar objects. However, the results are still reasonable for single-thread conditions, and we could even say they are good.