GSoC 2019: Cloth Simulator Improvement - Weekly Reports


Having Motion Blur is something absolutely needed for anything, devs should always plan things with this in mind :slight_smile:


Week 10:

  • Dynamic Remeshing is now WORKING! :smiley:
    • Link to video
    • Massive increase in remeshing speed
      • 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

Hey great job :+1:
May I ask if pressure is a planned feature? I’d use it extensively for making cushions, pillows etc.


1 Like

@Sleeper_G I will make the tutorial once GSoC is done, although the documentation will be enough to understand how to use it.

@MarcoG It is not part of the GSoC proposal but there was a proposal for the same created a long time back Maybe it can be merged in sometime soon.


Since you are already talking about making tutorials after GSoC, does that mean that the odds are good that this will be accepted into the main branch?

I certainly hope so, although this is up to the core developers. I do plan to continue to work on this even after GSoC is done.


Week 11:

  • Added support for sewing edges
    • If cloth has sewing edges, new sewing edges are automatically added when an edge between 2 sewing edges is subdivided. If the opposite side edge can be subdivided, it subdivides the edge and creates a new edge between the 2 newly created vertices, if the opposite edge cannot be subdivided, it creates a new edge between one of the existing vertices of the opposite edge.
  • Caching system is nearly implemented
    • Caching works if playback is started from the first frame, but fails if playback is started from any other frame, need to find a way to prevent this from happening.
  • UI changes
    • It is now possible to turn off adaptive remeshing.
    • Added option for choosing between static and dynamic remeshing.
  • Fix bugs that lead to instability
    • Most notably, BMesh vertices that were killed during collapse edges were not being reflected on the cloth vertices, this has now been fixed.

Plan for the following week:

  • Continue to implement caching
  • Start working on the documentation

Week 12:

  • Started working on documentation
  • Worked on fixing bugs and worked on caching (in separate branch)
    • Added custom method for collapsing an edge
      • The BMesh method for collapsing an edge lead to some mesh artifacts, so added a method to collapse an edge which maintains triangulation.
      • Initially, the bug seemed to be in split edges, so I implemented two other ways for splitting an edge and maintaining triangulation of the mesh. Need to see which method is most optimized and remove the rest.
    • Caching is still an ongoing issue.

Plan for the following week:

  • Wrap it up

How did things go with the final week of GSoC? I hope it went well! :slight_smile:

The final week has gone well, more info here.

In brief - Happy to say, pinning now works :smiley: , will work on making the project stable after a short break.


When I try applying the cloth simulation from the modifier stack or pause the object goes back to its original shape, I think it’s a bug, is it fixed?

Yes its a bug, caching has not been implemented completely which leads to the mesh jumping back to the original shape. I hope to get back to this project soon :slightly_smiling_face:


Thanks for the reply, although when you hit play the mesh continues of from where it left on from the last time the simulation was running and this keeps happening until you change a parameter within the cloth settings.