Nearly finished adding newly created vertices into the mass spring system
Simulation now takes place with newly created vertices (check link to video for the same)
There has been a change in the implementation, it was initially designed to add all the newly created vertices at the end of the remeshing step, this would have been the right move as long as there were no vertices that would be deleted from the cloth (which “collapse edges” would do). This had been overlooked during initial design, now each newly created vertex is immediately added into the cloth system to ensure accuracy of the simulation.
Currently doesn’t support stitching, I have thought about some implementation approaches, but yet to be coded
There are some random crashes that take place, possibly due to floating point precision errors, some workarounds are already in place but not enough to prevent all crashes
“collapse edges” pending from planned
Adding newly created vertices has been a very large task, had been extremely optimistic to finish it by this week but still haven’t been able to finish it.
Plan for the following week:
Fix crashes while adding newly created vertices into the mass spring system
Fixed crashes while adding newly created vertices into the mass spring system
Main problem was that the object matrix was not applied to the BMesh that is generated when the simulation is reset, this is now fixed
The above problem upon fixing also fixed most of the previously thought floating point related errors, further testings needs to be done
Started initial implementation of “collapse edges”
The ground work for next week has been set, hope to have something running by next week
Started initial implementation of “flip edges”
“flip edges” is required to ensure proper orientation of triangles to the sizing field
Needs to be run after “split edges” and “collapse edges”, so best to continue its development along with “collapse edges”
Ported remeshing code to cpp
This has been done mainly for the functionality of vector<> which is crucial for “collapse edges” and “flip edges”. Tried to use BLI_linklist and BLI_array, but were cumbersome to use.
'I think it’s wonderful what you’re doing, thx.I was watching a video on Youtube Named " Technical Talk_ A multi-scale model for simulating liquid-fabric interactions" & was wondering if this may be possible in Blender since you’re already improving the cloth simulation? The video had links to the code used for it but I know nothing about any of that. Please let me know, Thx again.
It would be great addition but adding liquid-fabric interaction would involve significant change in the fluid simulator as well. As you may know, Blender’s fluid simulator is going to be dissolved and replaced with Mantaflow. It will be better to look into this after Mantaflow has been merged into the master to prevent work being done multiple times.
@ish_bosamiya It hasn’t directly to do with this gsoc project, but do you know whether it would be somehow possible with the current cloth simulation system to implement the ability to rip and break clothes?
Yes, it is definitely possible but there would be many limitations to it so it has not been worked on yet.
After this GSoC project, it would get easier to implement cloth tearing because dynamically changing number of vertices would be supported. I hope to work on this after my GSoC
Hello, first of all thanks for all the hard work. About this project, my main concern is if the remeshing feature will work with motion blur, as it changes the number of vertices per frame.
Thanks!
I am not really sure about this, fluid simulation which has constantly changing number of vertices has motion blur applied in Cycles, of course EEVEE doesn’t support it because it is compatible only with object basis motion blur. So it might be possible to add such support even for this.
Finished obstacle metric support but dynamic remeshing not fully supported yet, need to continue to refine some parts
Split edges now flips the newly created edges if needed
Transitioned to using ClothVertMap which is a mapping between the BMVert pointer and the ClothVertex, this is important to eliminate floating point precision errors and to also speed up the remeshing step
Switched to using the same edge size calculation for all the different sub algorithms during remeshing to ensure consistency and better maintenance of code
Edge face pair detection used the method part of the BMesh api, it was overlooked that it gives the face pair if and only if 2 faces are available for the edge. Hence switched to custom function which works with even a single face.
Improved UV determination method
Started discussion with mentor about how the caching system can be changed to support changing number of vertices
One of the plans is to run the remeshing step before the cache file is read to ensure that the number of vertices matches for both, the mesh and the cache file match. The cache file already stores the information that is needed during the remeshing step, this would mean no extra data needs to be stored. Although this does have a time overhead.
Another plan is to store Barycentric UV coordinates of all the new points within the existing faces and also store face indices for each of those points. It might be possible to reconstruct the topological data from this information.
Plan for the following week:
Have a working build for dynamic remeshing
Start to implement the above mentioned caching methods
Continue to add back support for pinned vertices and sewing
By storing the nearest planes every frame instead of recalculating it for every face
By adding a new way to update active faces after “flip edges”
By calculating UV offset every frame instead of each time the UVs are needed
Found and fixed errors
Eigen decomposition was not working correctly, 2 elements of the matrix were swapped
Made an error while calculating the aspect ratio of the triangle leading to smaller than expected values
Some of the matrices were transposed which lead to wrong calculations
The remeshing step now respects the initial mesh structure and does not affect original vertices. Although this is useful, it is debatable that the remeshing step should preserve the overall structure not necessarily the original vertices. Need to discuss this with mentor.
Starting to implement the first caching method
Have run into the issue of the entire cloth modifier structure getting deleted every time the cache is invalidated, possible fix is to have a special function for freeing the modifier when adaptive cloth simulation is active
Plan for the following week:
Continue to fix bugs that lead to instability
Continue to implement caching
Continue to add back support for pinned vertices and sewing